From 10596c59bb72b72e90eb42869a1cd9f13f99f7613a99e4ec95d2fb913ae3f733 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 23 Jan 2025 08:24:47 +0000 Subject: [PATCH 01/34] - Add "BuildRequires: libgo23" to fix unresolved for factory. OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=406 --- .gitattributes | 23 + .gitignore | 1 + README.qa | 117 + _constraints | 24 + _multibuild | 3 + baselibs.conf | 11 + ...b.base-examine-backwards.exp-for-aix.patch | 53 + clean.sh | 46 + fix-gdb.mi-new-ui-mi-sync.exp.patch | 23 + ...egression-on-aarch64-linux-gdbserver.patch | 366 + ...e-gdb.ada-inline-section-gc.exp-test.patch | 80 + fixup-gdb-6.3-attach-see-vdso-test.patch | 30 + fixup-gdb-6.3-gstack-20050411.patch | 25 + ...5-bz243845-stale-testing-zombie-test.patch | 35 + fixup-gdb-bz634108-solib_address.patch | 22 + fixup-gdb-glibc-strstr-workaround.patch | 19 + fixup-gdb-linux_perf-bundle.patch | 40 + ...61564-aarch64-hw-watchpoint-test.pat.patch | 43 + fixup-gdb-test-bt-cfi-without-die.patch | 38 + fixup-gdb-test-dw2-aranges.patch | 21 + ...d-aarch64-fix-reverse-stepping-failu.patch | 70 + fixup-skip-tests.patch | 101 + gdb-14.2.tar.bz2 | 3 + gdb-6.3-attach-see-vdso-test.patch | 120 + gdb-6.3-gstack-20050411.patch | 258 + gdb-6.3-mapping-zero-inode-test.patch | 247 + ...337-resolve-tls-without-debuginfo-v2.patch | 265 + ...5-bz218379-ppc-solib-trampoline-test.patch | 107 + ...5-bz243845-stale-testing-zombie-test.patch | 89 + gdb-6.5-gcore-buffer-limit-test.patch | 154 + gdb-6.5-section-num-fixup-test.patch | 127 + ...buildid-locate-rpm-librpm-workaround.patch | 19 + gdb-6.6-buildid-locate-rpm-suse.patch | 123 + gdb-6.6-buildid-locate-rpm.patch | 1084 +++ ...6.6-buildid-locate-solib-missing-ids.patch | 238 + gdb-6.6-buildid-locate.patch | 1925 ++++++ gdb-6.6-bz229517-gcore-without-terminal.patch | 188 + ....6-bz237572-ppc-atomic-sequence-test.patch | 278 + gdb-6.6-testsuite-timeouts.patch | 32 + gdb-add-index.sh-fix-bashism.patch | 21 + gdb-archer-next-over-throw-cxx-exec.patch | 88 + gdb-arm-fix-epilogue-frame-id.patch | 47 + ...humb-bit-in-arm_adjust_breakpoint_ad.patch | 77 + ...pidruro-register-from-non-freebsd-ta.patch | 219 + ...gdbserver-linux-aarch64-low.cc-build.patch | 41 + gdb-bz634108-solib_address.patch | 41 + gdb-cli-add-ignore-errors-command.patch | 201 + gdb-core-open-vdso-warning.patch | 58 + ...xp-fix-cast-handling-for-indirection.patch | 150 + ...ting-of-out-of-bounds-struct-members.patch | 365 + ...p-redo-cast-handling-for-indirection.patch | 86 + gdb-fedora-libncursesw.patch | 333 + ...p-use-after-free-in-select_event_lwp.patch | 144 + ...ix-segfault-in-for_each_block-part-1.patch | 636 ++ ...ix-segfault-in-for_each_block-part-2.patch | 168 + gdb-ftbs-swapped-calloc-args.patch | 42 + gdb-gcore-bash.patch | 10 + gdb-glibc-strstr-workaround.patch | 132 + gdb-gstack.man | 48 + gdb-linux_perf-bundle.patch | 226 + gdb-orphanripper.c | 752 ++ gdb-python-finishbreakpoint-update.patch | 447 ++ ...db.python-py-disasm.exp-on-arm-linux.patch | 125 + ...windinfo.add_saved_register-mo-fixup.patch | 70 + ...gdb.unwindinfo.add_saved_register-mo.patch | 61 + ...mote-fix-abort-on-remote_close_error.patch | 229 + gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch | 264 + ...-generate-dwarf-5-index-consistently.patch | 101 + ...2086-generate-gdb-index-consistently.patch | 230 + ...hbz-2232086-reduce-size-of-gdb-index.patch | 222 + ...3-set-solib-absolute-prefix-testcase.patch | 83 + ...07614-memleak-infpy_read_memory-test.patch | 170 + ...-s390x-wrong-prologue-skip-O2-g-3of3.patch | 235 + ...149205-catch-syscall-after-fork-test.patch | 123 + ...bz1261564-aarch64-hw-watchpoint-test.patch | 104 + ...hbz2232086-refactor-selftest-support.patch | 77 + ...hbz2250652-avoid-PyOS_ReadlineTState.patch | 48 + gdb-rhbz2250652-gdbpy_gil.patch | 81 + ...2261580-intrusive_list-assertion-fix.patch | 55 + ...dvar-assertion-frame-failed-testcase.patch | 147 + gdb-rpmlintrc | 16 + ...390-add-arch14-record-replay-support.patch | 50 + ...ltaneous-step-resume-breakpoint-test.patch | 162 + gdb-symtab-add-producer_is_gas.patch | 125 + ...-defer-backward-refs-inter-cu-intra-.patch | 74 + ...-factor-out-m_deferred_entries-usage.patch | 76 + ...tab-factor-out-m_die_range_map-usage.patch | 151 + ...w_tag_inlined_subroutine-entries-in-.patch | 112 + ...e-nullptr-parent-in-parent_map-set_p.patch | 37 + ...track-of-all-parents-for-cooked-inde.patch | 38 + ...eep-track-of-processed-dies-in-shard.patch | 126 + ...se-into-c-dw_tag_subprogram-dies-for.patch | 31 + ...efactor-condition-in-scan_attributes.patch | 70 + ...ve-deferred-entries-inter-shard-case.patch | 500 ++ ...ve-deferred-entries-intra-shard-case.patch | 120 + ...n-correct-reader-for-top-level-cu-in.patch | 224 + ...set-default-dwarf-max-cache-age-1000.patch | 13 + gdb-symtab-work-around-gas-pr28629.patch | 278 + ...work-around-pr-gas-29517-dwarf2-case.patch | 137 + gdb-symtab-work-around-pr-gas-29517.patch | 256 + gdb-symtab-workaround-pr-gas-31115.patch | 122 + ...catching-syscall-execve-exit-for-arm.patch | 130 + ....base-watch-bitfields.exp-on-aarch64.patch | 349 + ....base-watchpoint-running-on-arm-ppc6.patch | 76 + ....base-watchpoint-unaligned.exp-on-aa.patch | 262 + ...array-elements-in-ppc64_aggregate_ca.patch | 86 + ...everse-execution-of-ldr-immediate-t4.patch | 80 + ...390-add-arch15-record-replay-support.patch | 168 + gdb-test-bt-cfi-without-die.patch | 214 + gdb-test-dw2-aranges.patch | 220 + gdb-testsuite-ada-pie.patch | 121 + ...d-gdb.dwarf2-backward-spec-inter-cu..patch | 128 + ...d-gdb.dwarf2-forward-spec-inter-cu.e.patch | 128 + ...estsuite-add-gdb.suse-debranding.exp.patch | 68 + ...stsuite-add-gdb.suse-zypper-hint.exp.patch | 101 + ...d-missing-include-in-gdb.base-ctf-pt.patch | 51 + ...d-missing-include-in-gdb.base-rtld-s.patch | 47 + ...d-missing-includes-in-gdb.trace-coll.patch | 60 + ...d-missing-no-prompt-anchor-in-gdb.ba.patch | 45 + ...d-pr-gdb-26967-kfail-in-two-more-tes.patch | 167 + ...oid-intermittent-failures-on-a-debug.patch | 59 + ...ll-ldd-version-in-gdb.testsuite-dump.patch | 39 + ...estsuite-factor-out-proc-get_portnum.patch | 98 + gdb-testsuite-factor-out-proc-lock_dir.patch | 63 + gdb-testsuite-factor-out-proc-with_lock.patch | 160 + ...x-error-in-gdb.server-server-kill-py.patch | 54 + ...x-gdb.ada-verylong.exp-on-32-bit-tar.patch | 84 + ...testsuite-fix-gdb.base-eh_return.exp.patch | 80 + ...x-gdb.base-ending-run.exp-on-manjaro.patch | 58 + ...x-gdb.base-list-no-debug.exp-on-debi.patch | 103 + ...p-over-syscall.exp-with-m32-amd-case.patch | 71 + ...-fix-gdb.cp-namespace.exp-with-read1.patch | 57 + ...ix-gdb.dwarf2-dw2-gas-workaround.exp.patch | 41 + ...x-gdb.fortran-array-bounds.exp-on-ar.patch | 95 + ...fix-gdb.mi-mi-dprintf.exp-with-read1.patch | 72 + ...x-gdb.server-server-connect.exp-for-.patch | 74 + ...x-gdbserver-pid-in-gdb.server-server.patch | 117 + ...x-license-text-in-gdb.reverse-map-to.patch | 49 + ...x-missing-return-type-in-gdb.linespe.patch | 40 + gdb-testsuite-fix-regexp-in-vgdb_start.patch | 66 + ...x-spurious-fails-with-examine-backwa.patch | 221 + ...x-test-case-gdb.threads-attach-stopp.patch | 65 + ...x-test-in-gdb.python-py-finish-break.patch | 67 + ...-fix-timeout-in-gdb.tui-resize-2.exp.patch | 76 + ...x-typo-in-gdb.base-catch-syscall.exp.patch | 52 + ...stsuite-fix-valgrind-tests-on-debian.patch | 54 + ...rther-handle-long-filenames-in-gdb.b.patch | 49 + ...ndle-core-without-build-id-in-gdb.ba.patch | 66 + gdb-testsuite-handle-pac-marker.patch | 213 + ...ke-gdb.base-solib-search.exp-more-ro.patch | 93 + ...ite-make-portnum-a-persistent-global.patch | 68 + ...-move-gpu-parallel.lock-to-cache-dir.patch | 42 + ...compilation-fails-with-unix-fpie-pie.patch | 132 + ...stsuite-remove-spurious-in-save_vars.patch | 53 + ...set-errcnt-and-warncnt-in-default_gd.patch | 68 + ...mplify-gdb.server-server-kill-python.patch | 65 + ...e-find_gnatmake-instead-of-gdb_find_.patch | 139 + gdb-testsuite-use-more-progbits-for-arm.patch | 858 +++ ...allel-testing-check-slash-slash-case.patch | 95 + ...e-unique-portnum-in-parallel-testing.patch | 102 + ...allow-command-window-of-1-or-2-lines.patch | 80 + ...able-work-around-libncurses-segfault.patch | 47 + ...resizing-of-terminal-to-1-or-2-lines.patch | 147 + ...be-uninitialized-in-tui_find_disasse.patch | 57 + gdb.changes | 6149 +++++++++++++++++ gdb.spec | 1459 ++++ gdbinit | 8 + gdbinit.without-python | 5 + import-fedora.sh | 142 + import-patches.sh | 100 + ...uage-print_type-handle-varstring-nul.patch | 43 + patchlist.pl | 74 + patchname_get.sh | 314 + ...aarch64-fix-reverse-stepping-failure.patch | 478 ++ ...pc-fix-test-gdb.ada-finish-large.exp.patch | 49 + qa-local.sh | 251 + qa-remote.sh | 163 + qa.sh | 1118 +++ riscv-lrsc.patch | 380 + rs6000-unwind-on-each-instruction-fix.patch | 97 + ...-z16-arch14-instruction-descriptions.patch | 103 + v2.0.5.tar.gz | 3 + 182 files changed, 33749 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 README.qa create mode 100644 _constraints create mode 100644 _multibuild create mode 100644 baselibs.conf create mode 100644 change-gdb.base-examine-backwards.exp-for-aix.patch create mode 100644 clean.sh create mode 100644 fix-gdb.mi-new-ui-mi-sync.exp.patch create mode 100644 fix-regression-on-aarch64-linux-gdbserver.patch create mode 100644 fix-the-gdb.ada-inline-section-gc.exp-test.patch create mode 100644 fixup-gdb-6.3-attach-see-vdso-test.patch create mode 100644 fixup-gdb-6.3-gstack-20050411.patch create mode 100644 fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch create mode 100644 fixup-gdb-bz634108-solib_address.patch create mode 100644 fixup-gdb-glibc-strstr-workaround.patch create mode 100644 fixup-gdb-linux_perf-bundle.patch create mode 100644 fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch create mode 100644 fixup-gdb-test-bt-cfi-without-die.patch create mode 100644 fixup-gdb-test-dw2-aranges.patch create mode 100644 fixup-powerpc-and-aarch64-fix-reverse-stepping-failu.patch create mode 100644 fixup-skip-tests.patch create mode 100644 gdb-14.2.tar.bz2 create mode 100644 gdb-6.3-attach-see-vdso-test.patch create mode 100644 gdb-6.3-gstack-20050411.patch create mode 100644 gdb-6.3-mapping-zero-inode-test.patch create mode 100644 gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch create mode 100644 gdb-6.5-bz218379-ppc-solib-trampoline-test.patch create mode 100644 gdb-6.5-bz243845-stale-testing-zombie-test.patch create mode 100644 gdb-6.5-gcore-buffer-limit-test.patch create mode 100644 gdb-6.5-section-num-fixup-test.patch create mode 100644 gdb-6.6-buildid-locate-rpm-librpm-workaround.patch create mode 100644 gdb-6.6-buildid-locate-rpm-suse.patch create mode 100644 gdb-6.6-buildid-locate-rpm.patch create mode 100644 gdb-6.6-buildid-locate-solib-missing-ids.patch create mode 100644 gdb-6.6-buildid-locate.patch create mode 100644 gdb-6.6-bz229517-gcore-without-terminal.patch create mode 100644 gdb-6.6-bz237572-ppc-atomic-sequence-test.patch create mode 100644 gdb-6.6-testsuite-timeouts.patch create mode 100644 gdb-add-index.sh-fix-bashism.patch create mode 100644 gdb-archer-next-over-throw-cxx-exec.patch create mode 100644 gdb-arm-fix-epilogue-frame-id.patch create mode 100644 gdb-arm-remove-thumb-bit-in-arm_adjust_breakpoint_ad.patch create mode 100644 gdb-arm-remove-tpidruro-register-from-non-freebsd-ta.patch create mode 100644 gdb-build-fix-gdbserver-linux-aarch64-low.cc-build.patch create mode 100644 gdb-bz634108-solib_address.patch create mode 100644 gdb-cli-add-ignore-errors-command.patch create mode 100644 gdb-core-open-vdso-warning.patch create mode 100644 gdb-exp-fix-cast-handling-for-indirection.patch create mode 100644 gdb-exp-fix-printing-of-out-of-bounds-struct-members.patch create mode 100644 gdb-exp-redo-cast-handling-for-indirection.patch create mode 100644 gdb-fedora-libncursesw.patch create mode 100644 gdb-fix-heap-use-after-free-in-select_event_lwp.patch create mode 100644 gdb-fix-segfault-in-for_each_block-part-1.patch create mode 100644 gdb-fix-segfault-in-for_each_block-part-2.patch create mode 100644 gdb-ftbs-swapped-calloc-args.patch create mode 100644 gdb-gcore-bash.patch create mode 100644 gdb-glibc-strstr-workaround.patch create mode 100644 gdb-gstack.man create mode 100644 gdb-linux_perf-bundle.patch create mode 100644 gdb-orphanripper.c create mode 100644 gdb-python-finishbreakpoint-update.patch create mode 100644 gdb-python-fix-gdb.python-py-disasm.exp-on-arm-linux.patch create mode 100644 gdb-python-make-gdb.unwindinfo.add_saved_register-mo-fixup.patch create mode 100644 gdb-python-make-gdb.unwindinfo.add_saved_register-mo.patch create mode 100644 gdb-remote-fix-abort-on-remote_close_error.patch create mode 100644 gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch create mode 100644 gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch create mode 100644 gdb-rhbz-2232086-generate-gdb-index-consistently.patch create mode 100644 gdb-rhbz-2232086-reduce-size-of-gdb-index.patch create mode 100644 gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch create mode 100644 gdb-rhbz1007614-memleak-infpy_read_memory-test.patch create mode 100644 gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch create mode 100644 gdb-rhbz1149205-catch-syscall-after-fork-test.patch create mode 100644 gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch create mode 100644 gdb-rhbz2232086-refactor-selftest-support.patch create mode 100644 gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch create mode 100644 gdb-rhbz2250652-gdbpy_gil.patch create mode 100644 gdb-rhbz2261580-intrusive_list-assertion-fix.patch create mode 100644 gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch create mode 100644 gdb-rpmlintrc create mode 100644 gdb-s390-add-arch14-record-replay-support.patch create mode 100644 gdb-simultaneous-step-resume-breakpoint-test.patch create mode 100644 gdb-symtab-add-producer_is_gas.patch create mode 100644 gdb-symtab-don-t-defer-backward-refs-inter-cu-intra-.patch create mode 100644 gdb-symtab-factor-out-m_deferred_entries-usage.patch create mode 100644 gdb-symtab-factor-out-m_die_range_map-usage.patch create mode 100644 gdb-symtab-fix-dw_tag_inlined_subroutine-entries-in-.patch create mode 100644 gdb-symtab-handle-nullptr-parent-in-parent_map-set_p.patch create mode 100644 gdb-symtab-keep-track-of-all-parents-for-cooked-inde.patch create mode 100644 gdb-symtab-keep-track-of-processed-dies-in-shard.patch create mode 100644 gdb-symtab-recurse-into-c-dw_tag_subprogram-dies-for.patch create mode 100644 gdb-symtab-refactor-condition-in-scan_attributes.patch create mode 100644 gdb-symtab-resolve-deferred-entries-inter-shard-case.patch create mode 100644 gdb-symtab-resolve-deferred-entries-intra-shard-case.patch create mode 100644 gdb-symtab-return-correct-reader-for-top-level-cu-in.patch create mode 100644 gdb-symtab-set-default-dwarf-max-cache-age-1000.patch create mode 100644 gdb-symtab-work-around-gas-pr28629.patch create mode 100644 gdb-symtab-work-around-pr-gas-29517-dwarf2-case.patch create mode 100644 gdb-symtab-work-around-pr-gas-29517.patch create mode 100644 gdb-symtab-workaround-pr-gas-31115.patch create mode 100644 gdb-tdep-fix-catching-syscall-execve-exit-for-arm.patch create mode 100644 gdb-tdep-fix-gdb.base-watch-bitfields.exp-on-aarch64.patch create mode 100644 gdb-tdep-fix-gdb.base-watchpoint-running-on-arm-ppc6.patch create mode 100644 gdb-tdep-fix-gdb.base-watchpoint-unaligned.exp-on-aa.patch create mode 100644 gdb-tdep-fix-nr-array-elements-in-ppc64_aggregate_ca.patch create mode 100644 gdb-tdep-fix-reverse-execution-of-ldr-immediate-t4.patch create mode 100644 gdb-tdep-s390-add-arch15-record-replay-support.patch create mode 100644 gdb-test-bt-cfi-without-die.patch create mode 100644 gdb-test-dw2-aranges.patch create mode 100644 gdb-testsuite-ada-pie.patch create mode 100644 gdb-testsuite-add-gdb.dwarf2-backward-spec-inter-cu..patch create mode 100644 gdb-testsuite-add-gdb.dwarf2-forward-spec-inter-cu.e.patch create mode 100644 gdb-testsuite-add-gdb.suse-debranding.exp.patch create mode 100644 gdb-testsuite-add-gdb.suse-zypper-hint.exp.patch create mode 100644 gdb-testsuite-add-missing-include-in-gdb.base-ctf-pt.patch create mode 100644 gdb-testsuite-add-missing-include-in-gdb.base-rtld-s.patch create mode 100644 gdb-testsuite-add-missing-includes-in-gdb.trace-coll.patch create mode 100644 gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch create mode 100644 gdb-testsuite-add-pr-gdb-26967-kfail-in-two-more-tes.patch create mode 100644 gdb-testsuite-avoid-intermittent-failures-on-a-debug.patch create mode 100644 gdb-testsuite-call-ldd-version-in-gdb.testsuite-dump.patch create mode 100644 gdb-testsuite-factor-out-proc-get_portnum.patch create mode 100644 gdb-testsuite-factor-out-proc-lock_dir.patch create mode 100644 gdb-testsuite-factor-out-proc-with_lock.patch create mode 100644 gdb-testsuite-fix-error-in-gdb.server-server-kill-py.patch create mode 100644 gdb-testsuite-fix-gdb.ada-verylong.exp-on-32-bit-tar.patch create mode 100644 gdb-testsuite-fix-gdb.base-eh_return.exp.patch create mode 100644 gdb-testsuite-fix-gdb.base-ending-run.exp-on-manjaro.patch create mode 100644 gdb-testsuite-fix-gdb.base-list-no-debug.exp-on-debi.patch create mode 100644 gdb-testsuite-fix-gdb.base-step-over-syscall.exp-with-m32-amd-case.patch create mode 100644 gdb-testsuite-fix-gdb.cp-namespace.exp-with-read1.patch create mode 100644 gdb-testsuite-fix-gdb.dwarf2-dw2-gas-workaround.exp.patch create mode 100644 gdb-testsuite-fix-gdb.fortran-array-bounds.exp-on-ar.patch create mode 100644 gdb-testsuite-fix-gdb.mi-mi-dprintf.exp-with-read1.patch create mode 100644 gdb-testsuite-fix-gdb.server-server-connect.exp-for-.patch create mode 100644 gdb-testsuite-fix-gdbserver-pid-in-gdb.server-server.patch create mode 100644 gdb-testsuite-fix-license-text-in-gdb.reverse-map-to.patch create mode 100644 gdb-testsuite-fix-missing-return-type-in-gdb.linespe.patch create mode 100644 gdb-testsuite-fix-regexp-in-vgdb_start.patch create mode 100644 gdb-testsuite-fix-spurious-fails-with-examine-backwa.patch create mode 100644 gdb-testsuite-fix-test-case-gdb.threads-attach-stopp.patch create mode 100644 gdb-testsuite-fix-test-in-gdb.python-py-finish-break.patch create mode 100644 gdb-testsuite-fix-timeout-in-gdb.tui-resize-2.exp.patch create mode 100644 gdb-testsuite-fix-typo-in-gdb.base-catch-syscall.exp.patch create mode 100644 gdb-testsuite-fix-valgrind-tests-on-debian.patch create mode 100644 gdb-testsuite-further-handle-long-filenames-in-gdb.b.patch create mode 100644 gdb-testsuite-handle-core-without-build-id-in-gdb.ba.patch create mode 100644 gdb-testsuite-handle-pac-marker.patch create mode 100644 gdb-testsuite-make-gdb.base-solib-search.exp-more-ro.patch create mode 100644 gdb-testsuite-make-portnum-a-persistent-global.patch create mode 100644 gdb-testsuite-move-gpu-parallel.lock-to-cache-dir.patch create mode 100644 gdb-testsuite-prevent-compilation-fails-with-unix-fpie-pie.patch create mode 100644 gdb-testsuite-remove-spurious-in-save_vars.patch create mode 100644 gdb-testsuite-reset-errcnt-and-warncnt-in-default_gd.patch create mode 100644 gdb-testsuite-simplify-gdb.server-server-kill-python.patch create mode 100644 gdb-testsuite-use-find_gnatmake-instead-of-gdb_find_.patch create mode 100644 gdb-testsuite-use-more-progbits-for-arm.patch create mode 100644 gdb-testsuite-use-unique-portnum-in-parallel-testing-check-slash-slash-case.patch create mode 100644 gdb-testsuite-use-unique-portnum-in-parallel-testing.patch create mode 100644 gdb-tui-allow-command-window-of-1-or-2-lines.patch create mode 100644 gdb-tui-enable-work-around-libncurses-segfault.patch create mode 100644 gdb-tui-fix-resizing-of-terminal-to-1-or-2-lines.patch create mode 100644 gdb-tui-fix-wmaybe-uninitialized-in-tui_find_disasse.patch create mode 100644 gdb.changes create mode 100644 gdb.spec create mode 100644 gdbinit create mode 100644 gdbinit.without-python create mode 100644 import-fedora.sh create mode 100644 import-patches.sh create mode 100644 make-pascal_language-print_type-handle-varstring-nul.patch create mode 100644 patchlist.pl create mode 100644 patchname_get.sh create mode 100644 powerpc-and-aarch64-fix-reverse-stepping-failure.patch create mode 100644 powerpc-fix-test-gdb.ada-finish-large.exp.patch create mode 100644 qa-local.sh create mode 100644 qa-remote.sh create mode 100644 qa.sh create mode 100644 riscv-lrsc.patch create mode 100644 rs6000-unwind-on-each-instruction-fix.patch create mode 100644 s390-provide-ibm-z16-arch14-instruction-descriptions.patch create mode 100644 v2.0.5.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/README.qa b/README.qa new file mode 100644 index 0000000..293a973 --- /dev/null +++ b/README.qa @@ -0,0 +1,117 @@ +I. LOCAL QA. + + +0. Notes. + +Note that the configs are hardcoded in the script. F.i. atm SLE-11 is not +included, because the config is unresolvable on devel:gcc/gdb. Also Leap +15.2 is not included because of 'remote error: unknown repository type +UNDEFINED"'. + +The script tries to keep disk usage low by removing the buildroot after each +build, but that requires sudo rights, so the first thing the script does is +ask for sudo authentication. + + +1. Cleanup. + +Do: +... +$ bash qa-local.sh 1 +... + + +2. Build. + +Do: +... +$ bash qa-local.sh 2 +... + +This builds gdb for each x86_64 config, without running the testsuite. + +I did a timing run on my laptop (with 6 configs) and got: +... +real 66m17.689s +user 149m31.925s +sys 12m25.359s +... +so for a dual-core/4-SMT CPU, it's ~1h5m. + + +3. Build & test. + +Do: +... +$ bash qa-local.sh 3 +... + +This builds gdb and produces test results for each x86_64 config. + +I did a timing run on my laptop (with 6 configs) and got: +... +real 285m9.679s +user 683m16.769s +sys 133m58.287s +... +so for a dual-core/4-SMT CPU, it's ~4h45m. + +The resulting testlogs (with 6 configs) is 1.4GB. + + +4. Verify. + +Do: +... +$ bash qa-local.sh 4 +... + +This verifies the test results for each x86_64 config, using the qa.sh script. + + +5. Cleanup. + +Do: +... +$ rm -Rf tmp-qa-local +... +l + + +I. REMOTE QA. + + +1. Cleanup. + +Do: +... +$ bash qa-remote.sh 1 +... + + +2. Get test results. + +Do: +... +$ bash qa-remote.sh 2 +... + +This downloads the remote test results. + + +3. Verify. + +Do: +... +$ bash qa-remote.sh 3 +... +with m running from 1 to 5. + +This verifies the test results, using the qa.sh script. + +4. Cleanup. + +Do: +... +$ rm -Rf tmp-qa-remote +... diff --git a/_constraints b/_constraints new file mode 100644 index 0000000..9afb8f7 --- /dev/null +++ b/_constraints @@ -0,0 +1,24 @@ + + + + ppc64 + ppc64le + + + + 4 + + + + + + x86_64 + + + + 8 + + + + + diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..964176c --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + testsuite + diff --git a/baselibs.conf b/baselibs.conf new file mode 100644 index 0000000..99bee94 --- /dev/null +++ b/baselibs.conf @@ -0,0 +1,11 @@ +gdb + +/usr/bin/gdb -> /usr/bin/gdb + # kill package for i586 32bit + targetarch x86_64 block! + prereq -glibc-x86 +gdbserver + +/usr/bin/gdbserver -> /usr/bin/gdbserver + provides "gdb-:/usr/bin/gdbserver" + # kill package for i586 32bit + targetarch x86_64 block! + prereq -glibc-x86 diff --git a/change-gdb.base-examine-backwards.exp-for-aix.patch b/change-gdb.base-examine-backwards.exp-for-aix.patch new file mode 100644 index 0000000..56d1ff4 --- /dev/null +++ b/change-gdb.base-examine-backwards.exp-for-aix.patch @@ -0,0 +1,53 @@ +From acc7b542a08819bec4aae767de547c531a7ab62e Mon Sep 17 00:00:00 2001 +From: Aditya Vidyadhar Kamath +Date: Mon, 6 Nov 2023 07:26:24 -0600 +Subject: [PATCH 03/48] Change gdb.base/examine-backwards.exp for AIX. + +In AIX unused or constant variables are collected as garbage by the linker and in the dwarf dump +an address with all f's in hexadecimal are assigned. Hence the testcase fails with many failures stating +it cannot access memory. + +This patch is a small change to get it working in AIX as well. +--- + gdb/testsuite/gdb.base/examine-backward.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/examine-backward.c b/gdb/testsuite/gdb.base/examine-backward.c +index e30b58fb005..354c2e2f323 100644 +--- a/gdb/testsuite/gdb.base/examine-backward.c ++++ b/gdb/testsuite/gdb.base/examine-backward.c +@@ -36,11 +36,11 @@ literals. The content of each array is the same as followings: + TestStrings, to avoid showing garbage when we look for strings + backwards from TestStrings. */ + +-const unsigned char Barrier[] = { ++unsigned char Barrier[] = { + 0x00, + }; + +-const unsigned char TestStrings[] = { ++unsigned char TestStrings[] = { + 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, + 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, + 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, +@@ -54,7 +54,7 @@ const unsigned char TestStrings[] = { + 0x00 + }; + +-const short TestStringsH[] = { ++short TestStringsH[] = { + 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, + 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, + 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, +@@ -67,7 +67,7 @@ const short TestStringsH[] = { + 0x0000 + }; + +-const int TestStringsW[] = { ++int TestStringsW[] = { + 0x00000041, 0x00000042, 0x00000043, 0x00000044, + 0x00000045, 0x00000046, 0x00000047, 0x00000048, + 0x00000049, 0x0000004a, 0x0000004b, 0x0000004c, +-- +2.35.3 + diff --git a/clean.sh b/clean.sh new file mode 100644 index 0000000..ae5f1e1 --- /dev/null +++ b/clean.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +dryrun=false +while [ $# -gt 0 ]; do + case $1 in + -dryrun|--dryrun|-dry-run|--dry-run) + dryrun=true + ;; + *) + echo "Don't know how to handle arg: $1" + exit 1 + esac + shift +done + +first=true +for f in *.patch; do + if grep -q "^Patch.*[ \t]$f" gdb.spec; then + continue + fi + + if $dryrun; then + if $first; then + echo "Patches not mentioned in gdb.spec:" + fi + first=false + + echo "$f" + + continue + fi + + ( set -x; osc remove -f "$f" ) +done + +files=$(echo ./*~) +if [ "$files" != "./*~" ]; then + if $dryrun; then + echo "Backup files:" + echo "$files" + else + for f in $files; do + ( set -x; rm -f "$f" ) + done + fi +fi diff --git a/fix-gdb.mi-new-ui-mi-sync.exp.patch b/fix-gdb.mi-new-ui-mi-sync.exp.patch new file mode 100644 index 0000000..0043a92 --- /dev/null +++ b/fix-gdb.mi-new-ui-mi-sync.exp.patch @@ -0,0 +1,23 @@ +Fix gdb.mi/new-ui-mi-sync.exp + +--- + gdb/testsuite/gdb.mi/new-ui-mi-sync.exp | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.mi/new-ui-mi-sync.exp b/gdb/testsuite/gdb.mi/new-ui-mi-sync.exp +index 887bd60abcd..18072d4e668 100644 +--- a/gdb/testsuite/gdb.mi/new-ui-mi-sync.exp ++++ b/gdb/testsuite/gdb.mi/new-ui-mi-sync.exp +@@ -83,7 +83,11 @@ proc do_test {sync_command} { + # in the separate MI UI. Note the "run" variant usually triggers + # =thread-group-started/=thread-created/=library-loaded as well. + with_spawn_id $gdb_main_spawn_id { +- gdb_test "add-inferior" "Added inferior 2 on connection .*" ++ gdb_test_multiple "add-inferior" "" { ++ -re "\r\nAdded inferior 2 on connection .*\[\r\n\]+$gdb_prompt " { ++ pass $gdb_test_name ++ } ++ } + } + + # Interrupt the program. diff --git a/fix-regression-on-aarch64-linux-gdbserver.patch b/fix-regression-on-aarch64-linux-gdbserver.patch new file mode 100644 index 0000000..2599a44 --- /dev/null +++ b/fix-regression-on-aarch64-linux-gdbserver.patch @@ -0,0 +1,366 @@ +From 2a7e48ca27f4c080151ce9da5a29239aa5d3b66f Mon Sep 17 00:00:00 2001 +From: Tom Tromey +Date: Fri, 19 Apr 2024 07:54:19 -0600 +Subject: [PATCH 15/48] Fix regression on aarch64-linux gdbserver + +Commit 9a03f218 ("Fix gdb.base/watchpoint-unaligned.exp on aarch64") +fixed a watchpoint bug in gdb -- but did not touch the corresponding +code in gdbserver. + +This patch moves the gdb code into gdb/nat, so that it can be shared +with gdbserver, and then changes gdbserver to use it, fixing the bug. + +This is yet another case where having a single back end would prevent +bugs. + +I tested this using the AdaCore internal gdb testsuite. + +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29423 +Approved-By: Luis Machado +--- + gdb/aarch64-nat.c | 115 --------------------------------- + gdb/aarch64-nat.h | 8 --- + gdb/nat/aarch64-hw-point.c | 115 +++++++++++++++++++++++++++++++++ + gdb/nat/aarch64-hw-point.h | 8 +++ + gdbserver/linux-aarch64-low.cc | 38 +---------- + 5 files changed, 126 insertions(+), 158 deletions(-) + +diff --git a/gdb/aarch64-nat.c b/gdb/aarch64-nat.c +index a173e4e18d5..97e3048568a 100644 +--- a/gdb/aarch64-nat.c ++++ b/gdb/aarch64-nat.c +@@ -225,121 +225,6 @@ aarch64_remove_watchpoint (CORE_ADDR addr, int len, enum target_hw_bp_type type, + return ret; + } + +-/* See aarch64-nat.h. */ +- +-bool +-aarch64_stopped_data_address (const struct aarch64_debug_reg_state *state, +- CORE_ADDR addr_trap, CORE_ADDR *addr_p) +-{ +- bool found = false; +- for (int phase = 0; phase <= 1; ++phase) +- for (int i = aarch64_num_wp_regs - 1; i >= 0; --i) +- { +- if (!(state->dr_ref_count_wp[i] +- && DR_CONTROL_ENABLED (state->dr_ctrl_wp[i]))) +- { +- /* Watchpoint disabled. */ +- continue; +- } +- +- const enum target_hw_bp_type type +- = aarch64_watchpoint_type (state->dr_ctrl_wp[i]); +- if (type == hw_execute) +- { +- /* Watchpoint disabled. */ +- continue; +- } +- +- if (phase == 0) +- { +- /* Phase 0: No hw_write. */ +- if (type == hw_write) +- continue; +- } +- else +- { +- /* Phase 1: Only hw_write. */ +- if (type != hw_write) +- continue; +- } +- +- const unsigned int offset +- = aarch64_watchpoint_offset (state->dr_ctrl_wp[i]); +- const unsigned int len +- = aarch64_watchpoint_length (state->dr_ctrl_wp[i]); +- const CORE_ADDR addr_watch = state->dr_addr_wp[i] + offset; +- const CORE_ADDR addr_watch_aligned +- = align_down (state->dr_addr_wp[i], AARCH64_HWP_MAX_LEN_PER_REG); +- const CORE_ADDR addr_orig = state->dr_addr_orig_wp[i]; +- +- /* ADDR_TRAP reports the first address of the memory range +- accessed by the CPU, regardless of what was the memory +- range watched. Thus, a large CPU access that straddles +- the ADDR_WATCH..ADDR_WATCH+LEN range may result in an +- ADDR_TRAP that is lower than the +- ADDR_WATCH..ADDR_WATCH+LEN range. E.g.: +- +- addr: | 4 | 5 | 6 | 7 | 8 | +- |---- range watched ----| +- |----------- range accessed ------------| +- +- In this case, ADDR_TRAP will be 4. +- +- The access size also can be larger than that of the watchpoint +- itself. For instance, the access size of an stp instruction is 16. +- So, if we use stp to store to address p, and set a watchpoint on +- address p + 8, the reported ADDR_TRAP can be p + 8 (observed on +- RK3399 SOC). But it also can be p (observed on M1 SOC). Checking +- for this situation introduces the possibility of false positives, +- so we only do this for hw_write watchpoints. */ +- const CORE_ADDR max_access_size = type == hw_write ? 16 : 8; +- const CORE_ADDR addr_watch_base = addr_watch_aligned - +- (max_access_size - AARCH64_HWP_MAX_LEN_PER_REG); +- if (!(addr_trap >= addr_watch_base +- && addr_trap < addr_watch + len)) +- { +- /* Not a match. */ +- continue; +- } +- +- /* To match a watchpoint known to GDB core, we must never +- report *ADDR_P outside of any ADDR_WATCH..ADDR_WATCH+LEN +- range. ADDR_WATCH <= ADDR_TRAP < ADDR_ORIG is a false +- positive on kernels older than 4.10. See PR +- external/20207. */ +- if (addr_p != nullptr) +- *addr_p = addr_orig; +- +- if (phase == 0) +- { +- /* Phase 0: Return first match. */ +- return true; +- } +- +- /* Phase 1. */ +- if (addr_p == nullptr) +- { +- /* First match, and we don't need to report an address. No need +- to look for other matches. */ +- return true; +- } +- +- if (!found) +- { +- /* First match, and we need to report an address. Look for other +- matches. */ +- found = true; +- continue; +- } +- +- /* More than one match, and we need to return an address. No need to +- look for further matches. */ +- return false; +- } +- +- return found; +-} +- + /* Define AArch64 maintenance commands. */ + + static void +diff --git a/gdb/aarch64-nat.h b/gdb/aarch64-nat.h +index fee6bda2577..f95a9d745e5 100644 +--- a/gdb/aarch64-nat.h ++++ b/gdb/aarch64-nat.h +@@ -45,14 +45,6 @@ struct aarch64_debug_reg_state *aarch64_get_debug_reg_state (pid_t pid); + + void aarch64_remove_debug_reg_state (pid_t pid); + +-/* Helper for the "stopped_data_address" target method. Returns TRUE +- if a hardware watchpoint trap at ADDR_TRAP matches a set +- watchpoint. The address of the matched watchpoint is returned in +- *ADDR_P. */ +- +-bool aarch64_stopped_data_address (const struct aarch64_debug_reg_state *state, +- CORE_ADDR addr_trap, CORE_ADDR *addr_p); +- + /* Helper functions used by aarch64_nat_target below. See their + definitions. */ + +diff --git a/gdb/nat/aarch64-hw-point.c b/gdb/nat/aarch64-hw-point.c +index 3b8cdcba23b..9eb78923e86 100644 +--- a/gdb/nat/aarch64-hw-point.c ++++ b/gdb/nat/aarch64-hw-point.c +@@ -647,3 +647,118 @@ aarch64_region_ok_for_watchpoint (CORE_ADDR addr, int len) + the checking is costly. */ + return 1; + } ++ ++/* See nat/aarch64-hw-point.h. */ ++ ++bool ++aarch64_stopped_data_address (const struct aarch64_debug_reg_state *state, ++ CORE_ADDR addr_trap, CORE_ADDR *addr_p) ++{ ++ bool found = false; ++ for (int phase = 0; phase <= 1; ++phase) ++ for (int i = aarch64_num_wp_regs - 1; i >= 0; --i) ++ { ++ if (!(state->dr_ref_count_wp[i] ++ && DR_CONTROL_ENABLED (state->dr_ctrl_wp[i]))) ++ { ++ /* Watchpoint disabled. */ ++ continue; ++ } ++ ++ const enum target_hw_bp_type type ++ = aarch64_watchpoint_type (state->dr_ctrl_wp[i]); ++ if (type == hw_execute) ++ { ++ /* Watchpoint disabled. */ ++ continue; ++ } ++ ++ if (phase == 0) ++ { ++ /* Phase 0: No hw_write. */ ++ if (type == hw_write) ++ continue; ++ } ++ else ++ { ++ /* Phase 1: Only hw_write. */ ++ if (type != hw_write) ++ continue; ++ } ++ ++ const unsigned int offset ++ = aarch64_watchpoint_offset (state->dr_ctrl_wp[i]); ++ const unsigned int len ++ = aarch64_watchpoint_length (state->dr_ctrl_wp[i]); ++ const CORE_ADDR addr_watch = state->dr_addr_wp[i] + offset; ++ const CORE_ADDR addr_watch_aligned ++ = align_down (state->dr_addr_wp[i], AARCH64_HWP_MAX_LEN_PER_REG); ++ const CORE_ADDR addr_orig = state->dr_addr_orig_wp[i]; ++ ++ /* ADDR_TRAP reports the first address of the memory range ++ accessed by the CPU, regardless of what was the memory ++ range watched. Thus, a large CPU access that straddles ++ the ADDR_WATCH..ADDR_WATCH+LEN range may result in an ++ ADDR_TRAP that is lower than the ++ ADDR_WATCH..ADDR_WATCH+LEN range. E.g.: ++ ++ addr: | 4 | 5 | 6 | 7 | 8 | ++ |---- range watched ----| ++ |----------- range accessed ------------| ++ ++ In this case, ADDR_TRAP will be 4. ++ ++ The access size also can be larger than that of the watchpoint ++ itself. For instance, the access size of an stp instruction is 16. ++ So, if we use stp to store to address p, and set a watchpoint on ++ address p + 8, the reported ADDR_TRAP can be p + 8 (observed on ++ RK3399 SOC). But it also can be p (observed on M1 SOC). Checking ++ for this situation introduces the possibility of false positives, ++ so we only do this for hw_write watchpoints. */ ++ const CORE_ADDR max_access_size = type == hw_write ? 16 : 8; ++ const CORE_ADDR addr_watch_base = addr_watch_aligned - ++ (max_access_size - AARCH64_HWP_MAX_LEN_PER_REG); ++ if (!(addr_trap >= addr_watch_base ++ && addr_trap < addr_watch + len)) ++ { ++ /* Not a match. */ ++ continue; ++ } ++ ++ /* To match a watchpoint known to GDB core, we must never ++ report *ADDR_P outside of any ADDR_WATCH..ADDR_WATCH+LEN ++ range. ADDR_WATCH <= ADDR_TRAP < ADDR_ORIG is a false ++ positive on kernels older than 4.10. See PR ++ external/20207. */ ++ if (addr_p != nullptr) ++ *addr_p = addr_orig; ++ ++ if (phase == 0) ++ { ++ /* Phase 0: Return first match. */ ++ return true; ++ } ++ ++ /* Phase 1. */ ++ if (addr_p == nullptr) ++ { ++ /* First match, and we don't need to report an address. No need ++ to look for other matches. */ ++ return true; ++ } ++ ++ if (!found) ++ { ++ /* First match, and we need to report an address. Look for other ++ matches. */ ++ found = true; ++ continue; ++ } ++ ++ /* More than one match, and we need to return an address. No need to ++ look for further matches. */ ++ return false; ++ } ++ ++ return found; ++} +diff --git a/gdb/nat/aarch64-hw-point.h b/gdb/nat/aarch64-hw-point.h +index 71ae2864927..2386cf60f90 100644 +--- a/gdb/nat/aarch64-hw-point.h ++++ b/gdb/nat/aarch64-hw-point.h +@@ -110,6 +110,14 @@ unsigned int aarch64_watchpoint_offset (unsigned int ctrl); + unsigned int aarch64_watchpoint_length (unsigned int ctrl); + enum target_hw_bp_type aarch64_watchpoint_type (unsigned int ctrl); + ++/* Helper for the "stopped_data_address" target method. Returns TRUE ++ if a hardware watchpoint trap at ADDR_TRAP matches a set ++ watchpoint. The address of the matched watchpoint is returned in ++ *ADDR_P. */ ++ ++bool aarch64_stopped_data_address (const struct aarch64_debug_reg_state *state, ++ CORE_ADDR addr_trap, CORE_ADDR *addr_p); ++ + int aarch64_handle_breakpoint (enum target_hw_bp_type type, CORE_ADDR addr, + int len, int is_insert, ptid_t ptid, + struct aarch64_debug_reg_state *state); +diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc +index fcbe7bb64d7..14346b89822 100644 +--- a/gdbserver/linux-aarch64-low.cc ++++ b/gdbserver/linux-aarch64-low.cc +@@ -577,41 +577,9 @@ aarch64_target::low_stopped_data_address () + + /* Check if the address matches any watched address. */ + state = aarch64_get_debug_reg_state (pid_of (current_thread)); +- for (i = aarch64_num_wp_regs - 1; i >= 0; --i) +- { +- const unsigned int offset +- = aarch64_watchpoint_offset (state->dr_ctrl_wp[i]); +- const unsigned int len = aarch64_watchpoint_length (state->dr_ctrl_wp[i]); +- const CORE_ADDR addr_watch = state->dr_addr_wp[i] + offset; +- const CORE_ADDR addr_watch_aligned = align_down (state->dr_addr_wp[i], 8); +- const CORE_ADDR addr_orig = state->dr_addr_orig_wp[i]; +- +- if (state->dr_ref_count_wp[i] +- && DR_CONTROL_ENABLED (state->dr_ctrl_wp[i]) +- && addr_trap >= addr_watch_aligned +- && addr_trap < addr_watch + len) +- { +- /* ADDR_TRAP reports the first address of the memory range +- accessed by the CPU, regardless of what was the memory +- range watched. Thus, a large CPU access that straddles +- the ADDR_WATCH..ADDR_WATCH+LEN range may result in an +- ADDR_TRAP that is lower than the +- ADDR_WATCH..ADDR_WATCH+LEN range. E.g.: +- +- addr: | 4 | 5 | 6 | 7 | 8 | +- |---- range watched ----| +- |----------- range accessed ------------| +- +- In this case, ADDR_TRAP will be 4. +- +- To match a watchpoint known to GDB core, we must never +- report *ADDR_P outside of any ADDR_WATCH..ADDR_WATCH+LEN +- range. ADDR_WATCH <= ADDR_TRAP < ADDR_ORIG is a false +- positive on kernels older than 4.10. See PR +- external/20207. */ +- return addr_orig; +- } +- } ++ CORE_ADDR result; ++ if (aarch64_stopped_data_address (state, addr_trap, &result)) ++ return result; + + return (CORE_ADDR) 0; + } +-- +2.35.3 + diff --git a/fix-the-gdb.ada-inline-section-gc.exp-test.patch b/fix-the-gdb.ada-inline-section-gc.exp-test.patch new file mode 100644 index 0000000..e72835c --- /dev/null +++ b/fix-the-gdb.ada-inline-section-gc.exp-test.patch @@ -0,0 +1,80 @@ +From c21fd9f7d5911fce0c17af7094d8861d1195dfda Mon Sep 17 00:00:00 2001 +From: Carl Love +Date: Mon, 13 Nov 2023 14:14:08 -0500 +Subject: [PATCH 01/48] Fix the gdb.ada/inline-section-gc.exp test + +The original intention of the test appears to be checking to make sure +setting a breakpoint in an inlined function didn't set multiple +breakpoints where one of them was at address 0. + +The gdb.ada/inline-section-gc.exp test may pass or fail depending on the +version of gnat. Per the discussion on IRC, the ada inlining appears to +have some target dependencies. In this test there are two functions, +callee and caller. Function calee is inlined into caller. The test sets +a breakpoint in function callee. The reported location where the +breakpoint is set may be at the requested location in callee or the +location in caller after callee has been inlined. The test needs to +accept either location as correct provided the breakpoint address is not +zero. + +This patch checks to see if the reported breakpoint is in function callee +or function caller and fails if the breakpoint address is 0x0. The line +number where the breakpoint is set will match the requested line if the +breakpoint location is reported is callee.adb. If the breakpoint is +reported in caller.adb, the line number in caller is the breakpoint +location in callee where it is inlined into caller. + +This patch fixes the single regression failure for the test on PowerPC. +It does not introduce any failures on X86-64. +--- + gdb/testsuite/gdb.ada/inline-section-gc.exp | 21 ++++++++++++++++--- + .../gdb.ada/inline-section-gc/caller.adb | 3 ++- + 2 files changed, 20 insertions(+), 4 deletions(-) + +diff --git a/gdb/testsuite/gdb.ada/inline-section-gc.exp b/gdb/testsuite/gdb.ada/inline-section-gc.exp +index b707335eb04..4f8b8c95395 100644 +--- a/gdb/testsuite/gdb.ada/inline-section-gc.exp ++++ b/gdb/testsuite/gdb.ada/inline-section-gc.exp +@@ -34,8 +34,23 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $options] != ""} { + + clean_restart ${testfile} + +-set bp_location [gdb_get_line_number "BREAK" ${testdir}/callee.adb] ++ ++# Depending on the version of gnat, the location of the set breakpoint may ++# be reported as being at the requested location in file callee.adb or in ++# file caller.adb where the callee function was inlined. Either way, only ++# one breakpoint should be reported and its address should not be at 0x0. ++set bp_location1 [gdb_get_line_number "BREAK" ${testdir}/callee.adb] ++set bp_location2 [gdb_get_line_number "CALLEE_LOC" ${testdir}/caller.adb] ++set test "break callee.adb:$bp_location1" ++set message "Breakpoint set" ++ + # The bug here was that gdb would set a breakpoint with two locations, + # one of them at 0x0. +-gdb_test "break callee.adb:$bp_location" \ +- "Breakpoint $decimal at $hex: file .*callee.adb, line $bp_location." ++gdb_test_multiple $test $message { ++ -re "Breakpoint $decimal at $hex: file .*callee.adb, line $bp_location1." { ++ pass $test ++ } ++ -re "Breakpoint $decimal at $hex: file .*caller.adb, line $bp_location2." { ++ pass $test ++ } ++} +diff --git a/gdb/testsuite/gdb.ada/inline-section-gc/caller.adb b/gdb/testsuite/gdb.ada/inline-section-gc/caller.adb +index 66eb2d9a910..161f3e85542 100644 +--- a/gdb/testsuite/gdb.ada/inline-section-gc/caller.adb ++++ b/gdb/testsuite/gdb.ada/inline-section-gc/caller.adb +@@ -18,4 +18,5 @@ with Callee; + procedure Caller is + begin + Callee; +-end Caller; ++end Caller; -- CALLEE_LOC, this is where the inlined callee breakpoint ++ -- is located. + +base-commit: 582fc35843fdf71b82d645d83d2903e2546cc21a +-- +2.35.3 + diff --git a/fixup-gdb-6.3-attach-see-vdso-test.patch b/fixup-gdb-6.3-attach-see-vdso-test.patch new file mode 100644 index 0000000..43ee239 --- /dev/null +++ b/fixup-gdb-6.3-attach-see-vdso-test.patch @@ -0,0 +1,30 @@ +From 19dc95258888a9e110ad54fa25a613611956a13f Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 13 Jun 2023 15:04:32 +0200 +Subject: [PATCH 5/6] fixup gdb-6.3-attach-see-vdso-test.patch + +--- + gdb/testsuite/gdb.base/attach-see-vdso.exp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.exp b/gdb/testsuite/gdb.base/attach-see-vdso.exp +index 5457ec4129d..35c49731f0b 100644 +--- a/gdb/testsuite/gdb.base/attach-see-vdso.exp ++++ b/gdb/testsuite/gdb.base/attach-see-vdso.exp +@@ -34,10 +34,11 @@ set escapedbinfile [string_to_regexp [standard_output_file ${testfile}]] + # The kernel VDSO is used for the syscalls returns only on i386 (not x86_64). + # + if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-m32}] != "" } { +- gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail." ++ unsupported "Testcase nonthreaded compile failed, so all tests in this file will automatically fail." ++ return + } + +-if [get_compiler_info ${binfile}] { ++if [get_compiler_info] { + return -1 + } + +-- +2.35.3 + diff --git a/fixup-gdb-6.3-gstack-20050411.patch b/fixup-gdb-6.3-gstack-20050411.patch new file mode 100644 index 0000000..427b668 --- /dev/null +++ b/fixup-gdb-6.3-gstack-20050411.patch @@ -0,0 +1,25 @@ +From 8c0ae8c3c6fa34f046131f76871db13bc392a440 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 13 Jun 2023 14:56:55 +0200 +Subject: [PATCH 4/6] fixup gdb-6.3-gstack-20050411.patch + +--- + gdb/testsuite/gdb.base/gstack.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.base/gstack.exp b/gdb/testsuite/gdb.base/gstack.exp +index 089407ec04a..a5dacd582ff 100644 +--- a/gdb/testsuite/gdb.base/gstack.exp ++++ b/gdb/testsuite/gdb.base/gstack.exp +@@ -52,7 +52,7 @@ gdb_expect { + # exiting the function. Still we could retry the gstack command if we fail. + + set test "spawn gstack" +-set command "sh -c GDB=$GDB\\ GDBARGS=-data-directory\\\\\\ $BUILD_DATA_DIRECTORY\\ sh\\ ${srcdir}/../gstack.sh\\ $pid\\;echo\\ GSTACK-END" ++set command "sh -c GDB=$GDB\\ GDBARGS=-data-directory\\\\\\ $GDB_DATA_DIRECTORY\\ sh\\ ${srcdir}/../gstack.sh\\ $pid\\;echo\\ GSTACK-END" + set res [remote_spawn host $command]; + if { $res < 0 || $res == "" } { + perror "Spawning $command failed." +-- +2.35.3 + diff --git a/fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch b/fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch new file mode 100644 index 0000000..d15ce01 --- /dev/null +++ b/fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch @@ -0,0 +1,35 @@ +Fixup gdb.base/tracefork-zombie.exp + +Fix ERROR: +... +PASS: gdb.base/tracefork-zombie.exp: attach +ERROR: tcl error sourcing gdb/testsuite/gdb.base/tracefork-zombie.exp. +ERROR: tcl error code POSIX ESRCH {no such process} +ERROR: error reading "file12": no such process + while executing +"read $statusfi" + ("foreach" body line 5) + invoked from within +... + +--- + gdb/testsuite/gdb.base/tracefork-zombie.exp | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/tracefork-zombie.exp b/gdb/testsuite/gdb.base/tracefork-zombie.exp +index 03f790d4c5d..3e2e5517d46 100644 +--- a/gdb/testsuite/gdb.base/tracefork-zombie.exp ++++ b/gdb/testsuite/gdb.base/tracefork-zombie.exp +@@ -58,8 +58,10 @@ foreach procpid [glob -directory /proc -type d {[0-9]*}] { + if {[catch {open $procpid/status} statusfi]} { + continue + } +- set status [read $statusfi] +- close $statusfi ++ if {[catch {read $statusfi} status]} { ++ continue ++ } ++ catch {close $statusfi} + if {1 + && [regexp -line {^Name:\tgdb$} $status] + && [regexp -line {^PPid:\t1$} $status] diff --git a/fixup-gdb-bz634108-solib_address.patch b/fixup-gdb-bz634108-solib_address.patch new file mode 100644 index 0000000..a18ae59 --- /dev/null +++ b/fixup-gdb-bz634108-solib_address.patch @@ -0,0 +1,22 @@ +From 023314feb400836eb377a5bc9151850fcdd81b11 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 6 Jun 2023 09:43:36 +0200 +Subject: [PATCH 3/4] Fixup gdb-bz634108-solib_address.patch + +--- + gdb/testsuite/gdb.python/rh634108-solib_address.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.python/rh634108-solib_address.exp b/gdb/testsuite/gdb.python/rh634108-solib_address.exp +index 99e6aaba831..ebf00babc34 100644 +--- a/gdb/testsuite/gdb.python/rh634108-solib_address.exp ++++ b/gdb/testsuite/gdb.python/rh634108-solib_address.exp +@@ -21,4 +21,4 @@ gdb_start + # Skip all tests if Python scripting is not enabled. + if { [skip_python_tests] } { continue } + +-gdb_test "python print (gdb.solib_name(-1))" "None" "gdb.solib_name exists" ++gdb_test "python print (gdb.solib_name(0))" "None" "gdb.solib_name exists" +-- +2.35.3 + diff --git a/fixup-gdb-glibc-strstr-workaround.patch b/fixup-gdb-glibc-strstr-workaround.patch new file mode 100644 index 0000000..b0037e0 --- /dev/null +++ b/fixup-gdb-glibc-strstr-workaround.patch @@ -0,0 +1,19 @@ +fixup-gdb-glibc-strstr-workaround.patch + +--- + gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp +index 889f8c6f584..052bd84d420 100644 +--- a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp ++++ b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp +@@ -68,7 +68,7 @@ gdb_test_multiple $test $test { + set addr $expect_out(1,string) + pass "$test (fixed glibc)" + } +- -re " = {char \\*\\(const char \\*, const char \\*\\)} 0x\[0-9a-f\]+ \r\n$gdb_prompt $" { ++ -re " = {char \\*\\(const char \\*, const char \\*\\)} 0x\[0-9a-f\]+ <(__GI_)?strstr>\r\n$gdb_prompt $" { + untested "$test (gnu-ifunc not in use by glibc)" + return 0 + } diff --git a/fixup-gdb-linux_perf-bundle.patch b/fixup-gdb-linux_perf-bundle.patch new file mode 100644 index 0000000..c118deb --- /dev/null +++ b/fixup-gdb-linux_perf-bundle.patch @@ -0,0 +1,40 @@ +From af4a87e2b3c2ac5acae1e6f4405fc59e1218de74 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 18 Apr 2024 14:26:58 +0200 +Subject: [PATCH] fixup-gdb-linux_perf-bundle + +--- + gdb/gdb.c | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/gdb/gdb.c b/gdb/gdb.c +index 41a9b70c222..6e3ff0755ab 100644 +--- a/gdb/gdb.c ++++ b/gdb/gdb.c +@@ -21,10 +21,6 @@ + #include "interps.h" + #include "run-on-main-thread.h" + +-#ifdef PERF_ATTR_SIZE_VER5_BUNDLE +-extern "C" void __libipt_init(void); +-#endif +- + int + main (int argc, char **argv) + { +@@ -36,10 +32,6 @@ main (int argc, char **argv) + + struct captured_main_args args; + +-#ifdef PERF_ATTR_SIZE_VER5_BUNDLE +- __libipt_init(); +-#endif +- + memset (&args, 0, sizeof args); + args.argc = argc; + args.argv = argv; + +base-commit: 254988c36fe592e89af5d92e1d35a6eb4b09cbb0 +-- +2.35.3 + diff --git a/fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch b/fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch new file mode 100644 index 0000000..7ee17b2 --- /dev/null +++ b/fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch @@ -0,0 +1,43 @@ +From e452307ba07f5d798edad73631182e137265da7d Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 13 Jun 2023 17:58:42 +0200 +Subject: [PATCH 9/9] fixup gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch + +--- + .../rhbz1261564-aarch64-watchpoint.exp | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp +index b1cf7115663..42ebc25cc49 100644 +--- a/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp ++++ b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp +@@ -20,12 +20,22 @@ if { [prepare_for_testing rhbz1261564-aarch64-watchpoint.exp "rhbz1261564-aarch6 + if { ! [ runto main ] } then { return 0 } + + set test "rwatch aligned.var4" +-if [istarget "s390*-*-*"] { +- gdb_test $test {Target does not support this type of hardware watchpoint\.} +- untested "s390* does not support hw read watchpoint" ++ ++set supported 1 ++gdb_test_multiple $test "" { ++ -re -wrap "Hardware read watchpoint \[0-9\]+: aligned.var4" { ++ pass $gdb_test_name ++ } ++ -re -wrap "Target does not support this type of hardware watchpoint\\." { ++ set supported 0 ++ } ++} ++ ++if { !$supported } { ++ unsupported $test + return + } +-gdb_test $test "Hardware read watchpoint \[0-9\]+: aligned.var4" ++ + + proc checkvar { address } { + global gdb_prompt +-- +2.35.3 + diff --git a/fixup-gdb-test-bt-cfi-without-die.patch b/fixup-gdb-test-bt-cfi-without-die.patch new file mode 100644 index 0000000..f68da30 --- /dev/null +++ b/fixup-gdb-test-bt-cfi-without-die.patch @@ -0,0 +1,38 @@ +fixup-gdb-test-bt-cfi-without-die.patch + +--- + gdb/testsuite/gdb.base/cfi-without-die.exp | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/cfi-without-die.exp b/gdb/testsuite/gdb.base/cfi-without-die.exp +index 5880d46f6d2..db1726646f8 100644 +--- a/gdb/testsuite/gdb.base/cfi-without-die.exp ++++ b/gdb/testsuite/gdb.base/cfi-without-die.exp +@@ -37,19 +37,22 @@ if ![runto callback] then { + fail "verify unwinding: Can't run to callback" + return 0 + } +-set test "verify unwinding breaks without CFI" +-gdb_test_multiple "bt" $test { ++ ++set as_expected 1 ++gdb_test_multiple "bt" "" { + -re " in \[?\]\[?\] .*\r\n$gdb_prompt $" { + # It may backtrace through some random frames even to main(). +- pass $test + } + -re " in main .*\r\n$gdb_prompt $" { +- fail $test ++ set as_expected 0 + } + -re "\r\n$gdb_prompt $" { +- pass $test + } + } ++if { ! $as_expected } { ++ untested ${testfile}.exp ++ return -1 ++} + + if { [gdb_compile "${srcdir}/${subdir}/${srccallerfile}" ${objcallerfile} \ + object [list {additional_flags=-fomit-frame-pointer -funwind-tables -fasynchronous-unwind-tables}]] != "" diff --git a/fixup-gdb-test-dw2-aranges.patch b/fixup-gdb-test-dw2-aranges.patch new file mode 100644 index 0000000..6438276 --- /dev/null +++ b/fixup-gdb-test-dw2-aranges.patch @@ -0,0 +1,21 @@ +From 81a7585502092b3c133534ac6ecb34fd56d05337 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 16 Feb 2023 12:56:41 +0100 +Subject: [PATCH 09/11] fixup gdb-test-dw2-aranges.patch + +--- + gdb/testsuite/gdb.dwarf2/dw2-aranges.S | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.S b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S +index d5b9ca5a3c6..b811f6644cb 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-aranges.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S +@@ -138,3 +138,4 @@ main: + .byte 0 /* aranges segment_size */ + + .Laranges_end: ++ .section .note.GNU-stack,"",@progbits +-- +2.35.3 + diff --git a/fixup-powerpc-and-aarch64-fix-reverse-stepping-failu.patch b/fixup-powerpc-and-aarch64-fix-reverse-stepping-failu.patch new file mode 100644 index 0000000..5be4f5e --- /dev/null +++ b/fixup-powerpc-and-aarch64-fix-reverse-stepping-failu.patch @@ -0,0 +1,70 @@ +From d60b57fe1a98094a7e4f19481193b2b5a9bb1e57 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 2 May 2024 12:02:50 +0200 +Subject: [PATCH 079/147] fixup PowerPC and aarch64: Fix reverse stepping + failure + +--- + gdb/infrun.c | 2 +- + gdb/symtab.c | 3 +-- + gdb/symtab.h | 3 +-- + 3 files changed, 3 insertions(+), 5 deletions(-) + +diff --git a/gdb/infrun.c b/gdb/infrun.c +index 069ef144a76..7be98cfc252 100644 +--- a/gdb/infrun.c ++++ b/gdb/infrun.c +@@ -6897,7 +6897,7 @@ update_line_range_start (CORE_ADDR pc, struct execution_control_state *ecs) + Given the PC, check the line table and return the PC that corresponds + to the line table entry for the source line that PC is in. */ + CORE_ADDR start_line_pc = ecs->event_thread->control.step_range_start; +- std::optional real_range_start; ++ gdb::optional real_range_start; + + /* Call find_line_range_start to get the smallest address in the + linetable for multiple Line X entries in the line table. */ +diff --git a/gdb/symtab.c b/gdb/symtab.c +index ef63ec93c5a..9a47796e5e0 100644 +--- a/gdb/symtab.c ++++ b/gdb/symtab.c +@@ -73,7 +73,6 @@ + #include "gdbsupport/gdb_string_view.h" + #include "gdbsupport/pathstuff.h" + #include "gdbsupport/common-utils.h" +-#include + + /* Forward declarations for local functions. */ + +@@ -3328,7 +3327,7 @@ sal_line_symtab_matches_p (const symtab_and_line &sal1, + + /* See symtah.h. */ + +-std::optional ++gdb::optional + find_line_range_start (CORE_ADDR pc) + { + struct symtab_and_line current_sal = find_pc_line (pc, 0); +diff --git a/gdb/symtab.h b/gdb/symtab.h +index e17d15c595b..6a611d42880 100644 +--- a/gdb/symtab.h ++++ b/gdb/symtab.h +@@ -38,7 +38,6 @@ + #include "gdb-demangle.h" + #include "split-name.h" + #include "frame.h" +-#include + + /* Opaque declarations. */ + struct ui_file; +@@ -2377,7 +2376,7 @@ extern struct symtab_and_line find_pc_sect_line (CORE_ADDR, + the starting PC of line X, and the ranges are contiguous. + */ + +-extern std::optional find_line_range_start (CORE_ADDR pc); ++extern gdb::optional find_line_range_start (CORE_ADDR pc); + + /* Wrapper around find_pc_line to just return the symtab. */ + +-- +2.35.3 + diff --git a/fixup-skip-tests.patch b/fixup-skip-tests.patch new file mode 100644 index 0000000..550d1d0 --- /dev/null +++ b/fixup-skip-tests.patch @@ -0,0 +1,101 @@ +From c1da0d6449415cc1fe6f863526735e4325b0b3ac Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 1 May 2024 12:43:41 +0200 +Subject: [PATCH 1/2] fixup-skip-tests + +--- + gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp | 4 +--- + gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp | 4 +--- + gdb/testsuite/gdb.cp/cxxexec.exp | 2 +- + .../py-gdb-rhbz1007614-memleak-infpy_read_memory.exp | 4 ++-- + gdb/testsuite/gdb.python/rh634108-solib_address.exp | 6 +++--- + 5 files changed, 8 insertions(+), 12 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp +index 0c46489f315..5879319f27c 100644 +--- a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp ++++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp +@@ -13,9 +13,7 @@ + # You should have received a copy of the GNU General Public License + # along with this program. If not, see . + +-if {[skip_shlib_tests]} { +- return 0 +-} ++require allow_shlib_tests + + set testfile "gcore-buildid-exec-but-not-solib" + set srcmainfile ${testfile}-main.c +diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp +index 052bd84d420..73a9bb64903 100644 +--- a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp ++++ b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp +@@ -17,9 +17,7 @@ + # invalid IFUNC DW_AT_linkage_name: memmove strstr time + # http://sourceware.org/bugzilla/show_bug.cgi?id=14166 + +-if {[skip_shlib_tests]} { +- return 0 +-} ++require allow_shlib_tests + + set testfile "gnu-ifunc-strstr-workaround" + set executable ${testfile} +diff --git a/gdb/testsuite/gdb.cp/cxxexec.exp b/gdb/testsuite/gdb.cp/cxxexec.exp +index 77c85587407..089a679a1a9 100644 +--- a/gdb/testsuite/gdb.cp/cxxexec.exp ++++ b/gdb/testsuite/gdb.cp/cxxexec.exp +@@ -13,7 +13,7 @@ + # You should have received a copy of the GNU General Public License + # along with this program. If not, see . + +-if { [skip_cplus_tests] } { continue } ++require allow_cplus_tests + + set testfile cxxexec + if { [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.cc {c++ debug}] } { +diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp +index 2e6786d499a..d2693cfef1d 100644 +--- a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp ++++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp +@@ -13,6 +13,8 @@ + # You should have received a copy of the GNU General Public License + # along with this program. If not, see . + ++require allow_python_tests ++ + set testfile py-gdb-rhbz1007614-memleak-infpy_read_memory + set srcfile ${testfile}.c + set binfile [standard_output_file ${testfile}] +@@ -21,8 +23,6 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { + return -1 + } + +-if { [skip_python_tests] } { continue } +- + set pid_of_gdb [exp_pid -i [board_info host fileid]] + + proc memory_v_pages_get {} { +diff --git a/gdb/testsuite/gdb.python/rh634108-solib_address.exp b/gdb/testsuite/gdb.python/rh634108-solib_address.exp +index ebf00babc34..2d950b79951 100644 +--- a/gdb/testsuite/gdb.python/rh634108-solib_address.exp ++++ b/gdb/testsuite/gdb.python/rh634108-solib_address.exp +@@ -15,10 +15,10 @@ + + # https://bugzilla.redhat.com/show_bug.cgi?id=634108 + ++# Skip all tests if Python scripting is not enabled. ++require allow_python_tests ++ + gdb_exit + gdb_start + +-# Skip all tests if Python scripting is not enabled. +-if { [skip_python_tests] } { continue } +- + gdb_test "python print (gdb.solib_name(0))" "None" "gdb.solib_name exists" + +base-commit: 50ee7556c2430effed45ca542852f36368336dce +-- +2.35.3 + diff --git a/gdb-14.2.tar.bz2 b/gdb-14.2.tar.bz2 new file mode 100644 index 0000000..793e37f --- /dev/null +++ b/gdb-14.2.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b47e772a5ab32185263ef36fc3c185df01e90deb63198d7deba550685864fa9 +size 32117643 diff --git a/gdb-6.3-attach-see-vdso-test.patch b/gdb-6.3-attach-see-vdso-test.patch new file mode 100644 index 0000000..5321c5f --- /dev/null +++ b/gdb-6.3-attach-see-vdso-test.patch @@ -0,0 +1,120 @@ +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-6.3-attach-see-vdso-test.patch + +;; Test kernel VDSO decoding while attaching to an i386 process. +;;=fedoratest + +diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.c b/gdb/testsuite/gdb.base/attach-see-vdso.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/attach-see-vdso.c +@@ -0,0 +1,25 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2007 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ++ ++#include ++ ++int main () ++{ ++ pause (); ++ return 1; ++} +diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.exp b/gdb/testsuite/gdb.base/attach-see-vdso.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/attach-see-vdso.exp +@@ -0,0 +1,77 @@ ++# Copyright 2007 ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++# This file was created by Jan Kratochvil . ++ ++# This test only works on Linux ++if { ![istarget "*-*-linux-gnu*"] } { ++ return 0 ++} ++ ++if {[use_gdb_stub]} { ++ untested "skipping test because of use_gdb_stub" ++ return -1 ++} ++ ++set testfile "attach-see-vdso" ++set srcfile ${testfile}.c ++set binfile [standard_output_file ${testfile}] ++set escapedbinfile [string_to_regexp [standard_output_file ${testfile}]] ++ ++# The kernel VDSO is used for the syscalls returns only on i386 (not x86_64). ++# ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-m32}] != "" } { ++ gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail." ++} ++ ++if [get_compiler_info ${binfile}] { ++ return -1 ++} ++ ++# Start the program running and then wait for a bit, to be sure ++# that it can be attached to. ++ ++set testpid [eval exec $binfile &] ++ ++# Avoid some race: ++sleep 2 ++ ++# Start with clean gdb ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++# Never call: gdb_load ${binfile} ++# as the former problem would not reproduce otherwise. ++ ++set test "attach" ++gdb_test_multiple "attach $testpid" "$test" { ++ -re "Attaching to process $testpid\r?\n.*$gdb_prompt $" { ++ pass "$test" ++ } ++} ++ ++gdb_test "bt" "#0 *0x\[0-9a-f\]* in \[^?\].*" "backtrace decodes VDSO" ++ ++# Exit and detach the process. ++ ++gdb_exit ++ ++# Make sure we don't leave a process around to confuse ++# the next test run (and prevent the compile by keeping ++# the text file busy), in case the "set should_exit" didn't ++# work. ++ ++remote_exec build "kill -9 ${testpid}" diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch new file mode 100644 index 0000000..c2e49ec --- /dev/null +++ b/gdb-6.3-gstack-20050411.patch @@ -0,0 +1,258 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Andrew Cagney +Date: Fri, 27 Oct 2017 21:07:50 +0200 +Subject: gdb-6.3-gstack-20050411.patch + +;; Add a wrapper script to GDB that implements pstack using the +;; --readnever option. +;;=push + +2004-11-23 Andrew Cagney + + * Makefile.in (uninstall-gstack, install-gstack): New rules, add + to install and uninstall. + * gstack.sh, gstack.1: New files. + +diff --git a/gdb/Makefile.in b/gdb/Makefile.in +--- a/gdb/Makefile.in ++++ b/gdb/Makefile.in +@@ -2035,7 +2035,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force + install: all + @$(MAKE) $(FLAGS_TO_PASS) install-only + +-install-only: $(CONFIG_INSTALL) ++install-only: install-gstack $(CONFIG_INSTALL) + transformed_name=`t='$(program_transform_name)'; \ + echo gdb | sed -e "$$t"` ; \ + if test "x$$transformed_name" = x; then \ +@@ -2085,7 +2085,25 @@ install-guile: + install-python: + $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb + +-uninstall: force $(CONFIG_UNINSTALL) ++GSTACK=gstack ++.PHONY: install-gstack ++install-gstack: ++ transformed_name=`t='$(program_transform_name)'; \ ++ echo $(GSTACK) | sed -e "$$t"` ; \ ++ if test "x$$transformed_name" = x; then \ ++ transformed_name=$(GSTACK) ; \ ++ else \ ++ true ; \ ++ fi ; \ ++ $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir) ; \ ++ $(INSTALL_PROGRAM) $(srcdir)/$(GSTACK).sh \ ++ $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \ ++ : $(SHELL) $(srcdir)/../mkinstalldirs \ ++ $(DESTDIR)$(man1dir) ; \ ++ : $(INSTALL_DATA) $(srcdir)/gstack.1 \ ++ $(DESTDIR)$(man1dir)/$$transformed_name.1 ++ ++uninstall: force uninstall-gstack $(CONFIG_UNINSTALL) + transformed_name=`t='$(program_transform_name)'; \ + echo gdb | sed -e $$t` ; \ + if test "x$$transformed_name" = x; then \ +@@ -2116,6 +2134,18 @@ uninstall: force $(CONFIG_UNINSTALL) + rm -f $(DESTDIR)$(bindir)/$$transformed_name + @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do + ++.PHONY: uninstall-gstack ++uninstall-gstack: ++ transformed_name=`t='$(program_transform_name)'; \ ++ echo $(GSTACK) | sed -e $$t` ; \ ++ if test "x$$transformed_name" = x; then \ ++ transformed_name=$(GSTACK) ; \ ++ else \ ++ true ; \ ++ fi ; \ ++ rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \ ++ $(DESTDIR)$(man1dir)/$$transformed_name.1 ++ + # The C++ name parser can be built standalone for testing. + test-cp-name-parser.o: cp-name-parser.c + $(COMPILE) -DTEST_CPNAMES cp-name-parser.c +diff --git a/gdb/gstack.sh b/gdb/gstack.sh +new file mode 100644 +--- /dev/null ++++ b/gdb/gstack.sh +@@ -0,0 +1,43 @@ ++#!/bin/sh ++ ++if test $# -ne 1; then ++ echo "Usage: `basename $0 .sh` " 1>&2 ++ exit 1 ++fi ++ ++if test ! -r /proc/$1; then ++ echo "Process $1 not found." 1>&2 ++ exit 1 ++fi ++ ++# GDB doesn't allow "thread apply all bt" when the process isn't ++# threaded; need to peek at the process to determine if that or the ++# simpler "bt" should be used. ++ ++backtrace="bt" ++if test -d /proc/$1/task ; then ++ # Newer kernel; has a task/ directory. ++ if test `/bin/ls /proc/$1/task | /usr/bin/wc -l` -gt 1 2>/dev/null ; then ++ backtrace="thread apply all bt" ++ fi ++elif test -f /proc/$1/maps ; then ++ # Older kernel; go by it loading libpthread. ++ if /bin/grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then ++ backtrace="thread apply all bt" ++ fi ++fi ++ ++GDB=${GDB:-gdb} ++ ++# Run GDB, strip out unwanted noise. ++# --readnever is no longer used since .gdb_index is now in use. ++$GDB --quiet -nx $GDBARGS /proc/$1/exe $1 <&1 | ++set width 0 ++set height 0 ++set pagination no ++$backtrace ++EOF ++/bin/sed -n \ ++ -e 's/^\((gdb) \)*//' \ ++ -e '/^#/p' \ ++ -e '/^Thread/p' +diff --git a/gdb/testsuite/gdb.base/gstack.c b/gdb/testsuite/gdb.base/gstack.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gstack.c +@@ -0,0 +1,43 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2005, 2007, 2008, 2009 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++#include ++#include ++#include ++ ++void ++func (void) ++{ ++ const char msg[] = "looping\n"; ++ ++ /* Use the most simple notification not to get caught by attach on exiting ++ the function. */ ++ write (1, msg, strlen (msg)); ++ ++ for (;;); ++} ++ ++int ++main (void) ++{ ++ alarm (60); ++ nice (100); ++ ++ func (); ++ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.base/gstack.exp b/gdb/testsuite/gdb.base/gstack.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gstack.exp +@@ -0,0 +1,84 @@ ++# Copyright (C) 2012 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++set testfile gstack ++set executable ${testfile} ++set binfile [standard_output_file $executable] ++if {[build_executable ${testfile} ${executable} "" {debug}] == -1} { ++ return -1 ++} ++ ++set test "spawn inferior" ++set command "${binfile}" ++set res [remote_spawn host $command]; ++if { $res < 0 || $res == "" } { ++ perror "Spawning $command failed." ++ fail $test ++ return ++} ++ ++# The spawn id of the test inferior. ++set test_spawn_id $res ++ ++set use_gdb_stub 1 ++set pid [exp_pid -i $res] ++gdb_expect { ++ -re "looping\r\n" { ++ pass $test ++ } ++ eof { ++ fail "$test (eof)" ++ return ++ } ++ timeout { ++ fail "$test (timeout)" ++ return ++ } ++} ++ ++# Testcase uses the most simple notification not to get caught by attach on ++# exiting the function. Still we could retry the gstack command if we fail. ++ ++set test "spawn gstack" ++set command "sh -c GDB=$GDB\\ GDBARGS=-data-directory\\\\\\ $BUILD_DATA_DIRECTORY\\ sh\\ ${srcdir}/../gstack.sh\\ $pid\\;echo\\ GSTACK-END" ++set res [remote_spawn host $command]; ++if { $res < 0 || $res == "" } { ++ perror "Spawning $command failed." ++ fail $test ++} ++ ++set gdb_spawn_id $res ++ ++gdb_test_multiple "" $test { ++ -re "^#0 +(0x\[0-9a-f\]+ in )?\\.?func \\(\\) at \[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in \\.?main \\(\\) at \[^\r\n\]*\r\nGSTACK-END\r\n\$" { ++ pass $test ++ } ++} ++ ++gdb_test_multiple "" "gstack exits" { ++ eof { ++ set result [wait -i $gdb_spawn_id] ++ verbose $result ++ ++ gdb_assert { [lindex $result 2] == 0 } "gstack exits with no error" ++ gdb_assert { [lindex $result 3] == 0 } "gstack's exit status is 0" ++ ++ remote_close host ++ clear_gdb_spawn_id ++ } ++} ++ ++# Kill the test inferior. ++kill_wait_spawned_process $test_spawn_id diff --git a/gdb-6.3-mapping-zero-inode-test.patch b/gdb-6.3-mapping-zero-inode-test.patch new file mode 100644 index 0000000..6fcf76a --- /dev/null +++ b/gdb-6.3-mapping-zero-inode-test.patch @@ -0,0 +1,247 @@ +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-6.3-mapping-zero-inode-test.patch + +;; Test GCORE for shmid 0 shared memory mappings. +;;=fedoratest: But it is broken anyway, sometimes the case being tested is not reproducible. + +diff --git a/gdb/testsuite/gdb.base/gcore-shmid0.c b/gdb/testsuite/gdb.base/gcore-shmid0.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gcore-shmid0.c +@@ -0,0 +1,128 @@ ++/* Copyright 2007, 2009 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or (at ++ your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, but ++ WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place - Suite 330, ++ Boston, MA 02111-1307, USA. */ ++ ++/* ++ * Test GDB's handling of gcore for mapping with a name but zero inode. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* The same test running in a parallel testsuite may steal us the zero SID, ++ even if we never get any EEXIST. Just try a while. */ ++ ++#define TIMEOUT_SEC 10 ++ ++static volatile int v; ++ ++static void ++initialized (void) ++{ ++ v++; ++} ++ ++static void ++unresolved (void) ++{ ++ v++; ++} ++ ++int ++main (void) ++{ ++ int sid; ++ unsigned int *addr = (void *) -1L; ++ int attempt, round = 0; ++ time_t ts_start, ts; ++ ++ if (time (&ts_start) == (time_t) -1) ++ { ++ printf ("time (): %m\n"); ++ exit (1); ++ } ++ ++ /* The generated SID will cycle with an increment of 32768, attempt until it ++ * wraps to 0. */ ++ ++ for (attempt = 0; addr == (void *) -1L; attempt++) ++ { ++ /* kernel-2.6.25-8.fc9.x86_64 just never returns the value 0 by ++ shmget(2). shmget returns SID range 0..1<<31 in steps of 32768, ++ 0x1000 should be enough but wrap the range it to be sure. */ ++ ++ if (attempt > 0x21000) ++ { ++ if (time (&ts) == (time_t) -1) ++ { ++ printf ("time (): %m\n"); ++ exit (1); ++ } ++ ++ if (ts >= ts_start && ts < ts_start + TIMEOUT_SEC) ++ { ++ attempt = 0; ++ round++; ++ continue; ++ } ++ ++ printf ("Problem is not reproducible on this kernel (attempt %d, " ++ "round %d)\n", attempt, round); ++ unresolved (); ++ exit (1); ++ } ++ ++ sid = shmget ((key_t) rand (), 0x1000, IPC_CREAT | IPC_EXCL | 0777); ++ if (sid == -1) ++ { ++ if (errno == EEXIST) ++ continue; ++ ++ printf ("shmget (%d, 0x1000, IPC_CREAT): errno %d\n", 0, errno); ++ exit (1); ++ } ++ ++ /* Use SID only if it is 0, retry it otherwise. */ ++ ++ if (sid == 0) ++ { ++ addr = shmat (sid, NULL, SHM_RND); ++ if (addr == (void *) -1L) ++ { ++ printf ("shmat (%d, NULL, SHM_RND): errno %d\n", sid, ++ errno); ++ exit (1); ++ } ++ } ++ if (shmctl (sid, IPC_RMID, NULL) != 0) ++ { ++ printf ("shmctl (%d, IPC_RMID, NULL): errno %d\n", sid, errno); ++ exit (1); ++ } ++ } ++ ++ initialized (); ++ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.base/gcore-shmid0.exp b/gdb/testsuite/gdb.base/gcore-shmid0.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gcore-shmid0.exp +@@ -0,0 +1,101 @@ ++# Copyright 2007, 2009 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++# Test GDB's handling of gcore for mapping with a name but zero inode. ++ ++if { [prepare_for_testing gcore-shmid0.exp gcore-shmid0] } { ++ return -1 ++} ++ ++# Does this gdb support gcore? ++set test "help gcore" ++gdb_test_multiple $test $test { ++ -re "Undefined command: .gcore.*$gdb_prompt $" { ++ # gcore command not supported -- nothing to test here. ++ unsupported "gdb does not support gcore on this target" ++ return -1; ++ } ++ -re "Save a core file .*$gdb_prompt $" { ++ pass $test ++ } ++} ++ ++if { ! [ runto_main ] } then { ++ untested gcore-shmid0.exp ++ return -1 ++} ++ ++gdb_breakpoint "initialized" ++gdb_breakpoint "unresolved" ++ ++set oldtimeout $timeout ++set timeout [expr $oldtimeout + 120] ++ ++set test "Continue to initialized." ++gdb_test_multiple "continue" $test { ++ -re "Breakpoint .*, initialized .* at .*\r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re "Breakpoint .*, unresolved .* at .*\r\n$gdb_prompt $" { ++ set timeout $oldtimeout ++ unsupported $test ++ return -1 ++ } ++} ++set timeout $oldtimeout ++ ++set escapedfilename [string_to_regexp [standard_output_file gcore-shmid0.test]] ++ ++set test "save a corefile" ++gdb_test_multiple "gcore [standard_output_file gcore-shmid0.test]" $test { ++ -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" { ++ pass $test ++ } ++ -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" { ++ unsupported $test ++ } ++} ++ ++# Be sure to remove the handle first. ++# But it would get removed even on a kill by GDB as the handle is already ++# deleted, just it is still attached. ++gdb_continue_to_end "finish" ++ ++set test "core-file command" ++gdb_test_multiple "core-file [standard_output_file gcore-shmid0.test]" $test { ++ -re ".* program is being debugged already.*y or n. $" { ++ # gdb_load may connect us to a gdbserver. ++ send_gdb "y\n" ++ exp_continue; ++ } ++ -re "Core was generated by .*\r\n\#0 .*\\\(\\\).*\r\n$gdb_prompt $" { ++ # The filename does not fit there anyway so do not check it. ++ pass $test ++ } ++ -re ".*registers from core file: File in wrong format.* $" { ++ fail "core-file command (could not read registers from core file)" ++ } ++} ++ ++set test "backtrace" ++gdb_test_multiple "bt" $test { ++ -re "#0 *initialized \\\(\\\) at .*#1 .* main \\\(.*$gdb_prompt $" { ++ pass $test ++ } ++ -re "#0 *initialized \\\(\\\) at .*Cannot access memory at address .*$gdb_prompt $" { ++ fail $test ++ } ++} diff --git a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch new file mode 100644 index 0000000..e5b6da9 --- /dev/null +++ b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch @@ -0,0 +1,265 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Jan Kratochvil +Date: Fri, 27 Oct 2017 21:07:50 +0200 +Subject: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch + +;; Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337). +;;=push+jan: It should be replaced by Infinity project. + +https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=185337 + +2008-02-24 Jan Kratochvil + + Port to GDB-6.8pre. + +currently for trivial nonthreaded helloworld with no debug info up to -ggdb2 you +will get: + (gdb) p errno + [some error] + +* with -ggdb2 and less "errno" in fact does not exist anywhere as it was + compiled to "(*__errno_location ())" and the macro definition is not present. + Unfortunately gdb will find the TLS symbol and it will try to access it but + as the program has been compiled without -lpthread the TLS base register + (%gs on i386) is not setup and it will result in: + Cannot access memory at address 0x8 + +Attached suggestion patch how to deal with the most common "errno" symbol +for the most common under-ggdb3 compiled programs. + +Original patch hooked into target_translate_tls_address. But its inferior +call invalidates `struct frame *' in the callers - RH BZ 690908. + +https://bugzilla.redhat.com/show_bug.cgi?id=1166549 + +2007-11-03 Jan Kratochvil + + * ./gdb/dwarf2read.c (read_partial_die, dwarf2_linkage_name): Prefer + DW_AT_MIPS_linkage_name over DW_AT_name now only for non-C. + +glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug: + <81a2> DW_AT_name : (indirect string, offset: 0x280e): __errno_location + <81a8> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location + +diff --git a/gdb/printcmd.c b/gdb/printcmd.c +--- a/gdb/printcmd.c ++++ b/gdb/printcmd.c +@@ -1308,6 +1308,11 @@ process_print_command_args (const char *args, value_print_options *print_opts, + + if (exp != nullptr && *exp) + { ++ /* '*((int *(*) (void)) __errno_location) ()' is incompatible with ++ function descriptors. */ ++ if (target_has_execution () && strcmp (exp, "errno") == 0) ++ exp = "*(*(int *(*)(void)) __errno_location) ()"; ++ + /* This setting allows large arrays to be printed by limiting the + number of elements that are loaded into GDB's memory; we only + need to load as many array elements as we plan to print. */ +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.c b/gdb/testsuite/gdb.dwarf2/dw2-errno.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.c +@@ -0,0 +1,28 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2005, 2007 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@prep.ai.mit.edu */ ++ ++#include ++ ++int main() ++{ ++ errno = 42; ++ ++ return 0; /* breakpoint */ ++} +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp +@@ -0,0 +1,60 @@ ++# Copyright 2007 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++set testfile dw2-errno ++set srcfile ${testfile}.c ++set binfile [standard_output_file ${testfile}] ++ ++proc prep {} { ++ global srcdir subdir binfile ++ gdb_exit ++ gdb_start ++ gdb_reinitialize_dir $srcdir/$subdir ++ gdb_load ${binfile} ++ ++ runto_main ++ ++ gdb_breakpoint [gdb_get_line_number "breakpoint"] ++ gdb_continue_to_breakpoint "breakpoint" ++} ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g2"] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++prep ++gdb_test "print errno" ".* = 42" "errno with macros=N threads=N" ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g3"] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++prep ++gdb_test "print errno" ".* = 42" "errno with macros=Y threads=N" ++ ++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g2"] != "" } { ++ return -1 ++} ++prep ++gdb_test "print errno" ".* = 42" "errno with macros=N threads=Y" ++ ++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g3"] != "" } { ++ return -1 ++} ++prep ++gdb_test "print errno" ".* = 42" "errno with macros=Y threads=Y" ++ ++# TODO: Test the error on resolving ERRNO with only libc loaded. ++# Just how to find the current libc filename? +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.c b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c +@@ -0,0 +1,28 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2005, 2007 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@prep.ai.mit.edu */ ++ ++#include ++ ++int main() ++{ ++ errno = 42; ++ ++ return 0; /* breakpoint */ ++} +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp +@@ -0,0 +1,71 @@ ++# Copyright 2007 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++set testfile dw2-errno2 ++set srcfile ${testfile}.c ++set binfile [standard_output_file ${testfile}] ++ ++proc prep { message {do_xfail 0} } { with_test_prefix $message { ++ global srcdir subdir binfile variant ++ gdb_exit ++ gdb_start ++ gdb_reinitialize_dir $srcdir/$subdir ++ gdb_load ${binfile}${variant} ++ ++ runto_main ++ ++ gdb_breakpoint [gdb_get_line_number "breakpoint"] ++ gdb_continue_to_breakpoint "breakpoint" ++ ++ gdb_test "gcore ${binfile}${variant}.core" "\r\nSaved corefile .*" "gcore $variant" ++ ++ gdb_test "print errno" ".* = 42" ++ ++ gdb_test "kill" ".*" "kill" {Kill the program being debugged\? \(y or n\) } "y" ++ gdb_test "core-file ${binfile}${variant}.core" "\r\nCore was generated by .*" "core-file" ++ if $do_xfail { ++ setup_xfail "*-*-*" ++ } ++ gdb_test "print (int) errno" ".* = 42" "print errno for core" ++}} ++ ++set variant g2thrN ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g2"] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++prep "macros=N threads=N" 1 ++ ++set variant g3thrN ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g3"] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++prep "macros=Y threads=N" 1 ++ ++set variant g2thrY ++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g2"] != "" } { ++ return -1 ++} ++prep "macros=N threads=Y" ++ ++set variant g3thrY ++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g3"] != "" } { ++ return -1 ++} ++prep "macros=Y threads=Y" 1 ++ ++# TODO: Test the error on resolving ERRNO with only libc loaded. ++# Just how to find the current libc filename? diff --git a/gdb-6.5-bz218379-ppc-solib-trampoline-test.patch b/gdb-6.5-bz218379-ppc-solib-trampoline-test.patch new file mode 100644 index 0000000..9a83337 --- /dev/null +++ b/gdb-6.5-bz218379-ppc-solib-trampoline-test.patch @@ -0,0 +1,107 @@ +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-6.5-bz218379-ppc-solib-trampoline-test.patch + +;; Test sideeffects of skipping ppc .so libs trampolines (BZ 218379). +;;=fedoratest + +https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379 + +diff --git a/gdb/testsuite/gdb.base/step-over-trampoline.c b/gdb/testsuite/gdb.base/step-over-trampoline.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/step-over-trampoline.c +@@ -0,0 +1,28 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2006 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@prep.ai.mit.edu */ ++ ++#include ++ ++int main (void) ++{ ++ puts ("hello world"); ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.base/step-over-trampoline.exp b/gdb/testsuite/gdb.base/step-over-trampoline.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/step-over-trampoline.exp +@@ -0,0 +1,59 @@ ++# Copyright 2006 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++if {[use_gdb_stub]} { ++ untested "skipping test because of use_gdb_stub" ++ return -1 ++} ++ ++if $tracelevel then { ++ strace $tracelevel ++} ++ ++set testfile step-over-trampoline ++set srcfile ${testfile}.c ++set binfile [standard_output_file ${testfile}] ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++ ++# Get things started. ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++# For C programs, "start" should stop in main(). ++ ++gdb_test "start" \ ++ "main \\(\\) at .*$srcfile.*" \ ++ "start" ++ ++# main () at hello2.c:5 ++# 5 puts("hello world\n"); ++# (gdb) next ++# 0x100007e0 in call___do_global_ctors_aux () ++ ++gdb_test_multiple "next" "invalid `next' output" { ++ -re "\nhello world.*return 0;.*" { ++ pass "stepped over" ++ } ++ -re " in call___do_global_ctors_aux \\(\\).*" { ++ fail "stepped into trampoline" ++ } ++} diff --git a/gdb-6.5-bz243845-stale-testing-zombie-test.patch b/gdb-6.5-bz243845-stale-testing-zombie-test.patch new file mode 100644 index 0000000..77d274a --- /dev/null +++ b/gdb-6.5-bz243845-stale-testing-zombie-test.patch @@ -0,0 +1,89 @@ +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-6.5-bz243845-stale-testing-zombie-test.patch + +;; Test leftover zombie process (BZ 243845). +;;=fedoratest + +diff --git a/gdb/testsuite/gdb.base/tracefork-zombie.exp b/gdb/testsuite/gdb.base/tracefork-zombie.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/tracefork-zombie.exp +@@ -0,0 +1,76 @@ ++# Copyright 2007 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ++ ++# are we on a target board ++if {[use_gdb_stub]} { ++ untested "skipping test because of use_gdb_stub" ++ return -1 ++} ++ ++# Start the program running and then wait for a bit, to be sure ++# that it can be attached to. ++ ++gdb_exit ++gdb_start ++gdb_load sleep ++ ++set gdb_pid [exp_pid -i [board_info host fileid]] ++set test "identified the child GDB" ++if {$gdb_pid != "" && $gdb_pid > 0} { ++ pass $test ++ verbose -log "Child GDB PID $gdb_pid" ++} else { ++ fail $test ++} ++ ++set testpid [eval exec sleep 10 &] ++exec sleep 2 ++ ++set test "attach" ++gdb_test_multiple "attach $testpid" "$test" { ++ -re "Attaching to program.*`?.*'?, process $testpid..*$gdb_prompt $" { ++ pass "$test" ++ } ++ -re "Attaching to program.*`?.*\.exe'?, process $testpid.*\[Switching to thread $testpid\..*\].*$gdb_prompt $" { ++ # Response expected on Cygwin ++ pass "$test" ++ } ++} ++ ++# Some time to let GDB spawn its testing child. ++exec sleep 2 ++ ++set found none ++foreach procpid [glob -directory /proc -type d {[0-9]*}] { ++ if {[catch {open $procpid/status} statusfi]} { ++ continue ++ } ++ set status [read $statusfi] ++ close $statusfi ++ if {1 ++ && [regexp -line {^Name:\tgdb$} $status] ++ && [regexp -line {^PPid:\t1$} $status] ++ && [regexp -line "^TracerPid:\t$gdb_pid$" $status]} { ++ set found $procpid ++ verbose -log "Found linux_test_for_tracefork zombie PID $procpid" ++ } ++} ++set test "linux_test_for_tracefork leaves no zombie" ++if {$found eq {none}} { ++ pass $test ++} else { ++ fail $test ++} diff --git a/gdb-6.5-gcore-buffer-limit-test.patch b/gdb-6.5-gcore-buffer-limit-test.patch new file mode 100644 index 0000000..c26c3c4 --- /dev/null +++ b/gdb-6.5-gcore-buffer-limit-test.patch @@ -0,0 +1,154 @@ +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-6.5-gcore-buffer-limit-test.patch + +;; Test gcore memory and time requirements for large inferiors. +;;=fedoratest + +diff --git a/gdb/testsuite/gdb.base/gcore-excessive-memory.c b/gdb/testsuite/gdb.base/gcore-excessive-memory.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gcore-excessive-memory.c +@@ -0,0 +1,37 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2008 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@prep.ai.mit.edu */ ++ ++#include ++#include ++ ++#define MEGS 64 ++ ++int main() ++{ ++ void *mem; ++ ++ mem = malloc (MEGS * 1024ULL * 1024ULL); ++ ++ for (;;) ++ sleep (1); ++ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.base/gcore-excessive-memory.exp b/gdb/testsuite/gdb.base/gcore-excessive-memory.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gcore-excessive-memory.exp +@@ -0,0 +1,99 @@ ++# Copyright 2008 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++if {[use_gdb_stub]} { ++ untested "skipping test because of use_gdb_stub" ++ return -1 ++} ++ ++set testfile gcore-excessive-memory ++set srcfile ${testfile}.c ++set shfile [standard_output_file ${testfile}-gdb.sh] ++set corefile [standard_output_file ${testfile}.core] ++set binfile [standard_output_file ${testfile}] ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++ ++set f [open "|getconf PAGESIZE" "r"] ++gets $f pagesize ++close $f ++ ++set pid_of_bin [eval exec $binfile &] ++sleep 2 ++ ++# Get things started. ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++set pid_of_gdb [exp_pid -i [board_info host fileid]] ++ ++gdb_test "attach $pid_of_bin" "Attaching to .*" "attach" ++gdb_test "up 99" "in main .*" "verify we can get to main" ++ ++proc memory_v_pages_get {} { ++ global pid_of_gdb pagesize ++ set fd [open "/proc/$pid_of_gdb/statm"] ++ gets $fd line ++ close $fd ++ # number of pages of virtual memory ++ scan $line "%d" drs ++ return $drs ++} ++ ++set pages_found [memory_v_pages_get] ++ ++# It must be definitely less than `MEGS' of `gcore-excessive-memory.c'. ++set mb_gcore_reserve 4 ++verbose -log "pages_found = $pages_found, mb_gcore_reserve = $mb_gcore_reserve" ++set kb_found [expr $pages_found * $pagesize / 1024] ++set kb_permit [expr $kb_found + 1 * 1024 + $mb_gcore_reserve * 1024] ++verbose -log "kb_found = $kb_found, kb_permit = $kb_permit" ++ ++# Create the ulimit wrapper. ++set f [open $shfile "w"] ++puts $f "#! /bin/sh" ++puts $f "ulimit -v $kb_permit" ++puts $f "exec $GDB \"\$@\"" ++close $f ++remote_exec host "chmod +x $shfile" ++ ++gdb_exit ++set GDBold $GDB ++set GDB "$shfile" ++gdb_start ++set GDB $GDBold ++ ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++set pid_of_gdb [exp_pid -i [board_info host fileid]] ++ ++gdb_test "attach $pid_of_bin" "Attaching to .*" "attach" ++gdb_test "up 99" "in main .*" "verify we can get to main" ++ ++verbose -log "kb_found before gcore = [expr [memory_v_pages_get] * $pagesize / 1024]" ++ ++gdb_test "gcore $corefile" "Saved corefile \[^\n\r\]*" "Save the core file" ++ ++verbose -log "kb_found after gcore = [expr [memory_v_pages_get] * $pagesize / 1024]" ++ ++# Cleanup. ++exec kill -9 $pid_of_bin diff --git a/gdb-6.5-section-num-fixup-test.patch b/gdb-6.5-section-num-fixup-test.patch new file mode 100644 index 0000000..3382769 --- /dev/null +++ b/gdb-6.5-section-num-fixup-test.patch @@ -0,0 +1,127 @@ +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-6.5-section-num-fixup-test.patch + +;; Test a crash on libraries missing the .text section. +;;=fedoratest + +diff --git a/gdb/testsuite/gdb.base/datalib-lib.c b/gdb/testsuite/gdb.base/datalib-lib.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/datalib-lib.c +@@ -0,0 +1,22 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2008 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@prep.ai.mit.edu */ ++ ++int var; +diff --git a/gdb/testsuite/gdb.base/datalib-main.c b/gdb/testsuite/gdb.base/datalib-main.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/datalib-main.c +@@ -0,0 +1,26 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2008 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@prep.ai.mit.edu */ ++ ++int ++main (void) ++{ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.base/datalib.exp b/gdb/testsuite/gdb.base/datalib.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/datalib.exp +@@ -0,0 +1,56 @@ ++# Copyright 2008 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++if {[use_gdb_stub]} { ++ untested "skipping test because of use_gdb_stub" ++ return -1 ++} ++ ++set testfile datalib ++set srcfilemain ${testfile}-main.c ++set srcfilelib ${testfile}-lib.c ++set libfile [standard_output_file ${testfile}-lib.so] ++set binfile [standard_output_file ${testfile}-main] ++if { [gdb_compile "${srcdir}/${subdir}/${srcfilelib}" "${libfile}" executable [list debug {additional_flags=-shared -nostdlib}]] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++if { [gdb_compile "${srcdir}/${subdir}/${srcfilemain}" "${binfile} ${libfile}" executable {debug}] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++ ++# Get things started. ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++# We must use a separate library as the main executable is compiled to the ++# address 0 by default and it would get fixed up already at the end of ++# INIT_OBJFILE_SECT_INDICES. We also cannot PRELINK it as PRELINK is missing ++# on ia64. The library must be NOSTDLIB as otherwise some stub code would ++# create the `.text' section there. Also DEBUG option is useful as some of ++# the crashes occur in dwarf2read.c. ++ ++# FAIL case: ++# ../../gdb/ia64-tdep.c:2838: internal-error: sect_index_text not initialized ++# A problem internal to GDB has been detected, ++ ++gdb_test "start" \ ++ "main \\(\\) at .*${srcfilemain}.*" \ ++ "start" diff --git a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch new file mode 100644 index 0000000..52bf236 --- /dev/null +++ b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch @@ -0,0 +1,19 @@ +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-6.6-buildid-locate-rpm-librpm-workaround.patch + +;; Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879). +;;=push+jan + +diff --git a/gdb/proc-service.list b/gdb/proc-service.list +--- a/gdb/proc-service.list ++++ b/gdb/proc-service.list +@@ -37,4 +37,7 @@ + ps_pstop; + ps_ptread; + ps_ptwrite; ++ ++ /* gdb-6.6-buildid-locate-rpm.patch */ ++ rpmsqEnable; + }; diff --git a/gdb-6.6-buildid-locate-rpm-suse.patch b/gdb-6.6-buildid-locate-rpm-suse.patch new file mode 100644 index 0000000..5b9cf7f --- /dev/null +++ b/gdb-6.6-buildid-locate-rpm-suse.patch @@ -0,0 +1,123 @@ +diff --git a/gdb/build-id.c b/gdb/build-id.c +index 059a72fc050..58d73e70bad 100644 +--- a/gdb/build-id.c ++++ b/gdb/build-id.c +@@ -863,10 +863,8 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) + #endif + { + Header h; +- char *debuginfo, **slot, *s, *s2; ++ char *debuginfo, **slot; + errmsg_t err; +- size_t srcrpmlen = sizeof (".src.rpm") - 1; +- size_t debuginfolen = sizeof ("-debuginfo") - 1; + rpmdbMatchIterator mi_debuginfo; + + h = rpmdbNextIterator_p (mi); +@@ -875,7 +873,9 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) + + /* Verify the debuginfo file is not already installed. */ + +- debuginfo = headerFormat_p (h, "%{sourcerpm}-debuginfo.%{arch}", ++ /* The allocated memory gets utilized below for MISSING_RPM_HASH. */ ++ debuginfo = headerFormat_p (h, ++ "%{name}-debuginfo-%{version}-%{release}.%{arch}", + &err); + if (!debuginfo) + { +@@ -883,60 +883,19 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) + err); + continue; + } +- /* s = `.src.rpm-debuginfo.%{arch}' */ +- s = strrchr (debuginfo, '-') - srcrpmlen; +- s2 = NULL; +- if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0) +- { +- /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */ +- s2 = (char *) memrchr (debuginfo, '-', s - debuginfo); +- } +- if (s2) +- { +- /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */ +- s2 = (char *) memrchr (debuginfo, '-', s2 - debuginfo); +- } +- if (!s2) +- { +- warning (_("Error querying the rpm file `%s': %s"), filename, +- debuginfo); +- xfree (debuginfo); +- continue; +- } +- /* s = `.src.rpm-debuginfo.%{arch}' */ +- /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */ +- memmove (s2 + debuginfolen, s2, s - s2); +- memcpy (s2, "-debuginfo", debuginfolen); +- /* s = `XXXX.%{arch}' */ +- /* strlen ("XXXX") == srcrpmlen + debuginfolen */ +- /* s2 = `-debuginfo-%{version}-%{release}XX.%{arch}' */ +- /* strlen ("XX") == srcrpmlen */ +- memmove (s + debuginfolen, s + srcrpmlen + debuginfolen, +- strlen (s + srcrpmlen + debuginfolen) + 1); +- /* s = `-debuginfo-%{version}-%{release}.%{arch}' */ + ++ /* Verify the debuginfo file is not already installed. */ + /* RPMDBI_PACKAGES requires keylen == sizeof (int). */ + /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */ + mi_debuginfo = rpmtsInitIterator_p (ts, (rpmDbiTagVal) RPMDBI_LABEL, debuginfo, 0); +- xfree (debuginfo); + if (mi_debuginfo) + { ++ xfree (debuginfo); + rpmdbFreeIterator_p (mi_debuginfo); + count = 0; + break; + } + +- /* The allocated memory gets utilized below for MISSING_RPM_HASH. */ +- debuginfo = headerFormat_p (h, +- "%{name}-%{version}-%{release}.%{arch}", +- &err); +- if (!debuginfo) +- { +- warning (_("Error querying the rpm file `%s': %s"), filename, +- err); +- continue; +- } +- + /* Base package name for `debuginfo-install'. We do not use the + `yum' command directly as the line + yum --enablerepo='*debug*' install NAME-debuginfo.ARCH +@@ -1085,10 +1044,7 @@ missing_rpm_list_print (void) + missing_rpm_list_entries = 0; + + gdb_printf (_("Missing separate debuginfos, use: %s"), +-#ifdef DNF_DEBUGINFO_INSTALL +- "dnf " +-#endif +- "debuginfo-install"); ++ "zypper install"); + for (const char *el : array) + { + gdb_printf (" %s", el); +@@ -1296,14 +1252,15 @@ debug_print_missing (const char *binary, const char *debug) + _("Missing separate debuginfo for %s.\n"), binary); + if (debug != NULL) + { ++#ifdef HAVE_LIBRPM + if (access (debug, F_OK) == 0) { +- gdb_printf (gdb_stdlog, _("Try: %s %s\n"), +-#ifdef DNF_DEBUGINFO_INSTALL +- "dnf" + #else +- "yum" ++ if (1) { + #endif +- " --enablerepo='*debug*' install", debug); ++ const char *p = strrchr (debug, '/'); ++ gdb_printf (gdb_stdlog, _("Try: %s%.2s%.38s\"\n"), ++ "zypper install -C \"debuginfo(build-id)=", ++ p - 2, p + 1); + } else + gdb_printf (gdb_stdlog, _("The debuginfo package for this file is probably broken.\n")); + } diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch new file mode 100644 index 0000000..b38b945 --- /dev/null +++ b/gdb-6.6-buildid-locate-rpm.patch @@ -0,0 +1,1084 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Kevin Buettner +Date: Wed, 22 Feb 2023 22:30:40 -0700 +Subject: gdb-6.6-buildid-locate-rpm.patch + +;;=push+jan + +diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4 +--- a/gdb/aclocal.m4 ++++ b/gdb/aclocal.m4 +@@ -11,7 +11,223 @@ + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A + # PARTICULAR PURPOSE. + ++# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- ++# serial 1 (pkg-config-0.24) ++# ++# Copyright © 2004 Scott James Remnant . ++# ++# 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. ++# ++# As a special exception to the GNU General Public License, if you ++# distribute this file as part of a program that contains a ++# configuration script generated by Autoconf, you may include it under ++# the same distribution terms that you use for the rest of that program. ++ ++# PKG_PROG_PKG_CONFIG([MIN-VERSION]) ++# ---------------------------------- ++AC_DEFUN([PKG_PROG_PKG_CONFIG], ++[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) ++m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) ++m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) ++AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) ++AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) ++AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) ++ ++if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then ++ AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) ++fi ++if test -n "$PKG_CONFIG"; then ++ _pkg_min_version=m4_default([$1], [0.9.0]) ++ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) ++ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then ++ AC_MSG_RESULT([yes]) ++ else ++ AC_MSG_RESULT([no]) ++ PKG_CONFIG="" ++ fi ++fi[]dnl ++])# PKG_PROG_PKG_CONFIG ++ ++# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) ++# ++# Check to see whether a particular set of modules exists. Similar ++# to PKG_CHECK_MODULES(), but does not set variables or print errors. ++# ++# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) ++# only at the first occurence in configure.ac, so if the first place ++# it's called might be skipped (such as if it is within an "if", you ++# have to call PKG_CHECK_EXISTS manually ++# -------------------------------------------------------------- ++AC_DEFUN([PKG_CHECK_EXISTS], ++[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl ++if test -n "$PKG_CONFIG" && \ ++ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then ++ m4_default([$2], [:]) ++m4_ifvaln([$3], [else ++ $3])dnl ++fi]) ++ ++# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) ++# --------------------------------------------- ++m4_define([_PKG_CONFIG], ++[if test -n "$$1"; then ++ pkg_cv_[]$1="$$1" ++ elif test -n "$PKG_CONFIG"; then ++ PKG_CHECK_EXISTS([$3], ++ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` ++ test "x$?" != "x0" && pkg_failed=yes ], ++ [pkg_failed=yes]) ++ else ++ pkg_failed=untried ++fi[]dnl ++])# _PKG_CONFIG ++ ++# _PKG_SHORT_ERRORS_SUPPORTED ++# ----------------------------- ++AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], ++[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) ++if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then ++ _pkg_short_errors_supported=yes ++else ++ _pkg_short_errors_supported=no ++fi[]dnl ++])# _PKG_SHORT_ERRORS_SUPPORTED ++ ++ ++# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], ++# [ACTION-IF-NOT-FOUND]) ++# ++# ++# Note that if there is a possibility the first call to ++# PKG_CHECK_MODULES might not happen, you should be sure to include an ++# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac ++# ++# ++# -------------------------------------------------------------- ++AC_DEFUN([PKG_CHECK_MODULES], ++[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl ++AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl ++AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl ++ ++pkg_failed=no ++AC_MSG_CHECKING([for $1]) ++ ++_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) ++_PKG_CONFIG([$1][_LIBS], [libs], [$2]) ++ ++m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS ++and $1[]_LIBS to avoid the need to call pkg-config. ++See the pkg-config man page for more details.]) ++ ++if test $pkg_failed = yes; then ++ AC_MSG_RESULT([no]) ++ _PKG_SHORT_ERRORS_SUPPORTED ++ if test $_pkg_short_errors_supported = yes; then ++ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` ++ else ++ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` ++ fi ++ # Put the nasty error message in config.log where it belongs ++ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD ++ ++ m4_default([$4], [AC_MSG_ERROR( ++[Package requirements ($2) were not met: ++ ++$$1_PKG_ERRORS ++ ++Consider adjusting the PKG_CONFIG_PATH environment variable if you ++installed software in a non-standard prefix. ++ ++_PKG_TEXT])[]dnl ++ ]) ++elif test $pkg_failed = untried; then ++ AC_MSG_RESULT([no]) ++ m4_default([$4], [AC_MSG_FAILURE( ++[The pkg-config script could not be found or is too old. Make sure it ++is in your PATH or set the PKG_CONFIG environment variable to the full ++path to pkg-config. ++ ++_PKG_TEXT ++ ++To get pkg-config, see .])[]dnl ++ ]) ++else ++ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS ++ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS ++ AC_MSG_RESULT([yes]) ++ $3 ++fi[]dnl ++])# PKG_CHECK_MODULES ++ ++ ++# PKG_INSTALLDIR(DIRECTORY) ++# ------------------------- ++# Substitutes the variable pkgconfigdir as the location where a module ++# should install pkg-config .pc files. By default the directory is ++# $libdir/pkgconfig, but the default can be changed by passing ++# DIRECTORY. The user can override through the --with-pkgconfigdir ++# parameter. ++AC_DEFUN([PKG_INSTALLDIR], ++[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) ++m4_pushdef([pkg_description], ++ [pkg-config installation directory @<:@]pkg_default[@:>@]) ++AC_ARG_WITH([pkgconfigdir], ++ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, ++ [with_pkgconfigdir=]pkg_default) ++AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) ++m4_popdef([pkg_default]) ++m4_popdef([pkg_description]) ++]) dnl PKG_INSTALLDIR ++ ++ ++# PKG_NOARCH_INSTALLDIR(DIRECTORY) ++# ------------------------- ++# Substitutes the variable noarch_pkgconfigdir as the location where a ++# module should install arch-independent pkg-config .pc files. By ++# default the directory is $datadir/pkgconfig, but the default can be ++# changed by passing DIRECTORY. The user can override through the ++# --with-noarch-pkgconfigdir parameter. ++AC_DEFUN([PKG_NOARCH_INSTALLDIR], ++[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) ++m4_pushdef([pkg_description], ++ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) ++AC_ARG_WITH([noarch-pkgconfigdir], ++ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, ++ [with_noarch_pkgconfigdir=]pkg_default) ++AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) ++m4_popdef([pkg_default]) ++m4_popdef([pkg_description]) ++]) dnl PKG_NOARCH_INSTALLDIR ++ ++ ++# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, ++# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) ++# ------------------------------------------- ++# Retrieves the value of the pkg-config variable for the given module. ++AC_DEFUN([PKG_CHECK_VAR], ++[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl ++AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl ++ ++_PKG_CONFIG([$1], [variable="][$3]["], [$2]) ++AS_VAR_COPY([$1], [pkg_cv_][$1]) ++ ++AS_VAR_IF([$1], [""], [$5], [$4])dnl ++])# PKG_CHECK_VAR ++ + m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) ++ + # AM_AUX_DIR_EXPAND -*- Autoconf -*- + + # Copyright (C) 2001-2017 Free Software Foundation, Inc. +diff --git a/gdb/build-id.c b/gdb/build-id.c +--- a/gdb/build-id.c ++++ b/gdb/build-id.c +@@ -780,10 +780,10 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) + static rpmts (*rpmtsCreate_p) (void); + extern rpmts rpmtsFree(rpmts ts); + static rpmts (*rpmtsFree_p) (rpmts ts); +- extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, ++ extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, + const void * keyp, size_t keylen); + static rpmdbMatchIterator (*rpmtsInitIterator_p) (const rpmts ts, +- rpmTag rpmtag, ++ rpmDbiTagVal rpmtag, + const void *keyp, + size_t keylen); + #else /* !DLOPEN_LIBRPM */ +@@ -838,7 +838,7 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) + && (rpmdbNextIterator_p = (Header (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbNextIterator")) + && (rpmtsCreate_p = (rpmts (*) (void)) dlsym (h, "rpmtsCreate")) + && (rpmtsFree_p = (rpmts (*) (rpmts ts)) dlsym (h, "rpmtsFree")) +- && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator")))) ++ && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmDbiTagVal rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator")))) + { + warning (_("Opened library \"%s\" is incompatible (%s), " + "missing debuginfos notifications will not be displayed"), +@@ -926,7 +926,7 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) + + /* RPMDBI_PACKAGES requires keylen == sizeof (int). */ + /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */ +- mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0); ++ mi_debuginfo = rpmtsInitIterator_p (ts, (rpmDbiTagVal) RPMDBI_LABEL, debuginfo, 0); + xfree (debuginfo); + if (mi_debuginfo) + { +diff --git a/gdb/config.in b/gdb/config.in +--- a/gdb/config.in ++++ b/gdb/config.in +@@ -42,6 +42,9 @@ + /* Handle .ctf type-info sections */ + #undef ENABLE_LIBCTF + ++/* librpm version specific library name to dlopen. */ ++#undef DLOPEN_LIBRPM ++ + /* Define to 1 if translation of program messages to the user's native + language is requested. */ + #undef ENABLE_NLS +@@ -265,6 +268,9 @@ + /* Define to 1 if you have the `m' library (-lm). */ + #undef HAVE_LIBM + ++/* Define if librpm library is being used. */ ++#undef HAVE_LIBRPM ++ + /* Define to 1 if you have the header file. */ + #undef HAVE_LIBUNWIND_IA64_H + +diff --git a/gdb/configure b/gdb/configure +--- a/gdb/configure ++++ b/gdb/configure +@@ -778,6 +778,11 @@ AMD_DBGAPI_CFLAGS + ENABLE_BFD_64_BIT_FALSE + ENABLE_BFD_64_BIT_TRUE + subdirs ++RPM_LIBS ++RPM_CFLAGS ++PKG_CONFIG_LIBDIR ++PKG_CONFIG_PATH ++PKG_CONFIG + GDB_DATADIR + DEBUGDIR + MAKEINFO_EXTRA_FLAGS +@@ -911,6 +916,7 @@ with_gdb_datadir + with_relocated_sources + with_auto_load_dir + with_auto_load_safe_path ++with_rpm + enable_targets + enable_64_bit_bfd + with_amd_dbgapi +@@ -988,6 +994,8 @@ AMD_DBGAPI_CFLAGS + AMD_DBGAPI_LIBS + DEBUGINFOD_CFLAGS + DEBUGINFOD_LIBS ++RPM_CFLAGS ++RPM_LIBS + YACC + YFLAGS + ZSTD_CFLAGS +@@ -1679,6 +1687,8 @@ Optional Packages: + --with-amd-dbgapi support for the amd-dbgapi target (yes / no / auto) + --with-debuginfod Enable debuginfo lookups with debuginfod + (auto/yes/no) ++ --with-rpm query rpm database for missing debuginfos (yes/no, ++ def. auto=librpm.so) + --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets + --with-curses use the curses library instead of the termcap + library +@@ -1759,6 +1769,8 @@ Some influential environment variables: + C compiler flags for DEBUGINFOD, overriding pkg-config + DEBUGINFOD_LIBS + linker flags for DEBUGINFOD, overriding pkg-config ++ RPM_CFLAGS C compiler flags for RPM, overriding pkg-config ++ RPM_LIBS linker flags for RPM, overriding pkg-config + YACC The `Yet Another Compiler Compiler' implementation to use. + Defaults to the first program found out of: `bison -y', `byacc', + `yacc'. +@@ -18039,6 +18051,495 @@ _ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5 + $as_echo "$with_auto_load_safe_path" >&6; } + ++# Integration with rpm library to support missing debuginfo suggestions. ++# --without-rpm: Disable any rpm support. ++# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime. ++# Even with runtime missing `libname.so' GDB will still other run correctly. ++# Missing `libname.so' during ./configure will abort the configuration. ++# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific ++# minor version first such as `librpm-4.6.so' as minor version differences ++# mean API+ABI incompatibility. If the specific match versioned library name ++# could not be found still open dynamically at least `librpm.so'. ++# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try ++# to find librpm for compilation-time linking by pkg-config. GDB binary will ++# be probably linked with the version specific library (as `librpm-4.6.so'). ++# Failure to find librpm by pkg-config will abort the configuration. ++# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config ++# cannot find librpm use to the rpmless compilation (like `--without-rpm'). ++ ++ ++# Check whether --with-rpm was given. ++if test "${with_rpm+set}" = set; then : ++ withval=$with_rpm; ++else ++ with_rpm="auto" ++fi ++ ++ ++ ++ ++if test "x$with_rpm" != "xno"; then ++ if test "x$with_rpm" = "xyes"; then ++ LIBRPM="librpm.so" ++ RPM_REQUIRE=true ++ DLOPEN_REQUIRE=false ++ elif test "x$with_rpm" = "xauto"; then ++ LIBRPM="librpm.so" ++ RPM_REQUIRE=false ++ DLOPEN_REQUIRE=false ++ else ++ LIBRPM="$with_rpm" ++ RPM_REQUIRE=true ++ DLOPEN_REQUIRE=true ++ fi ++ LIBRPM_STRING='"'"$LIBRPM"'"' ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking specific librpm version" >&5 ++$as_echo_n "checking specific librpm version... " >&6; } ++ HAVE_DLOPEN_LIBRPM=false ++ save_LIBS="$LIBS" ++ LIBS="$LIBS -ldl" ++ if test "$cross_compiling" = yes; then : ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error "cannot run test program while cross compiling ++See \`config.log' for more details." "$LINENO" 5; } ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#include ++#include ++#include ++ ++int ++main () ++{ ++ ++ void *h; ++ const char *const *rpmverp; ++ FILE *f; ++ ++ f = fopen ("conftest.out", "w"); ++ if (!f) ++ { ++ fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out", ++ strerror (errno)); ++ return 1; ++ } ++ h = dlopen ($LIBRPM_STRING, RTLD_LAZY); ++ if (!h) ++ { ++ fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ()); ++ return 1; ++ } ++ rpmverp = dlsym (h, "RPMVERSION"); ++ if (!rpmverp) ++ { ++ fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ()); ++ return 1; ++ } ++ fprintf (stderr, "RPMVERSION is: \""); ++ fprintf (stderr, "%s\"\n", *rpmverp); ++ ++ /* Try to find the specific librpm version only for "librpm.so" as we do ++ not know how to assemble the version string otherwise. */ ++ ++ if (strcmp ("librpm.so", $LIBRPM_STRING) != 0) ++ { ++ fprintf (f, "%s\n", $LIBRPM_STRING); ++ return 0; ++ } ++ else ++ { ++ char *h2_name; ++ void *h2; ++ int major, minor; ++ ++ if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2) ++ { ++ fprintf (stderr, "Unable to parse RPMVERSION.\n"); ++ fprintf (f, "%s\n", $LIBRPM_STRING); ++ return 0; ++ } ++ /* Avoid the square brackets by malloc. */ ++ h2_name = malloc (64); ++ sprintf (h2_name, "librpm-%d.%d.so", major, minor); ++ h2 = dlopen (h2_name, RTLD_LAZY); ++ if (!h2) ++ { ++ fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ()); ++ fprintf (f, "%s\n", $LIBRPM_STRING); ++ return 0; ++ } ++ if (h2 != h) ++ { ++ fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n", ++ $LIBRPM_STRING, h2_name); ++ fprintf (f, "%s\n", $LIBRPM_STRING); ++ return 0; ++ } ++ /* Found the valid .so name with a specific version. */ ++ fprintf (f, "%s\n", h2_name); ++ return 0; ++ } ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ ++ DLOPEN_LIBRPM="`cat conftest.out`" ++ if test "x$DLOPEN_LIBRPM" != "x"; then ++ HAVE_DLOPEN_LIBRPM=true ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLOPEN_LIBRPM" >&5 ++$as_echo "$DLOPEN_LIBRPM" >&6; } ++ fi ++ ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++ rm -f conftest.out ++ ++ ++ ++ if $HAVE_DLOPEN_LIBRPM; then ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5 ++$as_echo_n "checking rpm library API compatibility... " >&6; } ++ # The compilation requires -Werror to verify anything. ++ save_CFLAGS="$CFLAGS" ++ CFLAGS="$CFLAGS -Werror" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Duplicate here the declarations to verify they match "elfread.c". */ ++#include ++#include ++#include ++#include ++extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg); ++extern int rpmReadConfigFiles(const char * file, const char * target); ++extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi); ++extern Header rpmdbNextIterator(rpmdbMatchIterator mi); ++extern rpmts rpmtsCreate(void); ++extern rpmts rpmtsFree(rpmts ts); ++extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, ++ const void * keyp, size_t keylen); ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ++ LIBRPM_COMPAT=true ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } ++ ++else ++ ++ LIBRPM_COMPAT=false ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++ ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ CFLAGS="$save_CFLAGS" ++ ++ if ! $LIBRPM_COMPAT; then ++ HAVE_DLOPEN_LIBRPM=false ++ fi ++ fi ++ ++ if $HAVE_DLOPEN_LIBRPM; then ++ DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"' ++ ++cat >>confdefs.h <<_ACEOF ++#define DLOPEN_LIBRPM $DLOPEN_LIBRPM_STRING ++_ACEOF ++ ++ ++$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h ++ ++ else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++ LIBS="$save_LIBS" ++ if $DLOPEN_REQUIRE; then ++ as_fn_error "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5 ++ fi ++ ++ ++ ++ ++ ++ ++ ++if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then ++ if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. ++set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case $PKG_CONFIG in ++ [\\/]* | ?:[\\/]*) ++ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ++ ;; ++ *) ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++ ;; ++esac ++fi ++PKG_CONFIG=$ac_cv_path_PKG_CONFIG ++if test -n "$PKG_CONFIG"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 ++$as_echo "$PKG_CONFIG" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_path_PKG_CONFIG"; then ++ ac_pt_PKG_CONFIG=$PKG_CONFIG ++ # Extract the first word of "pkg-config", so it can be a program name with args. ++set dummy pkg-config; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case $ac_pt_PKG_CONFIG in ++ [\\/]* | ?:[\\/]*) ++ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ++ ;; ++ *) ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++ ;; ++esac ++fi ++ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG ++if test -n "$ac_pt_PKG_CONFIG"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 ++$as_echo "$ac_pt_PKG_CONFIG" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_pt_PKG_CONFIG" = x; then ++ PKG_CONFIG="" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ PKG_CONFIG=$ac_pt_PKG_CONFIG ++ fi ++else ++ PKG_CONFIG="$ac_cv_path_PKG_CONFIG" ++fi ++ ++fi ++if test -n "$PKG_CONFIG"; then ++ _pkg_min_version=0.9.0 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 ++$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } ++ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } ++ else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++ PKG_CONFIG="" ++ fi ++fi ++ ++pkg_failed=no ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM" >&5 ++$as_echo_n "checking for RPM... " >&6; } ++ ++if test -n "$RPM_CFLAGS"; then ++ pkg_cv_RPM_CFLAGS="$RPM_CFLAGS" ++ elif test -n "$PKG_CONFIG"; then ++ if test -n "$PKG_CONFIG" && \ ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5 ++ ($PKG_CONFIG --exists --print-errors "rpm") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then ++ pkg_cv_RPM_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null` ++ test "x$?" != "x0" && pkg_failed=yes ++else ++ pkg_failed=yes ++fi ++ else ++ pkg_failed=untried ++fi ++if test -n "$RPM_LIBS"; then ++ pkg_cv_RPM_LIBS="$RPM_LIBS" ++ elif test -n "$PKG_CONFIG"; then ++ if test -n "$PKG_CONFIG" && \ ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5 ++ ($PKG_CONFIG --exists --print-errors "rpm") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then ++ pkg_cv_RPM_LIBS=`$PKG_CONFIG --libs "rpm" 2>/dev/null` ++ test "x$?" != "x0" && pkg_failed=yes ++else ++ pkg_failed=yes ++fi ++ else ++ pkg_failed=untried ++fi ++ ++ ++ ++if test $pkg_failed = yes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++ ++if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then ++ _pkg_short_errors_supported=yes ++else ++ _pkg_short_errors_supported=no ++fi ++ if test $_pkg_short_errors_supported = yes; then ++ RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "rpm" 2>&1` ++ else ++ RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "rpm" 2>&1` ++ fi ++ # Put the nasty error message in config.log where it belongs ++ echo "$RPM_PKG_ERRORS" >&5 ++ ++ HAVE_LIBRPM=false ++elif test $pkg_failed = untried; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++ HAVE_LIBRPM=false ++else ++ RPM_CFLAGS=$pkg_cv_RPM_CFLAGS ++ RPM_LIBS=$pkg_cv_RPM_LIBS ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } ++ HAVE_LIBRPM=true ++fi ++ ++ if $HAVE_LIBRPM; then ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5 ++$as_echo_n "checking rpm library API compatibility... " >&6; } ++ # The compilation requires -Werror to verify anything. ++ save_CFLAGS="$CFLAGS" ++ CFLAGS="$CFLAGS -Werror" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Duplicate here the declarations to verify they match "elfread.c". */ ++#include ++#include ++#include ++#include ++extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg); ++extern int rpmReadConfigFiles(const char * file, const char * target); ++extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi); ++extern Header rpmdbNextIterator(rpmdbMatchIterator mi); ++extern rpmts rpmtsCreate(void); ++extern rpmts rpmtsFree(rpmts ts); ++extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, ++ const void * keyp, size_t keylen); ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ++ LIBRPM_COMPAT=true ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } ++ ++else ++ ++ LIBRPM_COMPAT=false ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++ ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ CFLAGS="$save_CFLAGS" ++ ++ if ! $LIBRPM_COMPAT; then ++ HAVE_LIBRPM=false ++ RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB" ++ fi ++ fi ++ ++ if $HAVE_LIBRPM; then ++ ++$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h ++ ++ CFLAGS="$CFLAGS $RPM_CFLAGS" ++ LIBS="$LIBS $RPM_LIBS" ++ else ++ if $RPM_REQUIRE; then ++ as_fn_error "$RPM_PKG_ERRORS" "$LINENO" 5 ++ else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $RPM_PKG_ERRORS" >&5 ++$as_echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;} ++ fi ++ fi ++ fi ++fi ++ + + + subdirs="$subdirs testsuite" +diff --git a/gdb/configure.ac b/gdb/configure.ac +--- a/gdb/configure.ac ++++ b/gdb/configure.ac +@@ -173,6 +173,200 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir, + [Directories safe to hold auto-loaded files.]) + AC_MSG_RESULT([$with_auto_load_safe_path]) + ++# Integration with rpm library to support missing debuginfo suggestions. ++# --without-rpm: Disable any rpm support. ++# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime. ++# Even with runtime missing `libname.so' GDB will still other run correctly. ++# Missing `libname.so' during ./configure will abort the configuration. ++# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific ++# minor version first such as `librpm-4.6.so' as minor version differences ++# mean API+ABI incompatibility. If the specific match versioned library name ++# could not be found still open dynamically at least `librpm.so'. ++# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try ++# to find librpm for compilation-time linking by pkg-config. GDB binary will ++# be probably linked with the version specific library (as `librpm-4.6.so'). ++# Failure to find librpm by pkg-config will abort the configuration. ++# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config ++# cannot find librpm use to the rpmless compilation (like `--without-rpm'). ++ ++AC_ARG_WITH([rpm], ++ [AS_HELP_STRING([--with-rpm], ++ [query rpm database for missing debuginfos (yes/no, def. auto=librpm.so)])], [], [with_rpm="auto"]) ++ ++m4_pattern_allow([^AC_MSG_ERROR$]) ++m4_pattern_allow([^AC_MSG_WARN$]) ++if test "x$with_rpm" != "xno"; then ++ if test "x$with_rpm" = "xyes"; then ++ LIBRPM="librpm.so" ++ RPM_REQUIRE=true ++ DLOPEN_REQUIRE=false ++ elif test "x$with_rpm" = "xauto"; then ++ LIBRPM="librpm.so" ++ RPM_REQUIRE=false ++ DLOPEN_REQUIRE=false ++ else ++ LIBRPM="$with_rpm" ++ RPM_REQUIRE=true ++ DLOPEN_REQUIRE=true ++ fi ++ LIBRPM_STRING='"'"$LIBRPM"'"' ++ ++ AC_MSG_CHECKING([specific librpm version]) ++ HAVE_DLOPEN_LIBRPM=false ++ save_LIBS="$LIBS" ++ LIBS="$LIBS -ldl" ++ AC_RUN_IFELSE(AC_LANG_PROGRAM([[ ++#include ++#include ++#include ++#include ++ ]], [[ ++ void *h; ++ const char *const *rpmverp; ++ FILE *f; ++ ++ f = fopen ("conftest.out", "w"); ++ if (!f) ++ { ++ fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out", ++ strerror (errno)); ++ return 1; ++ } ++ h = dlopen ($LIBRPM_STRING, RTLD_LAZY); ++ if (!h) ++ { ++ fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ()); ++ return 1; ++ } ++ rpmverp = dlsym (h, "RPMVERSION"); ++ if (!rpmverp) ++ { ++ fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ()); ++ return 1; ++ } ++ fprintf (stderr, "RPMVERSION is: \""); ++ fprintf (stderr, "%s\"\n", *rpmverp); ++ ++ /* Try to find the specific librpm version only for "librpm.so" as we do ++ not know how to assemble the version string otherwise. */ ++ ++ if (strcmp ("librpm.so", $LIBRPM_STRING) != 0) ++ { ++ fprintf (f, "%s\n", $LIBRPM_STRING); ++ return 0; ++ } ++ else ++ { ++ char *h2_name; ++ void *h2; ++ int major, minor; ++ ++ if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2) ++ { ++ fprintf (stderr, "Unable to parse RPMVERSION.\n"); ++ fprintf (f, "%s\n", $LIBRPM_STRING); ++ return 0; ++ } ++ /* Avoid the square brackets by malloc. */ ++ h2_name = malloc (64); ++ sprintf (h2_name, "librpm-%d.%d.so", major, minor); ++ h2 = dlopen (h2_name, RTLD_LAZY); ++ if (!h2) ++ { ++ fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ()); ++ fprintf (f, "%s\n", $LIBRPM_STRING); ++ return 0; ++ } ++ if (h2 != h) ++ { ++ fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n", ++ $LIBRPM_STRING, h2_name); ++ fprintf (f, "%s\n", $LIBRPM_STRING); ++ return 0; ++ } ++ /* Found the valid .so name with a specific version. */ ++ fprintf (f, "%s\n", h2_name); ++ return 0; ++ } ++ ]]), [ ++ DLOPEN_LIBRPM="`cat conftest.out`" ++ if test "x$DLOPEN_LIBRPM" != "x"; then ++ HAVE_DLOPEN_LIBRPM=true ++ AC_MSG_RESULT($DLOPEN_LIBRPM) ++ fi ++ ]) ++ rm -f conftest.out ++ ++ m4_define([CHECK_LIBRPM_COMPAT], [ ++ AC_MSG_CHECKING([rpm library API compatibility]) ++ # The compilation requires -Werror to verify anything. ++ save_CFLAGS="$CFLAGS" ++ CFLAGS="$CFLAGS -Werror" ++ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[ ++/* Duplicate here the declarations to verify they match "elfread.c". */ ++#include ++#include ++#include ++#include ++extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg); ++extern int rpmReadConfigFiles(const char * file, const char * target); ++extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi); ++extern Header rpmdbNextIterator(rpmdbMatchIterator mi); ++extern rpmts rpmtsCreate(void); ++extern rpmts rpmtsFree(rpmts ts); ++extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, ++ const void * keyp, size_t keylen); ++ ]]), [ ++ LIBRPM_COMPAT=true ++ AC_MSG_RESULT(yes) ++ ], [ ++ LIBRPM_COMPAT=false ++ AC_MSG_RESULT(no) ++ ]) ++ CFLAGS="$save_CFLAGS" ++ ]) ++ ++ if $HAVE_DLOPEN_LIBRPM; then ++ CHECK_LIBRPM_COMPAT ++ if ! $LIBRPM_COMPAT; then ++ HAVE_DLOPEN_LIBRPM=false ++ fi ++ fi ++ ++ if $HAVE_DLOPEN_LIBRPM; then ++ DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"' ++ AC_DEFINE_UNQUOTED(DLOPEN_LIBRPM, $DLOPEN_LIBRPM_STRING, [librpm version specific library name to dlopen.]) ++ AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.]) ++ else ++ AC_MSG_RESULT(no) ++ LIBS="$save_LIBS" ++ if $DLOPEN_REQUIRE; then ++ AC_MSG_ERROR([Specific name $LIBRPM was requested but it could not be opened.]) ++ fi ++ PKG_CHECK_MODULES(RPM, rpm, [HAVE_LIBRPM=true], [HAVE_LIBRPM=false]) ++ ++ if $HAVE_LIBRPM; then ++ CHECK_LIBRPM_COMPAT ++ if ! $LIBRPM_COMPAT; then ++ HAVE_LIBRPM=false ++ RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB" ++ fi ++ fi ++ ++ if $HAVE_LIBRPM; then ++ AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.]) ++ CFLAGS="$CFLAGS $RPM_CFLAGS" ++ LIBS="$LIBS $RPM_LIBS" ++ else ++ if $RPM_REQUIRE; then ++ AC_MSG_ERROR($RPM_PKG_ERRORS) ++ else ++ AC_MSG_WARN($RPM_PKG_ERRORS) ++ fi ++ fi ++ fi ++fi ++ + AC_CONFIG_SUBDIRS(testsuite) + + # Check whether to support alternative target configurations +diff --git a/gdb/event-top.c b/gdb/event-top.c +--- a/gdb/event-top.c ++++ b/gdb/event-top.c +@@ -43,6 +43,7 @@ + #include "async-event.h" + #include "bt-utils.h" + #include "pager.h" ++#include "symfile.h" + + /* readline include files. */ + #include "readline/readline.h" +@@ -404,6 +405,8 @@ display_gdb_prompt (const char *new_prompt) + /* Reset the nesting depth used when trace-commands is set. */ + reset_command_nest_depth (); + ++ debug_flush_missing (); ++ + /* Do not call the python hook on an explicit prompt change as + passed to this function, as this forms a secondary/local prompt, + IE, displayed but not set. */ +@@ -788,7 +791,10 @@ command_line_handler (gdb::unique_xmalloc_ptr &&rl) + command_handler (cmd); + + if (ui->prompt_state != PROMPTED) +- display_gdb_prompt (0); ++ { ++ debug_flush_missing (); ++ display_gdb_prompt (0); ++ } + } + } + +diff --git a/gdb/symfile.h b/gdb/symfile.h +--- a/gdb/symfile.h ++++ b/gdb/symfile.h +@@ -367,6 +367,7 @@ extern void generic_load (const char *args, int from_tty); + /* build-id support. */ + extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr); + extern void debug_print_missing (const char *binary, const char *debug); ++extern void debug_flush_missing (void); + #define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file") + + /* From minidebug.c. */ diff --git a/gdb-6.6-buildid-locate-solib-missing-ids.patch b/gdb-6.6-buildid-locate-solib-missing-ids.patch new file mode 100644 index 0000000..f52fbd9 --- /dev/null +++ b/gdb-6.6-buildid-locate-solib-missing-ids.patch @@ -0,0 +1,238 @@ +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-6.6-buildid-locate-solib-missing-ids.patch + +;; Fix loading of core files without build-ids but with build-ids in executables. +;; Load strictly build-id-checked core files only if no executable is specified +;; (Jan Kratochvil, RH BZ 1339862). +;;=push+jan + +gdb returns an incorrect back trace when applying a debuginfo +https://bugzilla.redhat.com/show_bug.cgi?id=1339862 + +diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c +--- a/gdb/solib-svr4.c ++++ b/gdb/solib-svr4.c +@@ -1320,14 +1320,28 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, + } + + { +- struct bfd_build_id *build_id; ++ struct bfd_build_id *build_id = NULL; + + strncpy (newobj->so_original_name, buffer.get (), SO_NAME_MAX_PATH_SIZE - 1); + newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; + /* May get overwritten below. */ + strcpy (newobj->so_name, newobj->so_original_name); + +- build_id = build_id_addr_get (((lm_info_svr4 *) newobj->lm_info)->l_ld); ++ /* In the case the main executable was found according to its build-id ++ (from a core file) prevent loading a different build of a library ++ with accidentally the same SO_NAME. ++ ++ It suppresses bogus backtraces (and prints "??" there instead) if ++ the on-disk files no longer match the running program version. ++ ++ If the main executable was not loaded according to its build-id do ++ not do any build-id checking of the libraries. There may be missing ++ build-ids dumped in the core file and we would map all the libraries ++ to the only existing file loaded that time - the executable. */ ++ if (current_program_space->symfile_object_file != NULL ++ && (current_program_space->symfile_object_file->flags ++ & OBJF_BUILD_ID_CORE_LOADED) != 0) ++ build_id = build_id_addr_get (li->l_ld); + if (build_id != NULL) + { + char *name, *build_id_filename; +@@ -1342,23 +1356,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, + xfree (name); + } + else +- { +- debug_print_missing (newobj->so_name, build_id_filename); +- +- /* In the case the main executable was found according to +- its build-id (from a core file) prevent loading +- a different build of a library with accidentally the +- same SO_NAME. +- +- It suppresses bogus backtraces (and prints "??" there +- instead) if the on-disk files no longer match the +- running program version. */ +- +- if (current_program_space->symfile_object_file != NULL +- && (current_program_space->symfile_object_file->flags +- & OBJF_BUILD_ID_CORE_LOADED) != 0) +- newobj->so_name[0] = 0; +- } ++ debug_print_missing (newobj->so_name, build_id_filename); + + xfree (build_id_filename); + xfree (build_id); +diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c +@@ -0,0 +1,21 @@ ++/* Copyright 2010 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++void ++lib (void) ++{ ++} +diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c +@@ -0,0 +1,25 @@ ++/* Copyright 2010 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++extern void lib (void); ++ ++int ++main (void) ++{ ++ lib (); ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp +@@ -0,0 +1,105 @@ ++# Copyright 2016 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++if {[skip_shlib_tests]} { ++ return 0 ++} ++ ++set testfile "gcore-buildid-exec-but-not-solib" ++set srcmainfile ${testfile}-main.c ++set srclibfile ${testfile}-lib.c ++set libfile [standard_output_file ${testfile}-lib.so] ++set objfile [standard_output_file ${testfile}-main.o] ++set executable ${testfile}-main ++set binfile [standard_output_file ${executable}] ++set gcorefile [standard_output_file ${executable}.gcore] ++set outdir [file dirname $binfile] ++ ++if { [gdb_compile_shlib ${srcdir}/${subdir}/${srclibfile} ${libfile} "debug additional_flags=-Wl,--build-id"] != "" ++ || [gdb_compile ${srcdir}/${subdir}/${srcmainfile} ${objfile} object {debug}] != "" } { ++ unsupported "-Wl,--build-id compilation failed" ++ return -1 ++} ++set opts [list debug shlib=${libfile} "additional_flags=-Wl,--build-id"] ++if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } { ++ unsupported "-Wl,--build-id compilation failed" ++ return -1 ++} ++ ++clean_restart $executable ++gdb_load_shlib $libfile ++ ++# Does this gdb support gcore? ++set test "help gcore" ++gdb_test_multiple $test $test { ++ -re "Undefined command: .gcore.*\r\n$gdb_prompt $" { ++ # gcore command not supported -- nothing to test here. ++ unsupported "gdb does not support gcore on this target" ++ return -1; ++ } ++ -re "Save a core file .*\r\n$gdb_prompt $" { ++ pass $test ++ } ++} ++ ++if { ![runto lib] } then { ++ return -1 ++} ++ ++set escapedfilename [string_to_regexp ${gcorefile}] ++ ++set test "save a corefile" ++gdb_test_multiple "gcore ${gcorefile}" $test { ++ -re "Saved corefile ${escapedfilename}\r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re "Can't create a corefile\r\n$gdb_prompt $" { ++ unsupported $test ++ return -1 ++ } ++} ++ ++# Now restart gdb and load the corefile. ++ ++clean_restart $executable ++gdb_load_shlib $libfile ++ ++set buildid [build_id_debug_filename_get $libfile] ++ ++regsub {\.debug$} $buildid {} buildid ++ ++set debugdir [standard_output_file ${testfile}-debugdir] ++file delete -force -- $debugdir ++ ++file mkdir $debugdir/[file dirname $libfile] ++file copy $libfile $debugdir/${libfile} ++ ++file mkdir $debugdir/[file dirname $buildid] ++file copy $libfile $debugdir/${buildid} ++ ++remote_exec build "ln -s /lib ${debugdir}/" ++remote_exec build "ln -s /lib64 ${debugdir}/" ++# /usr is not needed, all the libs are in /lib64: libm.so.6 libc.so.6 ld-linux-x86-64.so.2 ++ ++gdb_test "set solib-absolute-prefix $debugdir" ++ ++gdb_test_no_output "set debug-file-directory $debugdir" "set debug-file-directory" ++ ++gdb_test "core ${gcorefile}" "Core was generated by .*" "re-load generated corefile" ++ ++gdb_test "frame" "#0 \[^\r\n\]* lib .*" "library got loaded" ++ ++gdb_test "bt" ++gdb_test "info shared" diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch new file mode 100644 index 0000000..c2d7077 --- /dev/null +++ b/gdb-6.6-buildid-locate.patch @@ -0,0 +1,1925 @@ +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-6.6-buildid-locate.patch + +;; New locating of the matching binaries from the pure core file (build-id). +;;=push+jan + +diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h +--- a/bfd/libbfd-in.h ++++ b/bfd/libbfd-in.h +@@ -110,7 +110,7 @@ static inline char * + bfd_strdup (const char *str) + { + size_t len = strlen (str) + 1; +- char *buf = bfd_malloc (len); ++ char *buf = (char *) bfd_malloc (len); + if (buf != NULL) + memcpy (buf, str, len); + return buf; +diff --git a/bfd/libbfd.h b/bfd/libbfd.h +--- a/bfd/libbfd.h ++++ b/bfd/libbfd.h +@@ -116,7 +116,7 @@ static inline char * + bfd_strdup (const char *str) + { + size_t len = strlen (str) + 1; +- char *buf = bfd_malloc (len); ++ char *buf = (char *) bfd_malloc (len); + if (buf != NULL) + memcpy (buf, str, len); + return buf; +diff --git a/gdb/build-id.c b/gdb/build-id.c +--- a/gdb/build-id.c ++++ b/gdb/build-id.c +@@ -24,14 +24,72 @@ + #include "gdbsupport/gdb_vecs.h" + #include "symfile.h" + #include "objfiles.h" ++#include ++#include "elf-bfd.h" ++#include "elf/common.h" ++#include "elf/external.h" ++#include "elf/internal.h" + #include "filenames.h" ++#include "gdb_bfd.h" ++#include "gdbcmd.h" + #include "gdbcore.h" + #include "cli/cli-style.h" ++#include "inferior.h" ++#include "objfiles.h" ++#include "observable.h" ++#include "symfile.h" ++ ++#define BUILD_ID_VERBOSE_NONE 0 ++#define BUILD_ID_VERBOSE_FILENAMES 1 ++#define BUILD_ID_VERBOSE_BINARY_PARSE 2 ++static int build_id_verbose = BUILD_ID_VERBOSE_FILENAMES; ++static void ++show_build_id_verbose (struct ui_file *file, int from_tty, ++ struct cmd_list_element *c, const char *value) ++{ ++ gdb_printf (file, _("Verbosity level of the build-id locator is %s.\n"), ++ value); ++} ++/* Locate NT_GNU_BUILD_ID and return its matching debug filename. ++ FIXME: NOTE decoding should be unified with the BFD core notes decoding. */ ++ ++static struct bfd_build_id * ++build_id_buf_get (bfd *templ, gdb_byte *buf, bfd_size_type size) ++{ ++ bfd_byte *p; ++ ++ p = buf; ++ while (p < buf + size) ++ { ++ /* FIXME: bad alignment assumption. */ ++ Elf_External_Note *xnp = (Elf_External_Note *) p; ++ size_t namesz = H_GET_32 (templ, xnp->namesz); ++ size_t descsz = H_GET_32 (templ, xnp->descsz); ++ bfd_byte *descdata = (gdb_byte *) xnp->name + BFD_ALIGN (namesz, 4); ++ ++ if (H_GET_32 (templ, xnp->type) == NT_GNU_BUILD_ID ++ && namesz == sizeof "GNU" ++ && memcmp (xnp->name, "GNU", sizeof "GNU") == 0) ++ { ++ size_t sz = descsz; ++ gdb_byte *data = (gdb_byte *) descdata; ++ struct bfd_build_id *retval; ++ ++ retval = (struct bfd_build_id *) xmalloc (sizeof *retval - 1 + sz); ++ retval->size = sz; ++ memcpy (retval->data, data, sz); ++ ++ return retval; ++ } ++ p = descdata + BFD_ALIGN (descsz, 4); ++ } ++ return NULL; ++} + + /* See build-id.h. */ + + const struct bfd_build_id * +-build_id_bfd_get (bfd *abfd) ++build_id_bfd_shdr_get (bfd *abfd) + { + /* Dynamic objfiles such as ones created by JIT reader API + have no underlying bfd structure (that is, objfile->obfd +@@ -50,6 +108,348 @@ build_id_bfd_get (bfd *abfd) + return NULL; + } + ++/* Core files may have missing (corrupt) SHDR but PDHR is correct there. ++ bfd_elf_bfd_from_remote_memory () has too much overhead by ++ allocating/reading all the available ELF PT_LOADs. */ ++ ++static struct bfd_build_id * ++build_id_phdr_get (bfd *templ, bfd_vma loadbase, unsigned e_phnum, ++ Elf_Internal_Phdr *i_phdr) ++{ ++ int i; ++ struct bfd_build_id *retval = NULL; ++ ++ for (i = 0; i < e_phnum; i++) ++ if (i_phdr[i].p_type == PT_NOTE && i_phdr[i].p_filesz > 0) ++ { ++ Elf_Internal_Phdr *hdr = &i_phdr[i]; ++ gdb_byte *buf; ++ int err; ++ ++ buf = (gdb_byte *) xmalloc (hdr->p_filesz); ++ err = target_read_memory (loadbase + i_phdr[i].p_vaddr, buf, ++ hdr->p_filesz); ++ if (err == 0) ++ retval = build_id_buf_get (templ, buf, hdr->p_filesz); ++ else ++ retval = NULL; ++ xfree (buf); ++ if (retval != NULL) ++ break; ++ } ++ return retval; ++} ++ ++/* First we validate the file by reading in the ELF header and checking ++ the magic number. */ ++ ++static inline bfd_boolean ++elf_file_p (Elf64_External_Ehdr *x_ehdrp64) ++{ ++ gdb_assert (sizeof (Elf64_External_Ehdr) >= sizeof (Elf32_External_Ehdr)); ++ gdb_assert (offsetof (Elf64_External_Ehdr, e_ident) ++ == offsetof (Elf32_External_Ehdr, e_ident)); ++ gdb_assert (sizeof (((Elf64_External_Ehdr *) 0)->e_ident) ++ == sizeof (((Elf32_External_Ehdr *) 0)->e_ident)); ++ ++ return ((x_ehdrp64->e_ident[EI_MAG0] == ELFMAG0) ++ && (x_ehdrp64->e_ident[EI_MAG1] == ELFMAG1) ++ && (x_ehdrp64->e_ident[EI_MAG2] == ELFMAG2) ++ && (x_ehdrp64->e_ident[EI_MAG3] == ELFMAG3)); ++} ++ ++/* Translate an ELF file header in external format into an ELF file header in ++ internal format. */ ++ ++#define H_GET_WORD(bfd, ptr) (is64 ? H_GET_64 (bfd, (ptr)) \ ++ : H_GET_32 (bfd, (ptr))) ++#define H_GET_SIGNED_WORD(bfd, ptr) (is64 ? H_GET_S64 (bfd, (ptr)) \ ++ : H_GET_S32 (bfd, (ptr))) ++ ++static void ++elf_swap_ehdr_in (bfd *abfd, ++ const Elf64_External_Ehdr *src64, ++ Elf_Internal_Ehdr *dst) ++{ ++ int is64 = bfd_get_arch_size (abfd) == 64; ++#define SRC(field) (is64 ? src64->field \ ++ : ((const Elf32_External_Ehdr *) src64)->field) ++ ++ int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma; ++ memcpy (dst->e_ident, SRC (e_ident), EI_NIDENT); ++ dst->e_type = H_GET_16 (abfd, SRC (e_type)); ++ dst->e_machine = H_GET_16 (abfd, SRC (e_machine)); ++ dst->e_version = H_GET_32 (abfd, SRC (e_version)); ++ if (signed_vma) ++ dst->e_entry = H_GET_SIGNED_WORD (abfd, SRC (e_entry)); ++ else ++ dst->e_entry = H_GET_WORD (abfd, SRC (e_entry)); ++ dst->e_phoff = H_GET_WORD (abfd, SRC (e_phoff)); ++ dst->e_shoff = H_GET_WORD (abfd, SRC (e_shoff)); ++ dst->e_flags = H_GET_32 (abfd, SRC (e_flags)); ++ dst->e_ehsize = H_GET_16 (abfd, SRC (e_ehsize)); ++ dst->e_phentsize = H_GET_16 (abfd, SRC (e_phentsize)); ++ dst->e_phnum = H_GET_16 (abfd, SRC (e_phnum)); ++ dst->e_shentsize = H_GET_16 (abfd, SRC (e_shentsize)); ++ dst->e_shnum = H_GET_16 (abfd, SRC (e_shnum)); ++ dst->e_shstrndx = H_GET_16 (abfd, SRC (e_shstrndx)); ++ ++#undef SRC ++} ++ ++/* Translate an ELF program header table entry in external format into an ++ ELF program header table entry in internal format. */ ++ ++static void ++elf_swap_phdr_in (bfd *abfd, ++ const Elf64_External_Phdr *src64, ++ Elf_Internal_Phdr *dst) ++{ ++ int is64 = bfd_get_arch_size (abfd) == 64; ++#define SRC(field) (is64 ? src64->field \ ++ : ((const Elf32_External_Phdr *) src64)->field) ++ ++ int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma; ++ ++ dst->p_type = H_GET_32 (abfd, SRC (p_type)); ++ dst->p_flags = H_GET_32 (abfd, SRC (p_flags)); ++ dst->p_offset = H_GET_WORD (abfd, SRC (p_offset)); ++ if (signed_vma) ++ { ++ dst->p_vaddr = H_GET_SIGNED_WORD (abfd, SRC (p_vaddr)); ++ dst->p_paddr = H_GET_SIGNED_WORD (abfd, SRC (p_paddr)); ++ } ++ else ++ { ++ dst->p_vaddr = H_GET_WORD (abfd, SRC (p_vaddr)); ++ dst->p_paddr = H_GET_WORD (abfd, SRC (p_paddr)); ++ } ++ dst->p_filesz = H_GET_WORD (abfd, SRC (p_filesz)); ++ dst->p_memsz = H_GET_WORD (abfd, SRC (p_memsz)); ++ dst->p_align = H_GET_WORD (abfd, SRC (p_align)); ++ ++#undef SRC ++} ++ ++#undef H_GET_SIGNED_WORD ++#undef H_GET_WORD ++ ++static Elf_Internal_Phdr * ++elf_get_phdr (bfd *templ, bfd_vma ehdr_vma, unsigned *e_phnum_pointer, ++ bfd_vma *loadbase_pointer) ++{ ++ /* sizeof (Elf64_External_Ehdr) >= sizeof (Elf32_External_Ehdr) */ ++ Elf64_External_Ehdr x_ehdr64; /* Elf file header, external form */ ++ Elf_Internal_Ehdr i_ehdr; /* Elf file header, internal form */ ++ bfd_size_type x_phdrs_size; ++ gdb_byte *x_phdrs_ptr; ++ Elf_Internal_Phdr *i_phdrs; ++ int err; ++ unsigned int i; ++ bfd_vma loadbase; ++ int loadbase_set; ++ ++ gdb_assert (templ != NULL); ++ gdb_assert (sizeof (Elf64_External_Ehdr) >= sizeof (Elf32_External_Ehdr)); ++ ++ /* Read in the ELF header in external format. */ ++ err = target_read_memory (ehdr_vma, (bfd_byte *) &x_ehdr64, sizeof x_ehdr64); ++ if (err) ++ { ++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE) ++ warning (_("build-id: Error reading ELF header at address 0x%lx"), ++ (unsigned long) ehdr_vma); ++ return NULL; ++ } ++ ++ /* Now check to see if we have a valid ELF file, and one that BFD can ++ make use of. The magic number must match, the address size ('class') ++ and byte-swapping must match our XVEC entry. */ ++ ++ if (! elf_file_p (&x_ehdr64) ++ || x_ehdr64.e_ident[EI_VERSION] != EV_CURRENT ++ || !((bfd_get_arch_size (templ) == 64 ++ && x_ehdr64.e_ident[EI_CLASS] == ELFCLASS64) ++ || (bfd_get_arch_size (templ) == 32 ++ && x_ehdr64.e_ident[EI_CLASS] == ELFCLASS32))) ++ { ++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE) ++ warning (_("build-id: Unrecognized ELF header at address 0x%lx"), ++ (unsigned long) ehdr_vma); ++ return NULL; ++ } ++ ++ /* Check that file's byte order matches xvec's */ ++ switch (x_ehdr64.e_ident[EI_DATA]) ++ { ++ case ELFDATA2MSB: /* Big-endian */ ++ if (! bfd_header_big_endian (templ)) ++ { ++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE) ++ warning (_("build-id: Unrecognized " ++ "big-endian ELF header at address 0x%lx"), ++ (unsigned long) ehdr_vma); ++ return NULL; ++ } ++ break; ++ case ELFDATA2LSB: /* Little-endian */ ++ if (! bfd_header_little_endian (templ)) ++ { ++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE) ++ warning (_("build-id: Unrecognized " ++ "little-endian ELF header at address 0x%lx"), ++ (unsigned long) ehdr_vma); ++ return NULL; ++ } ++ break; ++ case ELFDATANONE: /* No data encoding specified */ ++ default: /* Unknown data encoding specified */ ++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE) ++ warning (_("build-id: Unrecognized " ++ "ELF header endianity at address 0x%lx"), ++ (unsigned long) ehdr_vma); ++ return NULL; ++ } ++ ++ elf_swap_ehdr_in (templ, &x_ehdr64, &i_ehdr); ++ ++ /* The file header tells where to find the program headers. ++ These are what we use to actually choose what to read. */ ++ ++ if (i_ehdr.e_phentsize != (bfd_get_arch_size (templ) == 64 ++ ? sizeof (Elf64_External_Phdr) ++ : sizeof (Elf32_External_Phdr)) ++ || i_ehdr.e_phnum == 0) ++ { ++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE) ++ warning (_("build-id: Invalid ELF program headers from the ELF header " ++ "at address 0x%lx"), (unsigned long) ehdr_vma); ++ return NULL; ++ } ++ ++ x_phdrs_size = (bfd_get_arch_size (templ) == 64 ? sizeof (Elf64_External_Phdr) ++ : sizeof (Elf32_External_Phdr)); ++ ++ i_phdrs = (Elf_Internal_Phdr *) xmalloc (i_ehdr.e_phnum * (sizeof *i_phdrs + x_phdrs_size)); ++ x_phdrs_ptr = (gdb_byte *) &i_phdrs[i_ehdr.e_phnum]; ++ err = target_read_memory (ehdr_vma + i_ehdr.e_phoff, (bfd_byte *) x_phdrs_ptr, ++ i_ehdr.e_phnum * x_phdrs_size); ++ if (err) ++ { ++ free (i_phdrs); ++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE) ++ warning (_("build-id: Error reading " ++ "ELF program headers at address 0x%lx"), ++ (unsigned long) (ehdr_vma + i_ehdr.e_phoff)); ++ return NULL; ++ } ++ ++ loadbase = ehdr_vma; ++ loadbase_set = 0; ++ for (i = 0; i < i_ehdr.e_phnum; ++i) ++ { ++ elf_swap_phdr_in (templ, (Elf64_External_Phdr *) ++ (x_phdrs_ptr + i * x_phdrs_size), &i_phdrs[i]); ++ /* IA-64 vDSO may have two mappings for one segment, where one mapping ++ is executable only, and one is read only. We must not use the ++ executable one (PF_R is the first one, PF_X the second one). */ ++ if (i_phdrs[i].p_type == PT_LOAD && (i_phdrs[i].p_flags & PF_R)) ++ { ++ /* Only the first PT_LOAD segment indicates the file bias. ++ Next segments may have P_VADDR arbitrarily higher. ++ If the first segment has P_VADDR zero any next segment must not ++ confuse us, the first one sets LOADBASE certainly enough. */ ++ if (!loadbase_set && i_phdrs[i].p_offset == 0) ++ { ++ loadbase = ehdr_vma - i_phdrs[i].p_vaddr; ++ loadbase_set = 1; ++ } ++ } ++ } ++ ++ if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE) ++ warning (_("build-id: Found ELF header at address 0x%lx, loadbase 0x%lx"), ++ (unsigned long) ehdr_vma, (unsigned long) loadbase); ++ ++ *e_phnum_pointer = i_ehdr.e_phnum; ++ *loadbase_pointer = loadbase; ++ return i_phdrs; ++} ++ ++/* BUILD_ID_ADDR_GET gets ADDR located somewhere in the object. ++ Find the first section before ADDR containing an ELF header. ++ We rely on the fact the sections from multiple files do not mix. ++ FIXME: We should check ADDR is contained _inside_ the section with possibly ++ missing content (P_FILESZ < P_MEMSZ). These omitted sections are currently ++ hidden by _BFD_ELF_MAKE_SECTION_FROM_PHDR. */ ++ ++static CORE_ADDR build_id_addr; ++struct build_id_addr_sect ++ { ++ struct build_id_addr_sect *next; ++ asection *sect; ++ }; ++static struct build_id_addr_sect *build_id_addr_sect; ++ ++static void build_id_addr_candidate (bfd *abfd, asection *sect, void *obj) ++{ ++ if (build_id_addr >= bfd_section_vma (sect)) ++ { ++ struct build_id_addr_sect *candidate; ++ ++ candidate = (struct build_id_addr_sect *) xmalloc (sizeof *candidate); ++ candidate->next = build_id_addr_sect; ++ build_id_addr_sect = candidate; ++ candidate->sect = sect; ++ } ++} ++ ++struct bfd_build_id * ++build_id_addr_get (CORE_ADDR addr) ++{ ++ struct build_id_addr_sect *candidate; ++ struct bfd_build_id *retval = NULL; ++ Elf_Internal_Phdr *i_phdr = NULL; ++ bfd_vma loadbase = 0; ++ unsigned e_phnum = 0; ++ ++ if (core_bfd == NULL) ++ return NULL; ++ ++ build_id_addr = addr; ++ gdb_assert (build_id_addr_sect == NULL); ++ bfd_map_over_sections (core_bfd, build_id_addr_candidate, NULL); ++ ++ /* Sections are sorted in the high-to-low VMAs order. ++ Stop the search on the first ELF header we find. ++ Do not continue the search even if it does not contain NT_GNU_BUILD_ID. */ ++ ++ for (candidate = build_id_addr_sect; candidate != NULL; ++ candidate = candidate->next) ++ { ++ i_phdr = elf_get_phdr (core_bfd, ++ bfd_section_vma (candidate->sect), ++ &e_phnum, &loadbase); ++ if (i_phdr != NULL) ++ break; ++ } ++ ++ if (i_phdr != NULL) ++ { ++ retval = build_id_phdr_get (core_bfd, loadbase, e_phnum, i_phdr); ++ xfree (i_phdr); ++ } ++ ++ while (build_id_addr_sect != NULL) ++ { ++ candidate = build_id_addr_sect; ++ build_id_addr_sect = candidate->next; ++ xfree (candidate); ++ } ++ ++ return retval; ++} ++ + /* See build-id.h. */ + + int +@@ -58,7 +458,7 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) + const struct bfd_build_id *found; + int retval = 0; + +- found = build_id_bfd_get (abfd); ++ found = build_id_bfd_shdr_get (abfd); + + if (found == NULL) + warning (_("File \"%s\" has no build-id, file skipped"), +@@ -73,63 +473,166 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) + return retval; + } + ++static char * ++link_resolve (const char *symlink, int level) ++{ ++ char buf[PATH_MAX + 1], *retval; ++ gdb::unique_xmalloc_ptr target; ++ ssize_t got; ++ ++ if (level > 10) ++ return xstrdup (symlink); ++ ++ got = readlink (symlink, buf, sizeof (buf)); ++ if (got < 0 || got >= sizeof (buf)) ++ return xstrdup (symlink); ++ buf[got] = '\0'; ++ ++ if (IS_ABSOLUTE_PATH (buf)) ++ target = make_unique_xstrdup (buf); ++ else ++ { ++ const std::string dir (ldirname (symlink)); ++ ++ target = xstrprintf ("%s" ++#ifndef HAVE_DOS_BASED_FILE_SYSTEM ++ "/" ++#else /* HAVE_DOS_BASED_FILE_SYSTEM */ ++ "\\" ++#endif /* HAVE_DOS_BASED_FILE_SYSTEM */ ++ "%s", dir.c_str(), buf); ++ } ++ ++ retval = link_resolve (target.get (), level + 1); ++ return retval; ++} ++ + /* Helper for build_id_to_debug_bfd. LINK is a path to a potential + build-id-based separate debug file, potentially a symlink to the real file. + If the file exists and matches BUILD_ID, return a BFD reference to it. */ + + static gdb_bfd_ref_ptr +-build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len, +- const bfd_byte *build_id) ++build_id_to_debug_bfd_1 (const std::string &orig_link, size_t build_id_len, ++ const bfd_byte *build_id, char **link_return) + { ++ gdb_bfd_ref_ptr ret_bfd = {}; ++ std::string ret_link; ++ + if (separate_debug_file_debug) + { +- gdb_printf (gdb_stdlog, _(" Trying %s..."), link.c_str ()); +- gdb_flush (gdb_stdlog); ++ gdb_printf (gdb_stdlog, _(" Trying %s..."), orig_link.c_str ()); ++ gdb_flush (gdb_stdout); + } + +- /* lrealpath() is expensive even for the usually non-existent files. */ +- gdb::unique_xmalloc_ptr filename_holder; +- const char *filename = nullptr; +- if (startswith (link, TARGET_SYSROOT_PREFIX)) +- filename = link.c_str (); +- else if (access (link.c_str (), F_OK) == 0) ++ for (unsigned seqno = 0;; seqno++) + { +- filename_holder.reset (lrealpath (link.c_str ())); +- filename = filename_holder.get (); +- } ++ std::string link = orig_link; + +- if (filename == NULL) +- { +- if (separate_debug_file_debug) +- gdb_printf (gdb_stdlog, +- _(" no, unable to compute real path\n")); ++ if (seqno > 0) ++ { ++ /* There can be multiple build-id symlinks pointing to real files ++ with the same build-id (such as hard links). Some of the real ++ files may not be installed. */ + +- return {}; +- } ++ string_appendf (link, ".%u", seqno); ++ } + +- /* We expect to be silent on the non-existing files. */ +- gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename, gnutarget); ++ ret_link = link; + +- if (debug_bfd == NULL) +- { +- if (separate_debug_file_debug) +- gdb_printf (gdb_stdlog, _(" no, unable to open.\n")); ++ struct stat statbuf_trash; ++ ++ /* `access' automatically dereferences LINK. */ ++ if (lstat (link.c_str (), &statbuf_trash) != 0) ++ { ++ /* Stop increasing SEQNO. */ ++ break; ++ } ++ ++ /* lrealpath() is expensive even for the usually non-existent files. */ ++ gdb::unique_xmalloc_ptr filename_holder; ++ const char *filename = nullptr; ++ if (startswith (link, TARGET_SYSROOT_PREFIX)) ++ filename = link.c_str (); ++ else if (access (link.c_str (), F_OK) == 0) ++ { ++ filename_holder.reset (lrealpath (link.c_str ())); ++ filename = filename_holder.get (); ++ } ++ ++ if (filename == NULL) ++ { ++ if (separate_debug_file_debug) ++ gdb_printf (gdb_stdlog, ++ _(" no, unable to compute real path\n")); ++ ++ continue; ++ } ++ ++ /* We expect to be silent on the non-existing files. */ ++ gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename, gnutarget); ++ ++ if (debug_bfd == NULL) ++ { ++ if (separate_debug_file_debug) ++ gdb_printf (gdb_stdlog, _(" no, unable to open.\n")); + +- return {}; ++ continue; ++ } ++ ++ if (!build_id_verify (debug_bfd.get(), build_id_len, build_id)) ++ { ++ if (separate_debug_file_debug) ++ gdb_printf (gdb_stdlog, ++ _(" no, build-id does not match.\n")); ++ ++ continue; ++ } ++ ++ ret_bfd = debug_bfd; ++ break; + } + +- if (!build_id_verify (debug_bfd.get(), build_id_len, build_id)) ++ std::string link_all; ++ ++ if (ret_bfd != NULL) + { + if (separate_debug_file_debug) +- gdb_printf (gdb_stdlog, _(" no, build-id does not match.\n")); ++ gdb_printf (gdb_stdlog, _(" yes!\n")); ++ } ++ else ++ { ++ /* If none of the real files is found report as missing file ++ always the non-.%u-suffixed file. */ ++ std::string link0 = orig_link; + +- return {}; ++ /* If the symlink has target request to install the target. ++ BASE-debuginfo.rpm contains the symlink but BASE.rpm may be missing. ++ https://bugzilla.redhat.com/show_bug.cgi?id=981154 */ ++ std::string link0_resolved (link_resolve (link0.c_str (), 0)); ++ ++ if (link_all.empty ()) ++ link_all = link0_resolved; ++ else ++ { ++ /* Use whitespace instead of DIRNAME_SEPARATOR to be compatible with ++ its possible use as an argument for installation command. */ ++ link_all += " " + link0_resolved; ++ } + } + +- if (separate_debug_file_debug) +- gdb_printf (gdb_stdlog, _(" yes!\n")); ++ if (link_return != NULL) ++ { ++ if (ret_bfd != NULL) ++ { ++ *link_return = xstrdup (ret_link.c_str ()); ++ } ++ else ++ { ++ *link_return = xstrdup (link_all.c_str ()); ++ } ++ } + +- return debug_bfd; ++ return ret_bfd; + } + + /* Common code for finding BFDs of a given build-id. This function +@@ -138,7 +641,7 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len, + + static gdb_bfd_ref_ptr + build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, +- const char *suffix) ++ const char *suffix, char **link_return) + { + /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will + cause "/.build-id/..." lookups. */ +@@ -161,16 +664,17 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, + if (size > 0) + { + size--; +- string_appendf (link, "%02x/", (unsigned) *data++); ++ string_appendf (link, "%02x", (unsigned) *data++); + } +- ++ if (size > 0) ++ link += "/"; + while (size-- > 0) + string_appendf (link, "%02x", (unsigned) *data++); + + link += suffix; + + gdb_bfd_ref_ptr debug_bfd +- = build_id_to_debug_bfd_1 (link, build_id_len, build_id); ++ = build_id_to_debug_bfd_1 (link, build_id_len, build_id, link_return); + if (debug_bfd != NULL) + return debug_bfd; + +@@ -181,7 +685,7 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, + if (!gdb_sysroot.empty ()) + { + link = gdb_sysroot + link; +- debug_bfd = build_id_to_debug_bfd_1 (link, build_id_len, build_id); ++ debug_bfd = build_id_to_debug_bfd_1 (link, build_id_len, build_id, NULL); + if (debug_bfd != NULL) + return debug_bfd; + } +@@ -190,31 +694,663 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, + return {}; + } + ++char * ++build_id_to_filename (const struct bfd_build_id *build_id, char **link_return) ++{ ++ gdb_bfd_ref_ptr abfd; ++ char *result; ++ ++ abfd = build_id_to_exec_bfd (build_id->size, build_id->data, link_return); ++ if (abfd == NULL) ++ return NULL; ++ ++ result = xstrdup (bfd_get_filename (abfd.get ())); ++ return result; ++} ++ ++void debug_flush_missing (void); ++ ++#ifdef HAVE_LIBRPM ++ ++#include ++#include ++#include ++#include ++#ifdef DLOPEN_LIBRPM ++#include ++#endif ++ ++/* Workarodun https://bugzilla.redhat.com/show_bug.cgi?id=643031 ++ librpm must not exit() an application on SIGINT ++ ++ Enable or disable a signal handler. SIGNUM: signal to enable (or disable ++ if negative). HANDLER: sa_sigaction handler (or NULL to use ++ rpmsqHandler()). Returns: no. of refs, -1 on error. */ ++extern int rpmsqEnable (int signum, /* rpmsqAction_t handler */ void *handler); ++int ++rpmsqEnable (int signum, /* rpmsqAction_t handler */ void *handler) ++{ ++ return 0; ++} ++ ++/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files ++ and avoid their duplicities during a single inferior run. */ ++ ++static struct htab *missing_rpm_hash; ++ ++/* This MISSING_RPM_LIST tracker is used to collect and print as a single line ++ all the rpms right before the nearest GDB prompt. It gets cleared after ++ each such print (it is questionable if we should clear it after the print). ++ */ ++ ++struct missing_rpm ++ { ++ struct missing_rpm *next; ++ char rpm[1]; ++ }; ++static struct missing_rpm *missing_rpm_list; ++static int missing_rpm_list_entries; ++ ++/* Returns the count of newly added rpms. */ ++ ++static int ++#ifndef GDB_INDEX_VERIFY_VENDOR ++missing_rpm_enlist (const char *filename) ++#else ++missing_rpm_enlist_1 (const char *filename, int verify_vendor) ++#endif ++{ ++ static int rpm_init_done = 0; ++ rpmts ts; ++ rpmdbMatchIterator mi; ++ int count = 0; ++ ++#ifdef DLOPEN_LIBRPM ++ /* Duplicate here the declarations to verify they match. The same sanity ++ check is present also in `configure.ac'. */ ++ extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg); ++ static char *(*headerFormat_p) (Header h, const char * fmt, errmsg_t *errmsg); ++ extern int rpmReadConfigFiles(const char * file, const char * target); ++ static int (*rpmReadConfigFiles_p) (const char * file, const char * target); ++ extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi); ++ static rpmdbMatchIterator (*rpmdbFreeIterator_p) (rpmdbMatchIterator mi); ++ extern Header rpmdbNextIterator(rpmdbMatchIterator mi); ++ static Header (*rpmdbNextIterator_p) (rpmdbMatchIterator mi); ++ extern rpmts rpmtsCreate(void); ++ static rpmts (*rpmtsCreate_p) (void); ++ extern rpmts rpmtsFree(rpmts ts); ++ static rpmts (*rpmtsFree_p) (rpmts ts); ++ extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, ++ const void * keyp, size_t keylen); ++ static rpmdbMatchIterator (*rpmtsInitIterator_p) (const rpmts ts, ++ rpmTag rpmtag, ++ const void *keyp, ++ size_t keylen); ++#else /* !DLOPEN_LIBRPM */ ++# define headerFormat_p headerFormat ++# define rpmReadConfigFiles_p rpmReadConfigFiles ++# define rpmdbFreeIterator_p rpmdbFreeIterator ++# define rpmdbNextIterator_p rpmdbNextIterator ++# define rpmtsCreate_p rpmtsCreate ++# define rpmtsFree_p rpmtsFree ++# define rpmtsInitIterator_p rpmtsInitIterator ++#endif /* !DLOPEN_LIBRPM */ ++ ++ gdb_assert (filename != NULL); ++ ++ if (strcmp (filename, BUILD_ID_MAIN_EXECUTABLE_FILENAME) == 0) ++ return 0; ++ ++ if (is_target_filename (filename)) ++ return 0; ++ ++ if (filename[0] != '/') ++ { ++ warning (_("Ignoring non-absolute filename: <%s>"), filename); ++ return 0; ++ } ++ ++ if (!rpm_init_done) ++ { ++ static int init_tried; ++ ++ /* Already failed the initialization before? */ ++ if (init_tried) ++ return 0; ++ init_tried = 1; ++ ++#ifdef DLOPEN_LIBRPM ++ { ++ void *h; ++ ++ h = dlopen (DLOPEN_LIBRPM, RTLD_LAZY); ++ if (!h) ++ { ++ warning (_("Unable to open \"%s\" (%s), " ++ "missing debuginfos notifications will not be displayed"), ++ DLOPEN_LIBRPM, dlerror ()); ++ return 0; ++ } ++ ++ if (!((headerFormat_p = (char *(*) (Header h, const char * fmt, errmsg_t *errmsg)) dlsym (h, "headerFormat")) ++ && (rpmReadConfigFiles_p = (int (*) (const char * file, const char * target)) dlsym (h, "rpmReadConfigFiles")) ++ && (rpmdbFreeIterator_p = (rpmdbMatchIterator (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbFreeIterator")) ++ && (rpmdbNextIterator_p = (Header (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbNextIterator")) ++ && (rpmtsCreate_p = (rpmts (*) (void)) dlsym (h, "rpmtsCreate")) ++ && (rpmtsFree_p = (rpmts (*) (rpmts ts)) dlsym (h, "rpmtsFree")) ++ && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator")))) ++ { ++ warning (_("Opened library \"%s\" is incompatible (%s), " ++ "missing debuginfos notifications will not be displayed"), ++ DLOPEN_LIBRPM, dlerror ()); ++ if (dlclose (h)) ++ warning (_("Error closing library \"%s\": %s\n"), DLOPEN_LIBRPM, ++ dlerror ()); ++ return 0; ++ } ++ } ++#endif /* DLOPEN_LIBRPM */ ++ ++ if (rpmReadConfigFiles_p (NULL, NULL) != 0) ++ { ++ warning (_("Error reading the rpm configuration files")); ++ return 0; ++ } ++ ++ rpm_init_done = 1; ++ } ++ ++ ts = rpmtsCreate_p (); ++ ++ mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0); ++ if (mi != NULL) ++ { ++#ifndef GDB_INDEX_VERIFY_VENDOR ++ for (;;) ++#else ++ if (!verify_vendor) for (;;) ++#endif ++ { ++ Header h; ++ char *debuginfo, **slot, *s, *s2; ++ errmsg_t err; ++ size_t srcrpmlen = sizeof (".src.rpm") - 1; ++ size_t debuginfolen = sizeof ("-debuginfo") - 1; ++ rpmdbMatchIterator mi_debuginfo; ++ ++ h = rpmdbNextIterator_p (mi); ++ if (h == NULL) ++ break; ++ ++ /* Verify the debuginfo file is not already installed. */ ++ ++ debuginfo = headerFormat_p (h, "%{sourcerpm}-debuginfo.%{arch}", ++ &err); ++ if (!debuginfo) ++ { ++ warning (_("Error querying the rpm file `%s': %s"), filename, ++ err); ++ continue; ++ } ++ /* s = `.src.rpm-debuginfo.%{arch}' */ ++ s = strrchr (debuginfo, '-') - srcrpmlen; ++ s2 = NULL; ++ if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0) ++ { ++ /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */ ++ s2 = (char *) memrchr (debuginfo, '-', s - debuginfo); ++ } ++ if (s2) ++ { ++ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */ ++ s2 = (char *) memrchr (debuginfo, '-', s2 - debuginfo); ++ } ++ if (!s2) ++ { ++ warning (_("Error querying the rpm file `%s': %s"), filename, ++ debuginfo); ++ xfree (debuginfo); ++ continue; ++ } ++ /* s = `.src.rpm-debuginfo.%{arch}' */ ++ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */ ++ memmove (s2 + debuginfolen, s2, s - s2); ++ memcpy (s2, "-debuginfo", debuginfolen); ++ /* s = `XXXX.%{arch}' */ ++ /* strlen ("XXXX") == srcrpmlen + debuginfolen */ ++ /* s2 = `-debuginfo-%{version}-%{release}XX.%{arch}' */ ++ /* strlen ("XX") == srcrpmlen */ ++ memmove (s + debuginfolen, s + srcrpmlen + debuginfolen, ++ strlen (s + srcrpmlen + debuginfolen) + 1); ++ /* s = `-debuginfo-%{version}-%{release}.%{arch}' */ ++ ++ /* RPMDBI_PACKAGES requires keylen == sizeof (int). */ ++ /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */ ++ mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0); ++ xfree (debuginfo); ++ if (mi_debuginfo) ++ { ++ rpmdbFreeIterator_p (mi_debuginfo); ++ count = 0; ++ break; ++ } ++ ++ /* The allocated memory gets utilized below for MISSING_RPM_HASH. */ ++ debuginfo = headerFormat_p (h, ++ "%{name}-%{version}-%{release}.%{arch}", ++ &err); ++ if (!debuginfo) ++ { ++ warning (_("Error querying the rpm file `%s': %s"), filename, ++ err); ++ continue; ++ } ++ ++ /* Base package name for `debuginfo-install'. We do not use the ++ `yum' command directly as the line ++ yum --enablerepo='*debug*' install NAME-debuginfo.ARCH ++ would be more complicated than just: ++ debuginfo-install NAME-VERSION-RELEASE.ARCH ++ Do not supply the rpm base name (derived from .src.rpm name) as ++ debuginfo-install is unable to install the debuginfo package if ++ the base name PKG binary rpm is not installed while for example ++ PKG-libs would be installed (RH Bug 467901). ++ FUTURE: After multiple debuginfo versions simultaneously installed ++ get supported the support for the VERSION-RELEASE tags handling ++ may need an update. */ ++ ++ if (missing_rpm_hash == NULL) ++ { ++ /* DEL_F is passed NULL as MISSING_RPM_LIST's HTAB_DELETE ++ should not deallocate the entries. */ ++ ++ missing_rpm_hash = htab_create_alloc (64, htab_hash_string, ++ (int (*) (const void *, const void *)) streq, ++ NULL, xcalloc, xfree); ++ } ++ slot = (char **) htab_find_slot (missing_rpm_hash, debuginfo, INSERT); ++ /* XCALLOC never returns NULL. */ ++ gdb_assert (slot != NULL); ++ if (*slot == NULL) ++ { ++ struct missing_rpm *missing_rpm; ++ ++ *slot = debuginfo; ++ ++ missing_rpm = (struct missing_rpm *) xmalloc (sizeof (*missing_rpm) + strlen (debuginfo)); ++ strcpy (missing_rpm->rpm, debuginfo); ++ missing_rpm->next = missing_rpm_list; ++ missing_rpm_list = missing_rpm; ++ missing_rpm_list_entries++; ++ } ++ else ++ xfree (debuginfo); ++ count++; ++ } ++#ifdef GDB_INDEX_VERIFY_VENDOR ++ else /* verify_vendor */ ++ { ++ int vendor_pass = 0, vendor_fail = 0; ++ ++ for (;;) ++ { ++ Header h; ++ errmsg_t err; ++ char *vendor; ++ ++ h = rpmdbNextIterator_p (mi); ++ if (h == NULL) ++ break; ++ ++ vendor = headerFormat_p (h, "%{vendor}", &err); ++ if (!vendor) ++ { ++ warning (_("Error querying the rpm file `%s': %s"), filename, ++ err); ++ continue; ++ } ++ if (strcmp (vendor, "Red Hat, Inc.") == 0) ++ vendor_pass = 1; ++ else ++ vendor_fail = 1; ++ xfree (vendor); ++ } ++ count = vendor_pass != 0 && vendor_fail == 0; ++ } ++#endif ++ ++ rpmdbFreeIterator_p (mi); ++ } ++ ++ rpmtsFree_p (ts); ++ ++ return count; ++} ++ ++#ifdef GDB_INDEX_VERIFY_VENDOR ++missing_rpm_enlist (const char *filename) ++{ ++ return missing_rpm_enlist_1 (filename, 0); ++} ++ ++extern int rpm_verify_vendor (const char *filename); ++int ++rpm_verify_vendor (const char *filename) ++{ ++ return missing_rpm_enlist_1 (filename, 1); ++} ++#endif ++ ++static bool ++missing_rpm_list_compar (const char *ap, const char *bp) ++{ ++ return strcoll (ap, bp) < 0; ++} ++ ++/* It returns a NULL-terminated array of strings needing to be FREEd. It may ++ also return only NULL. */ ++ ++static void ++missing_rpm_list_print (void) ++{ ++ struct missing_rpm *list_iter; ++ ++ if (missing_rpm_list_entries == 0) ++ return; ++ ++ std::vector array (missing_rpm_list_entries); ++ size_t idx = 0; ++ ++ for (list_iter = missing_rpm_list; list_iter != NULL; ++ list_iter = list_iter->next) ++ { ++ array[idx++] = list_iter->rpm; ++ } ++ gdb_assert (idx == missing_rpm_list_entries); ++ ++ std::sort (array.begin (), array.end (), missing_rpm_list_compar); ++ ++ /* We zero out the number of missing RPMs here because of a nasty ++ bug (see RHBZ 1801974). ++ ++ When we call 'puts_unfiltered' below, if pagination is on and if ++ the number of missing RPMs is big enough to trigger pagination, ++ we will end up in an infinite recursion. The call chain looks ++ like this: ++ ++ missing_rpm_list_print -> puts_unfiltered -> fputs_maybe_filtered ++ -> prompt_for_continue -> display_gdb_prompt -> ++ debug_flush_missing -> missing_rpm_list_print ... ++ ++ For this reason, we make sure MISSING_RPM_LIST_ENTRIES is zero ++ *before* calling any print function. ++ ++ Note: kevinb/2023-02-22: The code below used to call ++ puts_unfiltered() and printf_unfiltered(), but calls to these ++ functions have been replaced by calls to gdb_printf(). The call ++ chain shown above (probably) used to be the case at one time and ++ hopefully something similar is still the case now that ++ gdb_printf() is being used instead. */ ++ missing_rpm_list_entries = 0; ++ ++ gdb_printf (_("Missing separate debuginfos, use: %s"), ++#ifdef DNF_DEBUGINFO_INSTALL ++ "dnf " ++#endif ++ "debuginfo-install"); ++ for (const char *el : array) ++ { ++ gdb_printf (" %s", el); ++ } ++ gdb_printf ("\n"); ++ ++ while (missing_rpm_list != NULL) ++ { ++ list_iter = missing_rpm_list; ++ missing_rpm_list = list_iter->next; ++ xfree (list_iter); ++ } ++} ++ ++static void ++missing_rpm_change (void) ++{ ++ debug_flush_missing (); ++ ++ gdb_assert (missing_rpm_list == NULL); ++ if (missing_rpm_hash != NULL) ++ { ++ htab_delete (missing_rpm_hash); ++ missing_rpm_hash = NULL; ++ } ++} ++ ++enum missing_exec ++ { ++ /* Init state. EXEC_BFD also still could be NULL. */ ++ MISSING_EXEC_NOT_TRIED, ++ /* We saw a non-NULL EXEC_BFD but RPM has no info about it. */ ++ MISSING_EXEC_NOT_FOUND, ++ /* We found EXEC_BFD by RPM and we either have its symbols (either embedded ++ or separate) or the main executable's RPM is now contained in ++ MISSING_RPM_HASH. */ ++ MISSING_EXEC_ENLISTED ++ }; ++static enum missing_exec missing_exec = MISSING_EXEC_NOT_TRIED; ++ ++#endif /* HAVE_LIBRPM */ ++ ++void ++debug_flush_missing (void) ++{ ++#ifdef HAVE_LIBRPM ++ missing_rpm_list_print (); ++#endif ++} ++ ++/* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages ++ yum --enablerepo='*debug*' install ... ++ avoidance. */ ++ ++struct missing_filepair ++ { ++ char *binary; ++ char *debug; ++ char data[1]; ++ }; ++ ++static struct htab *missing_filepair_hash; ++static struct obstack missing_filepair_obstack; ++ ++static void * ++missing_filepair_xcalloc (size_t nmemb, size_t nmemb_size) ++{ ++ void *retval; ++ size_t size = nmemb * nmemb_size; ++ ++ retval = obstack_alloc (&missing_filepair_obstack, size); ++ memset (retval, 0, size); ++ return retval; ++} ++ ++static hashval_t ++missing_filepair_hash_func (const struct missing_filepair *elem) ++{ ++ hashval_t retval = 0; ++ ++ retval ^= htab_hash_string (elem->binary); ++ if (elem->debug != NULL) ++ retval ^= htab_hash_string (elem->debug); ++ ++ return retval; ++} ++ ++static int ++missing_filepair_eq (const struct missing_filepair *elem1, ++ const struct missing_filepair *elem2) ++{ ++ return strcmp (elem1->binary, elem2->binary) == 0 ++ && ((elem1->debug == NULL) == (elem2->debug == NULL)) ++ && (elem1->debug == NULL || strcmp (elem1->debug, elem2->debug) == 0); ++} ++ ++static void ++missing_filepair_change (void) ++{ ++ if (missing_filepair_hash != NULL) ++ { ++ obstack_free (&missing_filepair_obstack, NULL); ++ /* All their memory came just from missing_filepair_OBSTACK. */ ++ missing_filepair_hash = NULL; ++ } ++#ifdef HAVE_LIBRPM ++ missing_exec = MISSING_EXEC_NOT_TRIED; ++#endif ++} ++ ++static void ++debug_print_executable_changed (struct program_space *pspace, bool reload_p) ++{ ++#ifdef HAVE_LIBRPM ++ missing_rpm_change (); ++#endif ++ missing_filepair_change (); ++} ++ ++/* Notify user the file BINARY with (possibly NULL) associated separate debug ++ information file DEBUG is missing. DEBUG may or may not be the build-id ++ file such as would be: ++ /usr/lib/debug/.build-id/dd/b1d2ce632721c47bb9e8679f369e2295ce71be.debug ++ */ ++ ++void ++debug_print_missing (const char *binary, const char *debug) ++{ ++ size_t binary_len0 = strlen (binary) + 1; ++ size_t debug_len0 = debug ? strlen (debug) + 1 : 0; ++ struct missing_filepair missing_filepair_find; ++ struct missing_filepair *missing_filepair; ++ struct missing_filepair **slot; ++ ++ if (build_id_verbose < BUILD_ID_VERBOSE_FILENAMES) ++ return; ++ ++ if (missing_filepair_hash == NULL) ++ { ++ obstack_init (&missing_filepair_obstack); ++ missing_filepair_hash = htab_create_alloc (64, ++ (hashval_t (*) (const void *)) missing_filepair_hash_func, ++ (int (*) (const void *, const void *)) missing_filepair_eq, NULL, ++ missing_filepair_xcalloc, NULL); ++ } ++ ++ /* Use MISSING_FILEPAIR_FIND first instead of calling obstack_alloc with ++ obstack_free in the case of a (rare) match. The problem is ALLOC_F for ++ MISSING_FILEPAIR_HASH allocates from MISSING_FILEPAIR_OBSTACK maintenance ++ structures for MISSING_FILEPAIR_HASH. Calling obstack_free would possibly ++ not to free only MISSING_FILEPAIR but also some such structures (allocated ++ during the htab_find_slot call). */ ++ ++ missing_filepair_find.binary = (char *) binary; ++ missing_filepair_find.debug = (char *) debug; ++ slot = (struct missing_filepair **) htab_find_slot (missing_filepair_hash, ++ &missing_filepair_find, ++ INSERT); ++ ++ /* While it may be still printed duplicitely with the missing debuginfo file ++ * it is due to once printing about the binary file build-id link and once ++ * about the .debug file build-id link as both the build-id symlinks are ++ * located in the debuginfo package. */ ++ ++ if (*slot != NULL) ++ return; ++ ++ missing_filepair = (struct missing_filepair *) obstack_alloc (&missing_filepair_obstack, ++ sizeof (*missing_filepair) - 1 ++ + binary_len0 + debug_len0); ++ missing_filepair->binary = missing_filepair->data; ++ memcpy (missing_filepair->binary, binary, binary_len0); ++ if (debug != NULL) ++ { ++ missing_filepair->debug = missing_filepair->binary + binary_len0; ++ memcpy (missing_filepair->debug, debug, debug_len0); ++ } ++ else ++ missing_filepair->debug = NULL; ++ ++ *slot = missing_filepair; ++ ++#ifdef HAVE_LIBRPM ++ if (missing_exec == MISSING_EXEC_NOT_TRIED) ++ { ++ const char *execfilename = get_exec_file (0); ++ ++ if (execfilename != NULL) ++ { ++ if (missing_rpm_enlist (execfilename) == 0) ++ missing_exec = MISSING_EXEC_NOT_FOUND; ++ else ++ missing_exec = MISSING_EXEC_ENLISTED; ++ } ++ } ++ if (missing_exec != MISSING_EXEC_ENLISTED) ++ if ((binary[0] == 0 || missing_rpm_enlist (binary) == 0) ++ && (debug == NULL || missing_rpm_enlist (debug) == 0)) ++#endif /* HAVE_LIBRPM */ ++ { ++ /* We do not collect and flush these messages as each such message ++ already requires its own separate lines. */ ++ ++ gdb_printf (gdb_stdlog, ++ _("Missing separate debuginfo for %s.\n"), binary); ++ if (debug != NULL) ++ { ++ if (access (debug, F_OK) == 0) { ++ gdb_printf (gdb_stdlog, _("Try: %s %s\n"), ++#ifdef DNF_DEBUGINFO_INSTALL ++ "dnf" ++#else ++ "yum" ++#endif ++ " --enablerepo='*debug*' install", debug); ++ } else ++ gdb_printf (gdb_stdlog, _("The debuginfo package for this file is probably broken.\n")); ++ } ++ } ++} ++ + /* See build-id.h. */ + + gdb_bfd_ref_ptr +-build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id) ++build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id, ++ char **link_return) + { +- return build_id_to_bfd_suffix (build_id_len, build_id, ".debug"); ++ return build_id_to_bfd_suffix (build_id_len, build_id, ".debug", ++ link_return); + } + + /* See build-id.h. */ + + gdb_bfd_ref_ptr +-build_id_to_exec_bfd (size_t build_id_len, const bfd_byte *build_id) ++build_id_to_exec_bfd (size_t build_id_len, const bfd_byte *build_id, ++ char **link_return) + { +- return build_id_to_bfd_suffix (build_id_len, build_id, ""); ++ return build_id_to_bfd_suffix (build_id_len, build_id, "", link_return); + } + + /* See build-id.h. */ + + std::string + find_separate_debug_file_by_buildid (struct objfile *objfile, +- deferred_warnings *warnings) ++ deferred_warnings *warnings, ++ gdb::unique_xmalloc_ptr *build_id_filename_return) + { + const struct bfd_build_id *build_id; + +- build_id = build_id_bfd_get (objfile->obfd.get ()); ++ if (build_id_filename_return) ++ *build_id_filename_return = NULL; ++ ++ build_id = build_id_bfd_shdr_get (objfile->obfd.get ()); + if (build_id != NULL) + { + if (separate_debug_file_debug) +@@ -222,8 +1358,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile, + _("\nLooking for separate debug info (build-id) for " + "%s\n"), objfile_name (objfile)); + ++ char *build_id_filename_cstr = NULL; + gdb_bfd_ref_ptr abfd (build_id_to_debug_bfd (build_id->size, +- build_id->data)); ++ build_id->data, ++ (!build_id_filename_return ? NULL : &build_id_filename_cstr))); ++ if (build_id_filename_return) ++ { ++ if (!build_id_filename_cstr) ++ gdb_assert (!*build_id_filename_return); ++ else ++ { ++ *build_id_filename_return = gdb::unique_xmalloc_ptr (build_id_filename_cstr); ++ build_id_filename_cstr = NULL; ++ } ++ } ++ + /* Prevent looping on a stripped .debug file. */ + if (abfd != NULL + && filename_cmp (bfd_get_filename (abfd.get ()), +@@ -243,3 +1392,22 @@ find_separate_debug_file_by_buildid (struct objfile *objfile, + + return std::string (); + } ++ ++void _initialize_build_id (); ++ ++void ++_initialize_build_id () ++{ ++ add_setshow_zinteger_cmd ("build-id-verbose", no_class, &build_id_verbose, ++ _("\ ++Set debugging level of the build-id locator."), _("\ ++Show debugging level of the build-id locator."), _("\ ++Level 1 (default) enables printing the missing debug filenames,\n\ ++level 2 also prints the parsing of binaries to find the identificators."), ++ NULL, ++ show_build_id_verbose, ++ &setlist, &showlist); ++ ++ gdb::observers::executable_changed.attach (debug_print_executable_changed, ++ "build-id"); ++} +diff --git a/gdb/build-id.h b/gdb/build-id.h +--- a/gdb/build-id.h ++++ b/gdb/build-id.h +@@ -23,9 +23,10 @@ + #include "gdb_bfd.h" + #include "gdbsupport/rsp-low.h" + +-/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */ ++/* Separate debuginfo files have corrupted PHDR but SHDR is correct there. ++ Locate NT_GNU_BUILD_ID from ABFD and return its content. */ + +-extern const struct bfd_build_id *build_id_bfd_get (bfd *abfd); ++extern const struct bfd_build_id *build_id_bfd_shdr_get (bfd *abfd); + + /* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value. + Otherwise, issue a warning and return false. */ +@@ -38,14 +39,19 @@ extern int build_id_verify (bfd *abfd, + can be found, return NULL. */ + + extern gdb_bfd_ref_ptr build_id_to_debug_bfd (size_t build_id_len, +- const bfd_byte *build_id); ++ const bfd_byte *build_id, ++ char **link_return = NULL); ++ ++extern char *build_id_to_filename (const struct bfd_build_id *build_id, ++ char **link_return); + + /* Find and open a BFD for an executable file given a build-id. If no BFD + can be found, return NULL. The returned reference to the BFD must be + released by the caller. */ + + extern gdb_bfd_ref_ptr build_id_to_exec_bfd (size_t build_id_len, +- const bfd_byte *build_id); ++ const bfd_byte *build_id, ++ char **link_return); + + /* Find the separate debug file for OBJFILE, by using the build-id + associated with OBJFILE's BFD. If successful, returns the file name for the +@@ -58,7 +64,8 @@ extern gdb_bfd_ref_ptr build_id_to_exec_bfd (size_t build_id_len, + will be printed. */ + + extern std::string find_separate_debug_file_by_buildid +- (struct objfile *objfile, deferred_warnings *warnings); ++ (struct objfile *objfile, deferred_warnings *warnings, ++ gdb::unique_xmalloc_ptr *build_id_filename_return); + + /* Return an hex-string representation of BUILD_ID. */ + +diff --git a/gdb/coffread.c b/gdb/coffread.c +--- a/gdb/coffread.c ++++ b/gdb/coffread.c +@@ -729,7 +729,7 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) + { + deferred_warnings warnings; + std::string debugfile +- = find_separate_debug_file_by_buildid (objfile, &warnings); ++ = find_separate_debug_file_by_buildid (objfile, &warnings, NULL); + + if (debugfile.empty ()) + debugfile +diff --git a/gdb/corelow.c b/gdb/corelow.c +--- a/gdb/corelow.c ++++ b/gdb/corelow.c +@@ -22,6 +22,10 @@ + #include + #include + #include "frame.h" ++#include "auxv.h" ++#include "build-id.h" ++#include "elf/common.h" ++#include "gdbcmd.h" + #include "inferior.h" + #include "infrun.h" + #include "symtab.h" +@@ -380,6 +384,8 @@ add_to_thread_list (asection *asect, asection *reg_sect, inferior *inf) + switch_to_thread (thr); /* Yes, make it current. */ + } + ++static bool build_id_core_loads = true; ++ + /* Issue a message saying we have no core to debug, if FROM_TTY. */ + + static void +@@ -563,12 +569,14 @@ rename_vmcore_idle_reg_sections (bfd *abfd, inferior *inf) + static void + locate_exec_from_corefile_build_id (bfd *abfd, int from_tty) + { +- const bfd_build_id *build_id = build_id_bfd_get (abfd); ++ const bfd_build_id *build_id = build_id_bfd_shdr_get (abfd); + if (build_id == nullptr) + return; + ++ char *build_id_filename; + gdb_bfd_ref_ptr execbfd +- = build_id_to_exec_bfd (build_id->size, build_id->data); ++ = build_id_to_exec_bfd (build_id->size, build_id->data, ++ &build_id_filename); + + if (execbfd == nullptr) + { +@@ -596,7 +604,12 @@ locate_exec_from_corefile_build_id (bfd *abfd, int from_tty) + exec_file_attach (bfd_get_filename (execbfd.get ()), from_tty); + symbol_file_add_main (bfd_get_filename (execbfd.get ()), + symfile_add_flag (from_tty ? SYMFILE_VERBOSE : 0)); ++ if (current_program_space->symfile_object_file != NULL) ++ current_program_space->symfile_object_file->flags |= ++ OBJF_BUILD_ID_CORE_LOADED; + } ++ else ++ debug_print_missing (BUILD_ID_MAIN_EXECUTABLE_FILENAME, build_id_filename); + } + + /* See gdbcore.h. */ +@@ -1506,4 +1519,11 @@ _initialize_corelow () + maintenance_print_core_file_backed_mappings, + _("Print core file's file-backed mappings."), + &maintenanceprintlist); ++ ++ add_setshow_boolean_cmd ("build-id-core-loads", class_files, ++ &build_id_core_loads, _("\ ++Set whether CORE-FILE loads the build-id associated files automatically."), _("\ ++Show whether CORE-FILE loads the build-id associated files automatically."), ++ NULL, NULL, NULL, ++ &setlist, &showlist); + } +diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo +--- a/gdb/doc/gdb.texinfo ++++ b/gdb/doc/gdb.texinfo +@@ -22296,6 +22296,27 @@ information files. + + @end table + ++You can also adjust the current verbosity of the @dfn{build id} locating. ++ ++@table @code ++ ++@kindex set build-id-verbose ++@item set build-id-verbose 0 ++No additional messages are printed. ++ ++@item set build-id-verbose 1 ++Missing separate debug filenames are printed. ++ ++@item set build-id-verbose 2 ++Missing separate debug filenames are printed and also all the parsing of the ++binaries to find their @dfn{build id} content is printed. ++ ++@kindex show build-id-verbose ++@item show build-id-verbose ++Show the current verbosity value for the @dfn{build id} content locating. ++ ++@end table ++ + @cindex @code{.gnu_debuglink} sections + @cindex debug link sections + A debug link is a special section of the executable file named +diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c +--- a/gdb/dwarf2/index-cache.c ++++ b/gdb/dwarf2/index-cache.c +@@ -96,7 +96,7 @@ index_cache_store_context::index_cache_store_context (const index_cache &ic, + return; + + /* Get build id of objfile. */ +- const bfd_build_id *build_id = build_id_bfd_get (per_bfd->obfd); ++ const bfd_build_id *build_id = build_id_bfd_shdr_get (per_bfd->obfd); + if (build_id == nullptr) + { + index_cache_debug ("objfile %s has no build id", +@@ -111,7 +111,8 @@ index_cache_store_context::index_cache_store_context (const index_cache &ic, + + if (dwz != nullptr) + { +- const bfd_build_id *dwz_build_id = build_id_bfd_get (dwz->dwz_bfd.get ()); ++ const bfd_build_id *dwz_build_id ++ = build_id_bfd_shdr_get (dwz->dwz_bfd.get ()); + + if (dwz_build_id == nullptr) + { +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -3355,7 +3355,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) + { +- const bfd_build_id *build_id = build_id_bfd_get (obj->obfd.get ()); ++ const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd.get ()); + if (build_id == nullptr) + return {}; + +@@ -3368,7 +3368,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) + { +- const bfd_build_id *build_id = build_id_bfd_get (dwz->dwz_bfd.get ()); ++ const bfd_build_id *build_id = build_id_bfd_shdr_get (dwz->dwz_bfd.get ()); + if (build_id == nullptr) + return {}; + +diff --git a/gdb/elfread.c b/gdb/elfread.c +--- a/gdb/elfread.c ++++ b/gdb/elfread.c +@@ -1220,8 +1220,10 @@ elf_symfile_read_dwarf2 (struct objfile *objfile, + { + deferred_warnings warnings; + ++ gdb::unique_xmalloc_ptr build_id_filename; + std::string debugfile +- = find_separate_debug_file_by_buildid (objfile, &warnings); ++ = find_separate_debug_file_by_buildid (objfile, &warnings, ++ &build_id_filename); + + if (debugfile.empty ()) + debugfile = find_separate_debug_file_by_debuglink (objfile, &warnings); +@@ -1239,7 +1241,7 @@ elf_symfile_read_dwarf2 (struct objfile *objfile, + { + has_dwarf2 = false; + const struct bfd_build_id *build_id +- = build_id_bfd_get (objfile->obfd.get ()); ++ = build_id_bfd_shdr_get (objfile->obfd.get ()); + const char *filename = bfd_get_filename (objfile->obfd.get ()); + + if (build_id != nullptr) +@@ -1265,6 +1267,11 @@ elf_symfile_read_dwarf2 (struct objfile *objfile, + has_dwarf2 = true; + } + } ++ /* Check if any separate debug info has been extracted out. */ ++ else if (bfd_get_section_by_name (objfile->obfd.get (), ++ ".gnu_debuglink") ++ != NULL) ++ debug_print_missing (objfile_name (objfile), build_id_filename.get ()); + } + } + /* If all the methods to collect the debuginfo failed, print the +diff --git a/gdb/exec.c b/gdb/exec.c +--- a/gdb/exec.c ++++ b/gdb/exec.c +@@ -237,7 +237,7 @@ validate_exec_file (int from_tty) + current_exec_file = get_exec_file (0); + + const bfd_build_id *exec_file_build_id +- = build_id_bfd_get (current_program_space->exec_bfd ()); ++ = build_id_bfd_shdr_get (current_program_space->exec_bfd ()); + if (exec_file_build_id != nullptr) + { + /* Prepend the target prefix, to force gdb_bfd_open to open the +@@ -250,7 +250,7 @@ validate_exec_file (int from_tty) + if (abfd != nullptr) + { + const bfd_build_id *target_exec_file_build_id +- = build_id_bfd_get (abfd.get ()); ++ = build_id_bfd_shdr_get (abfd.get ()); + + if (target_exec_file_build_id != nullptr) + { +diff --git a/gdb/objfiles.h b/gdb/objfiles.h +--- a/gdb/objfiles.h ++++ b/gdb/objfiles.h +@@ -884,6 +884,10 @@ struct objfile + bool object_format_has_copy_relocs = false; + }; + ++/* This file was loaded according to the BUILD_ID_CORE_LOADS rules. */ ++ ++#define OBJF_BUILD_ID_CORE_LOADED static_cast(1 << 12) ++ + /* A deleter for objfile. */ + + struct objfile_deleter +diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c +--- a/gdb/python/py-objfile.c ++++ b/gdb/python/py-objfile.c +@@ -158,7 +158,7 @@ objfpy_get_build_id (PyObject *self, void *closure) + + try + { +- build_id = build_id_bfd_get (objfile->obfd.get ()); ++ build_id = build_id_bfd_shdr_get (objfile->obfd.get ()); + } + catch (const gdb_exception &except) + { +@@ -629,7 +629,7 @@ gdbpy_lookup_objfile (PyObject *self, PyObject *args, PyObject *kw) + if (obfd == nullptr) + return 0; + +- const bfd_build_id *obfd_build_id = build_id_bfd_get (obfd); ++ const bfd_build_id *obfd_build_id = build_id_bfd_shdr_get (obfd); + if (obfd_build_id == nullptr) + return 0; + +diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c +--- a/gdb/solib-svr4.c ++++ b/gdb/solib-svr4.c +@@ -44,6 +44,7 @@ + #include "auxv.h" + #include "gdb_bfd.h" + #include "probe.h" ++#include "build-id.h" + + #include + +@@ -1318,9 +1319,51 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, + continue; + } + +- strncpy (newobj->so_name, buffer.get (), SO_NAME_MAX_PATH_SIZE - 1); +- newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; +- strcpy (newobj->so_original_name, newobj->so_name); ++ { ++ struct bfd_build_id *build_id; ++ ++ strncpy (newobj->so_original_name, buffer.get (), SO_NAME_MAX_PATH_SIZE - 1); ++ newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; ++ /* May get overwritten below. */ ++ strcpy (newobj->so_name, newobj->so_original_name); ++ ++ build_id = build_id_addr_get (((lm_info_svr4 *) newobj->lm_info)->l_ld); ++ if (build_id != NULL) ++ { ++ char *name, *build_id_filename; ++ ++ /* Missing the build-id matching separate debug info file ++ would be handled while SO_NAME gets loaded. */ ++ name = build_id_to_filename (build_id, &build_id_filename); ++ if (name != NULL) ++ { ++ strncpy (newobj->so_name, name, SO_NAME_MAX_PATH_SIZE - 1); ++ newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; ++ xfree (name); ++ } ++ else ++ { ++ debug_print_missing (newobj->so_name, build_id_filename); ++ ++ /* In the case the main executable was found according to ++ its build-id (from a core file) prevent loading ++ a different build of a library with accidentally the ++ same SO_NAME. ++ ++ It suppresses bogus backtraces (and prints "??" there ++ instead) if the on-disk files no longer match the ++ running program version. */ ++ ++ if (current_program_space->symfile_object_file != NULL ++ && (current_program_space->symfile_object_file->flags ++ & OBJF_BUILD_ID_CORE_LOADED) != 0) ++ newobj->so_name[0] = 0; ++ } ++ ++ xfree (build_id_filename); ++ xfree (build_id); ++ } ++ } + + /* If this entry has no name, or its name matches the name + for the main executable, don't include it in the list. */ +diff --git a/gdb/source.c b/gdb/source.c +--- a/gdb/source.c ++++ b/gdb/source.c +@@ -1167,7 +1167,7 @@ open_source_file (struct symtab *s) + } + + const struct bfd_build_id *build_id +- = build_id_bfd_get (ofp->obfd.get ()); ++ = build_id_bfd_shdr_get (ofp->obfd.get ()); + + /* Query debuginfod for the source file. */ + if (build_id != nullptr && !srcpath.empty ()) +diff --git a/gdb/symfile.h b/gdb/symfile.h +--- a/gdb/symfile.h ++++ b/gdb/symfile.h +@@ -357,12 +357,18 @@ bool expand_symtabs_matching + void map_symbol_filenames (gdb::function_view fun, + bool need_fullname); + ++ + /* Target-agnostic function to load the sections of an executable into memory. + + ARGS should be in the form "EXECUTABLE [OFFSET]", where OFFSET is an + optional offset to apply to each section. */ + extern void generic_load (const char *args, int from_tty); + ++/* build-id support. */ ++extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr); ++extern void debug_print_missing (const char *binary, const char *debug); ++#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file") ++ + /* From minidebug.c. */ + + extern gdb_bfd_ref_ptr find_separate_debug_file_in_section (struct objfile *); +diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp +--- a/gdb/testsuite/gdb.base/corefile.exp ++++ b/gdb/testsuite/gdb.base/corefile.exp +@@ -347,3 +347,33 @@ gdb_test_multiple "core-file $corefile" $test { + pass $test + } + } ++ ++ ++# Test auto-loading of binary files through build-id from the core file. ++set buildid [build_id_debug_filename_get $binfile] ++set wholetest "binfile found by build-id" ++if {$buildid == ""} { ++ untested "$wholetest (binary has no build-id)" ++} else { ++ gdb_exit ++ gdb_start ++ ++ regsub {\.debug$} $buildid {} buildid ++ set debugdir [standard_output_file ${testfile}-debugdir] ++ file delete -force -- $debugdir ++ file mkdir $debugdir/[file dirname $buildid] ++ file copy $binfile $debugdir/$buildid ++ ++ set test "show debug-file-directory" ++ gdb_test_multiple $test $test { ++ -re "The directory where separate debug symbols are searched for is \"(.*)\"\\.\r\n$gdb_prompt $" { ++ set debugdir_orig $expect_out(1,string) ++ pass $test ++ } ++ } ++ gdb_test_no_output "set debug-file-directory $debugdir:$debugdir_orig" "set debug-file-directory" ++ gdb_test "show build-id-core-loads" {Whether CORE-FILE loads the build-id associated files automatically is on\.} ++ gdb_test "core-file $corefile" "\r\nProgram terminated with .*" "core-file without executable" ++ gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*" ++ pass $wholetest ++} +diff --git a/gdb/testsuite/gdb.base/gdbinit-history.exp b/gdb/testsuite/gdb.base/gdbinit-history.exp +--- a/gdb/testsuite/gdb.base/gdbinit-history.exp ++++ b/gdb/testsuite/gdb.base/gdbinit-history.exp +@@ -179,7 +179,8 @@ proc test_empty_history_filename { } { + global env + global gdb_prompt + +- set common_history [list "set height 0" "set width 0"] ++ set common_history [list "set height 0" "set width 0" \ ++ "set build-id-verbose 0"] + + set test_dir [standard_output_file history_test] + remote_exec host "mkdir -p $test_dir" +diff --git a/gdb/testsuite/gdb.base/new-ui-pending-input.exp b/gdb/testsuite/gdb.base/new-ui-pending-input.exp +--- a/gdb/testsuite/gdb.base/new-ui-pending-input.exp ++++ b/gdb/testsuite/gdb.base/new-ui-pending-input.exp +@@ -62,6 +62,7 @@ proc test_command_line_new_ui_pending_input {} { + set options "" + append options " -iex \"set height 0\"" + append options " -iex \"set width 0\"" ++ append options " -iex \"set build-id-verbose 0\"" + append options " -iex \"new-ui console $extra_tty_name\"" + append options " -ex \"b $bpline\"" + append options " -ex \"run\"" +diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp +--- a/gdb/testsuite/lib/gdb.exp ++++ b/gdb/testsuite/lib/gdb.exp +@@ -226,7 +226,8 @@ if ![info exists INTERNAL_GDBFLAGS] { + "-nx" \ + "-q" \ + {-iex "set height 0"} \ +- {-iex "set width 0"}]] ++ {-iex "set width 0"} \ ++ {-iex "set build-id-verbose 0"}]] + + # If DEBUGINFOD_URLS is set, gdb will try to download sources and + # debug info for f.i. system libraries. Prevent this. +@@ -2434,6 +2435,17 @@ proc default_gdb_start { } { + } + } + ++ # Turn off the missing warnings as the testsuite does not expect it. ++ send_gdb "set build-id-verbose 0\n" ++ gdb_expect 10 { ++ -re "$gdb_prompt $" { ++ verbose "Disabled the missing debug infos warnings." 2 ++ } ++ timeout { ++ warning "Could not disable the missing debug infos warnings.." ++ } ++ } ++ + gdb_debug_init + return 0 + } +diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp +--- a/gdb/testsuite/lib/mi-support.exp ++++ b/gdb/testsuite/lib/mi-support.exp +@@ -321,6 +321,16 @@ proc default_mi_gdb_start { { flags {} } } { + warning "Couldn't set the width to 0." + } + } ++ # Turn off the missing warnings as the testsuite does not expect it. ++ send_gdb "190-gdb-set build-id-verbose 0\n" ++ gdb_expect 10 { ++ -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" { ++ verbose "Disabled the missing debug infos warnings." 2 ++ } ++ timeout { ++ warning "Could not disable the missing debug infos warnings.." ++ } ++ } + + if { $separate_inferior_pty } { + mi_create_inferior_pty diff --git a/gdb-6.6-bz229517-gcore-without-terminal.patch b/gdb-6.6-bz229517-gcore-without-terminal.patch new file mode 100644 index 0000000..863f615 --- /dev/null +++ b/gdb-6.6-bz229517-gcore-without-terminal.patch @@ -0,0 +1,188 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Jan Kratochvil +Date: Fri, 27 Oct 2017 21:07:50 +0200 +Subject: gdb-6.6-bz229517-gcore-without-terminal.patch + +;; Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517). +;;=fedoratest + +2007-04-22 Jan Kratochvil + + * gdb_gcore.sh: Redirect GDB from ` + + * gdb.base/gcorebg.exp, gdb.base/gcorebg.c: New files. + +diff --git a/gdb/testsuite/gdb.base/gcorebg.c b/gdb/testsuite/gdb.base/gcorebg.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gcorebg.c +@@ -0,0 +1,49 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++int main (int argc, char **argv) ++{ ++ pid_t pid = 0; ++ pid_t ppid; ++ char buf[1024*2 + 500]; ++ int gotint; ++ ++ if (argc != 4) ++ { ++ fprintf (stderr, "Syntax: %s {standard|detached} \n", ++ argv[0]); ++ exit (1); ++ } ++ ++ pid = fork (); ++ ++ switch (pid) ++ { ++ case 0: ++ if (strcmp (argv[1], "detached") == 0) ++ setpgrp (); ++ ppid = getppid (); ++ gotint = snprintf (buf, sizeof (buf), "sh %s -o %s %d", argv[2], argv[3], (int) ppid); ++ assert (gotint < sizeof (buf)); ++ system (buf); ++ fprintf (stderr, "Killing parent PID %d\n", ppid); ++ kill (ppid, SIGTERM); ++ break; ++ ++ case -1: ++ perror ("fork err\n"); ++ exit (1); ++ break; ++ ++ default: ++ fprintf (stderr,"Sleeping as PID %d\n", getpid ()); ++ sleep (60); ++ } ++ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.base/gcorebg.exp b/gdb/testsuite/gdb.base/gcorebg.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gcorebg.exp +@@ -0,0 +1,113 @@ ++# Copyright 2007 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++# Please email any bugs, comments, and/or additions to this file to: ++# bug-gdb@prep.ai.mit.edu ++ ++# This file was written by Jan Kratochvil . ++# This is a test for `gdb_gcore.sh' functionality. ++# It also tests a regression with `gdb_gcore.sh' being run without its ++# accessible terminal. ++ ++if ![info exists GCORE] { ++ set GCORE "[standard_output_file ../../../../gcore]" ++} ++verbose "using GCORE = $GCORE" 2 ++ ++set testfile "gcorebg" ++set srcfile ${testfile}.c ++set binfile [standard_output_file ${testfile}] ++set corefile [standard_output_file ${testfile}.test] ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { ++ untested gcorebg.exp ++ return -1 ++} ++ ++# Cleanup. ++ ++proc core_clean {} { ++ global corefile ++ ++ foreach file [glob -nocomplain [join [list $corefile *] ""]] { ++ verbose "Delete file $file" 1 ++ remote_file target delete $file ++ } ++} ++core_clean ++remote_file target delete "./gdb" ++ ++# Generate the core file. ++ ++# Provide `./gdb' for `gdb_gcore.sh' running it as a bare `gdb' command. ++# Setup also `$PATH' appropriately. ++# If GDB was not found let `gdb_gcore.sh' to find the system GDB by `$PATH'. ++if {$GDB != "gdb"} { ++ file link ./gdb $GDB ++} ++global env ++set oldpath $env(PATH) ++set env(PATH) [join [list . $env(PATH)] ":"] ++verbose "PATH = $env(PATH)" 2 ++ ++# Test file body. ++# $detached == "standard" || $detached == "detached" ++ ++proc test_body { detached } { ++ global binfile ++ global GCORE ++ global corefile ++ ++ set res [remote_spawn target "$binfile $detached $GCORE $corefile"] ++ if { $res < 0 || $res == "" } { ++ fail "Spawning $detached gcore" ++ return 1 ++ } ++ pass "Spawning $detached gcore" ++ remote_expect target 20 { ++ timeout { ++ fail "Spawned $detached gcore finished (timeout)" ++ remote_exec target "kill -9 -[exp_pid -i $res]" ++ return 1 ++ } ++ "Saved corefile .*\r\nKilling parent PID " { ++ pass "Spawned $detached gcore finished" ++ remote_wait target 20 ++ } ++ } ++ ++ if {1 == [llength [glob -nocomplain [join [list $corefile *] ""]]]} { ++ pass "Core file generated by $detached gcore" ++ } else { ++ fail "Core file generated by $detached gcore" ++ } ++ core_clean ++} ++ ++# First a general `gdb_gcore.sh' spawn with its controlling terminal available. ++ ++test_body standard ++ ++# And now `gdb_gcore.sh' spawn without its controlling terminal available. ++# It is spawned through `gcorebg.c' using setpgrp (). ++ ++test_body detached ++ ++ ++# Cleanup. ++ ++set env(PATH) $oldpath ++remote_file target delete "./gdb" diff --git a/gdb-6.6-bz237572-ppc-atomic-sequence-test.patch b/gdb-6.6-bz237572-ppc-atomic-sequence-test.patch new file mode 100644 index 0000000..6d04711 --- /dev/null +++ b/gdb-6.6-bz237572-ppc-atomic-sequence-test.patch @@ -0,0 +1,278 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Jan Kratochvil +Date: Fri, 27 Oct 2017 21:07:50 +0200 +Subject: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch + +;; Support for stepping over PPC atomic instruction sequences (BZ 237572). +;;=fedoratest + +2007-06-25 Jan Kratochvil + + * gdb.threads/atomic-seq-threaded.c, + gdb.threads/atomic-seq-threaded.exp: New files. + +diff --git a/gdb/testsuite/gdb.threads/atomic-seq-threaded.c b/gdb/testsuite/gdb.threads/atomic-seq-threaded.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/atomic-seq-threaded.c +@@ -0,0 +1,171 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2007 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ++ MA 02110-1301, USA. */ ++ ++/* Test stepping over RISC atomic sequences. ++ This variant testcases the code for stepping another thread while skipping ++ over the atomic sequence in the former thread ++ (STEPPING_PAST_SINGLESTEP_BREAKPOINT). ++ Code comes from gcc/testsuite/gcc.dg/sync-2.c */ ++ ++/* { dg-options "-march=i486" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ ++/* { dg-options "-mcpu=v9" { target sparc*-*-* } } */ ++ ++/* Test functionality of the intrinsics for 'short' and 'char'. */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#define LOOPS 2 ++ ++static int unused; ++ ++static char AI[18]; ++static char init_qi[18] = { 3,5,7,9,0,0,0,0,-1,0,0,0,0,0,-1,0,0,0 }; ++static char test_qi[18] = { 3,5,7,9,1,4,22,-12,7,8,9,7,1,-12,7,8,9,7 }; ++ ++static void ++do_qi (void) ++{ ++ if (__sync_fetch_and_add(AI+4, 1) != 0) ++ abort (); ++ if (__sync_fetch_and_add(AI+5, 4) != 0) ++ abort (); ++ if (__sync_fetch_and_add(AI+6, 22) != 0) ++ abort (); ++ if (__sync_fetch_and_sub(AI+7, 12) != 0) ++ abort (); ++ if (__sync_fetch_and_and(AI+8, 7) != (char)-1) ++ abort (); ++ if (__sync_fetch_and_or(AI+9, 8) != 0) ++ abort (); ++ if (__sync_fetch_and_xor(AI+10, 9) != 0) ++ abort (); ++ if (__sync_fetch_and_nand(AI+11, 7) != 0) ++ abort (); ++ ++ if (__sync_add_and_fetch(AI+12, 1) != 1) ++ abort (); ++ if (__sync_sub_and_fetch(AI+13, 12) != (char)-12) ++ abort (); ++ if (__sync_and_and_fetch(AI+14, 7) != 7) ++ abort (); ++ if (__sync_or_and_fetch(AI+15, 8) != 8) ++ abort (); ++ if (__sync_xor_and_fetch(AI+16, 9) != 9) ++ abort (); ++ if (__sync_nand_and_fetch(AI+17, 7) != 7) ++ abort (); ++} ++ ++static short AL[18]; ++static short init_hi[18] = { 3,5,7,9,0,0,0,0,-1,0,0,0,0,0,-1,0,0,0 }; ++static short test_hi[18] = { 3,5,7,9,1,4,22,-12,7,8,9,7,1,-12,7,8,9,7 }; ++ ++static void ++do_hi (void) ++{ ++ if (__sync_fetch_and_add(AL+4, 1) != 0) ++ abort (); ++ if (__sync_fetch_and_add(AL+5, 4) != 0) ++ abort (); ++ if (__sync_fetch_and_add(AL+6, 22) != 0) ++ abort (); ++ if (__sync_fetch_and_sub(AL+7, 12) != 0) ++ abort (); ++ if (__sync_fetch_and_and(AL+8, 7) != -1) ++ abort (); ++ if (__sync_fetch_and_or(AL+9, 8) != 0) ++ abort (); ++ if (__sync_fetch_and_xor(AL+10, 9) != 0) ++ abort (); ++ if (__sync_fetch_and_nand(AL+11, 7) != 0) ++ abort (); ++ ++ if (__sync_add_and_fetch(AL+12, 1) != 1) ++ abort (); ++ if (__sync_sub_and_fetch(AL+13, 12) != -12) ++ abort (); ++ if (__sync_and_and_fetch(AL+14, 7) != 7) ++ abort (); ++ if (__sync_or_and_fetch(AL+15, 8) != 8) ++ abort (); ++ if (__sync_xor_and_fetch(AL+16, 9) != 9) ++ abort (); ++ if (__sync_nand_and_fetch(AL+17, 7) != 7) ++ abort (); ++} ++ ++static void * ++start1 (void *arg) ++{ ++ unsigned loop; ++ sleep(1); ++ ++ for (loop = 0; loop < LOOPS; loop++) ++ { ++ memcpy(AI, init_qi, sizeof(init_qi)); ++ ++ do_qi (); ++ ++ if (memcmp (AI, test_qi, sizeof(test_qi))) ++ abort (); ++ } ++ ++ return arg; /* _delete1_ */ ++} ++ ++static void * ++start2 (void *arg) ++{ ++ unsigned loop; ++ ++ for (loop = 0; loop < LOOPS; loop++) ++ { ++ memcpy(AL, init_hi, sizeof(init_hi)); ++ ++ do_hi (); ++ ++ if (memcmp (AL, test_hi, sizeof(test_hi))) ++ abort (); ++ } ++ ++ return arg; /* _delete2_ */ ++} ++ ++int ++main (int argc, char **argv) ++{ ++ pthread_t thread; ++ int i; ++ ++ i = pthread_create (&thread, NULL, start1, NULL); /* _create_ */ ++ assert (i == 0); /* _create_after_ */ ++ ++ sleep (1); ++ ++ start2 (NULL); ++ ++ i = pthread_join (thread, NULL); /* _delete_ */ ++ assert (i == 0); ++ ++ return 0; /* _exit_ */ ++} +diff --git a/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp b/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp +@@ -0,0 +1,84 @@ ++# atomic-seq-threaded.exp -- Test case for stepping over RISC atomic code seqs. ++# This variant testcases the code for stepping another thread while skipping ++# over the atomic sequence in the former thread ++# (STEPPING_PAST_SINGLESTEP_BREAKPOINT). ++# Copyright (C) 2007 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ++ ++# Please email any bugs, comments, and/or additions to this file to: ++# bug-gdb@prep.ai.mit.edu ++ ++set testfile atomic-seq-threaded ++set srcfile ${testfile}.c ++set binfile [standard_output_file ${testfile}] ++ ++foreach opts {{} {compiler=gcc4} {FAIL}} { ++ if {$opts eq "FAIL"} { ++ return -1 ++ } ++ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $opts]] eq "" } { ++ break ++ } ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++ ++gdb_load ${binfile} ++if ![runto_main] then { ++ fail "Can't run to main" ++ return 0 ++} ++ ++# pthread_create () will not pass even on x86_64 with software watchpoint. ++# Pass after pthread_create () without any watchpoint active. ++set line [gdb_get_line_number "_create_after_"] ++gdb_test "tbreak $line" \ ++ "reakpoint (\[0-9\]+) at .*$srcfile, line $line\..*" \ ++ "set breakpoint after pthread_create ()" ++gdb_test "c" \ ++ ".*/\\* _create_after_ \\*/.*" \ ++ "run till after pthread_create ()" ++ ++# Without a watchpoint being software no single-stepping would be used. ++set test "Start (software) watchpoint" ++gdb_test_multiple "watch unused" $test { ++ -re "Watchpoint \[0-9\]+: unused.*$gdb_prompt $" { ++ pass $test ++ } ++ -re "Hardware watchpoint \[0-9\]+: unused.*$gdb_prompt $" { ++ # We do not test the goal but still the whole testcase should pass. ++ unsupported $test ++ } ++} ++ ++# More thorough testing of the scheduling logic. ++gdb_test "set scheduler-locking step" "" ++ ++# Critical code path is stepped through at this point. ++set line [gdb_get_line_number "_exit_"] ++gdb_test "tbreak $line" \ ++ "reakpoint \[0-9\]+ at .*$srcfile, line $line\..*" \ ++ "set breakpoint at _exit_" ++gdb_test "c" \ ++ ".*/\\* _exit_ \\*/.*" \ ++ "run till _exit_" ++ ++# Just a nonproblematic program exit. ++gdb_test "c" \ ++ ".*Program exited normally\\..*" \ ++ "run till program exit" diff --git a/gdb-6.6-testsuite-timeouts.patch b/gdb-6.6-testsuite-timeouts.patch new file mode 100644 index 0000000..64102fa --- /dev/null +++ b/gdb-6.6-testsuite-timeouts.patch @@ -0,0 +1,32 @@ +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-6.6-testsuite-timeouts.patch + +;; Avoid too long timeouts on failing cases of "annota1.exp annota3.exp". +;;=fedoratest + +diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp +--- a/gdb/testsuite/gdb.base/annota1.exp ++++ b/gdb/testsuite/gdb.base/annota1.exp +@@ -37,6 +37,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb + + clean_restart ${binfile} + ++gdb_test "set breakpoint pending off" "" "Avoid lockup on nonexisting functions" ++ + # The commands we test here produce many lines of output; disable "press + # to continue" prompts. + gdb_test_no_output "set height 0" +diff --git a/gdb/testsuite/gdb.base/annota3.exp b/gdb/testsuite/gdb.base/annota3.exp +--- a/gdb/testsuite/gdb.base/annota3.exp ++++ b/gdb/testsuite/gdb.base/annota3.exp +@@ -36,6 +36,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb + + clean_restart ${binfile} + ++gdb_test "set breakpoint pending off" "" "Avoid lockup on nonexisting functions" ++ + # The commands we test here produce many lines of output; disable "press + # to continue" prompts. + gdb_test_no_output "set height 0" diff --git a/gdb-add-index.sh-fix-bashism.patch b/gdb-add-index.sh-fix-bashism.patch new file mode 100644 index 0000000..6ca00b1 --- /dev/null +++ b/gdb-add-index.sh-fix-bashism.patch @@ -0,0 +1,21 @@ +[gdb-add-index.sh] Fix bashism + +--- + gdb/contrib/gdb-add-index.sh | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh +index 734110caa3b..00d3ae8b0ae 100755 +--- a/gdb/contrib/gdb-add-index.sh ++++ b/gdb/contrib/gdb-add-index.sh +@@ -38,7 +38,9 @@ fi + file="$1" + + if test -L "$file"; then +- if ! command -v readlink >/dev/null 2>&1; then ++ target=$(readlink "$file") ++ st=$? ++ if [ $st -eq 127 ]; then + echo "$myname: 'readlink' missing. Failed to follow symlink $1." 1>&2 + exit 1 + fi diff --git a/gdb-archer-next-over-throw-cxx-exec.patch b/gdb-archer-next-over-throw-cxx-exec.patch new file mode 100644 index 0000000..ce3c1aa --- /dev/null +++ b/gdb-archer-next-over-throw-cxx-exec.patch @@ -0,0 +1,88 @@ +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-archer-next-over-throw-cxx-exec.patch + +;; Fix follow-exec for C++ programs (bugreported by Martin Stransky). +;;=fedoratest + +Archer-upstreamed: +http://sourceware.org/ml/archer/2010-q2/msg00031.html + +diff --git a/gdb/testsuite/gdb.cp/cxxexec.cc b/gdb/testsuite/gdb.cp/cxxexec.cc +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/cxxexec.cc +@@ -0,0 +1,25 @@ ++/* This test script is part of GDB, the GNU debugger. ++ ++ Copyright 2010 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++#include ++ ++int ++main() ++{ ++ execlp ("true", "true", NULL); ++ return 1; ++} +diff --git a/gdb/testsuite/gdb.cp/cxxexec.exp b/gdb/testsuite/gdb.cp/cxxexec.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.cp/cxxexec.exp +@@ -0,0 +1,42 @@ ++# Copyright 2010 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++if { [skip_cplus_tests] } { continue } ++ ++set testfile cxxexec ++if { [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.cc {c++ debug}] } { ++ return -1 ++} ++ ++runto_main ++ ++# We could stop after `continue' again at `main'. ++delete_breakpoints ++ ++set test "p _Unwind_DebugHook" ++gdb_test_multiple $test $test { ++ -re " = .* 0x\[0-9a-f\].*\r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re "\r\nNo symbol .*\r\n$gdb_prompt $" { ++ xfail $test ++ untested ${testfile}.exp ++ return -1 ++ } ++} ++ ++# Run to end. The buggy GDB failed instead with: ++# Cannot access memory at address ADDR. ++gdb_continue_to_end "" "continue" 1 diff --git a/gdb-arm-fix-epilogue-frame-id.patch b/gdb-arm-fix-epilogue-frame-id.patch new file mode 100644 index 0000000..8b9abe9 --- /dev/null +++ b/gdb-arm-fix-epilogue-frame-id.patch @@ -0,0 +1,47 @@ +From 40b2857e42b477832ca7fc2771b6cde910e22f05 Mon Sep 17 00:00:00 2001 +From: Thiago Jung Bauermann +Date: Tue, 23 Jan 2024 14:11:33 -0300 +Subject: [PATCH 4/7] gdb/arm: Fix epilogue frame id + +arm_epilogue_frame_this_id has a comment saying that it fall backs to using +the current PC if the function start address can't be identified, but it +actually uses only the PC to make the frame id. + +This patch makes the code match the comment. Another hint that it's what +is intended is that arm_prologue_this_id, a function almost identical to +it, does that. + +The problem was found by code inspection. It fixes the following testsuite +failures: + +FAIL: gdb.base/unwind-on-each-insn.exp: foo: instruction 9: check frame-id matches +FAIL: gdb.reverse/solib-reverse.exp: reverse-next third shr1 +FAIL: gdb.reverse/solib-reverse.exp: reverse-next second shr1 +FAIL: gdb.reverse/solib-reverse.exp: reverse-next first shr1 +FAIL: gdb.reverse/solib-reverse.exp: reverse-next generic +FAIL: gdb.reverse/solib-reverse.exp: reverse-step into solib function one +FAIL: gdb.reverse/solib-reverse.exp: reverse-step within solib function one +FAIL: gdb.reverse/solib-reverse.exp: reverse-step into solib function two +FAIL: gdb.reverse/solib-reverse.exp: reverse-step within solib function two + +Tested on arm-linux-gnueabi-hf. +--- + gdb/arm-tdep.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c +index 3b1682a2aea..21dad198dc7 100644 +--- a/gdb/arm-tdep.c ++++ b/gdb/arm-tdep.c +@@ -3252,7 +3252,7 @@ arm_epilogue_frame_this_id (frame_info_ptr this_frame, + + arm_gdbarch_tdep *tdep + = gdbarch_tdep (get_frame_arch (this_frame)); +- *this_id = frame_id_build (arm_cache_get_prev_sp_value (cache, tdep), pc); ++ *this_id = frame_id_build (arm_cache_get_prev_sp_value (cache, tdep), func); + } + + /* Implementation of function hook 'prev_register' in +-- +2.35.3 + diff --git a/gdb-arm-remove-thumb-bit-in-arm_adjust_breakpoint_ad.patch b/gdb-arm-remove-thumb-bit-in-arm_adjust_breakpoint_ad.patch new file mode 100644 index 0000000..f6620c7 --- /dev/null +++ b/gdb-arm-remove-thumb-bit-in-arm_adjust_breakpoint_ad.patch @@ -0,0 +1,77 @@ +From 51a5415b3313470cb62fda7ad6762fc1c41c8cbd Mon Sep 17 00:00:00 2001 +From: Simon Marchi +Date: Tue, 7 Nov 2023 11:11:18 -0500 +Subject: [PATCH] gdb/arm: remove thumb bit in arm_adjust_breakpoint_address + +When compiling gdb with -fsanitize=address on ARM, I get a crash in test +gdb.arch/arm-disp-step.exp, reproduced easily with: + + $ ./gdb -nx -q --data-directory=data-directory testsuite/outputs/gdb.arch/arm-disp-step/arm-disp-step -ex "break *test_call_end" + Reading symbols from testsuite/outputs/gdb.arch/arm-disp-step/arm-disp-step... + ================================================================= + ==23295==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xb4a14fd1 at pc 0x01a48871 bp 0xbeab8490 sp 0xbeab8494 + +Since it doesn't require running the program, it can be reproduced locally on a +dev machine other than ARM, after acquiring the test binary. + +The length of the allocate buffer `buf` is 1, and we try to extract an +integer of size 2 from it. The length of 1 comes from the subtraction +`bpaddr - boundary`. Normally, on ARM, all instructions are aligned on +a multiple of 2, so it's weird for this subtraction to result in 1. In +this case, boundary comes from the result of find_pc_partial_function +returning 0x549: + + (gdb) p/x bpaddr + $2 = 0x54a + (gdb) p/x boundary + $3 = 0x549 + (gdb) p/x bpaddr - boundary + $4 = 0x1 + +0x549 is the address of the test_call_subr label, 0x548, with the thumb +bit enabled. Before doing some math with the address, I think we need +to strip the thumb bit, like is done elsewhere (for instance for bpaddr +earlier in the same function). + +I wonder if find_pc_partial_function should do that itself, in order to +return an address that is suitable for arithmetic. In any case, that +would be a change with a broad impact, so for now just fix the issue +locally. + +After the patch: + + $ ./gdb -nx -q --data-directory=data-directory testsuite/outputs/gdb.arch/arm-disp-step/arm-disp-step -ex "break *test_call_end" + Reading symbols from testsuite/outputs/gdb.arch/arm-disp-step/arm-disp-step... + Breakpoint 1 at 0x54a: file /home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.arch/arm-disp-step.S, line 103. + +Change-Id: I74fc458dbea0d2c1e1f5eadd90755188df089288 +Approved-By: Luis Machado +--- + gdb/arm-tdep.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c +index 21dad198dc7..e61342f3ccb 100644 +--- a/gdb/arm-tdep.c ++++ b/gdb/arm-tdep.c +@@ -5340,9 +5340,12 @@ arm_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr) + + bpaddr = gdbarch_addr_bits_remove (gdbarch, bpaddr); + +- if (find_pc_partial_function (bpaddr, NULL, &func_start, NULL) +- && func_start > boundary) +- boundary = func_start; ++ if (find_pc_partial_function (bpaddr, NULL, &func_start, NULL)) ++ { ++ func_start = gdbarch_addr_bits_remove (gdbarch, func_start); ++ if (func_start > boundary) ++ boundary = func_start; ++ } + + /* Search for a candidate IT instruction. We have to do some fancy + footwork to distinguish a real IT instruction from the second + +base-commit: eafca1ce3d589c731927e5481199db715bcbeff3 +-- +2.35.3 + diff --git a/gdb-arm-remove-tpidruro-register-from-non-freebsd-ta.patch b/gdb-arm-remove-tpidruro-register-from-non-freebsd-ta.patch new file mode 100644 index 0000000..554c88f --- /dev/null +++ b/gdb-arm-remove-tpidruro-register-from-non-freebsd-ta.patch @@ -0,0 +1,219 @@ +From 7973eaf11e33ddd405830b9bd29495991db5901d Mon Sep 17 00:00:00 2001 +From: Thiago Jung Bauermann +Date: Mon, 26 Feb 2024 19:11:45 -0300 +Subject: [PATCH 2/7] gdb/arm: Remove tpidruro register from non-FreeBSD target + descriptions + +Commit 92d48a1e4eac ("Add an arm-tls feature which includes the tpidruro +register from CP15.") introduced the org.gnu.gdb.arm.tls feature, which +adds the tpidruro register, and unconditionally enabled it in +aarch32_create_target_description. + +In Linux, the tpidruro register isn't available via ptrace in the 32-bit +kernel but it is available for an aarch32 program running under an arm64 +kernel via the ptrace compat interface. This isn't currently implemented +however, which causes GDB on arm-linux with 64-bit kernel to list the +register but show it as unavailable, as reported by Tom de Vries: + + $ gdb -q -batch a.out -ex start -ex 'p $tpidruro' + Temporary breakpoint 1 at 0x512 + + Temporary breakpoint 1, 0xaaaaa512 in main () + $1 = + +Simon Marchi then clarified: + +> The only time we should be seeing some "unavailable" registers or memory +> is in the context of tracepoints, for things that are not collected. +> Seeing an unavailable register here is a sign that something is not +> right. + +Therefore, disable the TLS feature in aarch32 target descriptions for Linux +and NetBSD targets (the latter also doesn't seem to support accessing +tpidruro either, based on a quick look at arm-netbsd-nat.c). + +This patch fixes the following tests: + +Running gdb.base/inline-frame-cycle-unwind.exp ... +FAIL: gdb.base/inline-frame-cycle-unwind.exp: cycle at level 3: backtrace when the unwind is broken at frame 3 +FAIL: gdb.base/inline-frame-cycle-unwind.exp: cycle at level 5: backtrace when the unwind is broken at frame 5 +FAIL: gdb.base/inline-frame-cycle-unwind.exp: cycle at level 1: backtrace when the unwind is broken at frame 1 + +Tested with Ubuntu 22.04.3 on armv8l-linux-gnueabihf in native, +native-gdbserver and native-extended-gdbserver targets with no regressions. + +PR tdep/31418 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31418 + +Approved-By: John Baldwin +--- + gdb/aarch32-tdep.c | 15 ++++++++++----- + gdb/aarch32-tdep.h | 2 +- + gdb/aarch64-linux-nat.c | 2 +- + gdb/arch/aarch32.c | 5 +++-- + gdb/arch/aarch32.h | 2 +- + gdb/arm-fbsd-tdep.c | 2 +- + gdb/arm-linux-nat.c | 2 +- + gdb/arm-linux-tdep.c | 2 +- + gdb/arm-netbsd-nat.c | 2 +- + gdbserver/linux-aarch32-tdesc.cc | 2 +- + 10 files changed, 21 insertions(+), 15 deletions(-) + +diff --git a/gdb/aarch32-tdep.c b/gdb/aarch32-tdep.c +index bfa88a96522..395328936e4 100644 +--- a/gdb/aarch32-tdep.c ++++ b/gdb/aarch32-tdep.c +@@ -22,15 +22,20 @@ + #include "gdbsupport/common-regcache.h" + #include "arch/aarch32.h" + +-static struct target_desc *tdesc_aarch32; ++static struct target_desc *tdesc_aarch32_list[2]; + + /* See aarch32-tdep.h. */ + + const target_desc * +-aarch32_read_description () ++aarch32_read_description (bool tls) + { +- if (tdesc_aarch32 == nullptr) +- tdesc_aarch32 = aarch32_create_target_description (); ++ struct target_desc *tdesc = tdesc_aarch32_list[tls]; + +- return tdesc_aarch32; ++ if (tdesc == nullptr) ++ { ++ tdesc = aarch32_create_target_description (tls); ++ tdesc_aarch32_list[tls] = tdesc; ++ } ++ ++ return tdesc; + } +diff --git a/gdb/aarch32-tdep.h b/gdb/aarch32-tdep.h +index bee4d4e9fc0..efc93351298 100644 +--- a/gdb/aarch32-tdep.h ++++ b/gdb/aarch32-tdep.h +@@ -22,6 +22,6 @@ struct target_desc; + + /* Get the AArch32 target description. */ + +-const target_desc *aarch32_read_description (); ++const target_desc *aarch32_read_description (bool tls); + + #endif /* aarch32-tdep.h. */ +diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c +index 768748a20db..c680d6de0c9 100644 +--- a/gdb/aarch64-linux-nat.c ++++ b/gdb/aarch64-linux-nat.c +@@ -887,7 +887,7 @@ aarch64_linux_nat_target::read_description () + + ret = ptrace (PTRACE_GETREGSET, tid, NT_ARM_VFP, &iovec); + if (ret == 0) +- return aarch32_read_description (); ++ return aarch32_read_description (false); + + CORE_ADDR hwcap = linux_get_hwcap (); + CORE_ADDR hwcap2 = linux_get_hwcap2 (); +diff --git a/gdb/arch/aarch32.c b/gdb/arch/aarch32.c +index 5be2cc0156e..b7510ee41e9 100644 +--- a/gdb/arch/aarch32.c ++++ b/gdb/arch/aarch32.c +@@ -25,7 +25,7 @@ + /* See aarch32.h. */ + + target_desc * +-aarch32_create_target_description () ++aarch32_create_target_description (bool tls) + { + target_desc_up tdesc = allocate_target_description (); + +@@ -39,7 +39,8 @@ aarch32_create_target_description () + /* Create a vfpv3 feature, then a blank NEON feature. */ + regnum = create_feature_arm_arm_vfpv3 (tdesc.get (), regnum); + tdesc_create_feature (tdesc.get (), "org.gnu.gdb.arm.neon"); +- regnum = create_feature_arm_arm_tls (tdesc.get (), regnum); ++ if (tls) ++ regnum = create_feature_arm_arm_tls (tdesc.get (), regnum); + + return tdesc.release (); + } +diff --git a/gdb/arch/aarch32.h b/gdb/arch/aarch32.h +index 6b24ae94335..e06e260e370 100644 +--- a/gdb/arch/aarch32.h ++++ b/gdb/arch/aarch32.h +@@ -22,6 +22,6 @@ + + /* Create the AArch32 target description. */ + +-target_desc *aarch32_create_target_description (); ++target_desc *aarch32_create_target_description (bool tls); + + #endif /* aarch32.h. */ +diff --git a/gdb/arm-fbsd-tdep.c b/gdb/arm-fbsd-tdep.c +index b46fa91d0a0..a4cea77f388 100644 +--- a/gdb/arm-fbsd-tdep.c ++++ b/gdb/arm-fbsd-tdep.c +@@ -228,7 +228,7 @@ arm_fbsd_read_description_auxv (const gdb::optional &auxv, + if (arm_hwcap & HWCAP_VFP) + { + if (arm_hwcap & HWCAP_NEON) +- return aarch32_read_description (); ++ return aarch32_read_description (tls); + else if ((arm_hwcap & (HWCAP_VFPv3 | HWCAP_VFPD32)) + == (HWCAP_VFPv3 | HWCAP_VFPD32)) + return arm_read_description (ARM_FP_TYPE_VFPV3, tls); +diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c +index 70c6bc684fa..07af23d3881 100644 +--- a/gdb/arm-linux-nat.c ++++ b/gdb/arm-linux-nat.c +@@ -568,7 +568,7 @@ arm_linux_nat_target::read_description () + /* NEON implies VFPv3-D32 or no-VFP unit. Say that we only support + Neon with VFPv3-D32. */ + if (arm_hwcap & HWCAP_NEON) +- return aarch32_read_description (); ++ return aarch32_read_description (false); + else if ((arm_hwcap & (HWCAP_VFPv3 | HWCAP_VFPv3D16)) == HWCAP_VFPv3) + return arm_read_description (ARM_FP_TYPE_VFPV3, false); + +diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c +index dfa816990ff..33748731cfd 100644 +--- a/gdb/arm-linux-tdep.c ++++ b/gdb/arm-linux-tdep.c +@@ -740,7 +740,7 @@ arm_linux_core_read_description (struct gdbarch *gdbarch, + /* NEON implies VFPv3-D32 or no-VFP unit. Say that we only support + Neon with VFPv3-D32. */ + if (arm_hwcap & HWCAP_NEON) +- return aarch32_read_description (); ++ return aarch32_read_description (false); + else if ((arm_hwcap & (HWCAP_VFPv3 | HWCAP_VFPv3D16)) == HWCAP_VFPv3) + return arm_read_description (ARM_FP_TYPE_VFPV3, false); + +diff --git a/gdb/arm-netbsd-nat.c b/gdb/arm-netbsd-nat.c +index d83714a46c3..018964b010d 100644 +--- a/gdb/arm-netbsd-nat.c ++++ b/gdb/arm-netbsd-nat.c +@@ -350,7 +350,7 @@ arm_netbsd_nat_target::read_description () + + len = sizeof(flag); + if (sysctlbyname("machdep.neon_present", &flag, &len, NULL, 0) == 0 && flag) +- return aarch32_read_description (); ++ return aarch32_read_description (false); + + return arm_read_description (ARM_FP_TYPE_VFPV3, false); + } +diff --git a/gdbserver/linux-aarch32-tdesc.cc b/gdbserver/linux-aarch32-tdesc.cc +index e1380fa2a40..443f91e3585 100644 +--- a/gdbserver/linux-aarch32-tdesc.cc ++++ b/gdbserver/linux-aarch32-tdesc.cc +@@ -32,7 +32,7 @@ aarch32_linux_read_description () + { + if (tdesc_aarch32 == nullptr) + { +- tdesc_aarch32 = aarch32_create_target_description (); ++ tdesc_aarch32 = aarch32_create_target_description (false); + + static const char *expedite_regs[] = { "r11", "sp", "pc", 0 }; + init_target_desc (tdesc_aarch32, expedite_regs); +-- +2.35.3 + diff --git a/gdb-build-fix-gdbserver-linux-aarch64-low.cc-build.patch b/gdb-build-fix-gdbserver-linux-aarch64-low.cc-build.patch new file mode 100644 index 0000000..8edcbe7 --- /dev/null +++ b/gdb-build-fix-gdbserver-linux-aarch64-low.cc-build.patch @@ -0,0 +1,41 @@ +From 0397481ff25b76d43b123f3d51828982ceb92834 Mon Sep 17 00:00:00 2001 +From: Mark Wielaard +Date: Fri, 3 May 2024 15:17:42 +0200 +Subject: [PATCH] [gdb/build] Fix gdbserver/linux-aarch64-low.cc build + +Commit 0ee25f97d21e ("Fix regression on aarch64-linux gdbserver") +removed the last use of i in gdbserver/linux-aarch64-low.cc +(aarch64_target::low_stopped_data_address). Breaking the build on +aarch64 with: + +gdbserver/linux-aarch64-low.cc: In member function ?virtual CORE_ADDR aarch64_target::low_stopped_data_address()?: +gdbserver/linux-aarch64-low.cc:557:12: error: unused variable ?i? [-Werror=unused-variable] + 557 | int pid, i; + | ^ +cc1plus: all warnings being treated as errors + +Fix this by removing the variable i completely. + +Fixes: 0ee25f97d21e ("Fix regression on aarch64-linux gdbserver") +--- + gdbserver/linux-aarch64-low.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc +index 14346b89822..ce0029b885f 100644 +--- a/gdbserver/linux-aarch64-low.cc ++++ b/gdbserver/linux-aarch64-low.cc +@@ -555,7 +555,7 @@ CORE_ADDR + aarch64_target::low_stopped_data_address () + { + siginfo_t siginfo; +- int pid, i; ++ int pid; + struct aarch64_debug_reg_state *state; + + pid = lwpid_of (current_thread); + +base-commit: b33811a85ff53af77cdad995ad8cb50431c8c362 +-- +2.35.3 + diff --git a/gdb-bz634108-solib_address.patch b/gdb-bz634108-solib_address.patch new file mode 100644 index 0000000..bc7ef8a --- /dev/null +++ b/gdb-bz634108-solib_address.patch @@ -0,0 +1,41 @@ +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-bz634108-solib_address.patch + +;; Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108). +;;=fedoratest + +Fix gdb.solib_address (fix by Phil Muldoon). + +s/solib_address/solib_name/ during upstreaming. + +diff --git a/gdb/testsuite/gdb.python/rh634108-solib_address.exp b/gdb/testsuite/gdb.python/rh634108-solib_address.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.python/rh634108-solib_address.exp +@@ -0,0 +1,24 @@ ++# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# https://bugzilla.redhat.com/show_bug.cgi?id=634108 ++ ++gdb_exit ++gdb_start ++ ++# Skip all tests if Python scripting is not enabled. ++if { [skip_python_tests] } { continue } ++ ++gdb_test "python print (gdb.solib_name(-1))" "None" "gdb.solib_name exists" diff --git a/gdb-cli-add-ignore-errors-command.patch b/gdb-cli-add-ignore-errors-command.patch new file mode 100644 index 0000000..1e8ab5d --- /dev/null +++ b/gdb-cli-add-ignore-errors-command.patch @@ -0,0 +1,201 @@ +From 0bb6f49bb9ad577667075550ca2ad4cb49931078 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 18 Apr 2024 14:27:04 +0200 +Subject: [PATCH 2/2] gdb-cli-add-ignore-errors-command + +[gdb/cli] Add ignore-errors command + +While trying to reproduce a failing test-case from the testsuite on the +command line using a gdb command script, I ran into the problem that a command +failed which stopped script execution. + +I could work around this by splitting the script at each error, but I realized +it would be nice if I could tell gdb to ignore the error. + +A python workaround ignore-errors exists, mentioned here ( +https://sourceware.org/legacy-ml/gdb/2010-06/msg00100.html ), which is +already supplied by distros like Fedora and openSUSE. + +FTR, a more elaborate try-catch solution was posted here ( +https://sourceware.org/bugzilla/show_bug.cgi?id=8487 ). + +This patch adds native ignore-errors support (so no python needed). + +So with this script: +... +$ cat script.gdb +ignore-errors run +echo here +... +we have: +... +$ gdb -q -batch -x script.gdb +No executable file specified. +Use the "file" or "exec-file" command. +here$ +... + +Note that quit is not caught: +... +$ gdb -q +(gdb) ignore-errors quit +$ +... +which is the same behaviour as with the python implementation. + +Tested on x86_64-linux. + +gdb/ChangeLog: + +2021-05-18 Tom de Vries + + * cli/cli-cmds.c (ignore_errors_command_completer) + (ignore_errors_command): New function. + (_initialize_cli_cmds): Add "ignore-errors" cmd. + +gdb/doc/ChangeLog: + +2021-05-18 Tom de Vries + + * gdb.texinfo (Command Files): Document command ignore-errors. + +gdb/testsuite/ChangeLog: + +2021-05-18 Tom de Vries + + * gdb.base/ignore-errors.exp: New test. + * gdb.base/ignore-errors.gdb: New command file. +--- + gdb/cli/cli-cmds.c | 35 ++++++++++++++++++++++++ + gdb/doc/gdb.texinfo | 8 +++++- + gdb/testsuite/gdb.base/ignore-errors.exp | 24 ++++++++++++++++ + gdb/testsuite/gdb.base/ignore-errors.gdb | 2 ++ + 4 files changed, 68 insertions(+), 1 deletion(-) + create mode 100644 gdb/testsuite/gdb.base/ignore-errors.exp + create mode 100644 gdb/testsuite/gdb.base/ignore-errors.gdb + +diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c +index cfe7b71b0b7..0ae5530c558 100644 +--- a/gdb/cli/cli-cmds.c ++++ b/gdb/cli/cli-cmds.c +@@ -40,6 +40,7 @@ + #include "location.h" + #include "block.h" + #include "valprint.h" ++#include "event-top.h" + + #include "ui-out.h" + #include "interps.h" +@@ -2544,6 +2545,34 @@ shell_internal_fn (struct gdbarch *gdbarch, + return value::allocate_optimized_out (int_type); + } + ++/* Completer for "ignore-errors". */ ++ ++static void ++ignore_errors_command_completer (cmd_list_element *ignore, ++ completion_tracker &tracker, ++ const char *text, const char * /*word*/) ++{ ++ complete_nested_command_line (tracker, text); ++} ++ ++/* Implementation of the ignore-errors command. */ ++ ++static void ++ignore_errors_command (const char *args, int from_tty) ++{ ++ try ++ { ++ execute_command (args, from_tty); ++ } ++ catch (const gdb_exception_error &ex) ++ { ++ exception_print (gdb_stderr, ex); ++ ++ /* See also execute_gdb_command. */ ++ async_enable_stdin (); ++ } ++} ++ + void _initialize_cli_cmds (); + void + _initialize_cli_cmds () +@@ -2942,4 +2971,10 @@ when GDB is started."), GDBINIT).release (); + c = add_cmd ("source", class_support, source_command, + source_help_text, &cmdlist); + set_cmd_completer (c, filename_completer); ++ ++ c = add_cmd ("ignore-errors", class_support, ignore_errors_command, ++ _("Execute a single command, ignoring all errors.\n" ++ "Only one-line commands are supported.\n" ++ "This is primarily useful in scripts."), &cmdlist); ++ set_cmd_completer (c, ignore_errors_command_completer); + } +diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo +index 1abf91c4470..c277c16297c 100644 +--- a/gdb/doc/gdb.texinfo ++++ b/gdb/doc/gdb.texinfo +@@ -29250,7 +29250,8 @@ The lines in a command file are generally executed sequentially, + unless the order of execution is changed by one of the + @emph{flow-control commands} described below. The commands are not + printed as they are executed. An error in any command terminates +-execution of the command file and control is returned to the console. ++execution of the command file and control is returned to the console, ++unless the line is prefixed with the @code{ignore-errors} command. + + @value{GDBN} first searches for @var{filename} in the current directory. + If the file is not found there, and @var{filename} does not specify a +@@ -29345,6 +29346,11 @@ the controlling expression. + @item end + Terminate the block of commands that are the body of @code{if}, + @code{else}, or @code{while} flow-control commands. ++ ++@kindex ignore-errors ++@item ignore-errors ++This command executes the command specified by its arguments, but ++doesn't stop execution of the script if the command fails. + @end table + + +diff --git a/gdb/testsuite/gdb.base/ignore-errors.exp b/gdb/testsuite/gdb.base/ignore-errors.exp +new file mode 100644 +index 00000000000..30dac7a94e2 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/ignore-errors.exp +@@ -0,0 +1,24 @@ ++# Copyright 2021 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 . */ ++ ++# Check command ignore-errors. ++ ++clean_restart ++ ++gdb_test "source ignore-errors.gdb" \ ++ [multi_line \ ++ "No executable file specified\\." \ ++ "Use the \"file\" or \"exec-file\" command\\." \ ++ "here"] +diff --git a/gdb/testsuite/gdb.base/ignore-errors.gdb b/gdb/testsuite/gdb.base/ignore-errors.gdb +new file mode 100644 +index 00000000000..5962ff49b11 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/ignore-errors.gdb +@@ -0,0 +1,2 @@ ++ignore-errors run ++echo here\n +-- +2.35.3 + diff --git a/gdb-core-open-vdso-warning.patch b/gdb-core-open-vdso-warning.patch new file mode 100644 index 0000000..cc9910a --- /dev/null +++ b/gdb-core-open-vdso-warning.patch @@ -0,0 +1,58 @@ +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-core-open-vdso-warning.patch + +;; Fix GNU/Linux core open: Can't read pathname for load map: Input/output error. +;; Fix regression of undisplayed missing shared libraries caused by a fix for. +;;=fedoratest: It should be in glibc: libc-alpha: <20091004161706.GA27450@.*> + +http://sourceware.org/ml/gdb-patches/2009-10/msg00142.html +Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map: Input/output error. + +[ New patch variant. ] + +commit 7d760051ffb8a23cdc51342d4e6243fbc462f73f +Author: Ulrich Weigand +Date: Wed Sep 25 11:52:50 2013 +0000 + +diff --git a/gdb/testsuite/gdb.base/solib-symbol.exp b/gdb/testsuite/gdb.base/solib-symbol.exp +--- a/gdb/testsuite/gdb.base/solib-symbol.exp ++++ b/gdb/testsuite/gdb.base/solib-symbol.exp +@@ -27,6 +27,7 @@ set testfile "solib-symbol-main" + set srcfile ${srcdir}/${subdir}/${testfile}.c + set binfile [standard_output_file ${testfile}] + set bin_flags [list debug shlib=${binfile_lib}] ++set executable ${testfile} + + if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != "" + || [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } { +@@ -61,4 +62,28 @@ gdb_test "br foo2" \ + "Breakpoint.*: foo2. .2 locations..*" \ + "foo2 in mdlib" + ++# Test GDB warns for shared libraris which have not been found. ++ ++gdb_test "info sharedlibrary" "/${libname}.*" ++ ++clean_restart ${executable} ++gdb_breakpoint "main" ++gdb_run_cmd ++set test "no warning for missing libraries" ++gdb_test_multiple "" $test { ++ -re "warning: Could not load shared library symbols for \[0-9\]+ libraries,.*\r\n$gdb_prompt $" { ++ fail $test ++ } ++ -re "Breakpoint \[0-9\]+, main .*\r\n$gdb_prompt $" { ++ pass $test ++ } ++} ++ ++clean_restart ${executable} ++gdb_test_no_output "set solib-absolute-prefix /doESnotEXIST" ++gdb_breakpoint "main" ++gdb_run_cmd ++gdb_test "" "warning: Could not load shared library symbols for \[0-9\]+ libraries,.*\r\nBreakpoint \[0-9\]+, main .*" \ ++ "warning for missing libraries" ++ + gdb_exit diff --git a/gdb-exp-fix-cast-handling-for-indirection.patch b/gdb-exp-fix-cast-handling-for-indirection.patch new file mode 100644 index 0000000..e174e2d --- /dev/null +++ b/gdb-exp-fix-cast-handling-for-indirection.patch @@ -0,0 +1,150 @@ +From b96d3adafdb636898913710ec40ee86647665ae8 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 3 May 2024 09:37:19 +0200 +Subject: [PATCH 24/48] [gdb/exp] Fix cast handling for indirection + +Consider a test-case compiled without debug info, containing: +... +char a = 'a'; + +char * +a_loc (void) +{ + return &a; +} +... + +We get: +... +(gdb) p (char)*a_loc () +Cannot access memory at address 0x10 +... + +There's a bug in unop_ind_base_operation::evaluate that evaluates +"(char)*a_loc ()" the same as: +... +(gdb) p (char)*(char)a_loc () +Cannot access memory at address 0x10 +... + +Fix this by instead doing: +... +(gdb) p (char)*a_loc () +'a_loc' has unknown return type; cast the call to its declared return type +... + +Tested on x86_64-linux. + +PR exp/31693 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31693 +--- + gdb/expop.h | 5 +-- + gdb/testsuite/gdb.base/cast-indirection.c | 31 ++++++++++++++++ + gdb/testsuite/gdb.base/cast-indirection.exp | 41 +++++++++++++++++++++ + 3 files changed, 74 insertions(+), 3 deletions(-) + create mode 100644 gdb/testsuite/gdb.base/cast-indirection.c + create mode 100644 gdb/testsuite/gdb.base/cast-indirection.exp + +diff --git a/gdb/expop.h b/gdb/expop.h +index 25769d5b810..25d50fe00d0 100644 +--- a/gdb/expop.h ++++ b/gdb/expop.h +@@ -1513,9 +1513,8 @@ class unop_ind_base_operation + struct expression *exp, + enum noside noside) override + { +- if (expect_type != nullptr && expect_type->code () == TYPE_CODE_PTR) +- expect_type = check_typedef (expect_type)->target_type (); +- value *val = std::get<0> (m_storage)->evaluate (expect_type, exp, noside); ++ value *val ++ = std::get<0> (m_storage)->evaluate (nullptr, exp, noside); + return eval_op_ind (expect_type, exp, noside, val); + } + +diff --git a/gdb/testsuite/gdb.base/cast-indirection.c b/gdb/testsuite/gdb.base/cast-indirection.c +new file mode 100644 +index 00000000000..d59c66ead35 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/cast-indirection.c +@@ -0,0 +1,31 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2024 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++char a = 'a'; ++ ++char * ++a_loc (void) ++{ ++ return &a; ++} ++ ++int ++main (void) ++{ ++ int res = *a_loc () == 'a'; ++ return !res; ++} +diff --git a/gdb/testsuite/gdb.base/cast-indirection.exp b/gdb/testsuite/gdb.base/cast-indirection.exp +new file mode 100644 +index 00000000000..f1fe4302d27 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/cast-indirection.exp +@@ -0,0 +1,41 @@ ++# Copyright (C) 2024 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# Check that "p (char)*a_loc ()" is handled as "p (char)*(char *)a_loc ()". ++ ++standard_testfile ++ ++if { [prepare_for_testing "failed to prepare" $testfile $srcfile \ ++ {nodebug}] == -1} { ++ return -1 ++} ++ ++if ![runto_main] { ++ return -1 ++} ++ ++gdb_test "p a_loc ()" \ ++ "'a_loc' has unknown return type; cast the call to its declared return type" ++ ++gdb_test "p *a_loc ()" \ ++ "'a_loc' has unknown return type; cast the call to its declared return type" ++ ++gdb_test "p *(char *)a_loc ()" " = 97 'a'" ++ ++gdb_test "p (char)*(char *)a_loc ()" " = 97 'a'" ++ ++# Regression test for PR31693. ++gdb_test "p (char)*a_loc ()" \ ++ "'a_loc' has unknown return type; cast the call to its declared return type" +-- +2.35.3 + diff --git a/gdb-exp-fix-printing-of-out-of-bounds-struct-members.patch b/gdb-exp-fix-printing-of-out-of-bounds-struct-members.patch new file mode 100644 index 0000000..d036c43 --- /dev/null +++ b/gdb-exp-fix-printing-of-out-of-bounds-struct-members.patch @@ -0,0 +1,365 @@ +From 86e379aa22ba5e77ba0c6fa26588c5fd1d9e6abe Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 19 Feb 2024 09:59:15 +0100 +Subject: [PATCH 13/48] [gdb/exp] Fix printing of out of bounds struct members + +When building gdb with -O0 -fsanitize=address, and running test-case +gdb.ada/uninitialized_vars.exp, I run into: +... +(gdb) info locals +a = 0 +z = (a => 1, b => false, c => 2.0) +================================================================= +==66372==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000097f58 at pc 0xffff52c0da1c bp 0xffffc90a1d40 sp 0xffffc90a1d80 +READ of size 4 at 0x602000097f58 thread T0 + #0 0xffff52c0da18 in memmove (/lib64/libasan.so.8+0x6da18) + #1 0xbcab24 in unsigned char* std::__copy_move_backward::__copy_move_b(unsigned char const*, unsigned char const*, unsigned char*) /usr/include/c++/13/bits/stl_algobase.h:748 + #2 0xbc9bf4 in unsigned char* std::__copy_move_backward_a2(unsigned char const*, unsigned char const*, unsigned char*) /usr/include/c++/13/bits/stl_algobase.h:769 + #3 0xbc898c in unsigned char* std::__copy_move_backward_a1(unsigned char const*, unsigned char const*, unsigned char*) /usr/include/c++/13/bits/stl_algobase.h:778 + #4 0xbc715c in unsigned char* std::__copy_move_backward_a(unsigned char const*, unsigned char const*, unsigned char*) /usr/include/c++/13/bits/stl_algobase.h:807 + #5 0xbc4e6c in unsigned char* std::copy_backward(unsigned char const*, unsigned char const*, unsigned char*) /usr/include/c++/13/bits/stl_algobase.h:867 + #6 0xbc2934 in void gdb::copy(gdb::array_view, gdb::array_view) gdb/../gdbsupport/array-view.h:223 + #7 0x20e0100 in value::contents_copy_raw(value*, long, long, long) gdb/value.c:1239 + #8 0x20e9830 in value::primitive_field(long, int, type*) gdb/value.c:3078 + #9 0x20e98f8 in value_field(value*, int) gdb/value.c:3095 + #10 0xcafd64 in print_field_values gdb/ada-valprint.c:658 + #11 0xcb0fa0 in ada_val_print_struct_union gdb/ada-valprint.c:857 + #12 0xcb1bb4 in ada_value_print_inner(value*, ui_file*, int, value_print_options const*) gdb/ada-valprint.c:1042 + #13 0xc66e04 in ada_language::value_print_inner(value*, ui_file*, int, value_print_options const*) const (/home/vries/gdb/build/gdb/gdb+0xc66e04) + #14 0x20ca1e8 in common_val_print(value*, ui_file*, int, value_print_options const*, language_defn const*) gdb/valprint.c:1092 + #15 0x20caabc in common_val_print_checked(value*, ui_file*, int, value_print_options const*, language_defn const*) gdb/valprint.c:1184 + #16 0x196c524 in print_variable_and_value(char const*, symbol*, frame_info_ptr, ui_file*, int) gdb/printcmd.c:2355 + #17 0x1d99ca0 in print_variable_and_value_data::operator()(char const*, symbol*) gdb/stack.c:2308 + #18 0x1dabca0 in gdb::function_view::bind(print_variable_and_value_data&)::{lambda(gdb::fv_detail::erased_callable, char const*, symbol*)#1}::operator()(gdb::fv_detail::erased_callable, char const*, symbol*) const gdb/../gdbsupport/function-view.h:305 + #19 0x1dabd14 in gdb::function_view::bind(print_variable_and_value_data&)::{lambda(gdb::fv_detail::erased_callable, char const*, symbol*)#1}::_FUN(gdb::fv_detail::erased_callable, char const*, symbol*) gdb/../gdbsupport/function-view.h:299 + #20 0x1dab34c in gdb::function_view::operator()(char const*, symbol*) const gdb/../gdbsupport/function-view.h:289 + #21 0x1d9963c in iterate_over_block_locals gdb/stack.c:2240 + #22 0x1d99790 in iterate_over_block_local_vars(block const*, gdb::function_view) gdb/stack.c:2259 + #23 0x1d9a598 in print_frame_local_vars gdb/stack.c:2380 + #24 0x1d9afac in info_locals_command(char const*, int) gdb/stack.c:2458 + #25 0xfd7b30 in do_simple_func gdb/cli/cli-decode.c:95 + #26 0xfe5a2c in cmd_func(cmd_list_element*, char const*, int) gdb/cli/cli-decode.c:2735 + #27 0x1f03790 in execute_command(char const*, int) gdb/top.c:575 + #28 0x1384080 in command_handler(char const*) gdb/event-top.c:566 + #29 0x1384e2c in command_line_handler(std::unique_ptr >&&) gdb/event-top.c:802 + #30 0x1f731e4 in tui_command_line_handler gdb/tui/tui-interp.c:104 + #31 0x1382a58 in gdb_rl_callback_handler gdb/event-top.c:259 + #32 0x21dbb80 in rl_callback_read_char readline/readline/callback.c:290 + #33 0x1382510 in gdb_rl_callback_read_char_wrapper_noexcept gdb/event-top.c:195 + #34 0x138277c in gdb_rl_callback_read_char_wrapper gdb/event-top.c:234 + #35 0x1fe9b40 in stdin_event_handler gdb/ui.c:155 + #36 0x35ff1bc in handle_file_event gdbsupport/event-loop.cc:573 + #37 0x35ff9d8 in gdb_wait_for_event gdbsupport/event-loop.cc:694 + #38 0x35fd284 in gdb_do_one_event(int) gdbsupport/event-loop.cc:264 + #39 0x1768080 in start_event_loop gdb/main.c:408 + #40 0x17684c4 in captured_command_loop gdb/main.c:472 + #41 0x176cfc8 in captured_main gdb/main.c:1342 + #42 0x176d088 in gdb_main(captured_main_args*) gdb/main.c:1361 + #43 0xb73edc in main gdb/gdb.c:39 + #44 0xffff519b09d8 in __libc_start_call_main (/lib64/libc.so.6+0x309d8) + #45 0xffff519b0aac in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x30aac) + #46 0xb73c2c in _start (/home/vries/gdb/build/gdb/gdb+0xb73c2c) + +0x602000097f58 is located 0 bytes after 8-byte region [0x602000097f50,0x602000097f58) +allocated by thread T0 here: + #0 0xffff52c65218 in calloc (/lib64/libasan.so.8+0xc5218) + #1 0xcbc278 in xcalloc gdb/alloc.c:97 + #2 0x35f21e8 in xzalloc(unsigned long) gdbsupport/common-utils.cc:29 + #3 0x20de270 in value::allocate_contents(bool) gdb/value.c:937 + #4 0x20edc08 in value::fetch_lazy() gdb/value.c:4033 + #5 0x20dadc0 in value::entirely_covered_by_range_vector(std::vector > const&) gdb/value.c:229 + #6 0xcb2298 in value::entirely_optimized_out() gdb/value.h:560 + #7 0x20ca6fc in value_check_printable gdb/valprint.c:1133 + #8 0x20caa8c in common_val_print_checked(value*, ui_file*, int, value_print_options const*, language_defn const*) gdb/valprint.c:1182 + #9 0x196c524 in print_variable_and_value(char const*, symbol*, frame_info_ptr, ui_file*, int) gdb/printcmd.c:2355 + #10 0x1d99ca0 in print_variable_and_value_data::operator()(char const*, symbol*) gdb/stack.c:2308 + #11 0x1dabca0 in gdb::function_view::bind(print_variable_and_value_data&)::{lambda(gdb::fv_detail::erased_callable, char const*, symbol*)#1}::operator()(gdb::fv_detail::erased_callable, char const*, symbol*) const gdb/../gdbsupport/function-view.h:305 + #12 0x1dabd14 in gdb::function_view::bind(print_variable_and_value_data&)::{lambda(gdb::fv_detail::erased_callable, char const*, symbol*)#1}::_FUN(gdb::fv_detail::erased_callable, char const*, symbol*) gdb/../gdbsupport/function-view.h:299 + #13 0x1dab34c in gdb::function_view::operator()(char const*, symbol*) const gdb/../gdbsupport/function-view.h:289 + #14 0x1d9963c in iterate_over_block_locals gdb/stack.c:2240 + #15 0x1d99790 in iterate_over_block_local_vars(block const*, gdb::function_view) gdb/stack.c:2259 + #16 0x1d9a598 in print_frame_local_vars gdb/stack.c:2380 + #17 0x1d9afac in info_locals_command(char const*, int) gdb/stack.c:2458 + #18 0xfd7b30 in do_simple_func gdb/cli/cli-decode.c:95 + #19 0xfe5a2c in cmd_func(cmd_list_element*, char const*, int) gdb/cli/cli-decode.c:2735 + #20 0x1f03790 in execute_command(char const*, int) gdb/top.c:575 + #21 0x1384080 in command_handler(char const*) gdb/event-top.c:566 + #22 0x1384e2c in command_line_handler(std::unique_ptr >&&) gdb/event-top.c:802 + #23 0x1f731e4 in tui_command_line_handler gdb/tui/tui-interp.c:104 + #24 0x1382a58 in gdb_rl_callback_handler gdb/event-top.c:259 + #25 0x21dbb80 in rl_callback_read_char readline/readline/callback.c:290 + #26 0x1382510 in gdb_rl_callback_read_char_wrapper_noexcept gdb/event-top.c:195 + #27 0x138277c in gdb_rl_callback_read_char_wrapper gdb/event-top.c:234 + #28 0x1fe9b40 in stdin_event_handler gdb/ui.c:155 + #29 0x35ff1bc in handle_file_event gdbsupport/event-loop.cc:573 + +SUMMARY: AddressSanitizer: heap-buffer-overflow (/lib64/libasan.so.8+0x6da18) in memmove +... + +The error happens when trying to print either variable y or y2: +... + type Variable_Record (A : Boolean := True) is record + case A is + when True => + B : Integer; + when False => + C : Float; + D : Integer; + end case; + end record; + Y : Variable_Record := (A => True, B => 1); + Y2 : Variable_Record := (A => False, C => 1.0, D => 2); +... +when the variables are uninitialized. + +The error happens only when printing the entire variable: +... +(gdb) p y.a +$2 = 216 +(gdb) p y.b +There is no member named b. +(gdb) p y.c +$3 = 9.18340949e-41 +(gdb) p y.d +$4 = 1 +(gdb) p y + +... + +The error happens as follows: +- field a functions as discriminant, choosing either the b, or c+d variant. +- when y.a happens to be set to 216, as above, gdb interprets this as the + variable having the c+d variant (which is why trying to print y.b fails). +- when printing y, gdb allocates a value, copies the bytes into it from the + target, and then prints the value. +- gdb allocates the value using the type size, which is 8. It's 8 because + that's what the DW_AT_byte_size indicates. Note that for valid values of a, + it gives correct results: if a is 0 (c+d variant), size is 12, if a is 1 + (b variant), size is 8. +- gdb tries to print field d, which is at an 8 byte offset, and that results + in a out-of-bounds access for the allocated 8-byte value. + +Fix this by handling this case in value::contents_copy_raw, such that we have: +... +(gdb) p y +$1 = (a => 24, c => 9.18340949e-41, + d => ) +... + +An alternative (additional) fix could be this: in compute_variant_fields_inner +gdb reads the discriminant y.a to decide which variant is active. It would be +nice to detect that the value (y.a == 24) is not a valid Boolean, and give up +on choosing a variant altoghether. However, the situation regarding the +internal type CODE_TYPE_BOOL is currently ambiguous (see PR31282) and it's not +possible to reliably decide what valid values are. + +The test-case source file gdb.ada/uninitialized-variable-record/parse.adb is +a reduced version of gdb.ada/uninitialized_vars/parse.adb, so it copies the +copyright years. + +Note that the test-case needs gcc-12 or newer, it's unsupported for older gcc +versions. [ So, it would be nice to rewrite it into a dwarf assembly +test-case. ] + +The test-case loops over all languages. This is inherited from an earlier +attempt to fix this, which had language-specific fixes (in print_field_values, +cp_print_value_fields, pascal_object_print_value_fields and +f_language::value_print_inner). I've left this in, but I suppose it's not +strictly necessary anymore. + +Tested on x86_64-linux. + +PR exp/31258 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31258 +--- + .../gdb.ada/uninitialized-variable-record.exp | 122 ++++++++++++++++++ + .../uninitialized-variable-record/parse.adb | 33 +++++ + gdb/value.c | 3 + + 3 files changed, 158 insertions(+) + create mode 100644 gdb/testsuite/gdb.ada/uninitialized-variable-record.exp + create mode 100644 gdb/testsuite/gdb.ada/uninitialized-variable-record/parse.adb + +diff --git a/gdb/testsuite/gdb.ada/uninitialized-variable-record.exp b/gdb/testsuite/gdb.ada/uninitialized-variable-record.exp +new file mode 100644 +index 00000000000..7fc72395edf +--- /dev/null ++++ b/gdb/testsuite/gdb.ada/uninitialized-variable-record.exp +@@ -0,0 +1,122 @@ ++# Copyright 2024 Free Software Foundation, Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++load_lib "ada.exp" ++ ++require allow_ada_tests ++ ++standard_ada_testfile parse ++ ++if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != "" } { ++ return -1 ++} ++ ++clean_restart ${testfile} ++ ++set bp_location [gdb_get_line_number "START" ${testdir}/parse.adb] ++runto "parse.adb:$bp_location" ++ ++# Check that we have the expected value for variable y2. ++ ++gdb_test "p y2" [string_to_regexp " = (a => false, c => 1.0, d => 2)"] ++ ++# Shorthand. ++ ++proc set_lang { lang } { ++ gdb_test_multiple "set language $lang" "" { ++ -re -wrap "" { ++ } ++ } ++} ++ ++# Calculate the offset of y2.d. ++ ++set re_cast [string_to_regexp "(access integer)"] ++gdb_test_multiple "print &y2.d - &y2" "" { ++ -re -wrap " = $re_cast ($hex)" { ++ set offset_d $expect_out(1,string) ++ pass $gdb_test_name ++ } ++} ++ ++# Try to find a interesting discriminator value, such that at the same time: ++# - the d field is part of the variable, and ++# - the type size is too small to contain d. ++ ++set interesting_discriminator -1 ++set_lang c ++for { set i 0 } { $i < 256 } { incr i } { ++ with_test_prefix $i { ++ ++ # Patch in the discriminator value. ++ gdb_test_multiple "set var *(unsigned char *)(&y2.a)=$i" "" { ++ -re -wrap "" { ++ } ++ } ++ ++ # Check that we have the variant with fields c+d instead of b. ++ set have_b 0 ++ gdb_test_multiple "with language ada -- print y2.b" "" { ++ -re -wrap " = $decimal" { ++ set have_b 1 ++ } ++ -re -wrap "" { ++ } ++ } ++ if { $have_b } { ++ # This is the variant with field b. ++ continue ++ } ++ ++ set size 0 ++ gdb_test_multiple "print sizeof (y2)" "" { ++ -re -wrap " = (.*)" { ++ set size $expect_out(1,string) ++ } ++ } ++ ++ if { ! $size } { ++ continue ++ } ++ ++ if { [expr $size > $offset_d] } { ++ # Field d fits in the size. ++ continue ++ } ++ ++ set interesting_discriminator $i ++ break ++ } ++} ++ ++require {expr $interesting_discriminator != -1} ++ ++foreach lang [gdb_supported_languages] { ++ with_test_prefix $lang { ++ set_lang $lang ++ ++ gdb_test_multiple "print y2" "" { ++ -re -wrap ", d => $decimal.*" { ++ fail $gdb_test_name ++ } ++ -re -wrap ", d = $decimal.*" { ++ fail $gdb_test_name ++ } ++ -re -wrap "" { ++ pass $gdb_test_name ++ } ++ } ++ } ++} +diff --git a/gdb/testsuite/gdb.ada/uninitialized-variable-record/parse.adb b/gdb/testsuite/gdb.ada/uninitialized-variable-record/parse.adb +new file mode 100644 +index 00000000000..f00c75ca2dc +--- /dev/null ++++ b/gdb/testsuite/gdb.ada/uninitialized-variable-record/parse.adb +@@ -0,0 +1,33 @@ ++-- Copyright 2009-2024 Free Software Foundation, Inc. ++-- ++-- This program is free software; you can redistribute it and/or modify ++-- it under the terms of the GNU General Public License as published by ++-- the Free Software Foundation; either version 3 of the License, or ++-- (at your option) any later version. ++-- ++-- This program is distributed in the hope that it will be useful, ++-- but WITHOUT ANY WARRANTY; without even the implied warranty of ++-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++-- GNU General Public License for more details. ++-- ++-- You should have received a copy of the GNU General Public License ++-- along with this program. If not, see . ++ ++-- Based on gdb.ada/uninitialized_vars/parse.adb. ++ ++procedure Parse is ++ ++ type Variable_Record (A : Boolean := True) is record ++ case A is ++ when True => ++ B : Integer; ++ when False => ++ C : Float; ++ D : Integer; ++ end case; ++ end record; ++ Y2 : Variable_Record := (A => False, C => 1.0, D => 2); ++ ++begin ++ null; -- START ++end Parse; +diff --git a/gdb/value.c b/gdb/value.c +index 1cc32625629..56ae9db6603 100644 +--- a/gdb/value.c ++++ b/gdb/value.c +@@ -1188,6 +1188,9 @@ value::contents_copy_raw (struct value *dst, LONGEST dst_offset, + gdb_assert (!dst->bits_any_optimized_out (TARGET_CHAR_BIT * dst_offset, + TARGET_CHAR_BIT * length)); + ++ if ((src_offset + copy_length) * unit_size > enclosing_type ()-> length ()) ++ error (_("access outside bounds of object")); ++ + /* Copy the data. */ + gdb::array_view dst_contents + = dst->contents_all_raw ().slice (dst_offset * unit_size, +-- +2.35.3 + diff --git a/gdb-exp-redo-cast-handling-for-indirection.patch b/gdb-exp-redo-cast-handling-for-indirection.patch new file mode 100644 index 0000000..3000d9b --- /dev/null +++ b/gdb-exp-redo-cast-handling-for-indirection.patch @@ -0,0 +1,86 @@ +From a6800d9c8145f25001dd39afc3571e3350573e81 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 6 May 2024 14:23:25 +0200 +Subject: [PATCH] [gdb/exp] Redo cast handling for indirection + +In commit ed8fd0a342f ("[gdb/exp] Fix cast handling for indirection"), I +introduced the behaviour that even though we have: +... +(gdb) p *a_loc () +'a_loc' has unknown return type; cast the call to its declared return type +... +we get: +... +(gdb) p (char)*a_loc () +$1 = 97 'a' +... + +In other words, the unknown return type of a_loc is inferred from the cast, +effectually evaluating: +... +(gdb) p (char)*(char *)a_loc () +... + +This is convient for the case that errno is defined as: +... + #define errno (*__errno_location ()) +... +and the return type of __errno_location is unknown but the macro definition is +known, such that we can use: +... +(gdb) p (int)errno +... +instead of +... +(gdb) p *(int *)__errno_location () +... + +However, as Pedro has pointed out in post-commit review [1], this makes it +harder to reason about the semantics of an expression. + +For instance, this: +... +(gdb) p (long long)*a_loc ()" +... +would be evaluated without debug info as: +... +(gdb) p (long long)*(long long *)a_loc ()" +... +but with debug info as: +... +(gdb) p (long long)*(char *)a_loc ()" +... + +Fix this by instead simply erroring out for this case: +... +(gdb) p (char)*a_loc () +'a_loc' has unknown return type; cast the call to its declared return type +... + +Tested on x86_64-linux. + +Approved-By: Pedro Alves + +[1] https://sourceware.org/pipermail/gdb-patches/2024-May/208821.html +--- + gdb/testsuite/gdb.base/cast-indirection.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.base/cast-indirection.exp b/gdb/testsuite/gdb.base/cast-indirection.exp +index f1fe4302d27..7b9b5a5d677 100644 +--- a/gdb/testsuite/gdb.base/cast-indirection.exp ++++ b/gdb/testsuite/gdb.base/cast-indirection.exp +@@ -13,7 +13,7 @@ + # You should have received a copy of the GNU General Public License + # along with this program. If not, see . + +-# Check that "p (char)*a_loc ()" is handled as "p (char)*(char *)a_loc ()". ++# Check that "p (char)*a_loc ()" is handled correctly. + + standard_testfile + + +base-commit: fc73000faa1798573090994167b7e2d451c211db +-- +2.35.3 + diff --git a/gdb-fedora-libncursesw.patch b/gdb-fedora-libncursesw.patch new file mode 100644 index 0000000..6bf6aa3 --- /dev/null +++ b/gdb-fedora-libncursesw.patch @@ -0,0 +1,333 @@ +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-fedora-libncursesw.patch + +;; Force libncursesw over libncurses to match the includes (RH BZ 1270534). +;;=push+jan + +Fedora: Force libncursesw over libncurses to match the includes. +https://bugzilla.redhat.com/show_bug.cgi?id=1270534 + +diff --git a/gdb/configure b/gdb/configure +--- a/gdb/configure ++++ b/gdb/configure +@@ -780,9 +780,6 @@ ENABLE_BFD_64_BIT_TRUE + subdirs + RPM_LIBS + RPM_CFLAGS +-PKG_CONFIG_LIBDIR +-PKG_CONFIG_PATH +-PKG_CONFIG + GDB_DATADIR + DEBUGDIR + MAKEINFO_EXTRA_FLAGS +@@ -990,12 +987,12 @@ PKG_CONFIG_PATH + PKG_CONFIG_LIBDIR + MAKEINFO + MAKEINFOFLAGS ++RPM_CFLAGS ++RPM_LIBS + AMD_DBGAPI_CFLAGS + AMD_DBGAPI_LIBS + DEBUGINFOD_CFLAGS + DEBUGINFOD_LIBS +-RPM_CFLAGS +-RPM_LIBS + YACC + YFLAGS + ZSTD_CFLAGS +@@ -1684,11 +1681,11 @@ Optional Packages: + [--with-auto-load-dir] + --without-auto-load-safe-path + do not restrict auto-loaded files locations ++ --with-rpm query rpm database for missing debuginfos (yes/no, ++ def. auto=librpm.so) + --with-amd-dbgapi support for the amd-dbgapi target (yes / no / auto) + --with-debuginfod Enable debuginfo lookups with debuginfod + (auto/yes/no) +- --with-rpm query rpm database for missing debuginfos (yes/no, +- def. auto=librpm.so) + --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets + --with-curses use the curses library instead of the termcap + library +@@ -1761,6 +1758,8 @@ Some influential environment variables: + MAKEINFO Parent configure detects if it is of sufficient version. + MAKEINFOFLAGS + Parameters for MAKEINFO. ++ RPM_CFLAGS C compiler flags for RPM, overriding pkg-config ++ RPM_LIBS linker flags for RPM, overriding pkg-config + AMD_DBGAPI_CFLAGS + C compiler flags for AMD_DBGAPI, overriding pkg-config + AMD_DBGAPI_LIBS +@@ -1769,8 +1768,6 @@ Some influential environment variables: + C compiler flags for DEBUGINFOD, overriding pkg-config + DEBUGINFOD_LIBS + linker flags for DEBUGINFOD, overriding pkg-config +- RPM_CFLAGS C compiler flags for RPM, overriding pkg-config +- RPM_LIBS linker flags for RPM, overriding pkg-config + YACC The `Yet Another Compiler Compiler' implementation to use. + Defaults to the first program found out of: `bison -y', `byacc', + `yacc'. +@@ -11495,7 +11492,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11486 "configure" ++#line 11495 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -11601,7 +11598,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11592 "configure" ++#line 11601 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -18102,8 +18099,8 @@ $as_echo_n "checking specific librpm version... " >&6; } + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +-as_fn_error "cannot run test program while cross compiling +-See \`config.log' for more details." "$LINENO" 5; } ++as_fn_error $? "cannot run test program while cross compiling ++See \`config.log' for more details" "$LINENO" 5; } + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +@@ -18275,132 +18272,12 @@ $as_echo "#define HAVE_LIBRPM 1" >>confdefs.h + $as_echo "no" >&6; } + LIBS="$save_LIBS" + if $DLOPEN_REQUIRE; then +- as_fn_error "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5 ++ as_fn_error $? "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5 + fi + +- +- +- +- +- +- +-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then +- if test -n "$ac_tool_prefix"; then +- # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +-$as_echo_n "checking for $ac_word... " >&6; } +-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : +- $as_echo_n "(cached) " >&6 +-else +- case $PKG_CONFIG in +- [\\/]* | ?:[\\/]*) +- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. +- ;; +- *) +- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +- done +-IFS=$as_save_IFS +- +- ;; +-esac +-fi +-PKG_CONFIG=$ac_cv_path_PKG_CONFIG +-if test -n "$PKG_CONFIG"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +-$as_echo "$PKG_CONFIG" >&6; } +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +- +- +-fi +-if test -z "$ac_cv_path_PKG_CONFIG"; then +- ac_pt_PKG_CONFIG=$PKG_CONFIG +- # Extract the first word of "pkg-config", so it can be a program name with args. +-set dummy pkg-config; ac_word=$2 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +-$as_echo_n "checking for $ac_word... " >&6; } +-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : +- $as_echo_n "(cached) " >&6 +-else +- case $ac_pt_PKG_CONFIG in +- [\\/]* | ?:[\\/]*) +- ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. +- ;; +- *) +- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +- done +-IFS=$as_save_IFS +- +- ;; +-esac +-fi +-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +-if test -n "$ac_pt_PKG_CONFIG"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +-$as_echo "$ac_pt_PKG_CONFIG" >&6; } +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +- +- if test "x$ac_pt_PKG_CONFIG" = x; then +- PKG_CONFIG="" +- else +- case $cross_compiling:$ac_tool_warned in +-yes:) +-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +-ac_tool_warned=yes ;; +-esac +- PKG_CONFIG=$ac_pt_PKG_CONFIG +- fi +-else +- PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +-fi +- +-fi +-if test -n "$PKG_CONFIG"; then +- _pkg_min_version=0.9.0 +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } +- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +- PKG_CONFIG="" +- fi +-fi +- + pkg_failed=no +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM" >&5 +-$as_echo_n "checking for RPM... " >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rpm" >&5 ++$as_echo_n "checking for rpm... " >&6; } + + if test -n "$RPM_CFLAGS"; then + pkg_cv_RPM_CFLAGS="$RPM_CFLAGS" +@@ -18437,6 +18314,30 @@ fi + pkg_failed=untried + fi + ++if test $pkg_failed = no; then ++ pkg_save_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS $pkg_cv_RPM_LIBS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ++else ++ pkg_failed=yes ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++ LDFLAGS=$pkg_save_LDFLAGS ++fi ++ + + + if test $pkg_failed = yes; then +@@ -18531,7 +18432,7 @@ $as_echo "#define HAVE_LIBRPM 1" >>confdefs.h + LIBS="$LIBS $RPM_LIBS" + else + if $RPM_REQUIRE; then +- as_fn_error "$RPM_PKG_ERRORS" "$LINENO" 5 ++ as_fn_error $? "$RPM_PKG_ERRORS" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $RPM_PKG_ERRORS" >&5 + $as_echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;} +@@ -21164,6 +21065,7 @@ if test x"$prefer_curses" = xyes; then + # search /usr/local/include, if ncurses is installed in /usr/local. A + # default installation of ncurses on alpha*-dec-osf* will lead to such + # a situation. ++ # Fedora: Force libncursesw over libncurses to match the includes. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5 + $as_echo_n "checking for library containing waddstr... " >&6; } + if ${ac_cv_search_waddstr+:} false; then : +@@ -21188,7 +21090,7 @@ return waddstr (); + return 0; + } + _ACEOF +-for ac_lib in '' ncursesw ncurses cursesX curses; do ++for ac_lib in '' ncursesw; do + if test -z "$ac_lib"; then + ac_res="none required" + else +@@ -21260,6 +21162,7 @@ case $host_os in + esac + + # These are the libraries checked by Readline. ++# Fedora: Force libncursesw over libncurses to match the includes. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5 + $as_echo_n "checking for library containing tgetent... " >&6; } + if ${ac_cv_search_tgetent+:} false; then : +@@ -21284,7 +21187,7 @@ return tgetent (); + return 0; + } + _ACEOF +-for ac_lib in '' termcap tinfow tinfo curses ncursesw ncurses; do ++for ac_lib in '' ncursesw; do + if test -z "$ac_lib"; then + ac_res="none required" + else +diff --git a/gdb/configure.ac b/gdb/configure.ac +--- a/gdb/configure.ac ++++ b/gdb/configure.ac +@@ -749,7 +749,8 @@ if test x"$prefer_curses" = xyes; then + # search /usr/local/include, if ncurses is installed in /usr/local. A + # default installation of ncurses on alpha*-dec-osf* will lead to such + # a situation. +- AC_SEARCH_LIBS(waddstr, [ncursesw ncurses cursesX curses], ++ # Fedora: Force libncursesw over libncurses to match the includes. ++ AC_SEARCH_LIBS(waddstr, [ncursesw], + [curses_found=yes + AC_DEFINE([HAVE_LIBCURSES], [1], + [Define to 1 if curses is enabled.]) +@@ -789,7 +790,8 @@ case $host_os in + esac + + # These are the libraries checked by Readline. +-AC_SEARCH_LIBS(tgetent, [termcap tinfow tinfo curses ncursesw ncurses]) ++# Fedora: Force libncursesw over libncurses to match the includes. ++AC_SEARCH_LIBS(tgetent, [ncursesw]) + + if test "$ac_cv_search_tgetent" = no; then + CONFIG_OBS="$CONFIG_OBS stub-termcap.o" diff --git a/gdb-fix-heap-use-after-free-in-select_event_lwp.patch b/gdb-fix-heap-use-after-free-in-select_event_lwp.patch new file mode 100644 index 0000000..b362a6e --- /dev/null +++ b/gdb-fix-heap-use-after-free-in-select_event_lwp.patch @@ -0,0 +1,144 @@ +From 350172ea215c7074601e8424ff636563612f91e8 Mon Sep 17 00:00:00 2001 +From: Pedro Alves +Date: Wed, 21 Feb 2024 16:23:55 +0000 +Subject: [PATCH 14/48] [gdb] Fix heap-use-after-free in select_event_lwp + +PR gdb/31259 reveals one scenario where we run into a +heap-use-after-free reported by thread sanitizer, while running +gdb.base/vfork-follow-parent.exp. + +The heap-use-after-free happens during the following scenario: + + - linux_nat_wait_1 is about to return an event for T2. It stops all + other threads, and while doing so, stop_wait_callback -> wait_lwp + sees T1 exit, and decides to leave the exit event pending. It + should have set the lp->stopped flag too, but does not -- this is + the bug. + + - The event for T2 is reported, is processed by infrun, and we're + back at linux_nat_wait_1. + + - linux_nat_wait_1 selects LWP T1 with the pending exit status to + report. + + - it sets variable lp to point to the corresponding lwp_info. + + - it calls stop_callback and stop_wait_callback for all threads + (because !target_is_non_stop_p ()). + + - it calls select_event_lwp to maybe pick another thread than T1, to + prevent starvation. + +The problem is the following: + + - while calling stop_wait_callback for all threads, it also does this + for T1. While doing so, the corresponding lwp_info is deleted + (callstack stop_wait_callback -> wait_lwp -> exit_lwp -> + delete_lwp), leaving variable lp as a dangling pointer. + + - variable lp is passed to select_event_lwp, which derefences it, + which causes the heap-use-after-free. + +Note that the comment here mentions "all other LWP's": +... + /* Now stop all other LWP's ... */ + iterate_over_lwps (minus_one_ptid, stop_callback); + /* ... and wait until all of them have reported back that + they're no longer running. */ + iterate_over_lwps (minus_one_ptid, stop_wait_callback); +... + +The reason the comments say "all other LWP's", and doesn't bother +filtering out LP is that lp->stopped should be true at this point, and +the callbacks (both stop_callback and stop_wait_callback) check that +flag, and do nothing if set. I.e., they skip already-stopped threads, +so they should skip LP. + +In this particular scenario, though, we missed setting the stopped +flag right in the first step described above, so LP was iterated over +incorrectly. + +The fix is to make wait_lwp set the lp->stopped flag when it decides +to leave the exit event pending. However, going a bit further, +gdbserver has a mark_lwp_dead function to centralize setting up +various lwp flags such that the rest of the code doesn't mishandle +them, and it seems like a good idea to do a similar thing in gdb as +well. That is what this patch does. + +PR gdb/31259 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31259 +Co-Authored-By: Tom de Vries +Change-Id: I4a6169976f89bf714c478cbb2b7d4c32365e62a9 +--- + gdb/linux-nat.c | 34 +++++++++++++++++++++++++--------- + 1 file changed, 25 insertions(+), 9 deletions(-) + +diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c +index 7e36ced6292..ed445c5e5bb 100644 +--- a/gdb/linux-nat.c ++++ b/gdb/linux-nat.c +@@ -2029,6 +2029,27 @@ wait_for_signal () + } + } + ++/* Mark LWP dead, with STATUS as exit status pending to report ++ later. */ ++ ++static void ++mark_lwp_dead (lwp_info *lp, int status) ++{ ++ /* Store the exit status lp->waitstatus, because lp->status would be ++ ambiguous (W_EXITCODE(0,0) == 0). */ ++ lp->waitstatus = host_status_to_waitstatus (status); ++ ++ /* If we're processing LP's status, there should be no other event ++ already recorded as pending. */ ++ gdb_assert (lp->status == 0); ++ ++ /* Dead LWPs aren't expected to report a pending sigstop. */ ++ lp->signalled = 0; ++ ++ /* Prevent trying to stop it. */ ++ lp->stopped = 1; ++} ++ + /* Wait for LP to stop. Returns the wait status, or 0 if the LWP has + exited. */ + +@@ -2114,9 +2135,8 @@ wait_lwp (struct lwp_info *lp) + + /* If this is the leader exiting, it means the whole + process is gone. Store the status to report to the +- core. Store it in lp->waitstatus, because lp->status +- would be ambiguous (W_EXITCODE(0,0) == 0). */ +- lp->waitstatus = host_status_to_waitstatus (status); ++ core. */ ++ mark_lwp_dead (lp, status); + return 0; + } + +@@ -2908,12 +2928,7 @@ linux_nat_filter_event (int lwpid, int status) + linux_nat_debug_printf ("LWP %ld exited (resumed=%d)", + lp->ptid.lwp (), lp->resumed); + +- /* Dead LWP's aren't expected to reported a pending sigstop. */ +- lp->signalled = 0; +- +- /* Store the pending event in the waitstatus, because +- W_EXITCODE(0,0) == 0. */ +- lp->waitstatus = host_status_to_waitstatus (status); ++ mark_lwp_dead (lp, status); + return; + } + +@@ -3248,6 +3263,7 @@ linux_nat_wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus, + } + + gdb_assert (lp); ++ gdb_assert (lp->stopped); + + status = lp->status; + lp->status = 0; +-- +2.35.3 + diff --git a/gdb-fix-segfault-in-for_each_block-part-1.patch b/gdb-fix-segfault-in-for_each_block-part-1.patch new file mode 100644 index 0000000..8dad7a1 --- /dev/null +++ b/gdb-fix-segfault-in-for_each_block-part-1.patch @@ -0,0 +1,636 @@ +From 1d02ba0f4adcba2595a67e88fb1ba6d35c7f8e5b Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 7 May 2024 11:33:57 +0200 +Subject: [PATCH] [gdb] Fix segfault in for_each_block, part 1 + +When running test-case gdb.base/vfork-follow-parent.exp on powerpc64 (likewise +on s390x), I run into: +... +(gdb) PASS: gdb.base/vfork-follow-parent.exp: \ + exec_file=vfork-follow-parent-exit: target-non-stop=on: non-stop=off: \ + resolution_method=schedule-multiple: print unblock_parent = 1 +continue^M +Continuing.^M +Reading symbols from vfork-follow-parent-exit...^M +^M +^M +Fatal signal: Segmentation fault^M +----- Backtrace -----^M +0x1027d3e7 gdb_internal_backtrace_1^M + src/gdb/bt-utils.c:122^M +0x1027d54f _Z22gdb_internal_backtracev^M + src/gdb/bt-utils.c:168^M +0x1057643f handle_fatal_signal^M + src/gdb/event-top.c:889^M +0x10576677 handle_sigsegv^M + src/gdb/event-top.c:962^M +0x3fffa7610477 ???^M +0x103f2144 for_each_block^M + src/gdb/dcache.c:199^M +0x103f235b _Z17dcache_invalidateP13dcache_struct^M + src/gdb/dcache.c:251^M +0x10bde8c7 _Z24target_dcache_invalidatev^M + src/gdb/target-dcache.c:50^M +... +or similar. + +The root cause for the segmentation fault is that linux_is_uclinux gives an +incorrect result: it should always return false, given that we're running on a +regular linux system, but instead it returns first true, then false. + +In more detail, the segmentation fault happens as follows: +- a program space with an address space is created +- a second program space is about to be created. maybe_new_address_space + is called, and because linux_is_uclinux returns true, maybe_new_address_space + returns false, and no new address space is created +- a second program space with the same address space is created +- a program space is deleted. Because linux_is_uclinux now returns false, + gdbarch_has_shared_address_space (current_inferior ()->arch ()) returns + false, and the address space is deleted +- when gdb uses the address space of the remaining program space, we run into + the segfault, because the address space is deleted. + +Hardcoding linux_is_uclinux to false makes the test-case pass. + +We leave addressing the root cause for the following commit in this series. + +For now, prevent the segmentation fault by making the address space a refcounted +object. + +This was already suggested here [1]: +... +A better solution might be to have the address spaces be reference counted +... + +Tested on top of trunk on x86_64-linux and ppc64le-linux. +Tested on top of gdb-14-branch on ppc64-linux. + +Co-Authored-By: Simon Marchi + +PR gdb/30547 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30547 + +[1] https://sourceware.org/pipermail/gdb-patches/2023-October/202928.html +--- + gdb/breakpoint.c | 29 ++++++++------- + gdb/inferior.c | 8 ++--- + gdb/inferior.h | 2 +- + gdb/infrun.c | 18 +++++----- + gdb/linux-nat.c | 2 +- + gdb/process-stratum-target.c | 2 +- + gdb/progspace.c | 22 +++++------- + gdb/progspace.h | 64 +++++++++++++++++++++------------- + gdb/record-btrace.c | 2 +- + gdb/regcache.c | 2 +- + gdb/scoped-mock-context.h | 2 +- + gdb/target-dcache.c | 11 +++--- + gdbsupport/refcounted-object.h | 17 +++++++++ + 13 files changed, 102 insertions(+), 79 deletions(-) + +diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c +index 01f187ca4fe..a22bdb091cd 100644 +--- a/gdb/breakpoint.c ++++ b/gdb/breakpoint.c +@@ -1723,7 +1723,7 @@ one_breakpoint_xfer_memory (gdb_byte *readbuf, gdb_byte *writebuf, + int bptoffset = 0; + + if (!breakpoint_address_match (target_info->placed_address_space, 0, +- current_program_space->aspace, 0)) ++ current_program_space->aspace.get (), 0)) + { + /* The breakpoint is inserted in a different address space. */ + return; +@@ -2409,7 +2409,7 @@ should_be_inserted (struct bp_location *bl) + a breakpoint. */ + if ((bl->loc_type == bp_loc_software_breakpoint + || bl->loc_type == bp_loc_hardware_breakpoint) +- && stepping_past_instruction_at (bl->pspace->aspace, ++ && stepping_past_instruction_at (bl->pspace->aspace.get (), + bl->address) + /* The single-step breakpoint may be inserted at the location + we're trying to step if the instruction branches to itself. +@@ -2847,7 +2847,7 @@ insert_bp_location (struct bp_location *bl, + read the breakpoint instead of returning the data saved in + the breakpoint location's shadow contents. */ + bl->target_info.reqstd_address = bl->address; +- bl->target_info.placed_address_space = bl->pspace->aspace; ++ bl->target_info.placed_address_space = bl->pspace->aspace.get (); + bl->target_info.length = bl->length; + + /* When working with target-side conditions, we must pass all the conditions +@@ -4429,7 +4429,7 @@ bp_location_inserted_here_p (const struct bp_location *bl, + const address_space *aspace, CORE_ADDR pc) + { + if (bl->inserted +- && breakpoint_address_match (bl->pspace->aspace, bl->address, ++ && breakpoint_address_match (bl->pspace->aspace.get (), bl->address, + aspace, pc)) + { + /* An unmapped overlay can't be a match. */ +@@ -4508,7 +4508,7 @@ hardware_watchpoint_inserted_in_range (const address_space *aspace, + continue; + + for (bp_location &loc : bpt.locations ()) +- if (loc.pspace->aspace == aspace && loc.inserted) ++ if (loc.pspace->aspace.get () == aspace && loc.inserted) + { + CORE_ADDR l, h; + +@@ -7330,10 +7330,10 @@ breakpoint_location_address_match (struct bp_location *bl, + const address_space *aspace, + CORE_ADDR addr) + { +- return (breakpoint_address_match (bl->pspace->aspace, bl->address, ++ return (breakpoint_address_match (bl->pspace->aspace.get (), bl->address, + aspace, addr) + || (bl->length +- && breakpoint_address_match_range (bl->pspace->aspace, ++ && breakpoint_address_match_range (bl->pspace->aspace.get (), + bl->address, bl->length, + aspace, addr))); + } +@@ -7350,7 +7350,7 @@ breakpoint_location_address_range_overlap (struct bp_location *bl, + CORE_ADDR addr, int len) + { + if (gdbarch_has_global_breakpoints (target_gdbarch ()) +- || bl->pspace->aspace == aspace) ++ || bl->pspace->aspace.get () == aspace) + { + int bl_len = bl->length != 0 ? bl->length : 1; + +@@ -7407,8 +7407,10 @@ breakpoint_locations_match (const struct bp_location *loc1, + /* We compare bp_location.length in order to cover ranged + breakpoints. Keep this in sync with + bp_location_is_less_than. */ +- return (breakpoint_address_match (loc1->pspace->aspace, loc1->address, +- loc2->pspace->aspace, loc2->address) ++ return (breakpoint_address_match (loc1->pspace->aspace.get (), ++ loc1->address, ++ loc2->pspace->aspace.get (), ++ loc2->address) + && (loc1->loc_type == loc2->loc_type || sw_hw_bps_match) + && loc1->length == loc2->length); + } +@@ -9568,8 +9570,9 @@ ranged_breakpoint::breakpoint_hit (const struct bp_location *bl, + || ws.sig () != GDB_SIGNAL_TRAP) + return 0; + +- return breakpoint_address_match_range (bl->pspace->aspace, bl->address, +- bl->length, aspace, bp_addr); ++ return breakpoint_address_match_range (bl->pspace->aspace.get (), ++ bl->address, bl->length, aspace, ++ bp_addr); + } + + /* Implement the "resources_needed" method for ranged breakpoints. */ +@@ -12018,7 +12021,7 @@ code_breakpoint::breakpoint_hit (const struct bp_location *bl, + || ws.sig () != GDB_SIGNAL_TRAP) + return 0; + +- if (!breakpoint_address_match (bl->pspace->aspace, bl->address, ++ if (!breakpoint_address_match (bl->pspace->aspace.get (), bl->address, + aspace, bp_addr)) + return 0; + +diff --git a/gdb/inferior.c b/gdb/inferior.c +index 550bbd2827c..461f4fc076a 100644 +--- a/gdb/inferior.c ++++ b/gdb/inferior.c +@@ -831,15 +831,13 @@ remove_inferior_command (const char *args, int from_tty) + struct inferior * + add_inferior_with_spaces (void) + { +- struct address_space *aspace; + struct program_space *pspace; + struct inferior *inf; + + /* If all inferiors share an address space on this system, this + doesn't really return a new address space; otherwise, it + really does. */ +- aspace = maybe_new_address_space (); +- pspace = new program_space (aspace); ++ pspace = new program_space (maybe_new_address_space ()); + inf = add_inferior (0); + inf->pspace = pspace; + inf->aspace = pspace->aspace; +@@ -1002,15 +1000,13 @@ clone_inferior_command (const char *args, int from_tty) + + for (i = 0; i < copies; ++i) + { +- struct address_space *aspace; + struct program_space *pspace; + struct inferior *inf; + + /* If all inferiors share an address space on this system, this + doesn't really return a new address space; otherwise, it + really does. */ +- aspace = maybe_new_address_space (); +- pspace = new program_space (aspace); ++ pspace = new program_space (maybe_new_address_space ()); + inf = add_inferior (0); + inf->pspace = pspace; + inf->aspace = pspace->aspace; +diff --git a/gdb/inferior.h b/gdb/inferior.h +index 29c90d15efa..4139791740f 100644 +--- a/gdb/inferior.h ++++ b/gdb/inferior.h +@@ -577,7 +577,7 @@ class inferior : public refcounted_object, + bool removable = false; + + /* The address space bound to this inferior. */ +- struct address_space *aspace = NULL; ++ address_space_ref_ptr aspace; + + /* The program space bound to this inferior. */ + struct program_space *pspace = NULL; +diff --git a/gdb/infrun.c b/gdb/infrun.c +index 7be98cfc252..3854c66bf6c 100644 +--- a/gdb/infrun.c ++++ b/gdb/infrun.c +@@ -531,8 +531,8 @@ holding the child stopped. Try \"set detach-on-fork\" or \ + } + else + { +- child_inf->aspace = new address_space (); +- child_inf->pspace = new program_space (child_inf->aspace); ++ child_inf->pspace = new program_space (new_address_space ()); ++ child_inf->aspace = child_inf->pspace->aspace; + child_inf->removable = true; + clone_program_space (child_inf->pspace, parent_inf->pspace); + } +@@ -610,8 +610,8 @@ holding the child stopped. Try \"set detach-on-fork\" or \ + + child_inf->aspace = parent_inf->aspace; + child_inf->pspace = parent_inf->pspace; +- parent_inf->aspace = new address_space (); +- parent_inf->pspace = new program_space (parent_inf->aspace); ++ parent_inf->pspace = new program_space (new_address_space ()); ++ parent_inf->aspace = parent_inf->pspace->aspace; + clone_program_space (parent_inf->pspace, child_inf->pspace); + + /* The parent inferior is still the current one, so keep things +@@ -620,8 +620,8 @@ holding the child stopped. Try \"set detach-on-fork\" or \ + } + else + { +- child_inf->aspace = new address_space (); +- child_inf->pspace = new program_space (child_inf->aspace); ++ child_inf->pspace = new program_space (new_address_space ()); ++ child_inf->aspace = child_inf->pspace->aspace; + child_inf->removable = true; + child_inf->symfile_flags = SYMFILE_NO_READ; + clone_program_space (child_inf->pspace, parent_inf->pspace); +@@ -1031,7 +1031,6 @@ handle_vfork_child_exec_or_exit (int exec) + if (vfork_parent->pending_detach) + { + struct program_space *pspace; +- struct address_space *aspace; + + /* follow-fork child, detach-on-fork on. */ + +@@ -1056,9 +1055,8 @@ handle_vfork_child_exec_or_exit (int exec) + of" a hack. */ + + pspace = inf->pspace; +- aspace = inf->aspace; +- inf->aspace = nullptr; + inf->pspace = nullptr; ++ address_space_ref_ptr aspace = std::move (inf->aspace); + + if (print_inferior_events) + { +@@ -5906,7 +5904,7 @@ handle_inferior_event (struct execution_control_state *ecs) + = get_thread_arch_aspace_regcache (parent_inf, + ecs->ws.child_ptid (), + gdbarch, +- parent_inf->aspace); ++ parent_inf->aspace.get ()); + /* Read PC value of parent process. */ + parent_pc = regcache_read_pc (regcache); + +diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c +index ed445c5e5bb..c8991cc3da4 100644 +--- a/gdb/linux-nat.c ++++ b/gdb/linux-nat.c +@@ -4365,7 +4365,7 @@ linux_nat_target::thread_address_space (ptid_t ptid) + + inf = find_inferior_pid (this, pid); + gdb_assert (inf != NULL); +- return inf->aspace; ++ return inf->aspace.get (); + } + + /* Return the cached value of the processor core for thread PTID. */ +diff --git a/gdb/process-stratum-target.c b/gdb/process-stratum-target.c +index 5c031203e89..4bcca4f39c2 100644 +--- a/gdb/process-stratum-target.c ++++ b/gdb/process-stratum-target.c +@@ -37,7 +37,7 @@ process_stratum_target::thread_address_space (ptid_t ptid) + "address space of thread %s\n"), + target_pid_to_str (ptid).c_str ()); + +- return inf->aspace; ++ return inf->aspace.get (); + } + + struct gdbarch * +diff --git a/gdb/progspace.c b/gdb/progspace.c +index 1dbcd5875dd..b4d25ba6196 100644 +--- a/gdb/progspace.c ++++ b/gdb/progspace.c +@@ -55,8 +55,8 @@ address_space::address_space () + return a pointer to an existing address space, in case inferiors + share an address space on this target system. */ + +-struct address_space * +-maybe_new_address_space (void) ++address_space_ref_ptr ++maybe_new_address_space () + { + int shared_aspace = gdbarch_has_shared_address_space (target_gdbarch ()); + +@@ -66,7 +66,7 @@ maybe_new_address_space (void) + return program_spaces[0]->aspace; + } + +- return new address_space (); ++ return new_address_space (); + } + + /* Start counting over from scratch. */ +@@ -94,9 +94,9 @@ remove_program_space (program_space *pspace) + + /* See progspace.h. */ + +-program_space::program_space (address_space *aspace_) ++program_space::program_space (address_space_ref_ptr aspace_) + : num (++last_program_space_num), +- aspace (aspace_) ++ aspace (std::move (aspace_)) + { + program_spaces.push_back (this); + gdb::observers::new_program_space.notify (this); +@@ -121,8 +121,6 @@ program_space::~program_space () + /* Defer breakpoint re-set because we don't want to create new + locations for this pspace which we're tearing down. */ + clear_symtab_users (SYMFILE_DEFER_BP_RESET); +- if (!gdbarch_has_shared_address_space (target_gdbarch ())) +- delete this->aspace; + } + + /* See progspace.h. */ +@@ -408,18 +406,14 @@ update_address_spaces (void) + + if (shared_aspace) + { +- struct address_space *aspace = new address_space (); ++ address_space_ref_ptr aspace = new_address_space (); + +- delete current_program_space->aspace; + for (struct program_space *pspace : program_spaces) + pspace->aspace = aspace; + } + else + for (struct program_space *pspace : program_spaces) +- { +- delete pspace->aspace; +- pspace->aspace = new address_space (); +- } ++ pspace->aspace = new_address_space (); + + for (inferior *inf : all_inferiors ()) + if (gdbarch_has_global_solist (target_gdbarch ())) +@@ -456,5 +450,5 @@ initialize_progspace (void) + modules have done that. Do this before + initialize_current_architecture, because that accesses the ebfd + of current_program_space. */ +- current_program_space = new program_space (new address_space ()); ++ current_program_space = new program_space (new_address_space ()); + } +diff --git a/gdb/progspace.h b/gdb/progspace.h +index ee12d89c173..12f113f6d9c 100644 +--- a/gdb/progspace.h ++++ b/gdb/progspace.h +@@ -28,6 +28,8 @@ + #include "solist.h" + #include "gdbsupport/next-iterator.h" + #include "gdbsupport/safe-iterator.h" ++#include "gdbsupport/refcounted-object.h" ++#include "gdbsupport/gdb_ref_ptr.h" + #include + #include + +@@ -42,6 +44,40 @@ struct so_list; + + typedef std::list> objfile_list; + ++/* An address space. It is used for comparing if ++ pspaces/inferior/threads see the same address space and for ++ associating caches to each address space. */ ++struct address_space : public refcounted_object ++{ ++ /* Create a new address space object, and add it to the list. */ ++ address_space (); ++ DISABLE_COPY_AND_ASSIGN (address_space); ++ ++ /* Returns the integer address space id of this address space. */ ++ int num () const ++ { ++ return m_num; ++ } ++ ++ /* Per aspace data-pointers required by other GDB modules. */ ++ registry registry_fields; ++ ++private: ++ int m_num; ++}; ++ ++using address_space_ref_ptr ++ = gdb::ref_ptr>; ++ ++/* Create a new address space. */ ++ ++static inline address_space_ref_ptr ++new_address_space () ++{ ++ return address_space_ref_ptr::new_reference (new address_space); ++} ++ + /* An iterator that wraps an iterator over std::unique_ptr, + and dereferences the returned object. This is useful for iterating + over a list of shared pointers and returning raw pointers -- which +@@ -191,7 +227,7 @@ struct program_space + { + /* Constructs a new empty program space, binds it to ASPACE, and + adds it to the program space list. */ +- explicit program_space (address_space *aspace); ++ explicit program_space (address_space_ref_ptr aspace); + + /* Releases a program space, and all its contents (shared libraries, + objfiles, and any other references to the program space in other +@@ -336,7 +372,7 @@ struct program_space + are global, then this field is ignored (we don't currently + support inferiors sharing a program space if the target doesn't + make breakpoints global). */ +- struct address_space *aspace = NULL; ++ address_space_ref_ptr aspace; + + /* True if this program space's section offsets don't yet represent + the final offsets of the "live" address space (that is, the +@@ -383,28 +419,6 @@ struct program_space + target_section_table m_target_sections; + }; + +-/* An address space. It is used for comparing if +- pspaces/inferior/threads see the same address space and for +- associating caches to each address space. */ +-struct address_space +-{ +- /* Create a new address space object, and add it to the list. */ +- address_space (); +- DISABLE_COPY_AND_ASSIGN (address_space); +- +- /* Returns the integer address space id of this address space. */ +- int num () const +- { +- return m_num; +- } +- +- /* Per aspace data-pointers required by other GDB modules. */ +- registry registry_fields; +- +-private: +- int m_num; +-}; +- + /* The list of all program spaces. There's always at least one. */ + extern std::vectorprogram_spaces; + +@@ -447,7 +461,7 @@ class scoped_restore_current_program_space + /* Maybe create a new address space object, and add it to the list, or + return a pointer to an existing address space, in case inferiors + share an address space. */ +-extern struct address_space *maybe_new_address_space (void); ++extern address_space_ref_ptr maybe_new_address_space (); + + /* Update all program spaces matching to address spaces. The user may + have created several program spaces, and loaded executables into +diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c +index 97447d3e8f8..a4d6c1b5bf2 100644 +--- a/gdb/record-btrace.c ++++ b/gdb/record-btrace.c +@@ -2321,7 +2321,7 @@ record_btrace_replay_at_breakpoint (struct thread_info *tp) + if (insn == NULL) + return 0; + +- return record_check_stopped_by_breakpoint (tp->inf->aspace, insn->pc, ++ return record_check_stopped_by_breakpoint (tp->inf->aspace.get (), insn->pc, + &btinfo->stop_reason); + } + +diff --git a/gdb/regcache.c b/gdb/regcache.c +index 91b20b7a2a2..a78fe0a80e7 100644 +--- a/gdb/regcache.c ++++ b/gdb/regcache.c +@@ -1628,7 +1628,7 @@ get_thread_arch_aspace_regcache_and_check (inferior *inf_for_target_calls, + the current inferior's gdbarch. Also use the current inferior's address + space. */ + gdbarch *arch = inf_for_target_calls->gdbarch; +- address_space *aspace = inf_for_target_calls->aspace; ++ address_space *aspace = inf_for_target_calls->aspace.get (); + regcache *regcache = get_thread_arch_aspace_regcache (inf_for_target_calls, + ptid, arch, aspace); + +diff --git a/gdb/scoped-mock-context.h b/gdb/scoped-mock-context.h +index 9ad7ebf5f0c..5f25dc7ed6b 100644 +--- a/gdb/scoped-mock-context.h ++++ b/gdb/scoped-mock-context.h +@@ -38,7 +38,7 @@ struct scoped_mock_context + + Target mock_target; + ptid_t mock_ptid {1, 1}; +- program_space mock_pspace {new address_space ()}; ++ program_space mock_pspace {new_address_space ()}; + inferior mock_inferior {mock_ptid.pid ()}; + thread_info mock_thread {&mock_inferior, mock_ptid}; + +diff --git a/gdb/target-dcache.c b/gdb/target-dcache.c +index 13c2888e7ea..b1b772ab76e 100644 +--- a/gdb/target-dcache.c ++++ b/gdb/target-dcache.c +@@ -33,7 +33,7 @@ int + target_dcache_init_p (void) + { + DCACHE *dcache +- = target_dcache_aspace_key.get (current_program_space->aspace); ++ = target_dcache_aspace_key.get (current_program_space->aspace.get ()); + + return (dcache != NULL); + } +@@ -44,7 +44,7 @@ void + target_dcache_invalidate (void) + { + DCACHE *dcache +- = target_dcache_aspace_key.get (current_program_space->aspace); ++ = target_dcache_aspace_key.get (current_program_space->aspace.get ()); + + if (dcache != NULL) + dcache_invalidate (dcache); +@@ -56,7 +56,7 @@ target_dcache_invalidate (void) + DCACHE * + target_dcache_get (void) + { +- return target_dcache_aspace_key.get (current_program_space->aspace); ++ return target_dcache_aspace_key.get (current_program_space->aspace.get ()); + } + + /* Return the target dcache. If it is not initialized yet, initialize +@@ -66,12 +66,13 @@ DCACHE * + target_dcache_get_or_init (void) + { + DCACHE *dcache +- = target_dcache_aspace_key.get (current_program_space->aspace); ++ = target_dcache_aspace_key.get (current_program_space->aspace.get ()); + + if (dcache == NULL) + { + dcache = dcache_init (); +- target_dcache_aspace_key.set (current_program_space->aspace, dcache); ++ target_dcache_aspace_key.set (current_program_space->aspace.get (), ++ dcache); + } + + return dcache; +diff --git a/gdbsupport/refcounted-object.h b/gdbsupport/refcounted-object.h +index d8fdb950043..294fd873df1 100644 +--- a/gdbsupport/refcounted-object.h ++++ b/gdbsupport/refcounted-object.h +@@ -67,4 +67,21 @@ struct refcounted_object_ref_policy + } + }; + ++/* A policy class to interface gdb::ref_ptr with a refcounted_object, that ++ deletes the object once the refcount reaches 0.. */ ++ ++template ++struct refcounted_object_delete_ref_policy ++{ ++ static void incref (T *obj) ++ { obj->incref (); } ++ ++ static void decref (T *obj) ++ { ++ obj->decref (); ++ if (obj->refcount () == 0) ++ delete obj; ++ } ++}; ++ + #endif /* COMMON_REFCOUNTED_OBJECT_H */ + +base-commit: 0bb6f49bb9ad577667075550ca2ad4cb49931078 +-- +2.35.3 + diff --git a/gdb-fix-segfault-in-for_each_block-part-2.patch b/gdb-fix-segfault-in-for_each_block-part-2.patch new file mode 100644 index 0000000..00df214 --- /dev/null +++ b/gdb-fix-segfault-in-for_each_block-part-2.patch @@ -0,0 +1,168 @@ +From 3490f51a80a10d46dc1885ba672d9390a8221170 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 2 Nov 2023 14:51:02 +0100 +Subject: [PATCH] Fix segfault in for_each_block, part 2 + +The previous commit describes PR gdb/30547, a segfault when running test-case +gdb.base/vfork-follow-parent.exp on powerpc64 (likewise on s390x). + +The root cause for the segmentation fault is that linux_is_uclinux gives an +incorrect result: it returns true instead of false. + +So, why does linux_is_uclinux: +... +int +linux_is_uclinux (void) +{ + CORE_ADDR dummy; + + return (target_auxv_search (AT_NULL, &dummy) > 0 + && target_auxv_search (AT_PAGESZ, &dummy) == 0); +... +return true? + +This is because ppc_linux_target_wordsize returns 4 instead of 8, causing +ppc_linux_nat_target::auxv_parse to misinterpret the auxv vector. + +So, why does ppc_linux_target_wordsize: +... +int +ppc_linux_target_wordsize (int tid) +{ + int wordsize = 4; + + /* Check for 64-bit inferior process. This is the case when the host is + 64-bit, and in addition the top bit of the MSR register is set. */ + long msr; + + errno = 0; + msr = (long) ptrace (PTRACE_PEEKUSER, tid, PT_MSR * 8, 0); + if (errno == 0 && ppc64_64bit_inferior_p (msr)) + wordsize = 8; + + return wordsize; +} +... +return 4? + +Specifically, we get this result because because tid == 0, so we get +errno == ESRCH. + +The tid == 0 is caused by the switch_to_no_thread in +handle_vfork_child_exec_or_exit: +... + /* Switch to no-thread while running clone_program_space, so + that clone_program_space doesn't want to read the + selected frame of a dead process. */ + scoped_restore_current_thread restore_thread; + switch_to_no_thread (); + + inf->pspace = new program_space (maybe_new_address_space ()); +... +but moving the maybe_new_address_space call to before that gives us the +same result. The tid is no longer 0, but we still get ESRCH because the +thread has exited. + +Fix this in handle_vfork_child_exec_or_exit by doing the +maybe_new_address_space call in the context of the vfork parent. + +Tested on top of trunk on x86_64-linux and ppc64le-linux. +Tested on top of gdb-14-branch on ppc64-linux. + +Co-Authored-By: Simon Marchi + +PR gdb/30547 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30547 +--- + gdb/infrun.c | 16 +++++++++++----- + gdb/nat/ppc-linux.c | 2 ++ + gdb/ppc-linux-nat.c | 2 ++ + gdb/s390-linux-nat.c | 5 ++++- + 4 files changed, 19 insertions(+), 6 deletions(-) + +diff --git a/gdb/infrun.c b/gdb/infrun.c +index 3854c66bf6c..d259e81df84 100644 +--- a/gdb/infrun.c ++++ b/gdb/infrun.c +@@ -1105,13 +1105,19 @@ handle_vfork_child_exec_or_exit (int exec) + go ahead and create a new one for this exiting + inferior. */ + +- /* Switch to no-thread while running clone_program_space, so +- that clone_program_space doesn't want to read the +- selected frame of a dead process. */ + scoped_restore_current_thread restore_thread; +- switch_to_no_thread (); + +- inf->pspace = new program_space (maybe_new_address_space ()); ++ /* Temporarily switch to the vfork parent, to facilitate ptrace ++ calls done during maybe_new_address_space. */ ++ switch_to_thread (any_live_thread_of_inferior (vfork_parent)); ++ address_space_ref_ptr aspace = maybe_new_address_space (); ++ ++ /* Switch back to the vfork child inferior. Switch to no-thread ++ while running clone_program_space, so that clone_program_space ++ doesn't want to read the selected frame of a dead process. */ ++ switch_to_inferior_no_thread (inf); ++ ++ inf->pspace = new program_space (std::move (aspace)); + inf->aspace = inf->pspace->aspace; + set_current_program_space (inf->pspace); + inf->removable = true; +diff --git a/gdb/nat/ppc-linux.c b/gdb/nat/ppc-linux.c +index 0957d1b58a7..74549754806 100644 +--- a/gdb/nat/ppc-linux.c ++++ b/gdb/nat/ppc-linux.c +@@ -78,6 +78,8 @@ ppc64_64bit_inferior_p (long msr) + int + ppc_linux_target_wordsize (int tid) + { ++ gdb_assert (tid != 0); ++ + int wordsize = 4; + + /* Check for 64-bit inferior process. This is the case when the host is +diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c +index d14aba694e5..817505ea73e 100644 +--- a/gdb/ppc-linux-nat.c ++++ b/gdb/ppc-linux-nat.c +@@ -1914,6 +1914,8 @@ ppc_linux_nat_target::auxv_parse (const gdb_byte **readptr, + const gdb_byte *endptr, CORE_ADDR *typep, + CORE_ADDR *valp) + { ++ gdb_assert (inferior_ptid != null_ptid); ++ + int tid = inferior_ptid.lwp (); + if (tid == 0) + tid = inferior_ptid.pid (); +diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c +index 8f54e9f6322..54167f49480 100644 +--- a/gdb/s390-linux-nat.c ++++ b/gdb/s390-linux-nat.c +@@ -949,10 +949,12 @@ s390_target_wordsize (void) + /* Check for 64-bit inferior process. This is the case when the host is + 64-bit, and in addition bit 32 of the PSW mask is set. */ + #ifdef __s390x__ ++ int tid = s390_inferior_tid (); ++ gdb_assert (tid != 0); + long pswm; + + errno = 0; +- pswm = (long) ptrace (PTRACE_PEEKUSER, s390_inferior_tid (), PT_PSWMASK, 0); ++ pswm = (long) ptrace (PTRACE_PEEKUSER, tid, PT_PSWMASK, 0); + if (errno == 0 && (pswm & 0x100000000ul) != 0) + wordsize = 8; + #endif +@@ -965,6 +967,7 @@ s390_linux_nat_target::auxv_parse (const gdb_byte **readptr, + const gdb_byte *endptr, CORE_ADDR *typep, + CORE_ADDR *valp) + { ++ gdb_assert (inferior_ptid != null_ptid); + int sizeof_auxv_field = s390_target_wordsize (); + enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ()); + const gdb_byte *ptr = *readptr; + +base-commit: 1d02ba0f4adcba2595a67e88fb1ba6d35c7f8e5b +-- +2.35.3 + diff --git a/gdb-ftbs-swapped-calloc-args.patch b/gdb-ftbs-swapped-calloc-args.patch new file mode 100644 index 0000000..30d4a4a --- /dev/null +++ b/gdb-ftbs-swapped-calloc-args.patch @@ -0,0 +1,42 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Kevin Buettner +Date: Wed, 17 Jan 2024 12:53:53 -0700 +Subject: gdb-ftbs-swapped-calloc-args.patch + +Backport upstream commit 54195469c18ec9873cc5ba6907f768509473fa9b +which fixes a build problem in which arguments to calloc were swapped. + +[opcodes] ARC + PPC: Fix -Walloc-size warnings + +Recently, -Walloc-size warnings started to kick in. Fix these two +calloc() calls to match the intended usage pattern. + +opcodes/ChangeLog: + + * arc-dis.c (init_arc_disasm_info): Fix calloc() call. + * ppc-dis.c (powerpc_init_dialect): Ditto. + +diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c +--- a/opcodes/arc-dis.c ++++ b/opcodes/arc-dis.c +@@ -147,7 +147,7 @@ static bool + init_arc_disasm_info (struct disassemble_info *info) + { + struct arc_disassemble_info *arc_infop +- = calloc (sizeof (*arc_infop), 1); ++ = calloc (1, sizeof (*arc_infop)); + + if (arc_infop == NULL) + return false; +diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c +--- a/opcodes/ppc-dis.c ++++ b/opcodes/ppc-dis.c +@@ -348,7 +348,7 @@ powerpc_init_dialect (struct disassemble_info *info) + { + ppc_cpu_t dialect = 0; + ppc_cpu_t sticky = 0; +- struct dis_private *priv = calloc (sizeof (*priv), 1); ++ struct dis_private *priv = calloc (1, sizeof (*priv)); + + if (priv == NULL) + return; diff --git a/gdb-gcore-bash.patch b/gdb-gcore-bash.patch new file mode 100644 index 0000000..724b5ea --- /dev/null +++ b/gdb-gcore-bash.patch @@ -0,0 +1,10 @@ +diff --git a/gdb/gcore.in b/gdb/gcore.in +index b9770ea415..3149f6e1fe 100644 +--- a/gdb/gcore.in ++++ b/gdb/gcore.in +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/bin/bash + + # Copyright (C) 2003-2023 Free Software Foundation, Inc. + diff --git a/gdb-glibc-strstr-workaround.patch b/gdb-glibc-strstr-workaround.patch new file mode 100644 index 0000000..c2f50ff --- /dev/null +++ b/gdb-glibc-strstr-workaround.patch @@ -0,0 +1,132 @@ +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-glibc-strstr-workaround.patch + +;; Workaround PR libc/14166 for inferior calls of strstr. +;;=fedoratest: Compatibility with RHELs (unchecked which ones). + +diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp +@@ -0,0 +1,119 @@ ++# Copyright (C) 2012 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# Workaround for: ++# invalid IFUNC DW_AT_linkage_name: memmove strstr time ++# http://sourceware.org/bugzilla/show_bug.cgi?id=14166 ++ ++if {[skip_shlib_tests]} { ++ return 0 ++} ++ ++set testfile "gnu-ifunc-strstr-workaround" ++set executable ${testfile} ++set srcfile start.c ++set binfile [standard_output_file ${executable}] ++ ++if [prepare_for_testing ${testfile}.exp $executable $srcfile] { ++ return -1 ++} ++ ++if ![runto_main] { ++ return 0 ++} ++ ++set test "ptype atoi" ++gdb_test_multiple $test $test { ++ -re "type = int \\(const char \\*\\)\r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re "type = int \\(\\)\r\n$gdb_prompt $" { ++ untested "$test (no DWARF)" ++ return 0 ++ } ++ -re "type = \\(\\)\r\n$gdb_prompt $" { ++ untested "$test (no DWARF)" ++ return 0 ++ } ++} ++ ++set addr "" ++set test "print strstr" ++gdb_test_multiple $test $test { ++ -re " = {} (0x\[0-9a-f\]+) \r\n$gdb_prompt $" { ++ set addr $expect_out(1,string) ++ pass $test ++ } ++ -re " = {} (0x\[0-9a-f\]+) <__strstr>\r\n$gdb_prompt $" { ++ set addr $expect_out(1,string) ++ pass "$test (GDB workaround)" ++ } ++ -re " = {} (0x\[0-9a-f\]+) <__libc_strstr>\r\n$gdb_prompt $" { ++ set addr $expect_out(1,string) ++ pass "$test (fixed glibc)" ++ } ++ -re " = {} (0x\[0-9a-f\]+) <__libc_strstr_ifunc>\r\n$gdb_prompt $" { ++ set addr $expect_out(1,string) ++ pass "$test (fixed glibc)" ++ } ++ -re " = {char \\*\\(const char \\*, const char \\*\\)} 0x\[0-9a-f\]+ \r\n$gdb_prompt $" { ++ untested "$test (gnu-ifunc not in use by glibc)" ++ return 0 ++ } ++} ++ ++set test "info sym" ++gdb_test_multiple "info sym $addr" $test { ++ -re "strstr in section \\.text of /lib\[^/\]*/libc.so.6\r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re " = {char \\*\\(const char \\*, const char \\*\\)} 0x\[0-9a-f\]+ \r\n$gdb_prompt $" { ++ # unexpected ++ xfail "$test (not in libc.so.6)" ++ return 0 ++ } ++} ++ ++set test "info addr strstr" ++gdb_test_multiple $test $test { ++ -re "Symbol \"strstr\" is a function at address $addr\\.\r\n$gdb_prompt $" { ++ fail "$test (DWARF for strstr)" ++ } ++ -re "Symbol \"strstr\" is at $addr in a file compiled without debugging\\.\r\n$gdb_prompt $" { ++ pass "$test" ++ } ++} ++ ++set test "print strstr second time" ++gdb_test_multiple "print strstr" $test { ++ -re " = {} $addr \r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re " = {} $addr <__strstr>\r\n$gdb_prompt $" { ++ pass "$test (GDB workaround)" ++ } ++ -re " = {} $addr <__libc_strstr>\r\n$gdb_prompt $" { ++ pass "$test (fixed glibc)" ++ } ++ -re " = {} $addr <__libc_strstr_ifunc>\r\n$gdb_prompt $" { ++ pass "$test (fixed glibc)" ++ } ++ -re " = {void \\*\\(void\\)} 0x\[0-9a-f\]+ \r\n$gdb_prompt $" { ++ fail $test ++ } ++} ++ ++gdb_test {print (char *)strstr("abc","b")} { = 0x[0-9a-f]+ "bc"} ++gdb_test {print (char *)strstr("def","e")} { = 0x[0-9a-f]+ "ef"} diff --git a/gdb-gstack.man b/gdb-gstack.man new file mode 100644 index 0000000..f5bcea6 --- /dev/null +++ b/gdb-gstack.man @@ -0,0 +1,48 @@ +.\" +.\" gstack manual page. +.\" Copyright (c) 1999 Ross Thompson +.\" Copyright (c) 2001, 2002, 2004, 2008 Red Hat, Inc. +.\" +.\" Original author: Ross Thompson +.\" +.\" 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, 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; see the file COPYING. If not, write to +.\" the Free Software Foundation, 59 Temple Place - Suite 330, +.\" Boston, MA 02111-1307, USA. +.\" +.TH GSTACK 1 "Feb 15 2008" "Red Hat Linux" "Linux Programmer's Manual" + +.SH NAME +gstack \- print a stack trace of a running process + +.SH SYNOPSIS +.B gstack +pid + +.SH DESCRIPTION + +\f3gstack\f1 attaches to the active process named by the \f3pid\f1 on +the command line, and prints out an execution stack trace. If ELF +symbols exist in the binary (usually the case unless you have run +strip(1)), then symbolic addresses are printed as well. + +If the process is part of a thread group, then \f3gstack\f1 will print +out a stack trace for each of the threads in the group. + +.SH SEE ALSO +nm(1), ptrace(2), gdb(1) + +.SH AUTHORS +Ross Thompson + +Red Hat, Inc. diff --git a/gdb-linux_perf-bundle.patch b/gdb-linux_perf-bundle.patch new file mode 100644 index 0000000..36dbe9f --- /dev/null +++ b/gdb-linux_perf-bundle.patch @@ -0,0 +1,226 @@ +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-linux_perf-bundle.patch + +;; [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). +;;=fedora + +diff --git a/gdb/gdb.c b/gdb/gdb.c +--- a/gdb/gdb.c ++++ b/gdb/gdb.c +@@ -21,6 +21,10 @@ + #include "interps.h" + #include "run-on-main-thread.h" + ++#ifdef PERF_ATTR_SIZE_VER5_BUNDLE ++extern "C" void __libipt_init(void); ++#endif ++ + int + main (int argc, char **argv) + { +@@ -32,6 +36,10 @@ main (int argc, char **argv) + + struct captured_main_args args; + ++#ifdef PERF_ATTR_SIZE_VER5_BUNDLE ++ __libipt_init(); ++#endif ++ + memset (&args, 0, sizeof args); + args.argc = argc; + args.argv = argv; +diff --git a/gdb/nat/linux-btrace.h b/gdb/nat/linux-btrace.h +--- a/gdb/nat/linux-btrace.h ++++ b/gdb/nat/linux-btrace.h +@@ -28,6 +28,177 @@ + # include + #endif + ++#ifdef PERF_ATTR_SIZE_VER5_BUNDLE ++#ifndef HAVE_LINUX_PERF_EVENT_H ++# error "PERF_ATTR_SIZE_VER5_BUNDLE && !HAVE_LINUX_PERF_EVENT_H" ++#endif ++#ifndef PERF_ATTR_SIZE_VER5 ++#define PERF_ATTR_SIZE_VER5 ++#define perf_event_mmap_page perf_event_mmap_page_bundle ++// kernel-headers-3.10.0-493.el7.x86_64/usr/include/linux/perf_event.h ++/* ++ * Structure of the page that can be mapped via mmap ++ */ ++struct perf_event_mmap_page { ++ __u32 version; /* version number of this structure */ ++ __u32 compat_version; /* lowest version this is compat with */ ++ ++ /* ++ * Bits needed to read the hw events in user-space. ++ * ++ * u32 seq, time_mult, time_shift, index, width; ++ * u64 count, enabled, running; ++ * u64 cyc, time_offset; ++ * s64 pmc = 0; ++ * ++ * do { ++ * seq = pc->lock; ++ * barrier() ++ * ++ * enabled = pc->time_enabled; ++ * running = pc->time_running; ++ * ++ * if (pc->cap_usr_time && enabled != running) { ++ * cyc = rdtsc(); ++ * time_offset = pc->time_offset; ++ * time_mult = pc->time_mult; ++ * time_shift = pc->time_shift; ++ * } ++ * ++ * index = pc->index; ++ * count = pc->offset; ++ * if (pc->cap_user_rdpmc && index) { ++ * width = pc->pmc_width; ++ * pmc = rdpmc(index - 1); ++ * } ++ * ++ * barrier(); ++ * } while (pc->lock != seq); ++ * ++ * NOTE: for obvious reason this only works on self-monitoring ++ * processes. ++ */ ++ __u32 lock; /* seqlock for synchronization */ ++ __u32 index; /* hardware event identifier */ ++ __s64 offset; /* add to hardware event value */ ++ __u64 time_enabled; /* time event active */ ++ __u64 time_running; /* time event on cpu */ ++ union { ++ __u64 capabilities; ++ struct { ++ __u64 cap_bit0 : 1, /* Always 0, deprecated, see commit 860f085b74e9 */ ++ cap_bit0_is_deprecated : 1, /* Always 1, signals that bit 0 is zero */ ++ ++ cap_user_rdpmc : 1, /* The RDPMC instruction can be used to read counts */ ++ cap_user_time : 1, /* The time_* fields are used */ ++ cap_user_time_zero : 1, /* The time_zero field is used */ ++ cap_____res : 59; ++ }; ++ }; ++ ++ /* ++ * If cap_user_rdpmc this field provides the bit-width of the value ++ * read using the rdpmc() or equivalent instruction. This can be used ++ * to sign extend the result like: ++ * ++ * pmc <<= 64 - width; ++ * pmc >>= 64 - width; // signed shift right ++ * count += pmc; ++ */ ++ __u16 pmc_width; ++ ++ /* ++ * If cap_usr_time the below fields can be used to compute the time ++ * delta since time_enabled (in ns) using rdtsc or similar. ++ * ++ * u64 quot, rem; ++ * u64 delta; ++ * ++ * quot = (cyc >> time_shift); ++ * rem = cyc & (((u64)1 << time_shift) - 1); ++ * delta = time_offset + quot * time_mult + ++ * ((rem * time_mult) >> time_shift); ++ * ++ * Where time_offset,time_mult,time_shift and cyc are read in the ++ * seqcount loop described above. This delta can then be added to ++ * enabled and possible running (if index), improving the scaling: ++ * ++ * enabled += delta; ++ * if (index) ++ * running += delta; ++ * ++ * quot = count / running; ++ * rem = count % running; ++ * count = quot * enabled + (rem * enabled) / running; ++ */ ++ __u16 time_shift; ++ __u32 time_mult; ++ __u64 time_offset; ++ /* ++ * If cap_usr_time_zero, the hardware clock (e.g. TSC) can be calculated ++ * from sample timestamps. ++ * ++ * time = timestamp - time_zero; ++ * quot = time / time_mult; ++ * rem = time % time_mult; ++ * cyc = (quot << time_shift) + (rem << time_shift) / time_mult; ++ * ++ * And vice versa: ++ * ++ * quot = cyc >> time_shift; ++ * rem = cyc & (((u64)1 << time_shift) - 1); ++ * timestamp = time_zero + quot * time_mult + ++ * ((rem * time_mult) >> time_shift); ++ */ ++ __u64 time_zero; ++ __u32 size; /* Header size up to __reserved[] fields. */ ++ ++ /* ++ * Hole for extension of the self monitor capabilities ++ */ ++ ++ __u8 __reserved[118*8+4]; /* align to 1k. */ ++ ++ /* ++ * Control data for the mmap() data buffer. ++ * ++ * User-space reading the @data_head value should issue an smp_rmb(), ++ * after reading this value. ++ * ++ * When the mapping is PROT_WRITE the @data_tail value should be ++ * written by userspace to reflect the last read data, after issueing ++ * an smp_mb() to separate the data read from the ->data_tail store. ++ * In this case the kernel will not over-write unread data. ++ * ++ * See perf_output_put_handle() for the data ordering. ++ * ++ * data_{offset,size} indicate the location and size of the perf record ++ * buffer within the mmapped area. ++ */ ++ __u64 data_head; /* head in the data section */ ++ __u64 data_tail; /* user-space written tail */ ++ __u64 data_offset; /* where the buffer starts */ ++ __u64 data_size; /* data buffer size */ ++ ++ /* ++ * AUX area is defined by aux_{offset,size} fields that should be set ++ * by the userspace, so that ++ * ++ * aux_offset >= data_offset + data_size ++ * ++ * prior to mmap()ing it. Size of the mmap()ed area should be aux_size. ++ * ++ * Ring buffer pointers aux_{head,tail} have the same semantics as ++ * data_{head,tail} and same ordering rules apply. ++ */ ++ __u64 aux_head; ++ __u64 aux_tail; ++ __u64 aux_offset; ++ __u64 aux_size; ++}; ++#endif // PERF_ATTR_SIZE_VER5 ++#endif // PERF_ATTR_SIZE_VER5_BUNDLE ++ + struct target_ops; + + #if HAVE_LINUX_PERF_EVENT_H +diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4 +--- a/gdbsupport/common.m4 ++++ b/gdbsupport/common.m4 +@@ -168,7 +168,7 @@ AC_DEFUN([GDB_AC_COMMON], [ + AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ + #include + #ifndef PERF_ATTR_SIZE_VER5 +- # error ++ // error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL + #endif + ]])], [perf_event=yes], [perf_event=no]) + if test "$perf_event" != yes; then diff --git a/gdb-orphanripper.c b/gdb-orphanripper.c new file mode 100644 index 0000000..0f2ade5 --- /dev/null +++ b/gdb-orphanripper.c @@ -0,0 +1,752 @@ +/* + * Copyright 2006-2007 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Reap any leftover children possibly holding file descriptors. + * Children are identified by the stale file descriptor or PGID / SID. + * Both can be missed but only the stale file descriptors are important for us. + * PGID / SID may be set by the children on their own. + * If we fine a candidate we kill it will all its process tree (grandchildren). + * The child process is run with `2>&1' redirection (due to forkpty(3)). + * 2007-07-10 Jan Kratochvil + */ + +/* For getpgid(2). */ +#define _GNU_SOURCE 1 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define LENGTH(x) (sizeof (x) / sizeof (*(x))) + +static const char *progname; + +static volatile pid_t child; + +static void signal_chld (int signo) +{ +} + +static volatile int signal_alrm_hit = 0; + +static void signal_alrm (int signo) +{ + signal_alrm_hit = 1; +} + +static char childptyname[LINE_MAX]; + +static void print_child_error (const char *reason, char **argv) +{ + char **sp; + + fprintf (stderr, "%s: %d %s:", progname, (int) child, reason); + for (sp = argv; *sp != NULL; sp++) + { + fputc (' ', stderr); + fputs (*sp, stderr); + } + fputc ('\n', stderr); +} + +static int read_out (int amaster) +{ + char buf[LINE_MAX]; + ssize_t buf_got; + + buf_got = read (amaster, buf, sizeof buf); + if (buf_got == 0) + return 0; + /* Weird but at least after POLLHUP we get EIO instead of just EOF. */ + if (buf_got == -1 && errno == EIO) + return 0; + if (buf_got == -1 && errno == EAGAIN) + return 0; + if (buf_got < 0) + { + perror ("read (amaster)"); + exit (EXIT_FAILURE); + } + if (write (STDOUT_FILENO, buf, buf_got) != buf_got) + { + perror ("write(2)"); + exit (EXIT_FAILURE); + } + return 1; +} + +/* kill (child, 0) == 0 sometimes even when CHILD's state is already "Z". */ + +static int child_exited (void) +{ + char buf[200]; + int fd, i, retval; + ssize_t got; + char state[3]; + + snprintf (buf, sizeof (buf), "/proc/%ld/stat", (long) child); + fd = open (buf, O_RDONLY); + if (fd == -1) + { + perror ("open (/proc/CHILD/stat)"); + exit (EXIT_FAILURE); + } + got = read (fd, buf, sizeof(buf)); + if (got <= 0) + { + perror ("read (/proc/CHILD/stat)"); + exit (EXIT_FAILURE); + } + if (close (fd) != 0) + { + perror ("close (/proc/CHILD/stat)"); + exit (EXIT_FAILURE); + } + /* RHEL-5 does not support %ms. */ + i = sscanf (buf, "%*d%*s%2s", state); + if (i != 1) + { + perror ("sscanf (/proc/CHILD/stat)"); + exit (EXIT_FAILURE); + } + retval = strcmp (state, "Z") == 0; + return retval; +} + +static int spawn (char **argv, int timeout) +{ + pid_t child_got; + int status, amaster, i, rc; + struct sigaction act; + sigset_t set; + struct termios termios; + unsigned alarm_orig; + + /* We do not use signal(2) to be sure we do not have SA_RESTART. */ + memset (&act, 0, sizeof (act)); + act.sa_handler = signal_chld; + i = sigemptyset (&act.sa_mask); + assert (i == 0); + act.sa_flags = 0; /* !SA_RESTART */ + i = sigaction (SIGCHLD, &act, NULL); + assert (i == 0); + + i = sigemptyset (&set); + assert (i == 0); + i = sigaddset (&set, SIGCHLD); + assert (i == 0); + i = sigprocmask (SIG_SETMASK, &set, NULL); + assert (i == 0); + + /* With TERMP passed as NULL we get "\n" -> "\r\n". */ + termios.c_iflag = IGNBRK | IGNPAR; + termios.c_oflag = 0; + termios.c_cflag = CS8 | CREAD | CLOCAL | HUPCL | B9600; + termios.c_lflag = IEXTEN | NOFLSH; + memset (termios.c_cc, _POSIX_VDISABLE, sizeof (termios.c_cc)); + termios.c_cc[VTIME] = 0; + termios.c_cc[VMIN ] = 1; + cfmakeraw (&termios); +#ifdef FLUSHO + /* Workaround a readline deadlock bug in _get_tty_settings(). */ + termios.c_lflag &= ~FLUSHO; +#endif + child = forkpty (&amaster, childptyname, &termios, NULL); + switch (child) + { + case -1: + perror ("forkpty(3)"); + exit (EXIT_FAILURE); + case 0: + /* Do not replace STDIN as inferiors query its termios. */ +#if 0 + i = close (STDIN_FILENO); + assert (i == 0); + i = open ("/dev/null", O_RDONLY); + assert (i == STDIN_FILENO); +#endif + + i = sigemptyset (&set); + assert (i == 0); + i = sigprocmask (SIG_SETMASK, &set, NULL); + assert (i == 0); + + /* Do not setpgrp(2) in the parent process as the process-group + is shared for the whole sh(1) pipeline we could be a part + of. The process-group is set according to PID of the first + command in the pipeline. + We would rip even vi(1) in the case of: + ./orphanripper sh -c 'sleep 1&' | vi - + */ + /* Do not setpgrp(2) as our pty would not be ours and we would + get `SIGSTOP' later, particularly after spawning gdb(1). + setsid(3) was already executed by forkpty(3) and it would fail if + executed again. */ + if (getpid() != getpgrp ()) + { + perror ("getpgrp(2)"); + exit (EXIT_FAILURE); + } + execvp (argv[0], argv); + perror ("execvp(2)"); + exit (EXIT_FAILURE); + default: + break; + } + i = fcntl (amaster, F_SETFL, O_RDWR | O_NONBLOCK); + if (i != 0) + { + perror ("fcntl (amaster, F_SETFL, O_NONBLOCK)"); + exit (EXIT_FAILURE); + } + + /* We do not use signal(2) to be sure we do not have SA_RESTART. */ + act.sa_handler = signal_alrm; + i = sigaction (SIGALRM, &act, NULL); + assert (i == 0); + + alarm_orig = alarm (timeout); + assert (alarm_orig == 0); + + i = sigemptyset (&set); + assert (i == 0); + + while (!signal_alrm_hit) + { + struct pollfd pollfd; + + pollfd.fd = amaster; + pollfd.events = POLLIN; + i = ppoll (&pollfd, 1, NULL, &set); + if (i == -1 && errno == EINTR) + { + if (child_exited ()) + break; + /* Non-CHILD child may have exited. */ + continue; + } + assert (i == 1); + /* Data available? Process it first. */ + if (pollfd.revents & POLLIN) + { + if (!read_out (amaster)) + { + fprintf (stderr, "%s: Unexpected EOF\n", progname); + exit (EXIT_FAILURE); + } + } + if (pollfd.revents & POLLHUP) + break; + if ((pollfd.revents &= ~POLLIN) != 0) + { + fprintf (stderr, "%s: ppoll(2): revents 0x%x\n", progname, + (unsigned) pollfd.revents); + exit (EXIT_FAILURE); + } + /* Child exited? */ + if (child_exited ()) + break; + } + + if (signal_alrm_hit) + { + i = kill (child, SIGKILL); + assert (i == 0); + } + else + alarm (0); + + /* WNOHANG still could fail. */ + child_got = waitpid (child, &status, 0); + if (child != child_got) + { + fprintf (stderr, "waitpid (%d) = %d: %m\n", (int) child, (int) child_got); + exit (EXIT_FAILURE); + } + if (signal_alrm_hit) + { + char *buf; + + if (asprintf (&buf, "Timed out after %d seconds", timeout) != -1) + { + print_child_error (buf, argv); + free (buf); + } + rc = 128 + SIGALRM; + } + else if (WIFEXITED (status)) + rc = WEXITSTATUS (status); + else if (WIFSIGNALED (status)) + { + print_child_error (strsignal (WTERMSIG (status)), argv); + rc = 128 + WTERMSIG (status); + } + else if (WIFSTOPPED (status)) + { + fprintf (stderr, "waitpid (%d): WIFSTOPPED - WSTOPSIG is %d\n", + (int) child, WSTOPSIG (status)); + exit (EXIT_FAILURE); + } + else + { + fprintf (stderr, "waitpid (%d): !WIFEXITED (%d)\n", (int) child, status); + exit (EXIT_FAILURE); + } + + /* Not used in fact. */ + i = sigprocmask (SIG_SETMASK, &set, NULL); + assert (i == 0); + + /* Do not unset O_NONBLOCK as a stale child (the whole purpose of this + program) having open its output pty would block us in read_out. */ +#if 0 + i = fcntl (amaster, F_SETFL, O_RDONLY /* !O_NONBLOCK */); + if (i != 0) + { + perror ("fcntl (amaster, F_SETFL, O_RDONLY /* !O_NONBLOCK */)"); + exit (EXIT_FAILURE); + } +#endif + + while (read_out (amaster)); + + /* Do not close the master FD as the child would have `/dev/pts/23 (deleted)' + entries which are not expected (and expecting ` (deleted)' would be + a race. */ +#if 0 + i = close (amaster); + if (i != 0) + { + perror ("close (forkpty ()'s amaster)"); + exit (EXIT_FAILURE); + } +#endif + + return rc; +} + +/* Detected commandline may look weird due to a race: + Original command: + ./orphanripper sh -c 'sleep 1&' & + Correct output: + [1] 29610 + ./orphanripper: Killed -9 orphan PID 29612 (PGID 29611): sleep 1 + Raced output (sh(1) child still did not update its argv[]): + [1] 29613 + ./orphanripper: Killed -9 orphan PID 29615 (PGID 29614): sh -c sleep 1& + We could delay a bit before ripping the children. */ +static const char *read_cmdline (pid_t pid) +{ + char cmdline_fname[32]; + static char cmdline[LINE_MAX]; + int fd; + ssize_t got; + char *s; + + if (snprintf (cmdline_fname, sizeof cmdline_fname, "/proc/%d/cmdline", + (int) pid) < 0) + return NULL; + fd = open (cmdline_fname, O_RDONLY); + if (fd == -1) + { + /* It may have already exited - ENOENT. */ +#if 0 + fprintf (stderr, "%s: open (\"%s\"): %m\n", progname, cmdline_fname); +#endif + return NULL; + } + got = read (fd, cmdline, sizeof (cmdline) - 1); + if (got == -1) + fprintf (stderr, "%s: read (\"%s\"): %m\n", progname, + cmdline_fname); + if (close (fd) != 0) + fprintf (stderr, "%s: close (\"%s\"): %m\n", progname, + cmdline_fname); + if (got < 0) + return NULL; + /* Convert '\0' argument delimiters to spaces. */ + for (s = cmdline; s < cmdline + got; s++) + if (!*s) + *s = ' '; + /* Trim the trailing spaces (typically single '\0'->' '). */ + while (s > cmdline && isspace (s[-1])) + s--; + *s = 0; + return cmdline; +} + +static int dir_scan (const char *dirname, + int (*callback) (struct dirent *dirent, const char *pathname)) +{ + DIR *dir; + struct dirent *dirent; + int rc = 0; + + dir = opendir (dirname); + if (dir == NULL) + { + if (errno == EACCES || errno == ENOENT) + return rc; + fprintf (stderr, "%s: opendir (\"%s\"): %m\n", progname, dirname); + exit (EXIT_FAILURE); + } + while ((errno = 0, dirent = readdir (dir))) + { + char pathname[LINE_MAX]; + int pathname_len; + + pathname_len = snprintf (pathname, sizeof pathname, "%s/%s", + dirname, dirent->d_name); + if (pathname_len <= 0 || pathname_len >= (int) sizeof pathname) + { + fprintf (stderr, "entry file name too long: `%s' / `%s'\n", + dirname, dirent->d_name); + continue; + } + /* RHEL-4.5 on s390x never fills in D_TYPE. */ + if (dirent->d_type == DT_UNKNOWN) + { + struct stat statbuf; + int i; + + /* We are not interested in the /proc/PID/fd/ links targets. */ + i = lstat (pathname, &statbuf); + if (i == -1) + { + if (errno == EACCES || errno == ENOENT) + continue; + fprintf (stderr, "%s: stat (\"%s\"): %m\n", progname, pathname); + exit (EXIT_FAILURE); + } + if (S_ISDIR (statbuf.st_mode)) + dirent->d_type = DT_DIR; + if (S_ISLNK (statbuf.st_mode)) + dirent->d_type = DT_LNK; + /* No other D_TYPE types used in this code. */ + } + rc = (*callback) (dirent, pathname); + if (rc != 0) + { + errno = 0; + break; + } + } + if (errno != 0) + { + fprintf (stderr, "%s: readdir (\"%s\"): %m\n", progname, dirname); + exit (EXIT_FAILURE); + } + if (closedir (dir) != 0) + { + fprintf (stderr, "%s: closedir (\"%s\"): %m\n", progname, dirname); + exit (EXIT_FAILURE); + } + return rc; +} + +static int fd_fs_scan (pid_t pid, int (*func) (pid_t pid, const char *link)) +{ + char dirname[64]; + + if (snprintf (dirname, sizeof dirname, "/proc/%d/fd", (int) pid) < 0) + { + perror ("snprintf(3)"); + exit (EXIT_FAILURE); + } + + int callback (struct dirent *dirent, const char *pathname) + { + char buf[LINE_MAX]; + ssize_t buf_len; + + if ((dirent->d_type != DT_DIR && dirent->d_type != DT_LNK) + || (dirent->d_type == DT_DIR && strcmp (dirent->d_name, ".") != 0 + && strcmp (dirent->d_name, "..") != 0) + || (dirent->d_type == DT_LNK && strspn (dirent->d_name, "0123456789") + != strlen (dirent->d_name))) + { + fprintf (stderr, "Unexpected entry \"%s\" (d_type %u)" + " on readdir (\"%s\"): %m\n", + dirent->d_name, (unsigned) dirent->d_type, dirname); + return 0; + } + if (dirent->d_type == DT_DIR) + return 0; + buf_len = readlink (pathname, buf, sizeof buf - 1); + if (buf_len <= 0 || buf_len >= (ssize_t) sizeof buf - 1) + { + if (errno != ENOENT && errno != EACCES) + fprintf (stderr, "Error reading link \"%s\": %m\n", pathname); + return 0; + } + buf[buf_len] = 0; + return (*func) (pid, buf); + } + + return dir_scan (dirname, callback); +} + +static void pid_fs_scan (void (*func) (pid_t pid, void *data), void *data) +{ + int callback (struct dirent *dirent, const char *pathname) + { + if (dirent->d_type != DT_DIR + || strspn (dirent->d_name, "0123456789") != strlen (dirent->d_name)) + return 0; + (*func) (atoi (dirent->d_name), data); + return 0; + } + + dir_scan ("/proc", callback); +} + +static int rip_check_ptyname (pid_t pid, const char *link) +{ + assert (pid != getpid ()); + + return strcmp (link, childptyname) == 0; +} + +struct pid + { + struct pid *next; + pid_t pid; + }; +static struct pid *pid_list; + +static int pid_found (pid_t pid) +{ + struct pid *entry; + + for (entry = pid_list; entry != NULL; entry = entry->next) + if (entry->pid == pid) + return 1; + return 0; +} + +/* Single pass is not enough, a (multithreaded) process was seen to survive. + Repeated killing of the same process is not enough, zombies can be killed. + */ +static int cleanup_acted; + +static void pid_record (pid_t pid) +{ + struct pid *entry; + + if (pid_found (pid)) + return; + cleanup_acted = 1; + + entry = malloc (sizeof (*entry)); + if (entry == NULL) + { + fprintf (stderr, "%s: malloc: %m\n", progname); + exit (EXIT_FAILURE); + } + entry->pid = pid; + entry->next = pid_list; + pid_list = entry; +} + +static void pid_forall (void (*func) (pid_t pid)) +{ + struct pid *entry; + + for (entry = pid_list; entry != NULL; entry = entry->next) + (*func) (entry->pid); +} + +/* Returns 0 on failure. */ +static pid_t pid_get_parent (pid_t pid) +{ + char fname[64]; + FILE *f; + char line[LINE_MAX]; + pid_t retval = 0; + + if (snprintf (fname, sizeof fname, "/proc/%d/status", (int) pid) < 0) + { + perror ("snprintf(3)"); + exit (EXIT_FAILURE); + } + f = fopen (fname, "r"); + if (f == NULL) + { + return 0; + } + while (errno = 0, fgets (line, sizeof line, f) == line) + { + if (strncmp (line, "PPid:\t", sizeof "PPid:\t" - 1) != 0) + continue; + retval = atoi (line + sizeof "PPid:\t" - 1); + errno = 0; + break; + } + if (errno != 0) + { + fprintf (stderr, "%s: fgets (\"%s\"): %m\n", progname, fname); + exit (EXIT_FAILURE); + } + if (fclose (f) != 0) + { + fprintf (stderr, "%s: fclose (\"%s\"): %m\n", progname, fname); + exit (EXIT_FAILURE); + } + return retval; +} + +static void killtree (pid_t pid); + +static void killtree_pid_fs_scan (pid_t pid, void *data) +{ + pid_t parent_pid = *(pid_t *) data; + + /* Do not optimize it as we could miss some newly spawned processes. + Always traverse all the leaves. */ +#if 0 + /* Optimization. */ + if (pid_found (pid)) + return; +#endif + + if (pid_get_parent (pid) != parent_pid) + return; + + killtree (pid); +} + +static void killtree (pid_t pid) +{ + pid_record (pid); + pid_fs_scan (killtree_pid_fs_scan, &pid); +} + +static void rip_pid_fs_scan (pid_t pid, void *data) +{ + pid_t pgid; + + /* Shouldn't happen. */ + if (pid == getpid ()) + return; + + /* Check both PGID and the stale file descriptors. */ + pgid = getpgid (pid); + if (pgid == child + || fd_fs_scan (pid, rip_check_ptyname) != 0) + killtree (pid); +} + +static void killproc (pid_t pid) +{ + const char *cmdline; + + cmdline = read_cmdline (pid); + /* Avoid printing the message for already gone processes. */ + if (kill (pid, 0) != 0 && errno == ESRCH) + return; + if (cmdline == NULL) + cmdline = ""; + fprintf (stderr, "%s: Killed -9 orphan PID %d: %s\n", progname, (int) pid, cmdline); + if (kill (pid, SIGKILL) == 0) + cleanup_acted = 1; + else if (errno != ESRCH) + fprintf (stderr, "%s: kill (%d, SIGKILL): %m\n", progname, (int) pid); + /* RHEL-3 kernels cannot SIGKILL a `T (stopped)' process. */ + kill (pid, SIGCONT); + /* Do not waitpid(2) as it cannot be our direct descendant and it gets + cleaned up by init(8). */ +#if 0 + pid_t pid_got; + pid_got = waitpid (pid, NULL, 0); + if (pid != pid_got) + { + fprintf (stderr, "%s: waitpid (%d) != %d: %m\n", progname, + (int) pid, (int) pid_got); + return; + } +#endif +} + +static void rip (void) +{ + cleanup_acted = 0; + do + { + if (cleanup_acted) + usleep (1000000 / 10); + cleanup_acted = 0; + pid_fs_scan (rip_pid_fs_scan, NULL); + pid_forall (killproc); + } + while (cleanup_acted); +} + +int main (int argc, char **argv) +{ + int timeout = 0; + int rc; + + progname = *argv++; + argc--; + + if (argc < 1 || strcmp (*argv, "-h") == 0 + || strcmp (*argv, "--help") == 0) + { + puts ("Syntax: orphanripper [-t ] "); + exit (EXIT_FAILURE); + } + if ((*argv)[0] == '-' && (*argv)[1] == 't') + { + char *timeout_s = NULL; + + if ((*argv)[2] == 0) + timeout_s = *++argv; + else if (isdigit ((*argv)[2])) + timeout_s = (*argv) + 2; + if (timeout_s != NULL) + { + long l; + char *endptr; + + argv++; + l = strtol (timeout_s, &endptr, 0); + timeout = l; + if ((endptr != NULL && *endptr != 0) || timeout < 0 || timeout != l) + { + fprintf (stderr, "%s: Invalid timeout value: %s\n", progname, + timeout_s); + exit (EXIT_FAILURE); + } + } + } + + rc = spawn (argv, timeout); + rip (); + return rc; +} diff --git a/gdb-python-finishbreakpoint-update.patch b/gdb-python-finishbreakpoint-update.patch new file mode 100644 index 0000000..0638499 --- /dev/null +++ b/gdb-python-finishbreakpoint-update.patch @@ -0,0 +1,447 @@ +From adfcabe4cc43766996a61bdf08ce1e9db7f18dcc Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 18 Apr 2024 14:27:04 +0200 +Subject: [PATCH] gdb-python-finishbreakpoint-update + +[gdb/python] FinishBreakPoint update + +I. + +Consider the python gdb.FinishBreakpoint class, an extension of the +gdb.Breakpoint class. + +It sets a temporary breakpoint on the return address of a frame. + +This type of breakpoints is thread-specific. + +II. + +If the FinishBreakpoint is hit, it is deleted, and the method return_value +can be used to get the value returned by the function. + +Let's demonstrate this: +... +$ cat -n test.c + 1 int foo (int a) { return a + 2; } + 2 int main () { return foo (1); } +$ gcc -g test.c +$ gdb -q -batch a.out -ex "set trace-commands on" -ex "tbreak foo" -ex run \ + -ex "python bp = gdb.FinishBreakpoint()" -ex "info breakpoints" \ + -ex continue -ex "info breakpoints" -ex "python print (bp.return_value)" ++tbreak foo +Temporary breakpoint 1 at 0x40049e: file test.c, line 1. ++run + +Temporary breakpoint 1, foo (a=1) at test.c:1 +1 int foo (int a) { return a + 2; } ++python bp = gdb.FinishBreakpoint() +Temporary breakpoint 2 at 0x4004b4: file test.c, line 2. ++info breakpoints +Num Type Disp Enb Address What +2 breakpoint del y 0x004004b4 in main at test.c:2 thread 1 + stop only in thread 1 ++continue + +Temporary breakpoint 2, 0x004004b4 in main () at test.c:2 +2 int main () { return foo (1); } ++info breakpoints +No breakpoints or watchpoints. ++python print (bp.return_value) +3 +... + +III. + +Another possibility is that the FinishBreakpoint is not hit, because the +function did not terminate, f.i. because of longjmp, C++ exceptions, or GDB +return command. + +Let's demonstrate this, using C++ exceptions: +... +$ cat -n test.c + 1 int foo (int a) { throw 1; return a + 2; } + 2 int main () { + 3 try { return foo (1); } catch (...) {}; + 4 return 1; + 5 } +$ g++ -g test.c +$ gdb -q -batch a.out -ex "set trace-commands on" -ex "tbreak foo" -ex run \ + -ex "python bp = gdb.FinishBreakpoint()" -ex "info breakpoints" \ + -ex continue -ex "info breakpoints" -ex "python print (bp.return_value)" ++tbreak foo +Temporary breakpoint 1 at 0x400712: file test.c, line 1. ++run + +Temporary breakpoint 1, foo (a=1) at test.c:1 +1 int foo (int a) { throw 1; return a + 2; } ++python bp = gdb.FinishBreakpoint() +Temporary breakpoint 2 at 0x400742: file test.c, line 3. ++info breakpoints +Num Type Disp Enb Address What +2 breakpoint del y 0x00400742 in main() at test.c:3 thread 1 + stop only in thread 1 ++continue +[Inferior 1 (process 25269) exited with code 01] +Thread-specific breakpoint 2 deleted - thread 1 no longer in the thread list. ++info breakpoints +No breakpoints or watchpoints. ++python print (bp.return_value) +None +... + +Indeed, we do not hit the FinishBreakpoint. Instead, it's deleted when the +thread disappears, like any other thread-specific breakpoint. + +I think this is a bug: the deletion is meant to be handled by FinishBreakpoint +itself. + +IV. + +Fix aforementioned bug by: +- adding an observer of the thread_exit event in FinishBreakpoint +- making sure that this observer is called before the + remove_threaded_breakpoints observer of that same event. + +This changes the behaviour to: +... ++continue +[Inferior 1 (process 30256) exited with code 01] ++info breakpoints +No breakpoints or watchpoints. ++python print (bp.return_value) +None +... + +V. + +An out_of_scope callback can be defined to make this more verbose: +... +$ cat fbp.py +class FBP(gdb.FinishBreakpoint): + def __init__(self): + gdb.FinishBreakpoint.__init__(self) + + def out_of_scope(self): + try: + frame = gdb.selected_frame () + sal = frame.find_sal () + print ("out_of_scope triggered at %s:%s" + % (sal.symtab.fullname(), sal.line)) + except gdb.error as e: + print ("out_of_scope triggered at thread/inferior exit") +... +and using that gets us: +... ++continue +[Inferior 1 (process 30742) exited with code 01] +out_of_scope triggered at thread/inferior exit ++info breakpoints +No breakpoints or watchpoints. ++python print (bp.return_value) +None +... + +VI. + +This out_of_scope event can be triggered earlier than inferior/thread exit. + +Let's demonstrate this: +... +$ cat -n test.c + 1 int bar (int a) { throw 1; return a + 2; } + 2 int foo (int a) { + 3 int res = a; + 4 try + 5 { + 6 res += bar (1); + 7 } + 8 catch (...) + 9 { + 10 } + 11 return res; + 12 } + 13 int main () { + 14 int res = 0; + 15 res += foo (1); + 16 res += 2; + 17 return res * 2; + 18 } +$ g++ -g test.c +$ gdb -q -batch -ex "source fbp.py" a.out -ex "set trace-commands on" \ + -ex "tbreak bar" -ex run -ex "python bp = FBP()" -ex "info breakpoints" \ + -ex "tbreak 16" -ex continue -ex "info breakpoints" \ + -ex "python print (bp.return_value)" ++tbreak bar +Temporary breakpoint 1 at 0x400712: file test.c, line 1. ++run + +Temporary breakpoint 1, bar (a=1) at test.c:1 +1 int bar (int a) { throw 1; return a + 2; } ++python bp = FBP() +Temporary breakpoint 2 at 0x40074f: file test.c, line 6. ++info breakpoints +Num Type Disp Enb Address What +2 breakpoint del y 0x0040074f in foo(int) at test.c:6 thread 1 + stop only in thread 1 ++tbreak 16 +Temporary breakpoint 3 at 0x400784: file test.c, line 16. ++continue + +Temporary breakpoint 3, main () at test.c:16 +16 res += 2; +out_of_scope triggered at /home/vries/gdb_versions/devel/test.c:16 ++info breakpoints +No breakpoints or watchpoints. ++python print (bp.return_value) +None +... + +Note that the out_of_scope event triggers at the breakpoint we set at +test.c:16. If we'd set that breakpoint at line 17, the out_of_scope event +would trigger at line 17 instead. + +Also note that it can't be triggered earlier, say by setting the breakpoint in +foo at line 11. We would get instead "out_of_scope triggered at +thread/inferior exit". + +VII. + +Now consider a reduced version of +src/gdb/testsuite/gdb.python/py-finish-breakpoint2.cc: +... +$ cat -n test.c + 1 #include + 2 + 3 void + 4 throw_exception_1 (int e) + 5 { + 6 throw new int (e); + 7 } + 8 + 9 int + 10 main (void) + 11 { + 12 int i; + 13 try + 14 { + 15 throw_exception_1 (10); + 16 } + 17 catch (const int *e) + 18 { + 19 std::cerr << "Exception #" << *e << std::endl; + 20 } + 21 i += 1; + 22 + 23 return i; + 24 } +$ g++ -g test.c +... + +Now let's try to see if the FinishBreakPoint triggers: +... +$ gdb -q -batch -ex "source fbp.py" a.out -ex "set trace-commands on" \ + -ex "tbreak throw_exception_1" -ex run -ex "python bp = FBP()" \ + -ex "info breakpoints" -ex continue -ex "info breakpoints" \ + -ex "python print (bp.return_value)" ++tbreak throw_exception_1 +Temporary breakpoint 1 at 0x400bd5: file test.c, line 6. ++run + +Temporary breakpoint 1, throw_exception_1 (e=10) at test.c:6 +6 throw new int (e); ++python bp = FBP() +Temporary breakpoint 2 at 0x400c2f: file test.c, line 21. ++info breakpoints +Num Type Disp Enb Address What +2 breakpoint del y 0x00400c2f in main() at test.c:21 thread 1 + stop only in thread 1 ++continue +Exception #10 + +Temporary breakpoint 2, main () at test.c:21 +21 i += 1; ++info breakpoints +No breakpoints or watchpoints. ++python print (bp.return_value) +None +... + +Surprisingly, it did. The explanation is that FinishBreakPoint is really a +frame-return-address breakpoint, and that address happens to be at line 21, +which is still executed after the throw in throw_exception_1. + +Interestingly, with -m32 the FinishBreakPoint doesn't trigger, because the +frame-return-address happens to be an instruction which is part of line 15. + +VIII. + +In conclusion, the FinishBreakpoint is a frame-return-address breakpoint. + +After being set, either: +- it triggers, or +- an out-of-scope event will be generated. + +If an out-of-scope event is generated, it will be due to incomplete function +termination. + +OTOH, incomplete function termination does not guarantee an out-of-scope event +instead of hitting the breakpoint. + +IX. + +The documentation states that 'A finish breakpoint is a temporary breakpoint +set at the return address of a frame, based on the finish command'. + +It's indeed somewhat similar to the finish command, at least in the sense that +both may stop at the frame-return-address. + +But the finish command can accurately detect function termination. + +And the finish command will stop at any other address that is the first +address not in the original function. + +The documentation needs updating to accurately describe what it does. + +X. + +A better implementation of a finish breakpoint would be one that borrows from +the finish command implementation. That one: +- installs a thread_fsm, and +- continues + +A finish breakpoint would do the same minus the continue, but it requires gdb +to handle multiple thread_fsms at a time (because other commands may wish to +install their own thread_fsm), which AFAICT is not supported yet. + +XI. + +This patch repairs a minor part of the functionality, and updates +documentation and test-cases to match actual behaviour. + +The question remains how useful the functionality is, as it is now +( see f.i. discussion at +https://sourceware.org/pipermail/gdb-patches/2021-January/175290.html ). +Perhaps it would be better to deprecate this in a follow-up patch in some form +or another, say by disabling it by default and introducing a maintenance +command that switches it on, with the warning that it is deprecated. + +Tested on x86_64-linux with native and target board unix/-m32, by rebuilding +and running the test-cases: +- gdb.python/py-finish-breakpoint.exp +- gdb.python/py-finish-breakpoint2.exp +--- + gdb/breakpoint.c | 10 ++++++++++ + gdb/doc/python.texi | 6 ++++-- + gdb/python/py-finishbreakpoint.c | 20 +++++++++++++++++++ + .../gdb.python/py-finish-breakpoint2.exp | 1 + + 4 files changed, 35 insertions(+), 2 deletions(-) + +diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c +index db7d2e6a8e5..01f187ca4fe 100644 +--- a/gdb/breakpoint.c ++++ b/gdb/breakpoint.c +@@ -14683,6 +14683,10 @@ breakpoint_free_objfile (struct objfile *objfile) + + static struct cmd_list_element *enablebreaklist = NULL; + ++#if HAVE_PYTHON ++extern gdb::observers::token bpfinishpy_handle_thread_exit_observer_token; ++#endif ++ + /* See breakpoint.h. */ + + cmd_list_element *commands_cmd_element = nullptr; +@@ -15243,8 +15247,14 @@ This is useful for formatted output in user-defined commands.")); + + gdb::observers::about_to_proceed.attach (breakpoint_about_to_proceed, + "breakpoint"); ++#if HAVE_PYTHON ++ gdb::observers::thread_exit.attach ++ (remove_threaded_breakpoints, "breakpoint", ++ { &bpfinishpy_handle_thread_exit_observer_token }); ++#else + gdb::observers::thread_exit.attach (remove_threaded_breakpoints, + "breakpoint"); ++#endif + gdb::observers::inferior_removed.attach (remove_inferior_breakpoints, + "breakpoint"); + } +diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi +index 99670cca025..ba414b4e2c3 100644 +--- a/gdb/doc/python.texi ++++ b/gdb/doc/python.texi +@@ -6648,7 +6648,7 @@ is not writable. + @tindex gdb.FinishBreakpoint + + A finish breakpoint is a temporary breakpoint set at the return address of +-a frame, based on the @code{finish} command. @code{gdb.FinishBreakpoint} ++a frame. @code{gdb.FinishBreakpoint} + extends @code{gdb.Breakpoint}. The underlying breakpoint will be disabled + and deleted when the execution will run out of the breakpoint scope (i.e.@: + @code{Breakpoint.stop} or @code{FinishBreakpoint.out_of_scope} triggered). +@@ -6667,7 +6667,9 @@ details about this argument. + In some circumstances (e.g.@: @code{longjmp}, C@t{++} exceptions, @value{GDBN} + @code{return} command, @dots{}), a function may not properly terminate, and + thus never hit the finish breakpoint. When @value{GDBN} notices such a +-situation, the @code{out_of_scope} callback will be triggered. ++situation, the @code{out_of_scope} callback will be triggered. Note ++though that improper function termination does not guarantee that the ++finish breakpoint is not hit. + + You may want to sub-class @code{gdb.FinishBreakpoint} and override this + method: +diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c +index 42a7e0706d2..fa7ec43fbb4 100644 +--- a/gdb/python/py-finishbreakpoint.c ++++ b/gdb/python/py-finishbreakpoint.c +@@ -433,6 +433,24 @@ bpfinishpy_handle_exit (struct inferior *inf) + bpfinishpy_detect_out_scope_cb (&bp, nullptr, true); + } + ++/* Attached to `thread_exit' notifications, triggers all the necessary out of ++ scope notifications. */ ++ ++static void ++bpfinishpy_handle_thread_exit (struct thread_info *tp, gdb::optional, bool) ++{ ++ gdbpy_enter enter_py (target_gdbarch (), current_language); ++ ++ for (breakpoint &bp : all_breakpoints_safe ()) ++ { ++ if (tp->global_num == bp.thread) ++ bpfinishpy_detect_out_scope_cb (&bp, nullptr, true); ++ } ++} ++ ++extern gdb::observers::token bpfinishpy_handle_thread_exit_observer_token; ++gdb::observers::token bpfinishpy_handle_thread_exit_observer_token; ++ + /* Initialize the Python finish breakpoint code. */ + + static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION +@@ -452,6 +470,8 @@ gdbpy_initialize_finishbreakpoints (void) + "py-finishbreakpoint"); + gdb::observers::inferior_exit.attach (bpfinishpy_handle_exit, + "py-finishbreakpoint"); ++ gdb::observers::thread_exit.attach ++ (bpfinishpy_handle_thread_exit, "py-finishbreakpoint"); + + return 0; + } +diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp b/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp +index 66587b8b9a0..31479a05e6f 100644 +--- a/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp ++++ b/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp +@@ -87,6 +87,7 @@ if { $need_continue } { + gdb_test "continue" ".*Breakpoint.* throw_exception_1.*" \ + "continue to second exception" + } ++ + gdb_test "python ExceptionFinishBreakpoint(gdb.newest_frame())" \ + "init ExceptionFinishBreakpoint" "set FinishBP after the exception again" + + +base-commit: 6de9111c512de99fd8cb3ea89f9890b1d72f6ef0 +-- +2.35.3 + diff --git a/gdb-python-fix-gdb.python-py-disasm.exp-on-arm-linux.patch b/gdb-python-fix-gdb.python-py-disasm.exp-on-arm-linux.patch new file mode 100644 index 0000000..a8e39f6 --- /dev/null +++ b/gdb-python-fix-gdb.python-py-disasm.exp-on-arm-linux.patch @@ -0,0 +1,125 @@ +From 4c7dab250c3581e691c2da87395e80244074d8bf Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 10 Jun 2024 17:53:30 +0200 +Subject: [PATCH] [gdb/python] Fix gdb.python/py-disasm.exp on arm-linux + +After fixing test-case gdb.python/py-disasm.exp to recognize the arm nop: +... + nop {0} +... +we run into: +... +disassemble test^M +Dump of assembler code for function test:^M + 0x004004d8 <+0>: push {r11} @ (str r11, [sp, #-4]!)^M + 0x004004dc <+4>: add r11, sp, #0^M + 0x004004e0 <+8>: nop {0}^M +=> 0x004004e4 <+12>: Python Exception : Buffer \ + returned from read_memory is sized 0 instead of the expected 4^M +^M +unknown disassembler error (error = -1)^M +(gdb) FAIL: $exp: global_disassembler=ShowInfoRepr: disassemble test +... + +This is caused by this code in gdbpy_disassembler::read_memory_func: +... + gdbpy_ref<> result_obj (PyObject_CallMethod ((PyObject *) obj, + "read_memory", + "KL", len, offset)); +... +where len has type "unsigned int", while "K" means "unsigned long long" [1]. + +Fix this by using "I" instead, meaning "unsigned int". + +Also, offset has type LONGEST, which is typedef'ed to int64_t, while "L" means +"long long". + +Fix this by using type gdb_py_longest for offset, in combination with format +character "GDB_PY_LL_ARG". Likewise in disasmpy_info_read_memory. + +Tested on arm-linux. + +Reviewed-By: Alexandra Petlanova Hajkova +Approved-By: Tom Tromey + +PR python/31845 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31845 + +[1] https://docs.python.org/3/c-api/arg.html + +(cherry picked from commit 4cd214dce4579f86a85a96c882e0fc8c4d94601c) +--- + gdb/python/py-disasm.c | 12 +++++++----- + gdb/testsuite/gdb.python/py-disasm.exp | 2 +- + gdb/testsuite/gdb.python/py-disasm.py | 2 +- + 3 files changed, 9 insertions(+), 7 deletions(-) + +diff --git a/gdb/python/py-disasm.c b/gdb/python/py-disasm.c +index 6f0fed137e6..b2e95b3cba6 100644 +--- a/gdb/python/py-disasm.c ++++ b/gdb/python/py-disasm.c +@@ -668,12 +668,13 @@ disasmpy_info_read_memory (PyObject *self, PyObject *args, PyObject *kw) + disasm_info_object *obj = (disasm_info_object *) self; + DISASMPY_DISASM_INFO_REQUIRE_VALID (obj); + +- LONGEST length, offset = 0; ++ gdb_py_longest length, offset = 0; + gdb::unique_xmalloc_ptr buffer; + static const char *keywords[] = { "length", "offset", nullptr }; + +- if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "L|L", keywords, +- &length, &offset)) ++ if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, ++ GDB_PY_LL_ARG "|" GDB_PY_LL_ARG, ++ keywords, &length, &offset)) + return nullptr; + + /* The apparent address from which we are reading memory. Note that in +@@ -850,13 +851,14 @@ gdbpy_disassembler::read_memory_func (bfd_vma memaddr, gdb_byte *buff, + /* The DisassembleInfo.read_memory method expects an offset from the + address stored within the DisassembleInfo object; calculate that + offset here. */ +- LONGEST offset = (LONGEST) memaddr - (LONGEST) obj->address; ++ gdb_py_longest offset ++ = (gdb_py_longest) memaddr - (gdb_py_longest) obj->address; + + /* Now call the DisassembleInfo.read_memory method. This might have been + overridden by the user. */ + gdbpy_ref<> result_obj (PyObject_CallMethod ((PyObject *) obj, + "read_memory", +- "KL", len, offset)); ++ "I" GDB_PY_LL_ARG, len, offset)); + + /* Handle any exceptions. */ + if (result_obj == nullptr) +diff --git a/gdb/testsuite/gdb.python/py-disasm.exp b/gdb/testsuite/gdb.python/py-disasm.exp +index f2f9225168a..9d0f6ec1d01 100644 +--- a/gdb/testsuite/gdb.python/py-disasm.exp ++++ b/gdb/testsuite/gdb.python/py-disasm.exp +@@ -65,7 +65,7 @@ proc py_remove_all_disassemblers {} { + # + # Each different disassembler tests some different feature of the + # Python disassembler API. +-set nop "(nop|nop\t0)" ++set nop "(nop|nop\t0|[string_to_regexp nop\t{0}])" + set unknown_error_pattern "unknown disassembler error \\(error = -1\\)" + set addr_pattern "\r\n=> ${curr_pc_pattern} <\[^>\]+>:\\s+" + set base_pattern "${addr_pattern}${nop}" +diff --git a/gdb/testsuite/gdb.python/py-disasm.py b/gdb/testsuite/gdb.python/py-disasm.py +index 67ba6756ea9..6a39b0764e6 100644 +--- a/gdb/testsuite/gdb.python/py-disasm.py ++++ b/gdb/testsuite/gdb.python/py-disasm.py +@@ -46,7 +46,7 @@ def check_building_disassemble_result(): + + + def is_nop(s): +- return s == "nop" or s == "nop\t0" ++ return s == "nop" or s == "nop\t0" or s == "nop\t{0}" + + + # Remove all currently registered disassemblers. + +base-commit: 22383ac8031b0e626e8ecd62e4378266065d067c +-- +2.35.3 + diff --git a/gdb-python-make-gdb.unwindinfo.add_saved_register-mo-fixup.patch b/gdb-python-make-gdb.unwindinfo.add_saved_register-mo-fixup.patch new file mode 100644 index 0000000..757228c --- /dev/null +++ b/gdb-python-make-gdb.unwindinfo.add_saved_register-mo-fixup.patch @@ -0,0 +1,70 @@ +From fc73000faa1798573090994167b7e2d451c211db Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 10 May 2024 08:46:21 +0200 +Subject: [PATCH] [gdb/python] Make gdb.UnwindInfo.add_saved_register more + robust (fixup) + +In commit 2236c5e384d ("[gdb/python] Make gdb.UnwindInfo.add_saved_register +more robust") I added this code in unwind_infopy_add_saved_register: +... + if (value->optimized_out () || !value->entirely_available ()) +... +which may throw c++ exceptions. + +This needs to be caught and transformed into a python exception. + +Fix this by using GDB_PY_HANDLE_EXCEPTION. + +Tested on x86_64-linux. + +Approved-By: Tom Tromey + +Fixes: 2236c5e384d ("[gdb/python] Make gdb.UnwindInfo.add_saved_register more robust") +(cherry picked from commit 408bc9c5fc757bd4b8adb1c3d54ecd672beaedb7) +--- + gdb/python/py-unwind.c | 26 +++++++++++++++++--------- + 1 file changed, 17 insertions(+), 9 deletions(-) + +diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c +index 471eb851674..e57c8c1adcf 100644 +--- a/gdb/python/py-unwind.c ++++ b/gdb/python/py-unwind.c +@@ -354,16 +354,24 @@ unwind_infopy_add_saved_register (PyObject *self, PyObject *args, PyObject *kw) + return nullptr; + } + +- if (value->optimized_out () || !value->entirely_available ()) ++ ++ try ++ { ++ if (value->optimized_out () || !value->entirely_available ()) ++ { ++ /* If we allow this value to be registered here, pyuw_sniffer is going ++ to run into an exception when trying to access its contents. ++ Throwing an exception here just puts a burden on the user to ++ implement the same checks on the user side. We could return False ++ here and True otherwise, but again that might require changes in ++ user code. So, handle this with minimal impact for the user, while ++ improving robustness: silently ignore the register/value pair. */ ++ Py_RETURN_NONE; ++ } ++ } ++ catch (const gdb_exception &except) + { +- /* If we allow this value to be registered here, pyuw_sniffer is going +- to run into an exception when trying to access its contents. +- Throwing an exception here just puts a burden on the user to +- implement the same checks on the user side. We could return False +- here and True otherwise, but again that might require changes in user +- code. So, handle this with minimal impact for the user, while +- improving robustness: silently ignore the register/value pair. */ +- Py_RETURN_NONE; ++ GDB_PY_HANDLE_EXCEPTION (except); + } + + gdbpy_ref<> new_value = gdbpy_ref<>::new_reference (pyo_reg_value); + +base-commit: a6f598be3d0477c5c59bd490573a5d457949658e +-- +2.35.3 + diff --git a/gdb-python-make-gdb.unwindinfo.add_saved_register-mo.patch b/gdb-python-make-gdb.unwindinfo.add_saved_register-mo.patch new file mode 100644 index 0000000..19ed99f --- /dev/null +++ b/gdb-python-make-gdb.unwindinfo.add_saved_register-mo.patch @@ -0,0 +1,61 @@ +From eafca1ce3d589c731927e5481199db715bcbeff3 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sat, 2 Mar 2024 09:35:22 +0100 +Subject: [PATCH 2/2] [gdb/python] Make gdb.UnwindInfo.add_saved_register more + robust + +On arm-linux, until commit bbb12eb9c84 ("gdb/arm: Remove tpidruro register +from non-FreeBSD target descriptions") I ran into: +... +FAIL: gdb.base/inline-frame-cycle-unwind.exp: cycle at level 5: \ + backtrace when the unwind is broken at frame 5 +... + +What happens is the following: +- the TestUnwinder from inline-frame-cycle-unwind.py calls + gdb.UnwindInfo.add_saved_register with reg == tpidruro and value + "", +- pyuw_sniffer calls value->contents ().data () to access the value of the + register, which throws an UNAVAILABLE_ERROR, +- this causes the TestUnwinder unwinder to fail, after which another unwinder + succeeds and returns the correct frame, and +- the test-case fails because it's counting on the TestUnwinder to succeed and + return an incorrect frame. + +Fix this by checking for !value::entirely_available as well as +valued::optimized_out in unwind_infopy_add_saved_register. + +Tested on x86_64-linux and arm-linux. + +PR python/31437 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31437 +--- + gdb/python/py-unwind.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c +index 1856e41e2a1..471eb851674 100644 +--- a/gdb/python/py-unwind.c ++++ b/gdb/python/py-unwind.c +@@ -354,6 +354,18 @@ unwind_infopy_add_saved_register (PyObject *self, PyObject *args, PyObject *kw) + return nullptr; + } + ++ if (value->optimized_out () || !value->entirely_available ()) ++ { ++ /* If we allow this value to be registered here, pyuw_sniffer is going ++ to run into an exception when trying to access its contents. ++ Throwing an exception here just puts a burden on the user to ++ implement the same checks on the user side. We could return False ++ here and True otherwise, but again that might require changes in user ++ code. So, handle this with minimal impact for the user, while ++ improving robustness: silently ignore the register/value pair. */ ++ Py_RETURN_NONE; ++ } ++ + gdbpy_ref<> new_value = gdbpy_ref<>::new_reference (pyo_reg_value); + bool found = false; + for (saved_reg ® : *unwind_info->saved_regs) +-- +2.35.3 + diff --git a/gdb-remote-fix-abort-on-remote_close_error.patch b/gdb-remote-fix-abort-on-remote_close_error.patch new file mode 100644 index 0000000..d6a9a46 --- /dev/null +++ b/gdb-remote-fix-abort-on-remote_close_error.patch @@ -0,0 +1,229 @@ +From 0ad71e3088f345101085a1f72e81a000a100db18 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sat, 27 Apr 2024 17:48:22 +0200 +Subject: [PATCH 25/48] [gdb/remote] Fix abort on REMOTE_CLOSE_ERROR + +When running test-case gdb.server/connect-with-no-symbol-file.exp on +aarch64-linux (specifically, an opensuse leap 15.5 container on a +fedora asahi 39 system), I run into: +... +(gdb) detach^M +Detaching from program: target:connect-with-no-symbol-file, process 185104^M +Ending remote debugging.^M +terminate called after throwing an instance of 'gdb_exception_error'^M +... + +The detailed backtrace of the corefile is: +... + (gdb) bt + #0 0x0000ffff75504f54 in raise () from /lib64/libpthread.so.0 + #1 0x00000000007a86b4 in handle_fatal_signal (sig=6) + at gdb/event-top.c:926 + #2 + #3 0x0000ffff74b977b4 in raise () from /lib64/libc.so.6 + #4 0x0000ffff74b98c18 in abort () from /lib64/libc.so.6 + #5 0x0000ffff74ea26f4 in __gnu_cxx::__verbose_terminate_handler() () + from /usr/lib64/libstdc++.so.6 + #6 0x0000ffff74ea011c in ?? () from /usr/lib64/libstdc++.so.6 + #7 0x0000ffff74ea0180 in std::terminate() () from /usr/lib64/libstdc++.so.6 + #8 0x0000ffff74ea0464 in __cxa_throw () from /usr/lib64/libstdc++.so.6 + #9 0x0000000001548870 in throw_it (reason=RETURN_ERROR, + error=TARGET_CLOSE_ERROR, fmt=0x16c7810 "Remote connection closed", ap=...) + at gdbsupport/common-exceptions.cc:203 + #10 0x0000000001548920 in throw_verror (error=TARGET_CLOSE_ERROR, + fmt=0x16c7810 "Remote connection closed", ap=...) + at gdbsupport/common-exceptions.cc:211 + #11 0x0000000001548a00 in throw_error (error=TARGET_CLOSE_ERROR, + fmt=0x16c7810 "Remote connection closed") + at gdbsupport/common-exceptions.cc:226 + #12 0x0000000000ac8f2c in remote_target::readchar (this=0x233d3d90, timeout=2) + at gdb/remote.c:9856 + #13 0x0000000000ac9f04 in remote_target::getpkt (this=0x233d3d90, + buf=0x233d40a8, forever=false, is_notif=0x0) at gdb/remote.c:10326 + #14 0x0000000000acf3d0 in remote_target::remote_hostio_send_command + (this=0x233d3d90, command_bytes=13, which_packet=17, + remote_errno=0xfffff1a3cf38, attachment=0xfffff1a3ce88, + attachment_len=0xfffff1a3ce90) at gdb/remote.c:12567 + #15 0x0000000000ad03bc in remote_target::fileio_fstat (this=0x233d3d90, fd=3, + st=0xfffff1a3d020, remote_errno=0xfffff1a3cf38) + at gdb/remote.c:12979 + #16 0x0000000000c39878 in target_fileio_fstat (fd=0, sb=0xfffff1a3d020, + target_errno=0xfffff1a3cf38) at gdb/target.c:3315 + #17 0x00000000007eee5c in target_fileio_stream::stat (this=0x233d4400, + abfd=0x2323fc40, sb=0xfffff1a3d020) at gdb/gdb_bfd.c:467 + #18 0x00000000007f012c in ::operator()(bfd *, + void *, stat *) const (__closure=0x0, abfd=0x2323fc40, stream=0x233d4400, + sb=0xfffff1a3d020) at gdb/gdb_bfd.c:955 + #19 0x00000000007f015c in ::_FUN(bfd *, void *, + stat *) () at gdb/gdb_bfd.c:956 + #20 0x0000000000f9b838 in opncls_bstat (abfd=0x2323fc40, sb=0xfffff1a3d020) + at bfd/opncls.c:665 + #21 0x0000000000f90adc in bfd_stat (abfd=0x2323fc40, statbuf=0xfffff1a3d020) + at bfd/bfdio.c:431 + #22 0x000000000065fe20 in reopen_exec_file () at gdb/corefile.c:52 + #23 0x0000000000c3a3e8 in generic_mourn_inferior () + at gdb/target.c:3642 + #24 0x0000000000abf3f0 in remote_unpush_target (target=0x233d3d90) + at gdb/remote.c:6067 + #25 0x0000000000aca8b0 in remote_target::mourn_inferior (this=0x233d3d90) + at gdb/remote.c:10587 + #26 0x0000000000c387cc in target_mourn_inferior ( + ptid=) + at gdb/target.c:2738 + #27 0x0000000000abfff0 in remote_target::remote_detach_1 (this=0x233d3d90, + inf=0x22fce540, from_tty=1) at gdb/remote.c:6421 + #28 0x0000000000ac0094 in remote_target::detach (this=0x233d3d90, + inf=0x22fce540, from_tty=1) at gdb/remote.c:6436 + #29 0x0000000000c37c3c in target_detach (inf=0x22fce540, from_tty=1) + at gdb/target.c:2526 + #30 0x0000000000860424 in detach_command (args=0x0, from_tty=1) + at gdb/infcmd.c:2817 + #31 0x000000000060b594 in do_simple_func (args=0x0, from_tty=1, c=0x231431a0) + at gdb/cli/cli-decode.c:94 + #32 0x00000000006108c8 in cmd_func (cmd=0x231431a0, args=0x0, from_tty=1) + at gdb/cli/cli-decode.c:2741 + #33 0x0000000000c65a94 in execute_command (p=0x232e52f6 "", from_tty=1) + at gdb/top.c:570 + #34 0x00000000007a7d2c in command_handler (command=0x232e52f0 "") + at gdb/event-top.c:566 + #35 0x00000000007a8290 in command_line_handler (rl=...) + at gdb/event-top.c:802 + #36 0x0000000000c9092c in tui_command_line_handler (rl=...) + at gdb/tui/tui-interp.c:103 + #37 0x00000000007a750c in gdb_rl_callback_handler (rl=0x23385330 "detach") + at gdb/event-top.c:258 + #38 0x0000000000d910f4 in rl_callback_read_char () + at readline/readline/callback.c:290 + #39 0x00000000007a7338 in gdb_rl_callback_read_char_wrapper_noexcept () + at gdb/event-top.c:194 + #40 0x00000000007a73f0 in gdb_rl_callback_read_char_wrapper + (client_data=0x22fbf640) at gdb/event-top.c:233 + #41 0x0000000000cbee1c in stdin_event_handler (error=0, client_data=0x22fbf640) + at gdb/ui.c:154 + #42 0x000000000154ed60 in handle_file_event (file_ptr=0x232be730, ready_mask=1) + at gdbsupport/event-loop.cc:572 + #43 0x000000000154f21c in gdb_wait_for_event (block=1) + at gdbsupport/event-loop.cc:693 + #44 0x000000000154dec4 in gdb_do_one_event (mstimeout=-1) + at gdbsupport/event-loop.cc:263 + #45 0x0000000000910f98 in start_event_loop () at gdb/main.c:400 + #46 0x0000000000911130 in captured_command_loop () at gdb/main.c:464 + #47 0x0000000000912b5c in captured_main (data=0xfffff1a3db58) + at gdb/main.c:1338 + #48 0x0000000000912bf4 in gdb_main (args=0xfffff1a3db58) + at gdb/main.c:1357 + #49 0x00000000004170f4 in main (argc=10, argv=0xfffff1a3dcc8) + at gdb/gdb.c:38 + (gdb) +... + +The abort happens because a c++ exception escapes to c code, specifically +opncls_bstat in bfd/opncls.c. Compiling with -fexceptions works around this. + +Fix this by catching the exception just before it escapes, in stat_trampoline +and likewise in few similar spot. + +Add a new template catch_exceptions to do so in a consistent way. + +Tested on aarch64-linux. + +Approved-by: Pedro Alves + +PR remote/31577 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31577 +--- + gdb/gdb_bfd.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 56 insertions(+), 3 deletions(-) + +diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c +index 217753cf914..3c34cc5693f 100644 +--- a/gdb/gdb_bfd.c ++++ b/gdb/gdb_bfd.c +@@ -887,6 +887,29 @@ gdb_bfd_openw (const char *filename, const char *target) + return gdb_bfd_ref_ptr::new_reference (result); + } + ++/* Wrap f (args) and handle exceptions by: ++ - returning val, and ++ - calling set_quit_flag or set_force_quit_flag, if needed. */ ++ ++template ++static R ++catch_exceptions (F &&f, Args&&... args) ++{ ++ try ++ { ++ return f (std::forward (args)...); ++ } ++ catch (const gdb_exception &ex) ++ { ++ if (ex.reason == RETURN_QUIT) ++ set_quit_flag (); ++ else if (ex.reason == RETURN_FORCED_QUIT) ++ set_force_quit_flag (); ++ } ++ ++ return val; ++} ++ + /* See gdb_bfd.h. */ + + gdb_bfd_ref_ptr +@@ -896,21 +919,51 @@ gdb_bfd_openr_iovec (const char *filename, const char *target, + auto do_open = [] (bfd *nbfd, void *closure) -> void * + { + auto real_opener = static_cast (closure); +- return (*real_opener) (nbfd); ++ /* Prevent exceptions from escaping to C code and triggering an abort. */ ++ auto res = catch_exceptions ([&] ++ { ++ return (*real_opener) (nbfd); ++ }); ++ if (res == nullptr) ++ { ++ errno = EIO; ++ bfd_set_error (bfd_error_system_call); ++ } ++ return res; + }; + + auto read_trampoline = [] (bfd *nbfd, void *stream, void *buf, + file_ptr nbytes, file_ptr offset) -> file_ptr + { + gdb_bfd_iovec_base *obj = static_cast (stream); +- return obj->read (nbfd, buf, nbytes, offset); ++ /* Prevent exceptions from escaping to C code and triggering an abort. */ ++ auto res = catch_exceptions ([&] ++ { ++ return obj->read (nbfd, buf, nbytes, offset); ++ }); ++ if (res == -1) ++ { ++ errno = EIO; ++ bfd_set_error (bfd_error_system_call); ++ } ++ return res; + }; + + auto stat_trampoline = [] (struct bfd *abfd, void *stream, + struct stat *sb) -> int + { + gdb_bfd_iovec_base *obj = static_cast (stream); +- return obj->stat (abfd, sb); ++ /* Prevent exceptions from escaping to C code and triggering an abort. */ ++ auto res = catch_exceptions ([&] ++ { ++ return obj->stat (abfd, sb); ++ }); ++ if (res == -1) ++ { ++ errno = EIO; ++ bfd_set_error (bfd_error_system_call); ++ } ++ return res; + }; + + auto close_trampoline = [] (struct bfd *nbfd, void *stream) -> int +-- +2.35.3 + diff --git a/gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch b/gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch new file mode 100644 index 0000000..0b2e9a1 --- /dev/null +++ b/gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch @@ -0,0 +1,264 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Sat, 25 Nov 2023 10:35:37 +0000 +Subject: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch + +;; Back-port upstream commit acc117b57f7 as part of a fix for +;; non-deterministic gdb-index generation (RH BZ 2232086). + +gdb: C++-ify mapped_symtab from dwarf2/index-write.c + +Make static the functions add_index_entry, find_slot, and hash_expand, +member functions of the mapped_symtab class. + +Fold an additional snippet of code from write_gdbindex into +mapped_symtab::minimize, this code relates to minimisation, so this +seems like a good home for it. + +Make the n_elements, data, and m_string_obstack member variables of +mapped_symtab private. Provide a new obstack() member function to +provide access to the obstack when needed, and also add member +functions begin(), end(), cbegin(), and cend() so that the +mapped_symtab class can be treated like a contained and iterated +over. + +I've also taken this opportunity to split out the logic for whether +the hash table (m_data) needs expanding, this is the new function +hash_needs_expanding. This will be useful in a later commit. + +There should be no user visible changes after this commit. + +Approved-By: Tom Tromey + +diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c +--- a/gdb/dwarf2/index-write.c ++++ b/gdb/dwarf2/index-write.c +@@ -187,86 +187,135 @@ struct mapped_symtab + { + mapped_symtab () + { +- data.resize (1024); ++ m_data.resize (1024); + } + +- /* Minimize each entry in the symbol table, removing duplicates. */ ++ /* If there are no elements in the symbol table, then reduce the table ++ size to zero. Otherwise call symtab_index_entry::minimize each entry ++ in the symbol table. */ ++ + void minimize () + { +- for (symtab_index_entry &item : data) ++ if (m_element_count == 0) ++ m_data.resize (0); ++ ++ for (symtab_index_entry &item : m_data) + item.minimize (); + } + +- offset_type n_elements = 0; +- std::vector data; ++ /* Add an entry to SYMTAB. NAME is the name of the symbol. CU_INDEX is ++ the index of the CU in which the symbol appears. IS_STATIC is one if ++ the symbol is static, otherwise zero (global). */ ++ ++ void add_index_entry (const char *name, int is_static, ++ gdb_index_symbol_kind kind, offset_type cu_index); ++ ++ /* Access the obstack. */ ++ struct obstack *obstack () ++ { return &m_string_obstack; } ++ ++private: ++ ++ /* Find a slot in SYMTAB for the symbol NAME. Returns a reference to ++ the slot. ++ ++ Function is used only during write_hash_table so no index format ++ backward compatibility is needed. */ ++ ++ symtab_index_entry &find_slot (const char *name); ++ ++ /* Expand SYMTAB's hash table. */ ++ ++ void hash_expand (); ++ ++ /* Return true if the hash table in data needs to grow. */ ++ ++ bool hash_needs_expanding () const ++ { return 4 * m_element_count / 3 >= m_data.size (); } ++ ++ /* A vector that is used as a hash table. */ ++ std::vector m_data; ++ ++ /* The number of elements stored in the m_data hash. */ ++ offset_type m_element_count = 0; + + /* Temporary storage for names. */ + auto_obstack m_string_obstack; +-}; + +-/* Find a slot in SYMTAB for the symbol NAME. Returns a reference to +- the slot. ++public: ++ using iterator = decltype (m_data)::iterator; ++ using const_iterator = decltype (m_data)::const_iterator; + +- Function is used only during write_hash_table so no index format backward +- compatibility is needed. */ ++ iterator begin () ++ { return m_data.begin (); } + +-static symtab_index_entry & +-find_slot (struct mapped_symtab *symtab, const char *name) ++ iterator end () ++ { return m_data.end (); } ++ ++ const_iterator cbegin () ++ { return m_data.cbegin (); } ++ ++ const_iterator cend () ++ { return m_data.cend (); } ++}; ++ ++/* See class definition. */ ++ ++symtab_index_entry & ++mapped_symtab::find_slot (const char *name) + { + offset_type index, step, hash = mapped_index_string_hash (INT_MAX, name); + +- index = hash & (symtab->data.size () - 1); +- step = ((hash * 17) & (symtab->data.size () - 1)) | 1; ++ index = hash & (m_data.size () - 1); ++ step = ((hash * 17) & (m_data.size () - 1)) | 1; + + for (;;) + { +- if (symtab->data[index].name == NULL +- || strcmp (name, symtab->data[index].name) == 0) +- return symtab->data[index]; +- index = (index + step) & (symtab->data.size () - 1); ++ if (m_data[index].name == NULL ++ || strcmp (name, m_data[index].name) == 0) ++ return m_data[index]; ++ index = (index + step) & (m_data.size () - 1); + } + } + +-/* Expand SYMTAB's hash table. */ ++/* See class definition. */ + +-static void +-hash_expand (struct mapped_symtab *symtab) ++void ++mapped_symtab::hash_expand () + { +- auto old_entries = std::move (symtab->data); ++ auto old_entries = std::move (m_data); + +- symtab->data.clear (); +- symtab->data.resize (old_entries.size () * 2); ++ gdb_assert (m_data.size () == 0); ++ m_data.resize (old_entries.size () * 2); + + for (auto &it : old_entries) + if (it.name != NULL) + { +- auto &ref = find_slot (symtab, it.name); ++ auto &ref = this->find_slot (it.name); + ref = std::move (it); + } + } + +-/* Add an entry to SYMTAB. NAME is the name of the symbol. +- CU_INDEX is the index of the CU in which the symbol appears. +- IS_STATIC is one if the symbol is static, otherwise zero (global). */ ++/* See class definition. */ + +-static void +-add_index_entry (struct mapped_symtab *symtab, const char *name, +- int is_static, gdb_index_symbol_kind kind, +- offset_type cu_index) ++void ++mapped_symtab::add_index_entry (const char *name, int is_static, ++ gdb_index_symbol_kind kind, ++ offset_type cu_index) + { +- symtab_index_entry *slot = &find_slot (symtab, name); ++ symtab_index_entry *slot = &this->find_slot (name); + if (slot->name == NULL) + { + /* This is a new element in the hash table. */ +- ++symtab->n_elements; ++ ++this->m_element_count; + + /* We might need to grow the hash table. */ +- if (4 * symtab->n_elements / 3 >= symtab->data.size ()) ++ if (this->hash_needs_expanding ()) + { +- hash_expand (symtab); ++ this->hash_expand (); + + /* This element will have a different slot in the new table. */ +- slot = &find_slot (symtab, name); ++ slot = &this->find_slot (name); + + /* But it should still be a new element in the hash table. */ + gdb_assert (slot->name == nullptr); +@@ -387,7 +436,7 @@ write_hash_table (mapped_symtab *symtab, data_buf &output, data_buf &cpool) + + /* We add all the index vectors to the constant pool first, to + ensure alignment is ok. */ +- for (symtab_index_entry &entry : symtab->data) ++ for (symtab_index_entry &entry : *symtab) + { + if (entry.name == NULL) + continue; +@@ -416,7 +465,7 @@ write_hash_table (mapped_symtab *symtab, data_buf &output, data_buf &cpool) + + /* Now write out the hash table. */ + std::unordered_map str_table; +- for (const auto &entry : symtab->data) ++ for (const auto &entry : *symtab) + { + offset_type str_off, vec_off; + +@@ -1151,7 +1200,7 @@ write_cooked_index (cooked_index *table, + const auto it = cu_index_htab.find (entry->per_cu); + gdb_assert (it != cu_index_htab.cend ()); + +- const char *name = entry->full_name (&symtab->m_string_obstack); ++ const char *name = entry->full_name (symtab->obstack ()); + + if (entry->per_cu->lang () == language_ada) + { +@@ -1159,7 +1208,7 @@ write_cooked_index (cooked_index *table, + gdb, it has to use the encoded name, with any + suffixes stripped. */ + std::string encoded = ada_encode (name, false); +- name = obstack_strdup (&symtab->m_string_obstack, ++ name = obstack_strdup (symtab->obstack (), + encoded.c_str ()); + } + else if (entry->per_cu->lang () == language_cplus +@@ -1191,8 +1240,8 @@ write_cooked_index (cooked_index *table, + else + kind = GDB_INDEX_SYMBOL_KIND_TYPE; + +- add_index_entry (symtab, name, (entry->flags & IS_STATIC) != 0, +- kind, it->second); ++ symtab->add_index_entry (name, (entry->flags & IS_STATIC) != 0, ++ kind, it->second); + } + } + +@@ -1267,8 +1316,6 @@ write_gdbindex (dwarf2_per_bfd *per_bfd, cooked_index *table, + symtab.minimize (); + + data_buf symtab_vec, constant_pool; +- if (symtab.n_elements == 0) +- symtab.data.resize (0); + + write_hash_table (&symtab, symtab_vec, constant_pool); + diff --git a/gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch b/gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch new file mode 100644 index 0000000..15365e6 --- /dev/null +++ b/gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch @@ -0,0 +1,101 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Mon, 27 Nov 2023 13:19:39 +0000 +Subject: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch + +;; Back-port upstream commit 3644f41dc80 as part of a fix for +;; non-deterministic gdb-index generation (RH BZ 2232086). + +gdb: generate dwarf-5 index identically as worker-thread count changes + +Similar to the previous commit, this commit ensures that the dwarf-5 +index files are generated identically as the number of worker-threads +changes. + +Building the dwarf-5 index makes use of a closed hash table, the +bucket_hash local within debug_names::build(). Entries are added to +bucket_hash from m_name_to_value_set, which, in turn, is populated +by calls to debug_names::insert() in write_debug_names. The insert +calls are ordered based on the entries within the cooked_index, and +the ordering within cooked_index depends on the number of worker +threads that GDB is using. + +My proposal is to sort each chain within the bucket_hash closed hash +table prior to using this to build the dwarf-5 index. + +The buckets within bucket_hash will always have the same ordering (for +a given GDB build with a given executable), and by sorting the chains +within each bucket, we can be sure that GDB will see each entry in a +deterministic order. + +I've extended the index creation test to cover this case. + +Approved-By: Tom Tromey + +diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c +--- a/gdb/dwarf2/index-write.c ++++ b/gdb/dwarf2/index-write.c +@@ -452,6 +452,11 @@ class c_str_view + return strcmp (m_cstr, other.m_cstr) == 0; + } + ++ bool operator< (const c_str_view &other) const ++ { ++ return strcmp (m_cstr, other.m_cstr) < 0; ++ } ++ + /* Return the underlying C string. Note, the returned string is + only a reference with lifetime of this object. */ + const char *c_str () const +@@ -771,10 +776,18 @@ class debug_names + } + for (size_t bucket_ix = 0; bucket_ix < bucket_hash.size (); ++bucket_ix) + { +- const std::forward_list &hashitlist +- = bucket_hash[bucket_ix]; ++ std::forward_list &hashitlist = bucket_hash[bucket_ix]; + if (hashitlist.empty ()) + continue; ++ ++ /* Sort the items within each bucket. This ensures that the ++ generated index files will be the same no matter the order in ++ which symbols were added into the index. */ ++ hashitlist.sort ([] (const hash_it_pair &a, const hash_it_pair &b) ++ { ++ return a.it->first < b.it->first; ++ }); ++ + uint32_t &bucket_slot = m_bucket_table[bucket_ix]; + /* The hashes array is indexed starting at 1. */ + store_unsigned_integer (reinterpret_cast (&bucket_slot), +diff --git a/gdb/testsuite/gdb.gdb/index-file.exp b/gdb/testsuite/gdb.gdb/index-file.exp +--- a/gdb/testsuite/gdb.gdb/index-file.exp ++++ b/gdb/testsuite/gdb.gdb/index-file.exp +@@ -47,6 +47,9 @@ remote_exec host "mkdir -p ${dir1}" + with_timeout_factor $timeout_factor { + gdb_test_no_output "save gdb-index $dir1" \ + "create gdb-index file" ++ ++ gdb_test_no_output "save gdb-index -dwarf-5 $dir1" \ ++ "create dwarf-index files" + } + + # Close GDB. +@@ -143,13 +146,16 @@ if { $worker_threads > 1 } { + with_timeout_factor $timeout_factor { + gdb_test_no_output "save gdb-index $dir2" \ + "create second gdb-index file" ++ ++ gdb_test_no_output "save gdb-index -dwarf-5 $dir2" \ ++ "create second dwarf-index files" + } + + # Close GDB. + gdb_exit + + # Now check that the index files are identical. +- foreach suffix { gdb-index } { ++ foreach suffix { gdb-index debug_names debug_str } { + set result \ + [remote_exec host \ + "cmp -s \"$dir1/${index_filename_base}.${suffix}\" \"$dir2/${index_filename_base}.${suffix}\""] diff --git a/gdb-rhbz-2232086-generate-gdb-index-consistently.patch b/gdb-rhbz-2232086-generate-gdb-index-consistently.patch new file mode 100644 index 0000000..0d78380 --- /dev/null +++ b/gdb-rhbz-2232086-generate-gdb-index-consistently.patch @@ -0,0 +1,230 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Fri, 24 Nov 2023 12:04:36 +0000 +Subject: gdb-rhbz-2232086-generate-gdb-index-consistently.patch + +;; Back-port upstream commit aff250145af as part of a fix for +;; non-deterministic gdb-index generation (RH BZ 2232086). + +gdb: generate gdb-index identically regardless of work thread count + +It was observed that changing the number of worker threads that GDB +uses (maintenance set worker-threads NUM) would have an impact on the +layout of the generated gdb-index. + +The cause seems to be how the CU are distributed between threads, and +then symbols that appear in multiple CU can be encountered earlier or +later depending on whether a particular CU moves between threads. + +I certainly found this behaviour was reproducible when generating an +index for GDB itself, like: + + gdb -q -nx -nh -batch \ + -eiex 'maint set worker-threads NUM' \ + -ex 'save gdb-index /tmp/' + +And then setting different values for NUM will change the generated +index. + +Now, the question is: does this matter? + +I would like to suggest that yes, this does matter. At Red Hat we +generate a gdb-index as part of the build process, and we would +ideally like to have reproducible builds: for the same source, +compiled with the same tool-chain, we should get the exact same output +binary. And we do .... except for the index. + +Now we could simply force GDB to only use a single worker thread when +we build the index, but, I don't think the idea of reproducible builds +is that strange, so I think we should ensure that our generated +indexes are always reproducible. + +To achieve this, I propose that we add an extra step when building the +gdb-index file. After constructing the initial symbol hash table +contents, we will pull all the symbols out of the hash, sort them, +then re-insert them in sorted order. This will ensure that the +structure of the generated hash will remain consistent (given the same +set of symbols). + +I've extended the existing index-file test to check that the generated +index doesn't change if we adjust the number of worker threads used. +Given that this test is already rather slow, I've only made one change +to the worker-thread count. Maybe this test should be changed to use +a smaller binary, which is quicker to load, and for which we could +then try many different worker thread counts. + +Approved-By: Tom Tromey + +diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c +--- a/gdb/dwarf2/index-write.c ++++ b/gdb/dwarf2/index-write.c +@@ -210,6 +210,13 @@ struct mapped_symtab + void add_index_entry (const char *name, int is_static, + gdb_index_symbol_kind kind, offset_type cu_index); + ++ /* When entries are originally added into the data hash the order will ++ vary based on the number of worker threads GDB is configured to use. ++ This function will rebuild the hash such that the final layout will be ++ deterministic regardless of the number of worker threads used. */ ++ ++ void sort (); ++ + /* Access the obstack. */ + struct obstack *obstack () + { return &m_string_obstack; } +@@ -296,6 +303,65 @@ mapped_symtab::hash_expand () + } + } + ++/* See mapped_symtab class declaration. */ ++ ++void mapped_symtab::sort () ++{ ++ /* Move contents out of this->data vector. */ ++ std::vector original_data = std::move (m_data); ++ ++ /* Restore the size of m_data, this will avoid having to expand the hash ++ table (and rehash all elements) when we reinsert after sorting. ++ However, we do reset the element count, this allows for some sanity ++ checking asserts during the reinsert phase. */ ++ gdb_assert (m_data.size () == 0); ++ m_data.resize (original_data.size ()); ++ m_element_count = 0; ++ ++ /* Remove empty entries from ORIGINAL_DATA, this makes sorting quicker. */ ++ auto it = std::remove_if (original_data.begin (), original_data.end (), ++ [] (const symtab_index_entry &entry) -> bool ++ { ++ return entry.name == nullptr; ++ }); ++ original_data.erase (it, original_data.end ()); ++ ++ /* Sort the existing contents. */ ++ std::sort (original_data.begin (), original_data.end (), ++ [] (const symtab_index_entry &a, ++ const symtab_index_entry &b) -> bool ++ { ++ /* Return true if A is before B. */ ++ gdb_assert (a.name != nullptr); ++ gdb_assert (b.name != nullptr); ++ ++ return strcmp (a.name, b.name) < 0; ++ }); ++ ++ /* Re-insert each item from the sorted list. */ ++ for (auto &entry : original_data) ++ { ++ /* We know that ORIGINAL_DATA contains no duplicates, this data was ++ taken from a hash table that de-duplicated entries for us, so ++ count this as a new item. ++ ++ As we retained the original size of m_data (see above) then we ++ should never need to grow m_data_ during this re-insertion phase, ++ assert that now. */ ++ ++m_element_count; ++ gdb_assert (!this->hash_needs_expanding ()); ++ ++ /* Lookup a slot. */ ++ symtab_index_entry &slot = this->find_slot (entry.name); ++ ++ /* As discussed above, we should not find duplicates. */ ++ gdb_assert (slot.name == nullptr); ++ ++ /* Move this item into the slot we found. */ ++ slot = std::move (entry); ++ } ++} ++ + /* See class definition. */ + + void +@@ -1311,6 +1377,9 @@ write_gdbindex (dwarf2_per_bfd *per_bfd, cooked_index *table, + for (auto map : table->get_addrmaps ()) + write_address_map (map, addr_vec, cu_index_htab); + ++ /* Ensure symbol hash is built domestically. */ ++ symtab.sort (); ++ + /* Now that we've processed all symbols we can shrink their cu_indices + lists. */ + symtab.minimize (); +diff --git a/gdb/testsuite/gdb.gdb/index-file.exp b/gdb/testsuite/gdb.gdb/index-file.exp +--- a/gdb/testsuite/gdb.gdb/index-file.exp ++++ b/gdb/testsuite/gdb.gdb/index-file.exp +@@ -38,6 +38,9 @@ with_timeout_factor $timeout_factor { + clean_restart $filename + } + ++# Record how many worker threads GDB is using. ++set worker_threads [gdb_get_worker_threads] ++ + # Generate an index file. + set dir1 [standard_output_file "index_1"] + remote_exec host "mkdir -p ${dir1}" +@@ -116,3 +119,41 @@ proc check_symbol_table_usage { filename } { + + set index_filename_base [file tail $filename] + check_symbol_table_usage "$dir1/${index_filename_base}.gdb-index" ++ ++# If GDB is using more than 1 worker thread then reduce the number of ++# worker threads, regenerate the index, and check that we get the same ++# index file back. At one point the layout of the index would vary ++# based on the number of worker threads used. ++if { $worker_threads > 1 } { ++ # Start GDB, but don't load a file yet. ++ clean_restart ++ ++ # Adjust the number of threads to use. ++ set reduced_threads [expr $worker_threads / 2] ++ gdb_test_no_output "maint set worker-threads $reduced_threads" ++ ++ with_timeout_factor $timeout_factor { ++ # Now load the test binary. ++ gdb_file_cmd $filename ++ } ++ ++ # Generate an index file. ++ set dir2 [standard_output_file "index_2"] ++ remote_exec host "mkdir -p ${dir2}" ++ with_timeout_factor $timeout_factor { ++ gdb_test_no_output "save gdb-index $dir2" \ ++ "create second gdb-index file" ++ } ++ ++ # Close GDB. ++ gdb_exit ++ ++ # Now check that the index files are identical. ++ foreach suffix { gdb-index } { ++ set result \ ++ [remote_exec host \ ++ "cmp -s \"$dir1/${index_filename_base}.${suffix}\" \"$dir2/${index_filename_base}.${suffix}\""] ++ gdb_assert { [lindex $result 0] == 0 } \ ++ "$suffix files are identical" ++ } ++} +diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp +--- a/gdb/testsuite/lib/gdb.exp ++++ b/gdb/testsuite/lib/gdb.exp +@@ -10033,6 +10033,21 @@ proc is_target_non_stop { {testname ""} } { + return $is_non_stop + } + ++# Return the number of worker threads that GDB is currently using. ++ ++proc gdb_get_worker_threads { {testname ""} } { ++ set worker_threads "UNKNOWN" ++ gdb_test_multiple "maintenance show worker-threads" $testname { ++ -wrap -re "The number of worker threads GDB can use is unlimited \\(currently ($::decimal)\\)\\." { ++ set worker_threads $expect_out(1,string) ++ } ++ -wrap -re "The number of worker threads GDB can use is ($::decimal)\\." { ++ set worker_threads $expect_out(1,string) ++ } ++ } ++ return $worker_threads ++} ++ + # Check if the compiler emits epilogue information associated + # with the closing brace or with the last statement line. + # diff --git a/gdb-rhbz-2232086-reduce-size-of-gdb-index.patch b/gdb-rhbz-2232086-reduce-size-of-gdb-index.patch new file mode 100644 index 0000000..41b495e --- /dev/null +++ b/gdb-rhbz-2232086-reduce-size-of-gdb-index.patch @@ -0,0 +1,222 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Fri, 24 Nov 2023 11:50:35 +0000 +Subject: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch + +;; Back-port upstream commit aa19bc1d259 as part of a fix for +;; non-deterministic gdb-index generation (RH BZ 2232086). + +gdb: reduce size of generated gdb-index file + +I noticed in passing that out algorithm for generating the gdb-index +file is incorrect. When building the hash table in add_index_entry we +count every incoming entry rehash when the number of entries gets too +large. However, some of the incoming entries will be duplicates, +which don't actually result in new items being added to the hash +table. + +As a result, we grow the gdb-index hash table far too often. + +With an unmodified GDB, generating a gdb-index for GDB, I see a file +size of 90M, with a hash usage (in the generated index file) of just +2.6%. + +With a patched GDB, generating a gdb-index for the _same_ GDB binary, +I now see a gdb-index file size of 30M, with a hash usage of 41.9%. + +This is a 67% reduction in gdb-index file size. + +Obviously, not every gdb-index file is going to see such big savings, +however, the larger a program, and the more symbols that are +duplicated between compilation units, the more GDB would over count, +and so, over-grow the index. + +The gdb-index hash table we create has a minimum size of 1024, and +then we grow the hash when it is 75% full, doubling the hash table at +that time. Given this, then we expect that either: + + a. The hash table is size 1024, and less than 75% full, or + b. The hash table is between 37.5% and 75% full. + +I've include a test that checks some of these constraints -- I've not +bothered to check the upper limit, and over full hash table isn't +really a problem here, but if the fill percentage is less than 37.5% +then this indicates that we've done something wrong (obviously, I also +check for the 1024 minimum size). + +Approved-By: Tom Tromey + +diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c +--- a/gdb/dwarf2/index-write.c ++++ b/gdb/dwarf2/index-write.c +@@ -254,20 +254,29 @@ add_index_entry (struct mapped_symtab *symtab, const char *name, + int is_static, gdb_index_symbol_kind kind, + offset_type cu_index) + { +- offset_type cu_index_and_attrs; ++ symtab_index_entry *slot = &find_slot (symtab, name); ++ if (slot->name == NULL) ++ { ++ /* This is a new element in the hash table. */ ++ ++symtab->n_elements; + +- ++symtab->n_elements; +- if (4 * symtab->n_elements / 3 >= symtab->data.size ()) +- hash_expand (symtab); ++ /* We might need to grow the hash table. */ ++ if (4 * symtab->n_elements / 3 >= symtab->data.size ()) ++ { ++ hash_expand (symtab); + +- symtab_index_entry &slot = find_slot (symtab, name); +- if (slot.name == NULL) +- { +- slot.name = name; ++ /* This element will have a different slot in the new table. */ ++ slot = &find_slot (symtab, name); ++ ++ /* But it should still be a new element in the hash table. */ ++ gdb_assert (slot->name == nullptr); ++ } ++ ++ slot->name = name; + /* index_offset is set later. */ + } + +- cu_index_and_attrs = 0; ++ offset_type cu_index_and_attrs = 0; + DW2_GDB_INDEX_CU_SET_VALUE (cu_index_and_attrs, cu_index); + DW2_GDB_INDEX_SYMBOL_STATIC_SET_VALUE (cu_index_and_attrs, is_static); + DW2_GDB_INDEX_SYMBOL_KIND_SET_VALUE (cu_index_and_attrs, kind); +@@ -279,7 +288,7 @@ add_index_entry (struct mapped_symtab *symtab, const char *name, + the last entry pushed), but a symbol could have multiple kinds in one CU. + To keep things simple we don't worry about the duplication here and + sort and uniquify the list after we've processed all symbols. */ +- slot.cu_indices.push_back (cu_index_and_attrs); ++ slot->cu_indices.push_back (cu_index_and_attrs); + } + + /* See symtab_index_entry. */ +diff --git a/gdb/testsuite/gdb.gdb/index-file.exp b/gdb/testsuite/gdb.gdb/index-file.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.gdb/index-file.exp +@@ -0,0 +1,118 @@ ++# Copyright 2023 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# Load the GDB executable, and then 'save gdb-index', and make some ++# checks of the generated index file. ++ ++load_lib selftest-support.exp ++ ++# Can't save an index with readnow. ++if {[readnow]} { ++ untested "cannot create an index when readnow is in use" ++ return -1 ++} ++ ++# A multiplier used to ensure slow tasks are less likely to timeout. ++set timeout_factor 20 ++ ++set filename [selftest_prepare] ++if { $filename eq "" } { ++ unsupported "${gdb_test_file_name}.exp" ++ return -1 ++} ++ ++with_timeout_factor $timeout_factor { ++ # Start GDB, load FILENAME. ++ clean_restart $filename ++} ++ ++# Generate an index file. ++set dir1 [standard_output_file "index_1"] ++remote_exec host "mkdir -p ${dir1}" ++with_timeout_factor $timeout_factor { ++ gdb_test_no_output "save gdb-index $dir1" \ ++ "create gdb-index file" ++} ++ ++# Close GDB. ++gdb_exit ++ ++# Validate that the index-file FILENAME has made efficient use of its ++# symbol hash table. Calculate the number of symbols in the hash ++# table and the total hash table size. The hash table starts with ++# 1024 entries, and then doubles each time it is filled to 75%. At ++# 75% filled, doubling the size takes it to 37.5% filled. ++# ++# Thus, the hash table is correctly filled if: ++# 1. Its size is 1024 (i.e. it has not yet had its first doubling), or ++# 2. Its filled percentage is over 37% ++# ++# We could check that it is not over filled, but I don't as that's not ++# really an issue. But we did once have a bug where the table was ++# doubled incorrectly, in which case we'd see a filled percentage of ++# around 2% in some cases, which is a huge waste of disk space. ++proc check_symbol_table_usage { filename } { ++ # Open the file in binary mode and read-only mode. ++ set fp [open $filename rb] ++ ++ # Configure the channel to use binary translation. ++ fconfigure $fp -translation binary ++ ++ # Read the first 8 bytes of the file, which contain the header of ++ # the index section. ++ set header [read $fp [expr 7 * 4]] ++ ++ # Scan the header to get the version, the CU list offset, and the ++ # types CU list offset. ++ binary scan $header iiiiii version \ ++ _ _ _ symbol_table_offset shortcut_offset ++ ++ # The length of the symbol hash table (in entries). ++ set len [expr ($shortcut_offset - $symbol_table_offset) / 8] ++ ++ # Now walk the hash table and count how many entries are in use. ++ set offset $symbol_table_offset ++ set count 0 ++ while { $offset < $shortcut_offset } { ++ seek $fp $offset ++ set entry [read $fp 8] ++ binary scan $entry ii name_ptr flags ++ if { $name_ptr != 0 } { ++ incr count ++ } ++ ++ incr offset 8 ++ } ++ ++ # Close the file. ++ close $fp ++ ++ # Calculate how full the cache is. ++ set pct [expr (100 * double($count)) / $len] ++ ++ # Write our results out to the gdb.log. ++ verbose -log "Hash table size: $len" ++ verbose -log "Hash table entries: $count" ++ verbose -log "Percentage usage: $pct%" ++ ++ # The minimum fill percentage is actually 37.5%, but we give TCL a ++ # little flexibility in case the FP maths give a result a little ++ # off. ++ gdb_assert { $len == 1024 || $pct > 37 } \ ++ "symbol hash table usage" ++} ++ ++set index_filename_base [file tail $filename] ++check_symbol_table_usage "$dir1/${index_filename_base}.gdb-index" diff --git a/gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch b/gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch new file mode 100644 index 0000000..5a5af92 --- /dev/null +++ b/gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch @@ -0,0 +1,83 @@ +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-rhbz-818343-set-solib-absolute-prefix-testcase.patch + +;; Testcase for `Setting solib-absolute-prefix breaks vDSO' (BZ 818343). +;;=fedoratest + +diff --git a/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c +@@ -0,0 +1,26 @@ ++/* Copyright (C) 2012 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++#include ++#include ++ ++int ++main (int argc, char *argv[]) ++{ ++ printf ("Hello, World.\n"); ++ abort (); ++} +diff --git a/gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.exp +@@ -0,0 +1,39 @@ ++# Copyright 2012 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++set testfile "set-solib-absolute-prefix" ++set srcfile ${testfile}.c ++ ++# It is necessary to verify if the binary is 32-bit, so that the system ++# call `__kernel_vsyscall' originates from vDSO. ++ ++if { ![is_ilp32_target] } { ++ return -1 ++} ++ ++if { [prepare_for_testing $testfile.exp $testfile $srcfile] } { ++ return -1 ++} ++ ++if { ![runto_main] } { ++ return -1 ++} ++ ++gdb_test "continue" "Program received signal SIGABRT, Aborted.*" \ ++ "continue until abort" ++gdb_test "set solib-absolute-prefix /BOGUS_DIRECT" \ ++ ".*warning: Unable to find dynamic linker breakpoint function.*" \ ++ "set solib-absolute-prefix" ++gdb_test "bt" "__kernel_vsyscall.*" "backtrace with __kernel_vsyscall" diff --git a/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch b/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch new file mode 100644 index 0000000..6eecc8f --- /dev/null +++ b/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch @@ -0,0 +1,170 @@ +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-rhbz1007614-memleak-infpy_read_memory-test.patch + +;; Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614) +;;=fedoratest + +Original message by Tom Tromey: + + + Message-ID: <871uoc1va3.fsf@fleche.redhat.com> + +Comment from Sergio Durigan Junior: + + In order to correctly test this patch, I wrote a testcase based on Jan + Kratochvil's . The + testcase, which can be seen below, tests GDB in order to see if the + amount of memory being leaked is minimal, as requested in the bugzilla. + It is hard to define what "minimum" is, so I ran the testcase on all + supported RHEL architectures and came up with an average. + +commit cc0265cdda9dc7e8665e8bfcf5b4477489daf27c +Author: Tom Tromey +Date: Wed Mar 28 17:38:08 2012 +0000 + + * python/py-inferior.c (infpy_read_memory): Remove cleanups and + explicitly free 'buffer' on exit paths. Decref 'membuf_object' + before returning. + +diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c +@@ -0,0 +1,27 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2014 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++static struct x ++ { ++ char unsigned u[4096]; ++ } x, *px = &x; ++ ++int ++main (int argc, char *argv[]) ++{ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp +@@ -0,0 +1,68 @@ ++# Copyright 2014 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++set testfile py-gdb-rhbz1007614-memleak-infpy_read_memory ++set srcfile ${testfile}.c ++set binfile [standard_output_file ${testfile}] ++ ++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { ++ return -1 ++} ++ ++if { [skip_python_tests] } { continue } ++ ++set pid_of_gdb [exp_pid -i [board_info host fileid]] ++ ++proc memory_v_pages_get {} { ++ global pid_of_gdb ++ set fd [open "/proc/$pid_of_gdb/statm"] ++ gets $fd line ++ close $fd ++ # number of pages of virtual memory ++ scan $line "%d" drs ++ return $drs ++} ++ ++if { ![runto_main] } { ++ untested $testfile.exp ++ return -1 ++} ++ ++set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py] ++ ++gdb_test "source ${remote_python_file}" "" ++ ++gdb_test "hello-world" "" ++ ++set kbytes_before [memory_v_pages_get] ++verbose -log "kbytes_before = $kbytes_before" ++ ++gdb_test "hello-world" "" ++ ++set kbytes_after [memory_v_pages_get] ++verbose -log "kbytes_after = $kbytes_after" ++ ++set kbytes_diff [expr $kbytes_after - $kbytes_before] ++verbose -log "kbytes_diff = $kbytes_diff" ++ ++# The value "1000" was calculated by running a few GDB sessions with this ++# testcase, and seeing how much (in average) the memory consumption ++# increased after the "hello-world" command issued above. The average ++# was around 500 bytes, so I chose 1000 as a high estimate. ++if { $kbytes_diff > 1000 } { ++ fail "there is a memory leak on GDB (RHBZ 1007614)" ++} else { ++ pass "there is not a memory leak on GDB (RHBZ 1007614)" ++} +diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py +@@ -0,0 +1,30 @@ ++# Copyright (C) 2014 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++class HelloWorld (gdb.Command): ++ """Greet the whole world.""" ++ ++ def __init__ (self): ++ super (HelloWorld, self).__init__ ("hello-world", ++ gdb.COMMAND_OBSCURE) ++ ++ def invoke (self, arg, from_tty): ++ px = gdb.parse_and_eval("px") ++ core = gdb.inferiors()[0] ++ for i in range(256 * 1024): ++ chunk = core.read_memory(px, 4096) ++ print "Hello, World!" ++ ++HelloWorld () diff --git a/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch b/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch new file mode 100644 index 0000000..e6bd797 --- /dev/null +++ b/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch @@ -0,0 +1,235 @@ +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-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch + +;; Fix '[ppc64] and [s390x] wrong prologue skip on -O2 -g code' (Jan +;; Kratochvil, RH BZ 1084404). +;;=fedoratest + +These testcases have been created by compiling glibc-2.17-78 on +RHEL-7.1 s390x/ppc64 boxes, and then taking the "select.o" file +present at $builddir/misc/select.o. + +diff --git a/gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp b/gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp +@@ -0,0 +1,34 @@ ++# Copyright 2015 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++if { ![istarget powerpc64-*linux-*] || ![is_lp64_target] } { ++ verbose "Skipping ppc64-prologue-skip.exp" ++ return ++} ++ ++set testfile "ppc64-prologue-skip" ++set uufile "${srcdir}/${subdir}/${testfile}.o.uu" ++set ofile "${srcdir}/${subdir}/${testfile}.o" ++ ++if { [catch "system \"uudecode -o ${ofile} ${uufile}\"" ] != 0 } { ++ untested "failed uudecode" ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_load $ofile ++ ++gdb_test "break ___newselect_nocancel" "Breakpoint $decimal at 0xc: file ../sysdeps/unix/syscall-template.S, line 81." "breakpoint on ___newselect_nocancel" +diff --git a/gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu b/gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu +@@ -0,0 +1,70 @@ ++begin 644 ppc64-skip-prologue.o.uu ++M?T5,1@("`0`````````````!`!4````!```````````````````````````` ++M``-(``````!```````!``!0`$8%-B-`L"@``0,(`-#@``(Y$```"3.,`('P( ++M`J;X`0`0^"'_D4@```%@````Z`$`@#@A`'!\"`.F3H``(/@A_X%]*`*F^2$` ++MD/CA`-#XP0#(^*$`P/B!`+CX80"P2````6````#X80!PZ.$`T.C!`,CHH0#` ++MZ($`N.AA`+`X``".1````GP``";X80!X^`$`B.AA`'!(```!8````.DA`)#H ++M`0"(Z&$`>'TH`Z9\#_$@."$`@$SC`"!+__]@```````,($``````````O``( ++M7U]S96QE8W0```````````````````````````!6``(````Y!`'[#@T``0$! ++M`0````$```$N+B]S>7-D97!S+W5N:7@``'-Y"]S>7-C86QL+71E;7!L871E ++M+E,`+W)O;W0O9VQI8F,O9VQI8F,M,BXQ-RTW."YE;#$$!&PP!```` ++M`#`````8`````````+P`20YP$4%^1`X`009!0@Z``4(107Y2$49_20X`!D$& ++M1@``````+G-Y;71A8@`N`````````!(````$@````$`````````"``````````8```` ++M)@````$``````````P```````````````````1@````````````````````` ++M``````````$``````````````"P````(``````````,````````````````` ++M``$8```````````````````````````````!```````````````V`````0`` ++M```````#```````````````````!&``````````0```````````````````` ++M"```````````````,0````0`````````````````````````````"L`````` ++M````,````!(````%``````````@`````````&````#L````!```````````` ++M``````````````````$H```````````````````````````````!```````` ++M``````!0`````0`````````````````````````````!*`````````!:```` ++M`````````````````0``````````````2P````0````````````````````` ++M````````"O``````````&````!(````(``````````@`````````&````&$` ++M```!``````````````````````````````&"`````````),````````````` ++M```````!``````````````!<````!``````````````````````````````+ ++M"`````````!@````$@````H`````````"``````````8````;0````$````` ++M`````````````````````````A4`````````%`````````````````````$` ++M`````````````(`````!``````````````````````````````(P```````` ++M`#`````````````````````0``````````````![````!``````````````` ++M```````````````+:``````````P````$@````T`````````"``````````8 ++M````E`````$``````````@```````````````````F``````````2``````` ++M``````````````@``````````````(\````$```````````````````````` ++M``````N8`````````!@````2````#P`````````(`````````!@````1```` ++M`P`````````````````````````````"J`````````">```````````````` ++M`````0```````````````0````(`````````````````````````````"$@` ++M```````!L````!,````+``````````@`````````&`````D````#```````` ++M``````````````````````GX`````````'H````````````````````!```` ++M`````````````````````````````````````````````P```0`````````` ++M`````````````````P```P```````````````````````````P``!``````` ++M`````````````````````P``!0```````````````````````````P``"@`` ++M`````````````````````````P``#````````````````````````````P`` ++M"````````````````````````````P``#0`````````````````````````` ++M`P``#P```````````````````````````P``!P`````````````````````` ++M```!$@``!0```````````````````-@````*$@```0`````````,```````` ++M`#`````@$``````````````````````````````P$``````````````````` ++M``````````!*$`````````````````````````````!E(@``!0`````````` ++M`````````-@```!S(@``!0```````````````````-@`7U]S96QE8W0`7U]? ++M;F5W6YC8V%N8V5L`%]?;&EB8U]D:7-A8FQE7V%S>6YC8V%N8V5L`%]? ++M;&EB8U]S96QE8W0`. ++ ++if { ![istarget s390x-*linux-*] || ![is_lp64_target] } { ++ verbose "Skipping s390x-prologue-skip.exp" ++ return ++} ++ ++set testfile "s390x-prologue-skip" ++set uufile "${srcdir}/${subdir}/${testfile}.o.uu" ++set ofile "${srcdir}/${subdir}/${testfile}.o" ++ ++if { [catch "system \"uudecode -o ${ofile} ${uufile}\"" ] != 0 } { ++ untested "failed uudecode" ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_load $ofile ++ ++gdb_test "break select" "Breakpoint $decimal at 0x48: file ../sysdeps/unix/syscall-template.S, line 81." "breakpoint on select" +diff --git a/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu b/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu +@@ -0,0 +1,64 @@ ++begin 644 s390x-prologue-skip.o.uu ++M?T5,1@("`0`````````````!`!8````!```````````````````````````` ++M``+```````!```````!``!(`#^LE\!``).O?\&@`)+D$`.^G^_]@X^#P```D ++MP.4`````N00``NLE\+``!`J.N00`TKD$`"#`Y0````"Y!``MZ]_Q"``$I_0` ++M"L`0`````+\/$`"G=/_7"HZG2?`!N2$`),"T``````?^````5@`"````.0$! ++M^PX-``$!`0$````!```!+BXO7-C86QL+71E;7!L ++M871E+E,``0`````)`@```````````]```0)F$P("``$!````CP`"``````@! ++M```````````````````````````N+B]S>7-D97!S+W5N:7@OE(``7@. ++M`1L,#Z`!````````&````!P`````````1`!,CP6.!HT'2`[``@```!`````X ++M`````````"```````"YS>6UT86(`+G-T``````````&````!`````&``````````@````````` ++M&````%<````!``````````````````````````````$"`````````),````` ++M```````````````!``````````````!2````!``````````````````````` ++M```````)^`````````!@````$`````@`````````"``````````8````8P`` ++M``$``````````````````````````````94`````````%``````````````` ++M``````$``````````````'8````!``````````````````````````````&P ++M`````````#`````````````````````0``````````````!Q````!``````` ++M```````````````````````*6``````````P````$`````L`````````"``` ++M```````8````B@````$``````````@```````````````````>`````````` ++M2`````````````````````@``````````````(4````$```````````````` ++M``````````````J(`````````#`````0````#0`````````(`````````!@` ++M```1`````P`````````````````````````````"*`````````"4```````` ++M`````````````0```````````````0````(````````````````````````` ++M````!T`````````!L````!$````*``````````@`````````&`````D````# ++M``````````````````````````````CP`````````(X````````````````` ++M```!`````````````````````````````````````````````````P```0`` ++M`````````````````````````P```P```````````````````````````P`` ++M!````````````````````````````P``"``````````````````````````` ++M`P``"@```````````````````````````P``!@`````````````````````` ++M`````P``"P```````````````````````````P``#0`````````````````` ++M`````````P``!0`````````````````````````!$``````````````````` ++M```````````;$``````````````````````````````V$@```0````````!( ++M`````````"`````_$`````````````````````````````!7$@```0`````` ++M``!6`````````!````!I$`````````````````````````````!Y(@```0`` ++M``````!(`````````"````"'(@```0````````!(`````````"``7U]L:6)C ++M7V5N86)L95]A +Date: Fri, 27 Oct 2017 21:07:50 +0200 +Subject: gdb-rhbz1149205-catch-syscall-after-fork-test.patch + +;; Fix '`catch syscall' doesn't work for parent after `fork' is called' +;; (Philippe Waroquiers, RH BZ 1149205). +;;=fedoratest + +URL: +Message-ID: <1368136582.30058.7.camel@soleil> + + From: Philippe Waroquiers + To: gdb-patches at sourceware dot org + Subject: RFA: fix gdb_assert caused by 'catch signal ...' and fork + Date: Thu, 09 May 2013 23:56:22 +0200 + + The attached patch fixes a gdb_assert caused by the combination of catch + signal and fork: + break-catch-sig.c:152: internal-error: signal_catchpoint_remove_location: Assertion `signal_catch_counts[iter] > 0' failed. + + The problem is that the signal_catch_counts is decremented by detach_breakpoints. + The fix consists in not detaching breakpoint locations of type bp_loc_other. + The patch introduces a new test. + +Comments by Sergio Durigan Junior: + + I addded a specific testcase for this patch, which tests exactly the + issue that the customer is facing. This patch does not solve the + whole problem of catching a syscall and forking (for more details, + see , + specifically comment #3), but it solves the issue reported by the + customer. + + I also removed the original testcase of this patch, because it + relied on "catch signal", which is a command that is not implemented + in this version of GDB. + +commit bd9673a4ded96ea5c108601501c8e59003ea1be6 +Author: Philippe Waroquiers +Date: Tue May 21 18:47:05 2013 +0000 + + Fix internal error caused by interaction between catch signal and fork + +diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.c b/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.c +@@ -0,0 +1,11 @@ ++#include ++#include ++ ++int ++main (int argc, char **argv) ++{ ++ if (fork () == 0) ++ sleep (1); ++ chdir ("."); ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.exp b/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.exp +@@ -0,0 +1,58 @@ ++# Copyright 2015 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++if { [is_remote target] || ![isnative] } then { ++ continue ++} ++ ++set testfile "gdb-rhbz1149205-catch-syscall-fork" ++set srcfile ${testfile}.c ++set binfile [standard_output_file ${testfile}] ++ ++# Until "catch syscall" is implemented on other targets... ++if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then { ++ continue ++} ++ ++# This shall be updated whenever 'catch syscall' is implemented ++# on some architecture. ++#if { ![istarget "i\[34567\]86-*-linux*"] ++if { ![istarget "x86_64-*-linux*"] && ![istarget "i\[34567\]86-*-linux*"] ++ && ![istarget "powerpc-*-linux*"] && ![istarget "powerpc64-*-linux*"] ++ && ![istarget "sparc-*-linux*"] && ![istarget "sparc64-*-linux*"] } { ++ continue ++} ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { ++ untested ${testfile}.exp ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load $binfile ++ ++if { ![runto_main] } { ++ return -1 ++} ++ ++gdb_test "catch syscall chdir" \ ++ "Catchpoint $decimal \\\(syscall (.)?chdir(.)? \\\[$decimal\\\]\\\)" \ ++ "catch syscall chdir" ++ ++gdb_test "continue" \ ++ "Continuing\.\r\n.*\r\nCatchpoint $decimal \\\(call to syscall .?chdir.?.*" \ ++ "continue from catch syscall after fork" diff --git a/gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch b/gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch new file mode 100644 index 0000000..3a5e2d4 --- /dev/null +++ b/gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch @@ -0,0 +1,104 @@ +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-rhbz1261564-aarch64-hw-watchpoint-test.patch + +;; [aarch64] Fix hardware watchpoints (RH BZ 1261564). +;;=fedoratest + +diff --git a/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c +@@ -0,0 +1,33 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2016 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++__attribute__((aligned(16))) struct ++{ ++ int var0, var4, var8; ++} aligned; ++ ++int ++main (void) ++{ ++ aligned.var0 = 1; ++ aligned.var4 = 2; ++ aligned.var8 = 3; ++ ++ aligned.var4 = aligned.var0; ++ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp +@@ -0,0 +1,53 @@ ++# Copyright (C) 2016 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++if { [prepare_for_testing rhbz1261564-aarch64-watchpoint.exp "rhbz1261564-aarch64-watchpoint"] } { ++ return -1 ++} ++ ++if { ! [ runto main ] } then { return 0 } ++ ++set test "rwatch aligned.var4" ++if [istarget "s390*-*-*"] { ++ gdb_test $test {Target does not support this type of hardware watchpoint\.} ++ untested "s390* does not support hw read watchpoint" ++ return ++} ++gdb_test $test "Hardware read watchpoint \[0-9\]+: aligned.var4" ++ ++proc checkvar { address } { ++ global gdb_prompt ++ ++ set test "p &aligned.var$address" ++ gdb_test_multiple $test $test { ++ -re " = \\(int \\*\\) 0x\[0-9a-f\]+$address \r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re "\r\n$gdb_prompt $" { ++ untested "$test (unexpected ELF layout)" ++ return 0 ++ } ++ } ++ return 1 ++} ++if ![checkvar "0"] { return } ++if ![checkvar "4"] { return } ++if ![checkvar "8"] { return } ++ ++# Assumes: PPC_PTRACE_GETHWDBGINFO::data_bp_alignment == 8 ++# 'lwz' does read only 4 bytes but the hw watchpoint is 8 bytes wide. ++setup_xfail "powerpc*-*-*" ++ ++gdb_continue_to_end diff --git a/gdb-rhbz2232086-refactor-selftest-support.patch b/gdb-rhbz2232086-refactor-selftest-support.patch new file mode 100644 index 0000000..c19ef46 --- /dev/null +++ b/gdb-rhbz2232086-refactor-selftest-support.patch @@ -0,0 +1,77 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Fri, 24 Nov 2023 11:10:08 +0000 +Subject: gdb-rhbz2232086-refactor-selftest-support.patch + +;; Back-port upstream commit 1f0fab7ff86 as part of a fix for +;; non-deterministic gdb-index generation (RH BZ 2232086). + +gdb/testsuite: small refactor in selftest-support.exp + +Split out the code that makes a copy of the GDB executable ready for +self testing into a new proc. A later commit in this series wants to +load the GDB executable into GDB (for creating an on-disk debug +index), but doesn't need to make use of the full do_self_tests proc. + +There should be no changes in what is tested after this commit. + +Approved-By: Tom Tromey + +diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp +--- a/gdb/testsuite/lib/selftest-support.exp ++++ b/gdb/testsuite/lib/selftest-support.exp +@@ -92,11 +92,13 @@ proc selftest_setup { executable function } { + return 0 + } + +-# A simple way to run some self-tests. +- +-proc do_self_tests {function body} { +- global GDB tool +- ++# Prepare for running a self-test by moving the GDB executable to a ++# location where we can use it as the inferior. Return the filename ++# of the new location. ++# ++# If the current testing setup is not suitable for running a ++# self-test, then return an empty string. ++proc selftest_prepare {} { + # Are we testing with a remote board? In that case, the target + # won't have access to the GDB's auxilliary data files + # (data-directory, etc.). It's simpler to just skip. +@@ -120,19 +122,31 @@ proc do_self_tests {function body} { + # Run the test with self. Copy the file executable file in case + # this OS doesn't like to edit its own text space. + +- set GDB_FULLPATH [find_gdb $GDB] ++ set gdb_fullpath [find_gdb $::GDB] + + if {[is_remote host]} { +- set xgdb x$tool ++ set xgdb x$::tool + } else { +- set xgdb [standard_output_file x$tool] ++ set xgdb [standard_output_file x$::tool] + } + + # Remove any old copy lying around. + remote_file host delete $xgdb + ++ set filename [remote_download host $gdb_fullpath $xgdb] ++ ++ return $filename ++} ++ ++# A simple way to run some self-tests. ++ ++proc do_self_tests {function body} { ++ set file [selftest_prepare] ++ if { $file eq "" } { ++ return ++ } ++ + gdb_start +- set file [remote_download host $GDB_FULLPATH $xgdb] + + # When debugging GDB with GDB, some operations can take a relatively long + # time, especially if the build is non-optimized. Bump the timeout for the diff --git a/gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch b/gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch new file mode 100644 index 0000000..1aa07a6 --- /dev/null +++ b/gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch @@ -0,0 +1,48 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alexandra=20H=C3=A1jkov=C3=A1?= +Date: Mon, 8 Jan 2024 13:24:05 +0100 +Subject: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch + +gdb/python: avoid use of _PyOS_ReadlineTState + +In python/py-gdb-readline.c we make use of _PyOS_ReadlineTState, +however, this variable is no longer public in Python 3.13, and so GDB +no longer builds. + +We are making use of _PyOS_ReadlineTState in order to re-acquire the +Python Global Interpreter Lock (GIL). The _PyOS_ReadlineTState +variable is set in Python's outer readline code prior to calling the +user (GDB) supplied readline callback function, which for us is +gdbpy_readline_wrapper. The gdbpy_readline_wrapper function is called +without the GIL held. + +Instead of using _PyOS_ReadlineTState, I propose that we switch to +calling PyGILState_Ensure() and PyGILState_Release(). These functions +will acquire the GIL based on the current thread. I think this should +be sufficient; I can't imagine why we'd be running +gdbpy_readline_wrapper on one thread on behalf of a different Python +thread.... that would be unexpected I think. + +Approved-By: Tom Tromey + +diff --git a/gdb/python/py-gdb-readline.c b/gdb/python/py-gdb-readline.c +--- a/gdb/python/py-gdb-readline.c ++++ b/gdb/python/py-gdb-readline.c +@@ -56,13 +56,11 @@ gdbpy_readline_wrapper (FILE *sys_stdin, FILE *sys_stdout, + if (except.reason == RETURN_QUIT) + return NULL; + +- /* The thread state is nulled during gdbpy_readline_wrapper, +- with the original value saved in the following undocumented +- variable (see Python's Parser/myreadline.c and +- Modules/readline.c). */ +- PyEval_RestoreThread (_PyOS_ReadlineTState); ++ ++ /* This readline callback is called without the GIL held. */ ++ gdbpy_gil gil; ++ + gdbpy_convert_exception (except); +- PyEval_SaveThread (); + return NULL; + } + diff --git a/gdb-rhbz2250652-gdbpy_gil.patch b/gdb-rhbz2250652-gdbpy_gil.patch new file mode 100644 index 0000000..c51d512 --- /dev/null +++ b/gdb-rhbz2250652-gdbpy_gil.patch @@ -0,0 +1,81 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alexandra=20H=C3=A1jkov=C3=A1?= +Date: Mon, 8 Jan 2024 13:12:15 +0100 +Subject: gdb-rhbz2250652-gdbpy_gil.patch + +gdb: move gdbpy_gil into python-internal.h + +Move gdbpy_gil class into python-internal.h, the next +commit wants to make use of this class from a file other +than python.c. + +Approved-By: Tom Tromey + +diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h +--- a/gdb/python/python-internal.h ++++ b/gdb/python/python-internal.h +@@ -754,6 +754,30 @@ class gdbpy_allow_threads + PyThreadState *m_save; + }; + ++/* A helper class to save and restore the GIL, but without touching ++ the other globals that are handled by gdbpy_enter. */ ++ ++class gdbpy_gil ++{ ++public: ++ ++ gdbpy_gil () ++ : m_state (PyGILState_Ensure ()) ++ { ++ } ++ ++ ~gdbpy_gil () ++ { ++ PyGILState_Release (m_state); ++ } ++ ++ DISABLE_COPY_AND_ASSIGN (gdbpy_gil); ++ ++private: ++ ++ PyGILState_STATE m_state; ++}; ++ + /* Use this after a TRY_EXCEPT to throw the appropriate Python + exception. */ + #define GDB_PY_HANDLE_EXCEPTION(Exception) \ +diff --git a/gdb/python/python.c b/gdb/python/python.c +--- a/gdb/python/python.c ++++ b/gdb/python/python.c +@@ -257,30 +257,6 @@ gdbpy_enter::finalize () + python_gdbarch = target_gdbarch (); + } + +-/* A helper class to save and restore the GIL, but without touching +- the other globals that are handled by gdbpy_enter. */ +- +-class gdbpy_gil +-{ +-public: +- +- gdbpy_gil () +- : m_state (PyGILState_Ensure ()) +- { +- } +- +- ~gdbpy_gil () +- { +- PyGILState_Release (m_state); +- } +- +- DISABLE_COPY_AND_ASSIGN (gdbpy_gil); +- +-private: +- +- PyGILState_STATE m_state; +-}; +- + /* Set the quit flag. */ + + static void diff --git a/gdb-rhbz2261580-intrusive_list-assertion-fix.patch b/gdb-rhbz2261580-intrusive_list-assertion-fix.patch new file mode 100644 index 0000000..8ec30bc --- /dev/null +++ b/gdb-rhbz2261580-intrusive_list-assertion-fix.patch @@ -0,0 +1,55 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Kevin Buettner +Date: Mon, 29 Jan 2024 14:51:22 -0700 +Subject: gdb-rhbz2261580-intrusive_list-assertion-fix.patch + +;; Backport upstream workaround for GCC 14 problem which cause assertion +;; failures in GDB. + +[gdb/build] Workaround gcc PR113599 + +Since gcc commit d3f48f68227 ("c++: non-dependent .* operand folding +[PR112427]"), with gdb we run into PR gcc/113599 [1], a wrong-code bug, as +reported in PR build/31281. + +Work around this by flipping inherit order: +... +-class thread_info : public refcounted_object, +- public intrusive_list_node ++class thread_info : public intrusive_list_node, ++ public refcounted_object +... + +An argument could be made that this isn't necessary, because this occurred in +an unreleased gcc version. + +However, I think it could be useful when bisecting gcc for other problems in +building gdb. Having this workaround means the bisect won't reintroduce the +problem. Furthermore, the workaround is harmless. + +Tested on Fedora rawhide x86_64. + +Approved-By: Tom Tromey + +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31281 + +[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113599 + +diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h +--- a/gdb/gdbthread.h ++++ b/gdb/gdbthread.h +@@ -242,10 +242,11 @@ using private_thread_info_up = std::unique_ptr; + strong reference, and is thus not accounted for in the thread's + refcount. + +- The intrusive_list_node base links threads in a per-inferior list. */ ++ The intrusive_list_node base links threads in a per-inferior list. ++ We place it first in the inherit order to work around PR gcc/113599. */ + +-class thread_info : public refcounted_object, +- public intrusive_list_node ++class thread_info : public intrusive_list_node, ++ public refcounted_object + { + public: + explicit thread_info (inferior *inf, ptid_t ptid); diff --git a/gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch b/gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch new file mode 100644 index 0000000..c4b1a01 --- /dev/null +++ b/gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch @@ -0,0 +1,147 @@ +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-rhbz947564-findvar-assertion-frame-failed-testcase.patch + +;; Import regression test for `gdb/findvar.c:417: internal-error: +;; read_var_value: Assertion `frame' failed.' (RH BZ 947564) from RHEL 6.5. +;;=fedoratest + +diff --git a/gdb/testsuite/gdb.threads/tls-rhbz947564.cc b/gdb/testsuite/gdb.threads/tls-rhbz947564.cc +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/tls-rhbz947564.cc +@@ -0,0 +1,53 @@ ++#include ++#include ++ ++class x ++ { ++ public: ++ int n; ++ ++ x() : n(0) {} ++ }; ++ ++class y ++ { ++ public: ++ int v; ++ ++ y() : v(0) {} ++ static __thread x *xp; ++ }; ++ ++__thread x *y::xp; ++ ++static void ++foo (y *yp) ++{ ++ yp->v = 1; /* foo_marker */ ++} ++ ++static void * ++bar (void *unused) ++{ ++ x xinst; ++ y::xp= &xinst; ++ ++ y yy; ++ foo(&yy); ++ ++ return NULL; ++} ++ ++int ++main(int argc, char *argv[]) ++{ ++ pthread_t t[2]; ++ ++ pthread_create (&t[0], NULL, bar, NULL); ++ pthread_create (&t[1], NULL, bar, NULL); ++ ++ pthread_join (t[0], NULL); ++ pthread_join (t[1], NULL); ++ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.threads/tls-rhbz947564.exp b/gdb/testsuite/gdb.threads/tls-rhbz947564.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/tls-rhbz947564.exp +@@ -0,0 +1,75 @@ ++# Copyright (C) 2013 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . */ ++ ++set testfile tls-rhbz947564 ++set srcfile ${testfile}.cc ++set binfile [standard_output_file ${testfile}] ++ ++if [istarget "*-*-linux"] then { ++ set target_cflags "-D_MIT_POSIX_THREADS" ++} else { ++ set target_cflags "" ++} ++ ++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list c++ debug]] != "" } { ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++ ++gdb_load ${binfile} ++ ++if { ![runto_main] } { ++ fail "Can't run to function main" ++ return 0 ++} ++ ++gdb_breakpoint "foo" ++gdb_continue_to_breakpoint "foo" ".* foo_marker .*" ++ ++proc get_xp_val {try} { ++ global expect_out ++ global gdb_prompt ++ global hex ++ ++ set xp_val "" ++ gdb_test_multiple "print *yp" "print yp value" { ++ -re { = \{v = 0, static xp = (0x[0-9a-f]+)\}.* } { ++ pass "print $try value of *yp" ++ set xp_val $expect_out(1,string) ++ } ++ -re "$gdb_prompt $" { ++ fail "print $try value of *yp" ++ } ++ timeout { ++ fail "print $try value of *yp (timeout)" ++ } ++ } ++ return $xp_val ++} ++ ++set first_run [get_xp_val "first"] ++ ++gdb_test "continue" "Breakpoint \[0-9\]+, foo \\\(yp=$hex\\\) at.*" ++ ++set second_run [get_xp_val "second"] ++ ++if { $first_run != $second_run } { ++ pass "different values for TLS variable" ++} else { ++ fail "different values for TLS variable" ++} diff --git a/gdb-rpmlintrc b/gdb-rpmlintrc new file mode 100644 index 0000000..0abda80 --- /dev/null +++ b/gdb-rpmlintrc @@ -0,0 +1,16 @@ +# This line is mandatory to access the configuration functions +from Config import * + +# The testresult logs contain part of the build log and thus +# necessarily mention the buildroot +addFilter ("gdb-testresults.*file-contains-buildroot") + +# Historically libinproctrace was always in gdbserver. It's +# LD_PRELOADed into processes, so there are no direct ELF +# dependencies to it. It's required on the remote side (where +# gdbserver is) so it makes sense to put it in the same package. +# This never was a problem for rpmlint before because libinproctrace +# had no SONAME, so the check wasn't active. Now it has, so it's checked +# and because the gdbserver binary has no direct ELF visible dependency +# it's thought to be necessary to follow shlib policy. That's not the case. +addFilter ("gdbserver.*shlib-policy-name-error.*libinproctrace") diff --git a/gdb-s390-add-arch14-record-replay-support.patch b/gdb-s390-add-arch14-record-replay-support.patch new file mode 100644 index 0000000..185e315 --- /dev/null +++ b/gdb-s390-add-arch14-record-replay-support.patch @@ -0,0 +1,50 @@ +From 6cfb7bf81be3ab6f131dbc6a27eefca516cf7517 Mon Sep 17 00:00:00 2001 +From: Andreas Arnez +Date: Tue, 13 Feb 2024 18:55:29 +0100 +Subject: [PATCH 2/2] gdb: s390: Add arch14 record/replay support + +Enable recording of the new "arch14" instructions on z/Architecture +targets, except for the specialized-function-assist instruction NNPA. +--- + gdb/s390-tdep.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c +index 54b5c89e5e3..dcac407caef 100644 +--- a/gdb/s390-tdep.c ++++ b/gdb/s390-tdep.c +@@ -5534,6 +5534,14 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + case 0xe635: /* VLRL - vector load rightmost with immed. length */ + case 0xe637: /* VLRLR - vector load rightmost with length */ + case 0xe649: /* VLIP - vector load immediate decimal */ ++ case 0xe656: /* VCLFNH - vector fp convert and lengthen from NNP high */ ++ case 0xe65e: /* VCLFNL - vector fp convert and lengthen from NNP low */ ++ case 0xe655: /* VCNF - vector fp convert to NNP */ ++ case 0xe65d: /* VCFN - vector fp convert from NNP */ ++ case 0xe674: /* VSCHP - decimal scale and convert to HFP */ ++ case 0xe675: /* VCRNF - vector fp convert and round to NNP */ ++ case 0xe67c: /* VSCSHP - decimal scale and convert and split to HFP */ ++ case 0xe67d: /* VCSPH - vector convert HFP to scaled decimal */ + case 0xe700: /* VLEB - vector load element */ + case 0xe701: /* VLEH - vector load element */ + case 0xe702: /* VLEG - vector load element */ +@@ -5791,11 +5799,16 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + + /* 0xe747-0xe749 undefined */ + ++ case 0xe651: /* VCLZDP - vector count leading zero digits */ ++ case 0xe654: /* VUPKZH - vector unpack zoned high */ + case 0xe658: /* VCVD - vector convert to decimal 32 bit */ + case 0xe659: /* VSRP - vector shift and round decimal */ + case 0xe65a: /* VCVDG - vector convert to decimal 64 bit*/ + case 0xe65b: /* VPSOP - vector perform sign operation decimal */ ++ case 0xe65c: /* VUPKZL - vector unpack zoned low */ ++ case 0xe670: /* VPKZR - vector pack zoned register */ + case 0xe671: /* VAP - vector add decimal */ ++ case 0xe672: /* VSRPR - vector shift and round decimal register */ + case 0xe673: /* VSP - vector subtract decimal */ + case 0xe678: /* VMP - vector multiply decimal */ + case 0xe679: /* VMSP - vector multiply decimal */ +-- +2.35.3 + diff --git a/gdb-simultaneous-step-resume-breakpoint-test.patch b/gdb-simultaneous-step-resume-breakpoint-test.patch new file mode 100644 index 0000000..ad4a1f2 --- /dev/null +++ b/gdb-simultaneous-step-resume-breakpoint-test.patch @@ -0,0 +1,162 @@ +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-simultaneous-step-resume-breakpoint-test.patch + +;; New test for step-resume breakpoint placed in multiple threads at once. +;;=fedoratest + +diff --git a/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c +@@ -0,0 +1,79 @@ ++/* Copyright 2009 Free Software Foundation, Inc. ++ ++ Written by Fred Fish of Cygnus Support ++ Contributed by Cygnus Support ++ ++ This file is part of GDB. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++/* Test multiple threads stepping into a .debug_line-less function with ++ a breakpoint placed on its return-to-caller point. */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#define THREADS 3 ++ ++static void * ++func (void *unused) ++{ ++ int i; ++ ++ errno = 0; ++ i = 0xdeadf00d; ++ i = sleep (THREADS); /* sleep-call */ ++ if (errno != 0) /* sleep-after */ ++ perror ("sleep"); ++ ++ /* The GDB bug with forgotten step-resume breakpoint could leave stale ++ breakpoint on the I assignment making it a nop. */ ++ if (i == 0xdeadf00d) ++ assert (0); ++ ++ assert (i == 0); ++ ++ pthread_exit (NULL); ++} ++ ++int ++main (void) ++{ ++ pthread_t threads[THREADS]; ++ int threadi; ++ ++ for (threadi = 0; threadi < THREADS; threadi++) ++ { ++ int i; ++ ++ i = pthread_create (&threads[threadi], NULL, func, NULL); ++ assert (i == 0); ++ ++ i = sleep (1); ++ assert (i == 0); ++ } ++ ++ for (threadi = 0; threadi < THREADS; threadi++) ++ { ++ int i; ++ ++ i = pthread_join (threads[threadi], NULL); ++ assert (i == 0); ++ } ++ ++ return 0; /* final-exit */ ++} +diff --git a/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp +@@ -0,0 +1,65 @@ ++# Copyright (C) 2009 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . */ ++ ++# Test multiple threads stepping into a .debug_line-less function with ++# a breakpoint placed on its return-to-caller point. ++ ++set testfile simultaneous-step-resume-breakpoint ++set srcfile ${testfile}.c ++set binfile [standard_output_file ${testfile}] ++ ++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++ ++# Ensure we have no debuginfo for the `sleep' call itself (=for libc). ++gdb_test "set debug-file-directory /DoesNotExist" ++ ++gdb_load ${binfile} ++if ![runto_main] { ++ return -1 ++} ++ ++# Red Hat vendor patch does set it to "step" by default. ++gdb_test "set scheduler-locking off" ++ ++gdb_breakpoint [gdb_get_line_number "final-exit"] ++ ++gdb_breakpoint [gdb_get_line_number "sleep-call"] ++gdb_continue_to_breakpoint "sleep-call" ++ ++gdb_test "step" "sleep-call.*" "step thread 1" ++gdb_test "step" "sleep-call.*" "step thread 2" ++gdb_test "step" "sleep-after.*" "step thread 3" ++ ++set test "first continue" ++gdb_test_multiple "continue" $test { ++ -re "final-exit.*$gdb_prompt $" { ++ # gdb-7.0. ++ pass $test ++ return ++ } ++ -re "sleep-after.*$gdb_prompt $" { ++ # Fedora/RHEL branch. ++ pass $test ++ } ++} ++ ++gdb_test "continue" "sleep-after.*" "second continue" ++gdb_test "continue" "final-exit.*" "third continue" diff --git a/gdb-symtab-add-producer_is_gas.patch b/gdb-symtab-add-producer_is_gas.patch new file mode 100644 index 0000000..3ede8a8 --- /dev/null +++ b/gdb-symtab-add-producer_is_gas.patch @@ -0,0 +1,125 @@ +From aa8ba17b9a3fdfeeb65df4c3e0731a0e9e96cbf7 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 1 Nov 2023 00:33:12 +0100 +Subject: [PATCH 1/2] [gdb/symtab] Add producer_is_gas + +Add producer_is_gas, a generic way to get the gas version from the +producer string. + +Tested on x86_64-linux. +--- + gdb/dwarf2/read.c | 4 ++-- + gdb/producer.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++ + gdb/producer.h | 5 +++++ + 3 files changed, 63 insertions(+), 2 deletions(-) + +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +index 970dd54c7a5..472684a5817 100644 +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -13376,8 +13376,8 @@ check_producer (struct dwarf2_cu *cu) + cu->producer_is_codewarrior = true; + else if (producer_is_clang (cu->producer, &major, &minor)) + cu->producer_is_clang = true; +- else if (startswith (cu->producer, "GNU AS 2.39.0")) +- cu->producer_is_gas_2_39 = true; ++ else if (producer_is_gas (cu->producer, &major, &minor)) ++ cu->producer_is_gas_2_39 = major == 2 && minor == 39; + else + { + /* For other non-GCC compilers, expect their behavior is DWARF version +diff --git a/gdb/producer.c b/gdb/producer.c +index 9fcf749e3d4..cd83dfce128 100644 +--- a/gdb/producer.c ++++ b/gdb/producer.c +@@ -81,6 +81,45 @@ producer_is_gcc (const char *producer, int *major, int *minor) + + /* See producer.h. */ + ++bool ++producer_is_gas (const char *producer, int *major, int *minor) ++{ ++ if (producer == nullptr) ++ { ++ /* No producer, don't know. */ ++ return false; ++ } ++ ++ /* Detect prefix. */ ++ const char prefix[] = "GNU AS "; ++ if (!startswith (producer, prefix)) ++ { ++ /* Producer is not gas. */ ++ return false; ++ } ++ ++ /* Skip prefix. */ ++ const char *cs = &producer[strlen (prefix)]; ++ ++ /* Ensure that major/minor are not nullptrs. */ ++ int maj, min; ++ if (major == nullptr) ++ major = &maj; ++ if (minor == nullptr) ++ minor = &min; ++ ++ int scanned = sscanf (cs, "%d.%d", major, minor); ++ if (scanned != 2) ++ { ++ /* Unable to scan major/minor version. */ ++ return false; ++ } ++ ++ return true; ++} ++ ++ /* See producer.h. */ ++ + bool + producer_is_icc_ge_19 (const char *producer) + { +@@ -251,6 +290,23 @@ Version 18.0 Beta"; + SELF_CHECK (!producer_is_gcc (flang_llvm_exp, &major, &minor)); + SELF_CHECK (producer_is_llvm (flang_llvm_exp)); + } ++ ++ { ++ static const char gas_exp[] = "GNU AS 2.39.0"; ++ int major = 0, minor = 0; ++ SELF_CHECK (!producer_is_gcc (gas_exp, &major, &minor)); ++ SELF_CHECK (producer_is_gas (gas_exp, &major, &minor)); ++ SELF_CHECK (major == 2 && minor == 39); ++ ++ static const char gas_incomplete_exp[] = "GNU AS "; ++ SELF_CHECK (!producer_is_gas (gas_incomplete_exp, &major, &minor)); ++ SELF_CHECK (!producer_is_gcc (gas_incomplete_exp, &major, &minor)); ++ ++ static const char gas_incomplete_exp_2[] = "GNU AS 2"; ++ SELF_CHECK (!producer_is_gas (gas_incomplete_exp_2, &major, &minor)); ++ SELF_CHECK (!producer_is_gcc (gas_incomplete_exp_2, &major, &minor)); ++ } ++ + } + } + } +diff --git a/gdb/producer.h b/gdb/producer.h +index c915979b122..00718511775 100644 +--- a/gdb/producer.h ++++ b/gdb/producer.h +@@ -30,6 +30,11 @@ extern int producer_is_gcc_ge_4 (const char *producer); + is NULL or it isn't GCC. */ + extern int producer_is_gcc (const char *producer, int *major, int *minor); + ++/* Returns nonzero if the given PRODUCER string is GAS and sets the MAJOR ++ and MINOR versions when not NULL. Returns zero if the given PRODUCER ++ is NULL or it isn't GAS. */ ++bool producer_is_gas (const char *producer, int *major, int *minor); ++ + /* Check for Intel compilers >= 19.0. */ + extern bool producer_is_icc_ge_19 (const char *producer); + + +base-commit: 39553c1e285c426946188ec2a890c1c1cb933060 +-- +2.35.3 + diff --git a/gdb-symtab-don-t-defer-backward-refs-inter-cu-intra-.patch b/gdb-symtab-don-t-defer-backward-refs-inter-cu-intra-.patch new file mode 100644 index 0000000..5bf0f52 --- /dev/null +++ b/gdb-symtab-don-t-defer-backward-refs-inter-cu-intra-.patch @@ -0,0 +1,74 @@ +From 0218e033b415df76be0a14871447bbd94dce62a3 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sat, 16 Sep 2023 04:07:22 +0200 +Subject: [PATCH 10/13] [gdb/symtab] Don't defer backward refs, inter-cu + intra-shard case + +In patch "[gdb/symtab] Resolve deferred entries, inter-shard case" we've +solved the generic case of handling deferred entries. + +Add an optimization that doesn't defer inter-CU intra-shard dependencies that +are present in the shard's parent map. + +Tested on x86_64-linux. +--- + gdb/dwarf2/read.c | 29 ++++++++++++++++++++++++++++- + 1 file changed, 28 insertions(+), 1 deletion(-) + +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +index a97f738a54e..e7904532434 100644 +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -4709,6 +4709,12 @@ class cooked_index_storage + m_index->set_parent_valid (start, end); + } + ++ /* Return true if find_parents can be relied upon. */ ++ bool parent_valid (CORE_ADDR addr) ++ { ++ return m_index->parent_valid (addr); ++ } ++ + private: + + /* Hash function for a cutu_reader. */ +@@ -4857,6 +4863,12 @@ class cooked_indexer + { + m_index_storage->set_parent_valid (start, end); + } ++ ++ /* Return true if find_parents can be relied upon. */ ++ bool parent_valid (CORE_ADDR addr) ++ { ++ return m_index_storage->parent_valid (addr); ++ } + }; + + /* Subroutine of dwarf2_build_psymtabs_hard to simplify it. +@@ -16482,7 +16494,22 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu, + else + { + /* Inter-CU case. */ +- *maybe_defer = addr; ++ if (parent_valid (addr)) ++ { ++ auto tmp = find_parent (addr); ++ if (tmp == &parent_map::deferred) ++ { ++ /* Defer because origin is deferred. */ ++ *maybe_defer = addr; ++ } ++ else ++ *parent_entry = tmp; ++ } ++ else ++ { ++ /* Defer because origin is in other shard. */ ++ *maybe_defer = addr; ++ } + } + } + +-- +2.35.3 + diff --git a/gdb-symtab-factor-out-m_deferred_entries-usage.patch b/gdb-symtab-factor-out-m_deferred_entries-usage.patch new file mode 100644 index 0000000..a3dfe4f --- /dev/null +++ b/gdb-symtab-factor-out-m_deferred_entries-usage.patch @@ -0,0 +1,76 @@ +From 8a444a93d4bd78355fc4e6ecb1935cc2b0a6a997 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 15 Sep 2023 08:38:00 +0200 +Subject: [PATCH 04/13] [gdb/symtab] Factor out m_deferred_entries usage + +Factor out usage of cooked_indexer::m_deferred_entries in new member +functions defer_entry, handle_deferred_entries and resolve_deferred_entry. + +Tested on x86_64-linux. +--- + gdb/dwarf2/read.c | 35 ++++++++++++++++++++++++++++------- + 1 file changed, 28 insertions(+), 7 deletions(-) + +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +index d48f3010063..afdf9e870a8 100644 +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -4822,6 +4822,32 @@ class cooked_indexer + we'll know the containing context of all the DIEs that we might + have scanned. This vector stores these deferred entries. */ + std::vector m_deferred_entries; ++ ++ /* Defer creating a cooked_index_entry corresponding to deferred_entry DE. */ ++ void defer_entry (const deferred_entry &de) ++ { ++ m_deferred_entries.push_back (de); ++ } ++ ++ /* Create a cooked_index_entry corresponding to deferred_entry DE with ++ parent PARENT_ENTRY. */ ++ const cooked_index_entry *resolve_deferred_entry ++ (const deferred_entry &de, const cooked_index_entry *parent_entry) ++ { ++ return m_index_storage->add (de.die_offset, de.tag, de.flags, de.name, ++ parent_entry, m_per_cu); ++ } ++ ++ /* Create cooked_index_entries for the deferred entries. */ ++ void handle_deferred_entries () ++ { ++ for (const auto &entry : m_deferred_entries) ++ { ++ const cooked_index_entry *parent_entry ++ = find_parent (entry.spec_offset); ++ resolve_deferred_entry (entry, parent_entry); ++ } ++ } + }; + + /* Subroutine of dwarf2_build_psymtabs_hard to simplify it. +@@ -16611,7 +16637,7 @@ cooked_indexer::index_dies (cutu_reader *reader, + if (name != nullptr) + { + if (defer != 0) +- m_deferred_entries.push_back ({ ++ defer_entry ({ + this_die, name, defer, abbrev->tag, flags + }); + else +@@ -16716,12 +16742,7 @@ cooked_indexer::make_index (cutu_reader *reader) + return; + index_dies (reader, reader->info_ptr, nullptr, false); + +- for (const auto &entry : m_deferred_entries) +- { +- const cooked_index_entry *parent = find_parent (entry.spec_offset); +- m_index_storage->add (entry.die_offset, entry.tag, entry.flags, +- entry.name, parent, m_per_cu); +- } ++ handle_deferred_entries (); + } + + /* An implementation of quick_symbol_functions for the cooked DWARF +-- +2.35.3 + diff --git a/gdb-symtab-factor-out-m_die_range_map-usage.patch b/gdb-symtab-factor-out-m_die_range_map-usage.patch new file mode 100644 index 0000000..c827f0e --- /dev/null +++ b/gdb-symtab-factor-out-m_die_range_map-usage.patch @@ -0,0 +1,151 @@ +From b2f260d117dc11b8e90d4e9bf7f4b2cbd63d1d49 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 22 Aug 2023 13:17:47 +0200 +Subject: [PATCH 02/13] [gdb/symtab] Factor out m_die_range_map usage + +Factor out usage of cooked_indexer::m_die_range_map into new class parent_map +with member functions find_parent and set_parent, and static member function +form_addr. + +Tested on x86_64-linux. +--- + gdb/dwarf2/cooked-index.h | 32 +++++++++++++++++++++++++++ + gdb/dwarf2/read.c | 46 ++++++++++++++++++++------------------- + 2 files changed, 56 insertions(+), 22 deletions(-) + +diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h +index 5aacb321c91..979541fbf60 100644 +--- a/gdb/dwarf2/cooked-index.h ++++ b/gdb/dwarf2/cooked-index.h +@@ -239,6 +239,38 @@ struct cooked_index_entry : public allocate_on_obstack + bool for_name) const; + }; + ++class parent_map ++{ ++public: ++ /* A helper function to turn a section offset into an address that ++ can be used in a parent_map. */ ++ static CORE_ADDR form_addr (sect_offset offset, bool is_dwz) ++ { ++ CORE_ADDR value = to_underlying (offset); ++ if (is_dwz) ++ value |= ((CORE_ADDR) 1) << (8 * sizeof (CORE_ADDR) - 1); ++ return value; ++ } ++ ++ /* Find the parent of DIE LOOKUP. */ ++ const cooked_index_entry *find_parent (CORE_ADDR lookup) const ++ { ++ const void *obj = m_parent_map.find (lookup); ++ return static_cast (obj); ++ } ++ ++ /* Set the parent of DIES in range [START, END] to PARENT_ENTRY. */ ++ void set_parent (CORE_ADDR start, CORE_ADDR end, ++ const cooked_index_entry *parent_entry) ++ { ++ m_parent_map.set_empty (start, end, (void *)parent_entry); ++ } ++ ++private: ++ /* An addrmap that maps from section offsets to cooked_index_entry *. */ ++ addrmap_mutable m_parent_map; ++}; ++ + class cooked_index; + + /* An index of interesting DIEs. This is "cooked", in contrast to a +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +index 466d3e59878..d48f3010063 100644 +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -4722,16 +4722,6 @@ class cooked_indexer + + private: + +- /* A helper function to turn a section offset into an address that +- can be used in an addrmap. */ +- CORE_ADDR form_addr (sect_offset offset, bool is_dwz) +- { +- CORE_ADDR value = to_underlying (offset); +- if (is_dwz) +- value |= ((CORE_ADDR) 1) << (8 * sizeof (CORE_ADDR) - 1); +- return value; +- } +- + /* A helper function to scan the PC bounds of READER and record them + in the storage's addrmap. */ + void check_bounds (cutu_reader *reader); +@@ -4799,7 +4789,20 @@ class cooked_indexer + /* An addrmap that maps from section offsets (see the form_addr + method) to newly-created entries. See m_deferred_entries to + understand this. */ +- addrmap_mutable m_die_range_map; ++ parent_map m_die_range_map; ++ ++ /* Find the parent of DIE LOOKUP. */ ++ const cooked_index_entry *find_parent (CORE_ADDR lookup) const ++ { ++ return m_die_range_map.find_parent (lookup); ++ } ++ ++ /* Set the parent of DIES in range [START, END] to PARENT_ENTRY. */ ++ void set_parent (CORE_ADDR start, CORE_ADDR end, ++ const cooked_index_entry *parent_entry) ++ { ++ m_die_range_map.set_parent (start, end, parent_entry); ++ } + + /* A single deferred entry. */ + struct deferred_entry +@@ -16412,15 +16415,13 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu, + + if (*parent_entry == nullptr) + { +- CORE_ADDR addr = form_addr (origin_offset, origin_is_dwz); ++ CORE_ADDR addr ++ = parent_map::form_addr (origin_offset, origin_is_dwz); + if (new_reader->cu == reader->cu + && new_info_ptr > watermark_ptr) + *maybe_defer = addr; + else +- { +- void *obj = m_die_range_map.find (addr); +- *parent_entry = static_cast (obj); +- } ++ *parent_entry = find_parent (addr); + } + + unsigned int bytes_read; +@@ -16538,11 +16539,13 @@ cooked_indexer::recurse (cutu_reader *reader, + { + /* Both start and end are inclusive, so use both "+ 1" and "- 1" to + limit the range to the children of parent_entry. */ +- CORE_ADDR start = form_addr (parent_entry->die_offset + 1, +- reader->cu->per_cu->is_dwz); +- CORE_ADDR end = form_addr (sect_offset (info_ptr - 1 - reader->buffer), ++ CORE_ADDR start ++ = parent_map::form_addr (parent_entry->die_offset + 1, ++ reader->cu->per_cu->is_dwz); ++ CORE_ADDR end ++ = parent_map::form_addr (sect_offset (info_ptr - 1 - reader->buffer), + reader->cu->per_cu->is_dwz); +- m_die_range_map.set_empty (start, end, (void *) parent_entry); ++ set_parent (start, end, parent_entry); + } + + return info_ptr; +@@ -16715,8 +16718,7 @@ cooked_indexer::make_index (cutu_reader *reader) + + for (const auto &entry : m_deferred_entries) + { +- void *obj = m_die_range_map.find (entry.spec_offset); +- cooked_index_entry *parent = static_cast (obj); ++ const cooked_index_entry *parent = find_parent (entry.spec_offset); + m_index_storage->add (entry.die_offset, entry.tag, entry.flags, + entry.name, parent, m_per_cu); + } +-- +2.35.3 + diff --git a/gdb-symtab-fix-dw_tag_inlined_subroutine-entries-in-.patch b/gdb-symtab-fix-dw_tag_inlined_subroutine-entries-in-.patch new file mode 100644 index 0000000..0f20941 --- /dev/null +++ b/gdb-symtab-fix-dw_tag_inlined_subroutine-entries-in-.patch @@ -0,0 +1,112 @@ +From c79ecacd3f75cfb0ec1a3afc49ca3f30b1759009 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 11 Aug 2023 01:36:50 +0200 +Subject: [PATCH 13/13] [gdb/symtab] Fix DW_TAG_inlined_subroutine entries in + the cooked index + +We get incorrect qualified names in the cooked index for +DW_TAG_inlined_subroutine DIEs with abstract origin, due to the fact that the +DIE parent is used instead of the abstract origin. + +Fix this by preferring the abstract origin parent, if available. + +Tested on x86_64-linux. + +PR symtab/30728 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30728 +--- + gdb/dwarf2/read.c | 67 ++++++++++++++++++++++------------------------- + 1 file changed, 32 insertions(+), 35 deletions(-) + +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +index 93708ef11b9..a4f982962ae 100644 +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -16464,52 +16464,49 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu, + const gdb_byte *new_info_ptr = (new_reader->buffer + + to_underlying (origin_offset)); + +- if (*parent_entry == nullptr) ++ gdb_assert (reader->cu->per_cu->is_debug_types ++ == new_reader->cu->per_cu->is_debug_types); ++ CORE_ADDR addr ++ = parent_map::form_addr (origin_offset, origin_is_dwz, ++ reader->cu->per_cu->is_debug_types); ++ if (new_reader->cu == reader->cu) + { +- gdb_assert (reader->cu->per_cu->is_debug_types +- == new_reader->cu->per_cu->is_debug_types); +- CORE_ADDR addr +- = parent_map::form_addr (origin_offset, origin_is_dwz, +- reader->cu->per_cu->is_debug_types); +- if (new_reader->cu == reader->cu) ++ /* Intra-CU case. */ ++ if (new_info_ptr > watermark_ptr) + { +- /* Intra-CU case. */ +- if (new_info_ptr > watermark_ptr) +- { +- /* Defer because origin is not read yet. */ +- *maybe_defer = addr; +- } +- else +- { +- auto tmp = find_parent (addr); +- if (tmp == &parent_map::deferred) +- { +- /* Defer because origin is deferred. */ +- *maybe_defer = addr; +- } +- else +- *parent_entry = tmp; +- } ++ /* Defer because origin is not read yet. */ ++ *maybe_defer = addr; + } + else + { +- /* Inter-CU case. */ +- if (parent_valid (addr)) ++ auto tmp = find_parent (addr); ++ if (tmp == &parent_map::deferred) + { +- auto tmp = find_parent (addr); +- if (tmp == &parent_map::deferred) +- { +- /* Defer because origin is deferred. */ +- *maybe_defer = addr; +- } +- else +- *parent_entry = tmp; ++ /* Defer because origin is deferred. */ ++ *maybe_defer = addr; + } + else ++ *parent_entry = tmp; ++ } ++ } ++ else ++ { ++ /* Inter-CU case. */ ++ if (parent_valid (addr)) ++ { ++ auto tmp = find_parent (addr); ++ if (tmp == &parent_map::deferred) + { +- /* Defer because origin is in other shard. */ ++ /* Defer because origin is deferred. */ + *maybe_defer = addr; + } ++ else ++ *parent_entry = tmp; ++ } ++ else ++ { ++ /* Defer because origin is in other shard. */ ++ *maybe_defer = addr; + } + } + +-- +2.35.3 + diff --git a/gdb-symtab-handle-nullptr-parent-in-parent_map-set_p.patch b/gdb-symtab-handle-nullptr-parent-in-parent_map-set_p.patch new file mode 100644 index 0000000..21f26df --- /dev/null +++ b/gdb-symtab-handle-nullptr-parent-in-parent_map-set_p.patch @@ -0,0 +1,37 @@ +From bc970668f83cf142c4955d1cbeaa24e8bcc4b238 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 25 Aug 2023 09:30:54 +0200 +Subject: [PATCH 03/13] [gdb/symtab] Handle nullptr parent in + parent_map::set_parent + +Set_parent uses m_die_range_map.set_empty, which doesn't allow +parent_entry == nullptr. + +So it may be necessary to guard calls to set_parent with +"if (parent_entry != nullptr)". + +Fix this by handling the parent_entry == nullptr case in set_parent. + +Tested on x86_64-linux. +--- + gdb/dwarf2/cooked-index.h | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h +index 979541fbf60..79fbfe88c03 100644 +--- a/gdb/dwarf2/cooked-index.h ++++ b/gdb/dwarf2/cooked-index.h +@@ -263,7 +263,9 @@ class parent_map + void set_parent (CORE_ADDR start, CORE_ADDR end, + const cooked_index_entry *parent_entry) + { +- m_parent_map.set_empty (start, end, (void *)parent_entry); ++ /* Calling set_empty with nullptr is currently not allowed. */ ++ if (parent_entry != nullptr) ++ m_parent_map.set_empty (start, end, (void *)parent_entry); + } + + private: +-- +2.35.3 + diff --git a/gdb-symtab-keep-track-of-all-parents-for-cooked-inde.patch b/gdb-symtab-keep-track-of-all-parents-for-cooked-inde.patch new file mode 100644 index 0000000..03acf13 --- /dev/null +++ b/gdb-symtab-keep-track-of-all-parents-for-cooked-inde.patch @@ -0,0 +1,38 @@ +From 0e706742f37ee90629350780263b573f326f1a5f Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 7 Dec 2023 10:38:05 +0100 +Subject: [PATCH 12/13] [gdb/symtab] Keep track of all parents for cooked index + +Keep track of all parents for cooked index. + +Tested on x86_64-linux. +--- + gdb/dwarf2/read.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +index de7b655d26c..93708ef11b9 100644 +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -16718,9 +16718,15 @@ cooked_indexer::index_dies (cutu_reader *reader, + }); + } + else +- this_entry = m_index_storage->add (this_die, abbrev->tag, flags, +- name, this_parent_entry, +- m_per_cu); ++ { ++ CORE_ADDR addr ++ = parent_map::form_addr (this_die, reader->cu->per_cu->is_dwz, ++ reader->cu->per_cu->is_debug_types); ++ set_parent (addr, addr, this_parent_entry); ++ this_entry = m_index_storage->add (this_die, abbrev->tag, flags, ++ name, this_parent_entry, ++ m_per_cu); ++ } + } + + if (linkage_name != nullptr) +-- +2.35.3 + diff --git a/gdb-symtab-keep-track-of-processed-dies-in-shard.patch b/gdb-symtab-keep-track-of-processed-dies-in-shard.patch new file mode 100644 index 0000000..371363a --- /dev/null +++ b/gdb-symtab-keep-track-of-processed-dies-in-shard.patch @@ -0,0 +1,126 @@ +From e8285c8b37d28033209cad6579db4b9f6a48a01a Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sun, 24 Sep 2023 11:41:39 +0200 +Subject: [PATCH 08/13] [gdb/symtab] Keep track of processed DIEs in shard + +For optimizations in two following patches, we keep track in each shard which +DIEs have been processed. + +Tested on x86_64-linux. +--- + gdb/dwarf2/cooked-index.c | 1 + + gdb/dwarf2/cooked-index.h | 15 +++++++++++++++ + gdb/dwarf2/read.c | 24 ++++++++++++++++++++++++ + 3 files changed, 40 insertions(+) + +diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c +index 3231d25db5a..c096da57d62 100644 +--- a/gdb/dwarf2/cooked-index.c ++++ b/gdb/dwarf2/cooked-index.c +@@ -723,6 +723,7 @@ cooked_index::handle_deferred_entries () + { + shard->m_die_range_map.reset (nullptr); + shard->m_deferred_entries.reset (nullptr); ++ shard->m_die_range_map_valid.reset (nullptr); + } + } + +diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h +index 66424c37f7c..fa895233035 100644 +--- a/gdb/dwarf2/cooked-index.h ++++ b/gdb/dwarf2/cooked-index.h +@@ -316,6 +316,7 @@ class cooked_index_shard + { + m_die_range_map.reset (new parent_map); + m_deferred_entries.reset (new std::vector); ++ m_die_range_map_valid.reset (new addrmap_mutable); + } + + DISABLE_COPY_AND_ASSIGN (cooked_index_shard); +@@ -407,6 +408,18 @@ class cooked_index_shard + const cooked_index_entry *resolve_deferred_entry + (const deferred_entry &entry, const cooked_index_entry *parent_entry); + ++ /* Mark parents in range [START, END] as valid . */ ++ void set_parent_valid (CORE_ADDR start, CORE_ADDR end) ++ { ++ m_die_range_map_valid->set_empty (start, end, (void *) 1); ++ } ++ ++ /* Return true if find_parents can be relied upon. */ ++ bool parent_valid (CORE_ADDR addr) ++ { ++ return m_die_range_map_valid->find (addr) != nullptr; ++ } ++ + private: + + /* Return the entry that is believed to represent the program's +@@ -470,6 +483,8 @@ class cooked_index_shard + understand this. */ + std::unique_ptr m_die_range_map; + ++ std::unique_ptr m_die_range_map_valid; ++ + /* The generated DWARF can sometimes have the declaration for a + method in a class (or perhaps namespace) scope, with the + definition appearing outside this scope... just one of the many +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +index 5b7c0969ed7..09598e702bc 100644 +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -4697,6 +4697,12 @@ class cooked_index_storage + m_index->defer_entry (de); + } + ++ /* Mark parents in range [START, END] as valid . */ ++ void set_parent_valid (CORE_ADDR start, CORE_ADDR end) ++ { ++ m_index->set_parent_valid (start, end); ++ } ++ + private: + + /* Hash function for a cutu_reader. */ +@@ -4840,6 +4846,11 @@ class cooked_indexer + { + m_index_storage->defer_entry (de); + } ++ ++ void set_parent_valid (CORE_ADDR start, CORE_ADDR end) ++ { ++ m_index_storage->set_parent_valid (start, end); ++ } + }; + + /* Subroutine of dwarf2_build_psymtabs_hard to simplify it. +@@ -16604,6 +16615,11 @@ cooked_indexer::index_dies (cutu_reader *reader, + + to_underlying (reader->cu->header.sect_off) + + reader->cu->header.get_length_with_initial ()); + ++ const CORE_ADDR start_cu ++ = parent_map::form_addr (sect_offset (info_ptr - reader->buffer), ++ reader->cu->per_cu->is_dwz, ++ reader->cu->per_cu->is_debug_types); ++ + while (info_ptr < end_ptr) + { + sect_offset this_die = (sect_offset) (info_ptr - reader->buffer); +@@ -16754,6 +16770,14 @@ cooked_indexer::index_dies (cutu_reader *reader, + } + } + ++ { ++ CORE_ADDR end_prev_die ++ = parent_map::form_addr (sect_offset (info_ptr - reader->buffer - 1), ++ reader->cu->per_cu->is_dwz, ++ reader->cu->per_cu->is_debug_types); ++ set_parent_valid (start_cu, end_prev_die); ++ } ++ + return info_ptr; + } + +-- +2.35.3 + diff --git a/gdb-symtab-recurse-into-c-dw_tag_subprogram-dies-for.patch b/gdb-symtab-recurse-into-c-dw_tag_subprogram-dies-for.patch new file mode 100644 index 0000000..f525a56 --- /dev/null +++ b/gdb-symtab-recurse-into-c-dw_tag_subprogram-dies-for.patch @@ -0,0 +1,31 @@ +From 0f53dc7e5cc07e30d11f3f5a0645239535824890 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 7 Dec 2023 10:36:07 +0100 +Subject: [PATCH 11/13] [gdb/symtab] Recurse into c++ DW_TAG_subprogram DIEs + for cooked index + +Recurse into c++ DW_TAG_subprogram DIEs for cooked index, to add +DW_TAG_inlined_subroutine entries. + +Tested on x86_64-linux. +--- + gdb/dwarf2/read.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +index e7904532434..de7b655d26c 100644 +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -16781,7 +16781,8 @@ cooked_indexer::index_dies (cutu_reader *reader, + + case DW_TAG_subprogram: + if ((m_language == language_fortran +- || m_language == language_ada) ++ || m_language == language_ada ++ || m_language == language_cplus) + && this_entry != nullptr) + { + info_ptr = recurse (reader, info_ptr, this_entry, true); +-- +2.35.3 + diff --git a/gdb-symtab-refactor-condition-in-scan_attributes.patch b/gdb-symtab-refactor-condition-in-scan_attributes.patch new file mode 100644 index 0000000..169e8f4 --- /dev/null +++ b/gdb-symtab-refactor-condition-in-scan_attributes.patch @@ -0,0 +1,70 @@ +From f72f115b4c012e3748a2e702d7b970be19974885 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 11 Dec 2023 15:41:26 +0100 +Subject: [PATCH 01/13] [gdb/symtab] Refactor condition in scan_attributes + +In scan_attributes there's code: +... + if (new_reader->cu == reader->cu + && new_info_ptr > watermark_ptr + && *parent_entry == nullptr) + ... + else if (*parent_entry == nullptr) + ... +... +that uses the "*parent_entry == nullptr" condition twice. + +Make this somewhat more readable by factoring out the condition: +... + if (*parent_entry == nullptr) + { + if (new_reader->cu == reader->cu + && new_info_ptr > watermark_ptr) + ... + else + ... + } +... + +This also allows us to factor out "form_addr (origin_offset, origin_is_dwz)". + +Tested on x86_64-linux. +--- + gdb/dwarf2/read.c | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +index 50fa302b43a..466d3e59878 100644 +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -16410,15 +16410,17 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu, + const gdb_byte *new_info_ptr = (new_reader->buffer + + to_underlying (origin_offset)); + +- if (new_reader->cu == reader->cu +- && new_info_ptr > watermark_ptr +- && *parent_entry == nullptr) +- *maybe_defer = form_addr (origin_offset, origin_is_dwz); +- else if (*parent_entry == nullptr) ++ if (*parent_entry == nullptr) + { +- CORE_ADDR lookup = form_addr (origin_offset, origin_is_dwz); +- void *obj = m_die_range_map.find (lookup); +- *parent_entry = static_cast (obj); ++ CORE_ADDR addr = form_addr (origin_offset, origin_is_dwz); ++ if (new_reader->cu == reader->cu ++ && new_info_ptr > watermark_ptr) ++ *maybe_defer = addr; ++ else ++ { ++ void *obj = m_die_range_map.find (addr); ++ *parent_entry = static_cast (obj); ++ } + } + + unsigned int bytes_read; + +base-commit: 3490f51a80a10d46dc1885ba672d9390a8221170 +-- +2.35.3 + diff --git a/gdb-symtab-resolve-deferred-entries-inter-shard-case.patch b/gdb-symtab-resolve-deferred-entries-inter-shard-case.patch new file mode 100644 index 0000000..cc4f6f3 --- /dev/null +++ b/gdb-symtab-resolve-deferred-entries-inter-shard-case.patch @@ -0,0 +1,500 @@ +From e2d7097cf236c9ea6959785754d067833fc302af Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 22 Aug 2023 14:24:42 +0200 +Subject: [PATCH 05/13] [gdb/symtab] Resolve deferred entries, inter-shard case + +Generically solve the case of inter-CU dependencies, including inter-shard +dependencies: +- mark deferred entries in new data structure m_deferred, +- return &parent_map::deferred in find_parent for deferred entries, +- defer all intra-CU dependencies that depend on deferred entries, +- defer all inter-CU dependencies (note that two subsequent patches implement + optimizations to deal with this more optimally), +- move m_die_range_map and m_deferred_dies to cooked_index_shard, and +- move handle_deferred_dies to the cooked_index, where it is called in the + constructor, and update it to handle the intra-shard case. + +Handling units from the .debug_info section alongside units from the +.debug_types section requires us to extend form_addr to take is_debug_types +into account. + +Tested on x86_64-linux. + +PR symtab/30846 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30846 +--- + gdb/dwarf2/cooked-index.c | 77 +++++++++++++++++++++++ + gdb/dwarf2/cooked-index.h | 105 ++++++++++++++++++++++++++++++- + gdb/dwarf2/read.c | 128 ++++++++++++++++++++++---------------- + 3 files changed, 254 insertions(+), 56 deletions(-) + +diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c +index 58ea541a5c9..3231d25db5a 100644 +--- a/gdb/dwarf2/cooked-index.c ++++ b/gdb/dwarf2/cooked-index.c +@@ -228,6 +228,12 @@ cooked_index_entry::write_scope (struct obstack *storage, + + /* See cooked-index.h. */ + ++cooked_index_entry parent_map::deferred((sect_offset)0, (dwarf_tag)0, ++ (cooked_index_flag)0, nullptr, ++ nullptr, nullptr); ++ ++/* See cooked-index.h. */ ++ + const cooked_index_entry * + cooked_index_shard::add (sect_offset die_offset, enum dwarf_tag tag, + cooked_index_flag flags, const char *name, +@@ -446,6 +452,8 @@ cooked_index_shard::wait (bool allow_quit) const + cooked_index::cooked_index (vec_type &&vec) + : m_vector (std::move (vec)) + { ++ handle_deferred_entries (); ++ + for (auto &idx : m_vector) + idx->finalize (); + +@@ -649,6 +657,75 @@ cooked_index::maybe_write_index (dwarf2_per_bfd *per_bfd, + global_index_cache.store (per_bfd, ctx); + } + ++/* See cooked-index.h. */ ++ ++const cooked_index_entry * ++cooked_index_shard::resolve_deferred_entry ++ (const deferred_entry &de, const cooked_index_entry *parent_entry) ++{ ++ reset_parent_deferred (parent_map::form_addr (de.die_offset, de.per_cu_2->is_dwz, ++ de.per_cu_2->is_debug_types)); ++ return add (de.die_offset, de.tag, de.flags, de.name, ++ parent_entry, de.per_cu); ++} ++ ++/* See cooked-index.h. */ ++ ++const cooked_index_entry * ++cooked_index::find_parent_deferred_entry ++ (const cooked_index_shard::deferred_entry &entry) const ++{ ++ const cooked_index_entry *parent_entry = nullptr; ++ for (auto &parent_map_shard : m_vector) ++ { ++ auto res = parent_map_shard->find_parent (entry.spec_offset); ++ if (res != nullptr) ++ { ++ parent_entry = res; ++ break; ++ } ++ } ++ ++ return parent_entry; ++} ++ ++/* See cooked-index.h. */ ++ ++void ++cooked_index::handle_deferred_entries () ++{ ++ bool changed; ++ bool deferred; ++ do ++ { ++ deferred = false; ++ changed = false; ++ for (auto &shard : m_vector) ++ for (auto it = shard->m_deferred_entries->begin (); ++ it != shard->m_deferred_entries->end (); ) ++ { ++ const cooked_index_entry *parent_entry ++ = find_parent_deferred_entry (*it); ++ if (parent_entry == &parent_map::deferred) ++ { ++ deferred = true; ++ it++; ++ continue; ++ } ++ shard->resolve_deferred_entry (*it, parent_entry); ++ it = shard->m_deferred_entries->erase (it); ++ changed = true; ++ } ++ } ++ while (changed && deferred); ++ ++ for (auto &shard : m_vector) ++ { ++ shard->m_die_range_map.reset (nullptr); ++ shard->m_deferred_entries.reset (nullptr); ++ } ++} ++ + /* Wait for all the index cache entries to be written before gdb + exits. */ + static void +diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h +index 79fbfe88c03..66424c37f7c 100644 +--- a/gdb/dwarf2/cooked-index.h ++++ b/gdb/dwarf2/cooked-index.h +@@ -34,6 +34,7 @@ + #include "dwarf2/mapped-index.h" + #include "dwarf2/tag.h" + #include "gdbsupport/range-chain.h" ++#include + + struct dwarf2_per_cu_data; + struct dwarf2_per_bfd; +@@ -242,19 +243,29 @@ struct cooked_index_entry : public allocate_on_obstack + class parent_map + { + public: ++ /* A dummy cooked_index_entry to mark that computing the parent has been ++ deferred. */ ++ static cooked_index_entry deferred; ++ + /* A helper function to turn a section offset into an address that + can be used in a parent_map. */ +- static CORE_ADDR form_addr (sect_offset offset, bool is_dwz) ++ static CORE_ADDR form_addr (sect_offset offset, bool is_dwz, ++ bool is_debug_types) + { + CORE_ADDR value = to_underlying (offset); + if (is_dwz) + value |= ((CORE_ADDR) 1) << (8 * sizeof (CORE_ADDR) - 1); ++ if (is_debug_types) ++ value |= ((CORE_ADDR) 1) << (8 * sizeof (CORE_ADDR) - 2); + return value; + } + + /* Find the parent of DIE LOOKUP. */ + const cooked_index_entry *find_parent (CORE_ADDR lookup) const + { ++ if (m_deferred.find (lookup) != m_deferred.end ()) ++ return &parent_map::deferred; ++ + const void *obj = m_parent_map.find (lookup); + return static_cast (obj); + } +@@ -265,12 +276,28 @@ class parent_map + { + /* Calling set_empty with nullptr is currently not allowed. */ + if (parent_entry != nullptr) +- m_parent_map.set_empty (start, end, (void *)parent_entry); ++ { ++ gdb_assert (parent_entry != &parent_map::deferred); ++ m_parent_map.set_empty (start, end, (void *)parent_entry); ++ } ++ } ++ ++ void set_parent_deferred (CORE_ADDR addr) ++ { ++ m_deferred.emplace (addr); ++ } ++ ++ void reset_parent_deferred (CORE_ADDR addr) ++ { ++ m_deferred.erase (addr); + } + + private: + /* An addrmap that maps from section offsets to cooked_index_entry *. */ + addrmap_mutable m_parent_map; ++ ++ /* DIEs that are deffered. */ ++ std::unordered_set m_deferred; + }; + + class cooked_index; +@@ -285,7 +312,12 @@ class cooked_index; + class cooked_index_shard + { + public: +- cooked_index_shard () = default; ++ cooked_index_shard () ++ { ++ m_die_range_map.reset (new parent_map); ++ m_deferred_entries.reset (new std::vector); ++ } ++ + DISABLE_COPY_AND_ASSIGN (cooked_index_shard); + + /* Create a new cooked_index_entry and register it with this object. +@@ -329,6 +361,52 @@ class cooked_index_shard + for completion, will be returned. */ + range find (const std::string &name, bool completing) const; + ++ /* Find the parent of DIE LOOKUP. */ ++ const cooked_index_entry * ++ find_parent (CORE_ADDR lookup) const ++ { ++ return m_die_range_map->find_parent (lookup); ++ } ++ ++ /* Set the parent of DIES in range [START, END] to PARENT_ENTRY. */ ++ void set_parent (CORE_ADDR start, CORE_ADDR end, ++ const cooked_index_entry *parent_entry) ++ { ++ m_die_range_map->set_parent (start, end, parent_entry); ++ } ++ ++ void set_parent_deferred (CORE_ADDR addr) ++ { ++ m_die_range_map->set_parent_deferred (addr); ++ } ++ ++ void reset_parent_deferred (CORE_ADDR addr) ++ { ++ m_die_range_map->reset_parent_deferred (addr); ++ } ++ ++ /* A single deferred entry. See m_deferred_entries. */ ++ struct deferred_entry ++ { ++ sect_offset die_offset; ++ const char *name; ++ CORE_ADDR spec_offset; ++ dwarf_tag tag; ++ cooked_index_flag flags; ++ dwarf2_per_cu_data *per_cu; ++ dwarf2_per_cu_data *per_cu_2; ++ }; ++ ++ /* Defer creating a cooked_index_entry corresponding to DEFERRED. */ ++ void defer_entry (deferred_entry de) ++ { ++ m_deferred_entries->push_back (de); ++ } ++ ++ /* Variant of add that takes a deferred_entry as parameter. */ ++ const cooked_index_entry *resolve_deferred_entry ++ (const deferred_entry &entry, const cooked_index_entry *parent_entry); ++ + private: + + /* Return the entry that is believed to represent the program's +@@ -386,6 +464,20 @@ class cooked_index_shard + that the 'get' method is never called on this future, only + 'wait'. */ + gdb::future m_future; ++ ++ /* An addrmap that maps from section offsets (see the form_addr ++ method) to newly-created entries. See m_deferred_entries to ++ understand this. */ ++ std::unique_ptr m_die_range_map; ++ ++ /* The generated DWARF can sometimes have the declaration for a ++ method in a class (or perhaps namespace) scope, with the ++ definition appearing outside this scope... just one of the many ++ bad things about DWARF. In order to handle this situation, we ++ defer certain entries until the end of scanning, at which point ++ we'll know the containing context of all the DIEs that we might ++ have scanned. This vector stores these deferred entries. */ ++ std::unique_ptr> m_deferred_entries; + }; + + /* The main index of DIEs. The parallel DIE indexers create +@@ -469,6 +561,13 @@ class cooked_index : public dwarf_scanner_base + + private: + ++ /* Find the parent corresponding to deferred entry ENTRY. */ ++ const cooked_index_entry *find_parent_deferred_entry ++ (const cooked_index_shard::deferred_entry &entry) const; ++ ++ /* Create cooked_index_entries for the deferred entries. */ ++ void handle_deferred_entries (); ++ + /* Maybe write the index to the index cache. */ + void maybe_write_index (dwarf2_per_bfd *per_bfd, + const index_cache_store_context &); +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +index afdf9e870a8..5b7c0969ed7 100644 +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -4672,6 +4672,31 @@ class cooked_index_storage + return &m_addrmap; + } + ++ /* Find the parent of DIE LOOKUP. */ ++ const cooked_index_entry *find_parent (CORE_ADDR lookup) ++ { ++ return m_index->find_parent (lookup); ++ } ++ ++ /* Set the parent of DIES in range [START, END] to PARENT_ENTRY. */ ++ void set_parent (CORE_ADDR start, CORE_ADDR end, ++ const cooked_index_entry *parent_entry) ++ { ++ m_index->set_parent (start, end, parent_entry); ++ } ++ ++ /* Set the parent of DIE at ADDR as deferred. */ ++ void set_parent_deferred (CORE_ADDR addr) ++ { ++ m_index->set_parent_deferred (addr); ++ } ++ ++ /* Defer creating a cooked_index_entry corresponding to deferred_entry DE. */ ++ void defer_entry (cooked_index_shard::deferred_entry de) ++ { ++ m_index->defer_entry (de); ++ } ++ + private: + + /* Hash function for a cutu_reader. */ +@@ -4794,59 +4819,26 @@ class cooked_indexer + /* Find the parent of DIE LOOKUP. */ + const cooked_index_entry *find_parent (CORE_ADDR lookup) const + { +- return m_die_range_map.find_parent (lookup); ++ return m_index_storage->find_parent (lookup); + } + + /* Set the parent of DIES in range [START, END] to PARENT_ENTRY. */ + void set_parent (CORE_ADDR start, CORE_ADDR end, + const cooked_index_entry *parent_entry) + { +- m_die_range_map.set_parent (start, end, parent_entry); ++ m_index_storage->set_parent (start, end, parent_entry); + } + +- /* A single deferred entry. */ +- struct deferred_entry +- { +- sect_offset die_offset; +- const char *name; +- CORE_ADDR spec_offset; +- dwarf_tag tag; +- cooked_index_flag flags; +- }; +- +- /* The generated DWARF can sometimes have the declaration for a +- method in a class (or perhaps namespace) scope, with the +- definition appearing outside this scope... just one of the many +- bad things about DWARF. In order to handle this situation, we +- defer certain entries until the end of scanning, at which point +- we'll know the containing context of all the DIEs that we might +- have scanned. This vector stores these deferred entries. */ +- std::vector m_deferred_entries; +- +- /* Defer creating a cooked_index_entry corresponding to deferred_entry DE. */ +- void defer_entry (const deferred_entry &de) ++ /* Set the parent of DIE at ADDR as deferred. */ ++ void set_parent_deferred (CORE_ADDR addr) + { +- m_deferred_entries.push_back (de); ++ m_index_storage->set_parent_deferred (addr); + } + +- /* Create a cooked_index_entry corresponding to deferred_entry DE with +- parent PARENT_ENTRY. */ +- const cooked_index_entry *resolve_deferred_entry +- (const deferred_entry &de, const cooked_index_entry *parent_entry) +- { +- return m_index_storage->add (de.die_offset, de.tag, de.flags, de.name, +- parent_entry, m_per_cu); +- } +- +- /* Create cooked_index_entries for the deferred entries. */ +- void handle_deferred_entries () ++ /* Defer creating a cooked_index_entry corresponding to deferred_entry DE. */ ++ void defer_entry (const cooked_index_shard::deferred_entry &de) + { +- for (const auto &entry : m_deferred_entries) +- { +- const cooked_index_entry *parent_entry +- = find_parent (entry.spec_offset); +- resolve_deferred_entry (entry, parent_entry); +- } ++ m_index_storage->defer_entry (de); + } + }; + +@@ -16441,13 +16433,36 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu, + + if (*parent_entry == nullptr) + { ++ gdb_assert (reader->cu->per_cu->is_debug_types ++ == new_reader->cu->per_cu->is_debug_types); + CORE_ADDR addr +- = parent_map::form_addr (origin_offset, origin_is_dwz); +- if (new_reader->cu == reader->cu +- && new_info_ptr > watermark_ptr) +- *maybe_defer = addr; ++ = parent_map::form_addr (origin_offset, origin_is_dwz, ++ reader->cu->per_cu->is_debug_types); ++ if (new_reader->cu == reader->cu) ++ { ++ /* Intra-CU case. */ ++ if (new_info_ptr > watermark_ptr) ++ { ++ /* Defer because origin is not read yet. */ ++ *maybe_defer = addr; ++ } ++ else ++ { ++ auto tmp = find_parent (addr); ++ if (tmp == &parent_map::deferred) ++ { ++ /* Defer because origin is deferred. */ ++ *maybe_defer = addr; ++ } ++ else ++ *parent_entry = tmp; ++ } ++ } + else +- *parent_entry = find_parent (addr); ++ { ++ /* Inter-CU case. */ ++ *maybe_defer = addr; ++ } + } + + unsigned int bytes_read; +@@ -16567,10 +16582,12 @@ cooked_indexer::recurse (cutu_reader *reader, + limit the range to the children of parent_entry. */ + CORE_ADDR start + = parent_map::form_addr (parent_entry->die_offset + 1, +- reader->cu->per_cu->is_dwz); ++ reader->cu->per_cu->is_dwz, ++ reader->cu->per_cu->is_debug_types); + CORE_ADDR end + = parent_map::form_addr (sect_offset (info_ptr - 1 - reader->buffer), +- reader->cu->per_cu->is_dwz); ++ reader->cu->per_cu->is_dwz, ++ reader->cu->per_cu->is_debug_types); + set_parent (start, end, parent_entry); + } + +@@ -16637,9 +16654,16 @@ cooked_indexer::index_dies (cutu_reader *reader, + if (name != nullptr) + { + if (defer != 0) +- defer_entry ({ +- this_die, name, defer, abbrev->tag, flags +- }); ++ { ++ CORE_ADDR addr ++ = parent_map::form_addr (this_die, reader->cu->per_cu->is_dwz, ++ reader->cu->per_cu->is_debug_types); ++ set_parent_deferred (addr); ++ defer_entry ({ ++ this_die, name, defer, abbrev->tag, flags, m_per_cu, ++ reader->cu->per_cu ++ }); ++ } + else + this_entry = m_index_storage->add (this_die, abbrev->tag, flags, + name, this_parent_entry, +@@ -16741,8 +16765,6 @@ cooked_indexer::make_index (cutu_reader *reader) + if (!reader->comp_unit_die->has_children) + return; + index_dies (reader, reader->info_ptr, nullptr, false); +- +- handle_deferred_entries (); + } + + /* An implementation of quick_symbol_functions for the cooked DWARF +-- +2.35.3 + diff --git a/gdb-symtab-resolve-deferred-entries-intra-shard-case.patch b/gdb-symtab-resolve-deferred-entries-intra-shard-case.patch new file mode 100644 index 0000000..a18108a --- /dev/null +++ b/gdb-symtab-resolve-deferred-entries-intra-shard-case.patch @@ -0,0 +1,120 @@ +From 3b2f2b376bb80edadacc582161c362612947e3a6 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sun, 24 Sep 2023 11:43:24 +0200 +Subject: [PATCH 09/13] [gdb/symtab] Resolve deferred entries, intra-shard case + +In patch "[gdb/symtab] Resolve deferred entries, inter-shard case" we've +solved the generic case of handling deferred entries. + +Now add an optimization that handles deferred entries with an intra-shard +dependency in the parallel for. + +Tested on x86_64-linux. +--- + gdb/dwarf2/cooked-index.c | 35 +++++++++++++++++++++++++++++++++++ + gdb/dwarf2/cooked-index.h | 7 +++++++ + gdb/dwarf2/read.c | 10 ++++++++++ + 3 files changed, 52 insertions(+) + +diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c +index c096da57d62..ebed21d510c 100644 +--- a/gdb/dwarf2/cooked-index.c ++++ b/gdb/dwarf2/cooked-index.c +@@ -452,6 +452,7 @@ cooked_index_shard::wait (bool allow_quit) const + cooked_index::cooked_index (vec_type &&vec) + : m_vector (std::move (vec)) + { ++ /* Handle deferred entries, inter-cu case. */ + handle_deferred_entries (); + + for (auto &idx : m_vector) +@@ -659,6 +660,40 @@ cooked_index::maybe_write_index (dwarf2_per_bfd *per_bfd, + + /* See cooked-index.h. */ + ++const cooked_index_entry * ++cooked_index_shard::find_parent_deferred_entry ++ (const cooked_index_shard::deferred_entry &entry) const ++{ ++ return find_parent (entry.spec_offset); ++} ++ ++/* See cooked-index.h. */ ++ ++void ++cooked_index_shard::handle_deferred_entries () ++{ ++ for (auto it = m_deferred_entries->begin (); it != m_deferred_entries->end (); ) ++ { ++ const deferred_entry & deferred_entry = *it; ++ if (!parent_valid (deferred_entry.spec_offset)) ++ { ++ it++; ++ continue; ++ } ++ const cooked_index_entry *parent_entry ++ = find_parent_deferred_entry (deferred_entry); ++ if (parent_entry == &parent_map::deferred) ++ { ++ it++; ++ continue; ++ } ++ resolve_deferred_entry (deferred_entry, parent_entry); ++ it = m_deferred_entries->erase (it); ++ } ++} ++ ++/* See cooked-index.h. */ ++ + const cooked_index_entry * + cooked_index_shard::resolve_deferred_entry + (const deferred_entry &de, const cooked_index_entry *parent_entry) +diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h +index fa895233035..106e3091a90 100644 +--- a/gdb/dwarf2/cooked-index.h ++++ b/gdb/dwarf2/cooked-index.h +@@ -408,6 +408,13 @@ class cooked_index_shard + const cooked_index_entry *resolve_deferred_entry + (const deferred_entry &entry, const cooked_index_entry *parent_entry); + ++ /* Find the parent entry for deferred_entry ENTRY. */ ++ const cooked_index_entry *find_parent_deferred_entry ++ (const cooked_index_shard::deferred_entry &entry) const; ++ ++ /* Create cooked_index_entries for the deferred entries. */ ++ void handle_deferred_entries (); ++ + /* Mark parents in range [START, END] as valid . */ + void set_parent_valid (CORE_ADDR start, CORE_ADDR end) + { +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +index 09598e702bc..a97f738a54e 100644 +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -4697,6 +4697,12 @@ class cooked_index_storage + m_index->defer_entry (de); + } + ++ /* Handle deferred entries, intra-cu case. */ ++ void handle_deferred_entries () ++ { ++ m_index->handle_deferred_entries (); ++ } ++ + /* Mark parents in range [START, END] as valid . */ + void set_parent_valid (CORE_ADDR start, CORE_ADDR end) + { +@@ -5183,6 +5189,10 @@ dwarf2_build_psymtabs_hard (dwarf2_per_objfile *per_objfile) + errors.push_back (std::move (except)); + } + } ++ ++ /* Handle deferred entries, intra-cu case. */ ++ thread_storage.handle_deferred_entries (); ++ + return result_type (thread_storage.release (), std::move (errors)); + }, task_size); + +-- +2.35.3 + diff --git a/gdb-symtab-return-correct-reader-for-top-level-cu-in.patch b/gdb-symtab-return-correct-reader-for-top-level-cu-in.patch new file mode 100644 index 0000000..24e3484 --- /dev/null +++ b/gdb-symtab-return-correct-reader-for-top-level-cu-in.patch @@ -0,0 +1,224 @@ +From 84b9218d98eb2ac242fe3afc81598206279f7b13 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 22 Aug 2024 10:00:27 +0200 +Subject: [PATCH] [gdb/symtab] Return correct reader for top-level CU in + cooked_indexer::ensure_cu_exists + +With the test-case included in this patch, we run into: +... +$ gdb -q -batch $exec +Dwarf Error: Could not find abbrev number 3 in CU at offset 0xdb \ + [in module $exec] +... + +The debug info consists of two CUs: +... + Compilation Unit @ offset 0xb2: + Length: 0x25 (32-bit) + Version: 4 + Abbrev Offset: 0x6c + Pointer Size: 8 + <0>: Abbrev Number: 1 (DW_TAG_compile_unit) + DW_AT_language : 2 (non-ANSI C) + <1>: Abbrev Number: 2 (DW_TAG_subprogram) + DW_AT_low_pc : 0x4004a7 + DW_AT_high_pc : 0x4004b2 + DW_AT_specification: <0xe8> + <1>: Abbrev Number: 3 (DW_TAG_subprogram) + DW_AT_name : main + <1>: Abbrev Number: 0 + Compilation Unit @ offset 0xdb: + Length: 0xf (32-bit) + Version: 4 + Abbrev Offset: 0x86 + Pointer Size: 8 + <0>: Abbrev Number: 1 (DW_TAG_compile_unit) + DW_AT_language : 2 (non-ANSI C) + <1>: Abbrev Number: 2 (DW_TAG_subprogram) + DW_AT_specification: <0xd4> + <1>: Abbrev Number: 0 +... +where: +- DIE 0xbf in CU@0xb2 contains an inter-CU reference to +- DIE 0xe8 in CU@0xdb, which contains an inter-CU reference to +- DIE 0xd4 back in CU@0xb2. + +The dwarf error is caused by this bit of code in +cooked_indexer::ensure_cu_exists: +... + if (per_cu == m_per_cu) + return reader; +... + +The dwarf error happens as follows: +- a cutu_reader A is created for CU@0xb2 +- using cutu_reader A, the cooked index reader starts indexing dies, with + m_per_cu set to CU@0xb2 +- while indexing it scans the attributes of DIE 0xbf and encounters the + inter-CU reference to DIE 0xe8 +- it calls cooked_indexer::ensure_cu_exists, which creates a cutu_reader B for + CU@0xdb and returns it +- using cutu_reader B, it continues scanning attributes of DIE 0xe8 and + encounters the inter-CU reference to DIE 0xd4 +- it calls cooked_indexer::ensure_cu_exists, the problematic bit is triggered + and cutu_reader B is returned +- using cutu_reader B, it continues scanning attributes of DIE 0xd4 +- this goes wrong because: + - the attributes of the DIE are encoded using the abbreviation table at + offset 0x6c, while + - the decoding is done using cutu_reader B which uses the abbreviation table + at offset 0x86. + +Fix this by removing the problematic if clause. + +Since cutu_reader A is not preserved in m_index_storage, +cooked_indexer::ensure_cu_exists cannot find it there and creates a duplicate +cutu_reader C for CU@0xb2. Fix this in process_psymtab_comp_unit by preserving +the cutu_reader A as well in m_index_storage. + +Tested on x86_64-linux and aarch64-linux. + +PR symtab/32081 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32081 + +Approved-By: Tom Tromey +Reported-By: Andreas Schwab +--- + gdb/dwarf2/read.c | 35 ++++++----- + .../dw2-inter-cu-forth-and-back.exp | 60 +++++++++++++++++++ + 2 files changed, 80 insertions(+), 15 deletions(-) + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-inter-cu-forth-and-back.exp + +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +index 8f2d7a34aef..b72b5fe8c83 100644 +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -4880,28 +4880,35 @@ process_psymtab_comp_unit (dwarf2_per_cu_data *this_cu, + dwarf2_per_objfile *per_objfile, + cooked_index_storage *storage) + { +- cutu_reader reader (this_cu, per_objfile, nullptr, nullptr, false, +- storage->get_abbrev_cache ()); ++ cutu_reader *reader = storage->get_reader (this_cu); ++ if (reader == nullptr) ++ { ++ cutu_reader new_reader (this_cu, per_objfile, nullptr, nullptr, false, ++ storage->get_abbrev_cache ()); + +- if (reader.comp_unit_die == nullptr) +- return; ++ if (new_reader.comp_unit_die == nullptr || new_reader.dummy_p) ++ return; + +- if (reader.dummy_p) +- { +- /* Nothing. */ ++ std::unique_ptr copy ++ (new cutu_reader (std::move (new_reader))); ++ reader = storage->preserve (std::move (copy)); + } +- else if (this_cu->is_debug_types) +- build_type_psymtabs_reader (&reader, storage); +- else if (reader.comp_unit_die->tag != DW_TAG_partial_unit) ++ ++ if (reader->comp_unit_die == nullptr || reader->dummy_p) ++ return; ++ ++ if (this_cu->is_debug_types) ++ build_type_psymtabs_reader (reader, storage); ++ else if (reader->comp_unit_die->tag != DW_TAG_partial_unit) + { + bool nope = false; + if (this_cu->scanned.compare_exchange_strong (nope, true)) + { +- prepare_one_comp_unit (reader.cu, reader.comp_unit_die, ++ prepare_one_comp_unit (reader->cu, reader->comp_unit_die, + language_minimal); + gdb_assert (storage != nullptr); +- cooked_indexer indexer (storage, this_cu, reader.cu->lang ()); +- indexer.make_index (&reader); ++ cooked_indexer indexer (storage, this_cu, reader->cu->lang ()); ++ indexer.make_index (reader); + } + } + } +@@ -16280,8 +16287,6 @@ cooked_indexer::ensure_cu_exists (cutu_reader *reader, + if (!per_cu->scanned.compare_exchange_strong (nope, true)) + return nullptr; + } +- if (per_cu == m_per_cu) +- return reader; + + cutu_reader *result = m_index_storage->get_reader (per_cu); + if (result == nullptr) +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inter-cu-forth-and-back.exp b/gdb/testsuite/gdb.dwarf2/dw2-inter-cu-forth-and-back.exp +new file mode 100644 +index 00000000000..62674bdb700 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-inter-cu-forth-and-back.exp +@@ -0,0 +1,60 @@ ++# Copyright 2024 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# Check that the cooked index reader can handle inter-CU references: ++# - DIE1@CU1 -> DIE2@CU2 ++# - DIE2@CU2 -> DIE3@CU1. ++ ++load_lib dwarf.exp ++ ++# This test can only be run on targets which support DWARF-2 and use gas. ++require dwarf2_support ++ ++standard_testfile main.c .S ++ ++# Create the DWARF. ++set asm_file [standard_output_file $srcfile2] ++Dwarf::assemble $asm_file { ++ declare_labels label1 label2 ++ ++ cu {} { ++ compile_unit {{language @DW_LANG_C}} { ++ subprogram { ++ {MACRO_AT_range { main }} ++ {DW_AT_specification %$label1} ++ } ++ ++ label2: subprogram { ++ {DW_AT_name main} ++ } ++ } ++ } ++ ++ cu {} { ++ compile_unit {{language @DW_LANG_C}} { ++ label1: subprogram { ++ {DW_AT_specification %$label2} ++ } ++ } ++ } ++} ++ ++if [prepare_for_testing "failed to prepare" $testfile \ ++ [list $asm_file $srcfile] {nodebug}] { ++ return -1 ++} ++ ++# Regression test for PR32081. ++gdb_assert { ![regexp -nocase "error:" $gdb_file_cmd_msg] } "No Error message" + +base-commit: 102b31b0b7f62e6e4f685e725f325f2ab6283c2a +-- +2.35.3 + diff --git a/gdb-symtab-set-default-dwarf-max-cache-age-1000.patch b/gdb-symtab-set-default-dwarf-max-cache-age-1000.patch new file mode 100644 index 0000000..ffb32ad --- /dev/null +++ b/gdb-symtab-set-default-dwarf-max-cache-age-1000.patch @@ -0,0 +1,13 @@ +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +index f8797537108..cb8f86fa352 100644 +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -1250,7 +1250,7 @@ struct field_info + compilation units. Set this to zero to disable caching. Cache + sizes of up to at least twenty will improve startup time for + typical inter-CU-reference binaries, at an obvious memory cost. */ +-static int dwarf_max_cache_age = 5; ++static int dwarf_max_cache_age = 1000; + static void + show_dwarf_max_cache_age (struct ui_file *file, int from_tty, + struct cmd_list_element *c, const char *value) diff --git a/gdb-symtab-work-around-gas-pr28629.patch b/gdb-symtab-work-around-gas-pr28629.patch new file mode 100644 index 0000000..9bcab94 --- /dev/null +++ b/gdb-symtab-work-around-gas-pr28629.patch @@ -0,0 +1,278 @@ +From 1b878333913343630472f89b4bc42f51b1619308 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 1 Nov 2023 00:33:12 +0100 +Subject: [PATCH 1/2] [gdb/symtab] Work around gas PR28629 + +When running test-case gdb.tui/tui-layout-asm-short-prog.exp on AlmaLinux 9.2 +ppc64le, I run into: +... +FAIL: gdb.tui/tui-layout-asm-short-prog.exp: check asm box contents +... + +The problem is that we get: +... + 7 [ No Assembly Available ] +... +because tui_get_begin_asm_address doesn't succeed. + +In more detail, tui_get_begin_asm_address calls: +... + find_line_pc (sal.symtab, sal.line, &addr); +... +with: +... +(gdb) p *sal.symtab +$5 = {next = 0x130393c0, m_compunit = 0x130392f0, m_linetable = 0x0, + filename = "tui-layout-asm-short-prog.S", + filename_for_id = "$gdb/build/gdb/testsuite/tui-layout-asm-short-prog.S", + m_language = language_asm, fullname = 0x0} +(gdb) p sal.line +$6 = 1 +... + +The problem is the filename_for_id which is the source file prefixed with the +compilation dir rather than the source dir. + +This is due to faulty debug info generated by gas, PR28629: +... + <1a> DW_AT_name : tui-layout-asm-short-prog.S + <1e> DW_AT_comp_dir : $gdb/build/gdb/testsuite + <22> DW_AT_producer : GNU AS 2.35.2 +... + +The DW_AT_name is relative, and it's relative to the DW_AT_comp_dir entry, +making the effective name $gdb/build/gdb/testsuite/tui-layout-asm-short-prog.S. + +The bug is fixed starting version 2.38, where we get instead: +... + <1a> DW_AT_name : + $gdb/src/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S + <1e> DW_AT_comp_dir : $gdb/build/gdb/testsuite + <22> DW_AT_producer : GNU AS 2.38 +... + +Work around the faulty debug info by constructing the filename_for_id using +the second directory from the directory table in the .debug_line header: +... + The Directory Table (offset 0x22, lines 2, columns 1): + Entry Name + 0 $gdb/build/gdb/testsuite + 1 $gdb/src/gdb/testsuite/gdb.tui +... + +Note that the used gas contains a backport of commit 3417bfca676 ("GAS: +DWARF-5: Ensure that the 0'th entry in the directory table contains the +current working directory."), because directory 0 is correct. With the +unpatched 2.35.2 release the directory 0 entry is incorrect: it's a copy of +entry 1. + +Add a dwarf assembly test-case that reflects the debug info as generated by +unpatched gas 2.35.2. + +Tested on x86_64-linux. + +Approved-By: Tom Tromey +--- + gdb/dwarf2/cu.c | 1 + + gdb/dwarf2/cu.h | 1 + + gdb/dwarf2/read.c | 37 +++++++- + .../gdb.dwarf2/dw2-gas-workaround.exp | 92 +++++++++++++++++++ + 4 files changed, 130 insertions(+), 1 deletion(-) + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp + +diff --git a/gdb/dwarf2/cu.c b/gdb/dwarf2/cu.c +index a908ec908cd..f9b05dfc709 100644 +--- a/gdb/dwarf2/cu.c ++++ b/gdb/dwarf2/cu.c +@@ -40,6 +40,7 @@ dwarf2_cu::dwarf2_cu (dwarf2_per_cu_data *per_cu, + producer_is_icc_lt_14 (false), + producer_is_codewarrior (false), + producer_is_clang (false), ++ producer_is_gas_lt_2_38 (false), + producer_is_gas_2_39 (false), + processing_has_namespace_info (false), + load_all_dies (false) +diff --git a/gdb/dwarf2/cu.h b/gdb/dwarf2/cu.h +index 6c611710503..ef8db480e3f 100644 +--- a/gdb/dwarf2/cu.h ++++ b/gdb/dwarf2/cu.h +@@ -265,6 +265,7 @@ struct dwarf2_cu + bool producer_is_icc_lt_14 : 1; + bool producer_is_codewarrior : 1; + bool producer_is_clang : 1; ++ bool producer_is_gas_lt_2_38 : 1; + bool producer_is_gas_2_39 : 1; + + /* When true, the file that we're processing is known to have +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +index fc4667b782f..50fa302b43a 100644 +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -147,6 +147,8 @@ static int dwarf2_locexpr_block_index; + static int dwarf2_loclist_block_index; + static int ada_block_index; + ++static bool producer_is_gas_lt_2_38 (struct dwarf2_cu *cu); ++ + /* Size of .debug_loclists section header for 32-bit DWARF format. */ + #define LOCLIST_HEADER_SIZE32 12 + +@@ -7665,6 +7667,27 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu) + + file_and_directory &fnd = find_file_and_directory (die, cu); + ++ /* GAS supports generating dwarf-5 info starting version 2.35. Versions ++ 2.35-2.37 generate an incorrect CU name attribute: it's relative, ++ implicitly prefixing it with the compilation dir. Work around this by ++ prefixing it with the source dir instead. */ ++ if (cu->header.version == 5 && !IS_ABSOLUTE_PATH (fnd.get_name ()) ++ && producer_is_gas_lt_2_38 (cu)) ++ { ++ attr = dwarf2_attr (die, DW_AT_stmt_list, cu); ++ if (attr != nullptr && attr->form_is_unsigned ()) ++ { ++ sect_offset line_offset = (sect_offset) attr->as_unsigned (); ++ line_header_up lh = dwarf_decode_line_header (line_offset, cu, ++ fnd.get_comp_dir ()); ++ if (lh->version == 5 && lh->is_valid_file_index (1)) ++ { ++ std::string dir = lh->include_dir_at (1); ++ fnd.set_comp_dir (std::move (dir)); ++ } ++ } ++ } ++ + cu->start_compunit_symtab (fnd.get_name (), fnd.intern_comp_dir (objfile), + lowpc); + +@@ -11427,7 +11450,10 @@ check_producer (struct dwarf2_cu *cu) + else if (producer_is_clang (cu->producer, &major, &minor)) + cu->producer_is_clang = true; + else if (producer_is_gas (cu->producer, &major, &minor)) +- cu->producer_is_gas_2_39 = major == 2 && minor == 39; ++ { ++ cu->producer_is_gas_lt_2_38 = major < 2 || (major == 2 && minor < 38); ++ cu->producer_is_gas_2_39 = major == 2 && minor == 39; ++ } + else + { + /* For other non-GCC compilers, expect their behavior is DWARF version +@@ -11463,6 +11489,15 @@ producer_is_codewarrior (struct dwarf2_cu *cu) + return cu->producer_is_codewarrior; + } + ++static bool ++producer_is_gas_lt_2_38 (struct dwarf2_cu *cu) ++{ ++ if (!cu->checked_producer) ++ check_producer (cu); ++ ++ return cu->producer_is_gas_lt_2_38; ++} ++ + static bool + producer_is_gas_2_39 (struct dwarf2_cu *cu) + { +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp b/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp +new file mode 100644 +index 00000000000..ca2b10f23b3 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp +@@ -0,0 +1,92 @@ ++# Copyright 2023 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# Test line number information in various configurations. ++ ++load_lib dwarf.exp ++ ++# This test can only be run on targets which support DWARF-2 and use gas. ++require dwarf2_support ++ ++standard_testfile dw2-lines.c -dw2.S ++ ++with_shared_gdb { ++ set func_info_vars [get_func_info bar] ++} ++ ++# Helper function. ++proc line_for { l } { ++ global srcfile ++ set line [gdb_get_line_number "$l:" $srcfile] ++ return [expr $line + 1] ++} ++ ++set asm_file [standard_output_file $srcfile2] ++Dwarf::assemble $asm_file { ++ declare_labels Llines ++ global srcdir subdir srcfile objdir ++ global func_info_vars ++ foreach var $func_info_vars { ++ global $var ++ } ++ ++ cu { version 5 } { ++ compile_unit { ++ {language @DW_LANG_Mips_Assembler} ++ {name $srcfile} ++ {comp_dir $objdir} ++ {stmt_list $Llines DW_FORM_sec_offset} ++ {producer "GNU AS 2.35.2"} ++ } { ++ subprogram { ++ {external 1 flag} ++ {name bar} ++ {low_pc $bar_start addr} ++ {high_pc "$bar_start + $bar_len" addr} ++ } ++ } ++ } ++ ++ lines [list version 5] Llines { ++ set diridx1 [include_dir "${srcdir}/${subdir}"] ++ set diridx2 [include_dir "${srcdir}/${subdir}"] ++ file_name "$srcfile" $diridx1 ++ file_name "$srcfile" $diridx2 ++ ++ program { ++ DW_LNE_set_address bar_label ++ line [line_for bar_label] ++ DW_LNS_copy ++ ++ DW_LNE_set_address bar_label_2 ++ DW_LNE_end_sequence ++ } ++ } ++} ++ ++if { [prepare_for_testing "failed to prepare" ${testfile} \ ++ [list $srcfile $asm_file] {nodebug}] } { ++ return -1 ++} ++ ++gdb_test_no_output "set debug symtab-create 1" ++gdb_test_multiple "ptype bar" "" { ++ -re -wrap "$objdir.*" { ++ fail $gdb_test_name ++ } ++ -re -wrap "" { ++ pass $gdb_test_name ++ } ++} + +base-commit: d9951c3c9ea2e542d071710e9706ed505046fe36 +-- +2.35.3 + diff --git a/gdb-symtab-work-around-pr-gas-29517-dwarf2-case.patch b/gdb-symtab-work-around-pr-gas-29517-dwarf2-case.patch new file mode 100644 index 0000000..be57664 --- /dev/null +++ b/gdb-symtab-work-around-pr-gas-29517-dwarf2-case.patch @@ -0,0 +1,137 @@ +From 582fc35843fdf71b82d645d83d2903e2546cc21a Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 1 May 2024 15:10:50 +0200 +Subject: [PATCH 2/2] [gdb/symtab] Work around PR gas/29517, dwarf2 case + +In commit 1d45d90934b ("[gdb/symtab] Work around PR gas/29517") we added a +workaround for PR gas/29517. + +The problem is present in gas version 2.39, and fixed in 2.40, so the +workaround is only active for gas version == 2.39. + +However, the problem in gas is only fixed for dwarf version >= 3, which +supports DW_TAG_unspecified_type. + +Fix this by also activating the workaround for dwarf version == 2. + +Tested on x86_64-linux. + +PR symtab/31689 +https://sourceware.org/bugzilla/show_bug.cgi?id=31689 +--- + gdb/dwarf2/read.c | 5 +++- + .../gdb.dwarf2/dw2-unspecified-type-foo.c | 7 ++++++ + .../gdb.dwarf2/dw2-unspecified-type.c | 3 ++- + .../gdb.dwarf2/dw2-unspecified-type.exp | 23 ++++++++++++++++++- + 4 files changed, 35 insertions(+), 3 deletions(-) + +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +index 761437f6631..fc4667b782f 100644 +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -14646,10 +14646,13 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu) + + type = die_type (die, cu); + ++ /* PR gas/29517 occurs in 2.39, and is fixed in 2.40, but it's only fixed ++ for dwarf version >= 3 which supports DW_TAG_unspecified_type. */ + if (type->code () == TYPE_CODE_VOID + && !type->is_stub () + && die->child == nullptr +- && producer_is_gas_2_39 (cu)) ++ && (cu->per_cu->version () == 2 ++ || producer_is_gas_2_39 (cu))) + { + /* Work around PR gas/29517, pretend we have an DW_TAG_unspecified_type + return type. */ +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c +index 164e781c9f0..bcf525a4d2e 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c ++++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c +@@ -21,3 +21,10 @@ foo (void) + asm ("foo_label: .globl foo_label"); + return 0; + } ++ ++int ++foo2 (void) ++{ ++ asm ("foo2_label: .globl foo2_label"); ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c +index e07d9517ff2..9e600f9dcce 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c ++++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c +@@ -16,6 +16,7 @@ + along with this program. If not, see . */ + + extern int foo (void); ++extern int foo2 (void); + + int + bar (void) +@@ -27,6 +28,6 @@ bar (void) + int + main (void) + { +- int res = foo () + bar (); ++ int res = foo () + bar () + foo2 (); + return res; + } +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp +index a6f2a57e33e..947246ba44d 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp ++++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp +@@ -34,11 +34,19 @@ lassign $bar_res \ + bar_start bar_len + set bar_end "$bar_start + $bar_len" + ++set foo2_res \ ++ [function_range foo2 \ ++ [list ${srcdir}/${subdir}/$srcfile ${srcdir}/${subdir}/$srcfile2]] ++lassign $foo2_res \ ++ foo2_start foo2_len ++set foo2_end "$foo2_start + $foo2_len" ++ + # Create the DWARF. + set asm_file [standard_output_file $srcfile3] + Dwarf::assemble $asm_file { + global foo_start foo_end + global bar_start bar_end ++ global foo2_start foo2_end + declare_labels unspecified_type_label + + cu {} { +@@ -68,6 +76,19 @@ Dwarf::assemble $asm_file { + } + } + } ++ ++ cu { version 2 } { ++ compile_unit { ++ {language @DW_LANG_Mips_Assembler} ++ {producer "GNU AS 2.40.0"} ++ } { ++ DW_TAG_subprogram { ++ {name foo2} ++ {low_pc $foo2_start addr} ++ {high_pc $foo2_end addr} ++ } ++ } ++ } + } + + if [prepare_for_testing "failed to prepare" $testfile \ +@@ -79,7 +100,7 @@ if ![runto_main] { + return -1 + } + +-foreach f {foo bar} { ++foreach f {foo bar foo2} { + # Print the function type. Return type should be stub type, which is printed + # as void. + gdb_test "ptype $f" "type = void \\(void\\)" +-- +2.35.3 + diff --git a/gdb-symtab-work-around-pr-gas-29517.patch b/gdb-symtab-work-around-pr-gas-29517.patch new file mode 100644 index 0000000..54fc9de --- /dev/null +++ b/gdb-symtab-work-around-pr-gas-29517.patch @@ -0,0 +1,256 @@ +From 7a2731d9d1c0926d22905b9d07e32a7b63c43b34 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 28 Sep 2023 13:55:07 +0200 +Subject: [PATCH 57/65] Work around PR gas/29517 + +When using glibc debuginfo generated with gas 2.39, we run into PR gas/29517: +... +$ gdb -q -batch a.out -ex start -ex "p (char *)strstr (\"haha\", \"ah\")" +Temporary breakpoint 1 at 0x40051b: file hello.c, line 6. + +Temporary breakpoint 1, main () at hello.c:6 +6 printf ("hello\n"); +Invalid cast. +... +while without glibc debuginfo installed we get the expected result: +... +$n = 0x7ffff7daa1b1 "aha" +... +and likewise with glibc debuginfo generated with gas 2.40. + +The strstr ifunc resolves to __strstr_sse2_unaligned. The problem is that gas +generates dwarf that states that the return type is void: +... +<1><3e1e58>: Abbrev Number: 2 (DW_TAG_subprogram) + <3e1e59> DW_AT_name : __strstr_sse2_unaligned + <3e1e5d> DW_AT_external : 1 + <3e1e5e> DW_AT_low_pc : 0xbbd2e + <3e1e66> DW_AT_high_pc : 0xbc1c3 +... +while the return type should be a DW_TAG_unspecified_type, as is the case +with gas 2.40. + +We can still use the workaround of casting to another function type for both +__strstr_sse2_unaligned: +... +(gdb) p ((char * (*) (const char *, const char *))__strstr_sse2_unaligned) \ + ("haha", "ah") +$n = 0x7ffff7daa211 "aha" +... +and strstr (which requires using *strstr to dereference the ifunc before we +cast): +... +gdb) p ((char * (*) (const char *, const char *))*strstr) ("haha", "ah") +$n = 0x7ffff7daa251 "aha" +... +but that's a bit cumbersome to use. + +Work around this in the dwarf reader, such that we have instead: +... +(gdb) p (char *)strstr ("haha", "ah") +$n = 0x7ffff7daa1b1 "aha" +... + +This also requires fixing producer_is_gcc to stop returning true for +producer "GNU AS 2.39.0". + +Tested on x86_64-linux. + +PR symtab/30911 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30911 +--- + gdb/dwarf2/cu.c | 1 + + gdb/dwarf2/cu.h | 1 + + gdb/dwarf2/read.c | 23 ++++++++++++ + gdb/producer.c | 8 ++++- + .../gdb.dwarf2/dw2-unspecified-type.c | 9 ++++- + .../gdb.dwarf2/dw2-unspecified-type.exp | 36 +++++++++++++++---- + 6 files changed, 69 insertions(+), 9 deletions(-) + +diff --git a/gdb/dwarf2/cu.c b/gdb/dwarf2/cu.c +index 89de40daab0..a908ec908cd 100644 +--- a/gdb/dwarf2/cu.c ++++ b/gdb/dwarf2/cu.c +@@ -40,6 +40,7 @@ dwarf2_cu::dwarf2_cu (dwarf2_per_cu_data *per_cu, + producer_is_icc_lt_14 (false), + producer_is_codewarrior (false), + producer_is_clang (false), ++ producer_is_gas_2_39 (false), + processing_has_namespace_info (false), + load_all_dies (false) + { +diff --git a/gdb/dwarf2/cu.h b/gdb/dwarf2/cu.h +index 0c15d8b02db..6c611710503 100644 +--- a/gdb/dwarf2/cu.h ++++ b/gdb/dwarf2/cu.h +@@ -265,6 +265,7 @@ struct dwarf2_cu + bool producer_is_icc_lt_14 : 1; + bool producer_is_codewarrior : 1; + bool producer_is_clang : 1; ++ bool producer_is_gas_2_39 : 1; + + /* When true, the file that we're processing is known to have + debugging info for C++ namespaces. GCC 3.3.x did not produce +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +index a5c48baa6f8..e5e557c17d3 100644 +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -11426,6 +11426,8 @@ check_producer (struct dwarf2_cu *cu) + cu->producer_is_codewarrior = true; + else if (producer_is_clang (cu->producer, &major, &minor)) + cu->producer_is_clang = true; ++ else if (startswith (cu->producer, "GNU AS 2.39.0")) ++ cu->producer_is_gas_2_39 = true; + else + { + /* For other non-GCC compilers, expect their behavior is DWARF version +@@ -11461,6 +11463,15 @@ producer_is_codewarrior (struct dwarf2_cu *cu) + return cu->producer_is_codewarrior; + } + ++static bool ++producer_is_gas_2_39 (struct dwarf2_cu *cu) ++{ ++ if (!cu->checked_producer) ++ check_producer (cu); ++ ++ return cu->producer_is_gas_2_39; ++} ++ + /* Return the accessibility of DIE, as given by DW_AT_accessibility. + If that attribute is not available, return the appropriate + default. */ +@@ -14635,6 +14646,18 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu) + + type = die_type (die, cu); + ++ if (type->code () == TYPE_CODE_VOID ++ && !type->is_stub () ++ && die->child == nullptr ++ && producer_is_gas_2_39 (cu)) ++ { ++ /* Work around PR gas/29517, pretend we have an DW_TAG_unspecified_type ++ return type. */ ++ type = (type_allocator (cu->per_objfile->objfile, cu->lang ()) ++ .new_type (TYPE_CODE_VOID, 0, nullptr)); ++ type->set_is_stub (true); ++ } ++ + /* The die_type call above may have already set the type for this DIE. */ + ftype = get_die_type (die, cu); + if (ftype) +diff --git a/gdb/producer.c b/gdb/producer.c +index 655eb971283..9fcf749e3d4 100644 +--- a/gdb/producer.c ++++ b/gdb/producer.c +@@ -54,13 +54,19 @@ producer_is_gcc (const char *producer, int *major, int *minor) + if (minor == NULL) + minor = &min; + ++ /* Skip GNU. */ ++ cs = &producer[strlen ("GNU ")]; ++ ++ /* Bail out for GNU AS. */ ++ if (startswith (cs, "AS ")) ++ return 0; ++ + /* Skip any identifier after "GNU " - such as "C11" "C++" or "Java". + A full producer string might look like: + "GNU C 4.7.2" + "GNU Fortran 4.8.2 20140120 (Red Hat 4.8.2-16) -mtune=generic ..." + "GNU C++14 5.0.0 20150123 (experimental)" + */ +- cs = &producer[strlen ("GNU ")]; + while (*cs && !isspace (*cs)) + cs++; + if (*cs && isspace (*cs)) +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c +index 1df09214d4a..e07d9517ff2 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c ++++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c +@@ -17,9 +17,16 @@ + + extern int foo (void); + ++int ++bar (void) ++{ ++ asm ("bar_label: .globl bar_label"); ++ return 0; ++} ++ + int + main (void) + { +- int res = foo (); ++ int res = foo () + bar (); + return res; + } +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp +index 5fa6ee544b2..a6f2a57e33e 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp ++++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp +@@ -27,10 +27,18 @@ lassign $foo_res \ + foo_start foo_len + set foo_end "$foo_start + $foo_len" + ++set bar_res \ ++ [function_range bar \ ++ [list ${srcdir}/${subdir}/$srcfile ${srcdir}/${subdir}/$srcfile2]] ++lassign $bar_res \ ++ bar_start bar_len ++set bar_end "$bar_start + $bar_len" ++ + # Create the DWARF. + set asm_file [standard_output_file $srcfile3] + Dwarf::assemble $asm_file { + global foo_start foo_end ++ global bar_start bar_end + declare_labels unspecified_type_label + + cu {} { +@@ -45,7 +53,19 @@ Dwarf::assemble $asm_file { + {high_pc $foo_end addr} + {type :$unspecified_type_label} + } ++ } ++ } + ++ cu {} { ++ compile_unit { ++ {language @DW_LANG_Mips_Assembler} ++ {producer "GNU AS 2.39.0"} ++ } { ++ DW_TAG_subprogram { ++ {name bar} ++ {low_pc $bar_start addr} ++ {high_pc $bar_end addr} ++ } + } + } + } +@@ -59,12 +79,14 @@ if ![runto_main] { + return -1 + } + +-# Print the function type. Return type should be stub type, which is printed +-# as void. +-gdb_test "ptype foo" "type = void \\(void\\)" ++foreach f {foo bar} { ++ # Print the function type. Return type should be stub type, which is printed ++ # as void. ++ gdb_test "ptype $f" "type = void \\(void\\)" + +-# Call the function, casting the function to the correct function type. +-gdb_test "p ((int (*) ()) foo) ()" " = 0" ++ # Call the function, casting the function to the correct function type. ++ gdb_test "p ((int (*) ()) $f) ()" " = 0" + +-# Call the function, casting the function result to the correct type. +-gdb_test "p (int) foo ()" " = 0" ++ # Call the function, casting the function result to the correct type. ++ gdb_test "p (int) $f ()" " = 0" ++} +-- +2.35.3 + diff --git a/gdb-symtab-workaround-pr-gas-31115.patch b/gdb-symtab-workaround-pr-gas-31115.patch new file mode 100644 index 0000000..d5869cf --- /dev/null +++ b/gdb-symtab-workaround-pr-gas-31115.patch @@ -0,0 +1,122 @@ +From d25e3f4ed05c3a6c207263d7e532f829860b83f0 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 20 Mar 2024 09:57:49 +0100 +Subject: [PATCH 1/7] [gdb/symtab] Workaround PR gas/31115 + +On arm-linux, with gas 2.40, I run into: +... +(gdb) x /i main+8^M + 0x4e1 : vrhadd.u16 d14, d14, d31^M +(gdb) FAIL: gdb.arch/pr25124.exp: disassemble thumb instruction (1st try) +... + +This is a regression due to PR gas/31115, which makes gas produce a low_pc +with the thumb bit set (0x4d8 & 0x1): +... + <1><24>: Abbrev Number: 2 (DW_TAG_subprogram) + <25> DW_AT_name : main + <29> DW_AT_external : 1 + <29> DW_AT_type : <0x2f> + <2a> DW_AT_low_pc : 0x4d9 + <2e> DW_AT_high_pc : 12 +... + +The regression was introduced in 2.39, and is also present in 2.40 and 2.41, +and hasn't been fixed yet. + +Work around this in read_func_scope, by using gdbarch_addr_bits_remove on +low_pc and high_pc. + +Tested on arm-linux and x86_64-linux. + +PR tdep/31453 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31453 +--- + gdb/dwarf2/cu.c | 1 + + gdb/dwarf2/cu.h | 1 + + gdb/dwarf2/read.c | 22 ++++++++++++++++++++++ + 3 files changed, 24 insertions(+) + +diff --git a/gdb/dwarf2/cu.c b/gdb/dwarf2/cu.c +index f9b05dfc709..7f89500effd 100644 +--- a/gdb/dwarf2/cu.c ++++ b/gdb/dwarf2/cu.c +@@ -42,6 +42,7 @@ dwarf2_cu::dwarf2_cu (dwarf2_per_cu_data *per_cu, + producer_is_clang (false), + producer_is_gas_lt_2_38 (false), + producer_is_gas_2_39 (false), ++ producer_is_gas_ge_2_40 (false), + processing_has_namespace_info (false), + load_all_dies (false) + { +diff --git a/gdb/dwarf2/cu.h b/gdb/dwarf2/cu.h +index ef8db480e3f..1b02f89ed2f 100644 +--- a/gdb/dwarf2/cu.h ++++ b/gdb/dwarf2/cu.h +@@ -267,6 +267,7 @@ struct dwarf2_cu + bool producer_is_clang : 1; + bool producer_is_gas_lt_2_38 : 1; + bool producer_is_gas_2_39 : 1; ++ bool producer_is_gas_ge_2_40 : 1; + + /* When true, the file that we're processing is known to have + debugging info for C++ namespaces. GCC 3.3.x did not produce +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +index a4f982962ae..8f2d7a34aef 100644 +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -148,6 +148,7 @@ static int dwarf2_loclist_block_index; + static int ada_block_index; + + static bool producer_is_gas_lt_2_38 (struct dwarf2_cu *cu); ++static bool producer_is_gas_ge_2_39 (struct dwarf2_cu *cu); + + /* Size of .debug_loclists section header for 32-bit DWARF format. */ + #define LOCLIST_HEADER_SIZE32 12 +@@ -10223,6 +10224,15 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) + lowpc = per_objfile->relocate (unrel_low); + highpc = per_objfile->relocate (unrel_high); + ++ if (gdbarch_bfd_arch_info (gdbarch)->arch == bfd_arch_arm ++ && producer_is_gas_ge_2_39 (cu)) ++ { ++ /* Gas version 2.39 produces DWARF for a Thumb subprogram with a low_pc ++ attribute with the thumb bit set (PR gas/31115). Work around this. */ ++ lowpc = gdbarch_addr_bits_remove (gdbarch, lowpc); ++ highpc = gdbarch_addr_bits_remove (gdbarch, highpc); ++ } ++ + /* If we have any template arguments, then we must allocate a + different sort of symbol. */ + for (child_die = die->child; child_die; child_die = child_die->sibling) +@@ -11507,6 +11517,7 @@ check_producer (struct dwarf2_cu *cu) + { + cu->producer_is_gas_lt_2_38 = major < 2 || (major == 2 && minor < 38); + cu->producer_is_gas_2_39 = major == 2 && minor == 39; ++ cu->producer_is_gas_ge_2_40 = major > 2 || (major == 2 && minor >= 40); + } + else + { +@@ -11561,6 +11572,17 @@ producer_is_gas_2_39 (struct dwarf2_cu *cu) + return cu->producer_is_gas_2_39; + } + ++/* Return true if CU is produced by GAS 2.39 or later. */ ++ ++static bool ++producer_is_gas_ge_2_39 (struct dwarf2_cu *cu) ++{ ++ if (!cu->checked_producer) ++ check_producer (cu); ++ ++ return cu->producer_is_gas_2_39 || cu->producer_is_gas_ge_2_40; ++} ++ + /* Return the accessibility of DIE, as given by DW_AT_accessibility. + If that attribute is not available, return the appropriate + default. */ + +base-commit: c79ecacd3f75cfb0ec1a3afc49ca3f30b1759009 +-- +2.35.3 + diff --git a/gdb-tdep-fix-catching-syscall-execve-exit-for-arm.patch b/gdb-tdep-fix-catching-syscall-execve-exit-for-arm.patch new file mode 100644 index 0000000..3aa1420 --- /dev/null +++ b/gdb-tdep-fix-catching-syscall-execve-exit-for-arm.patch @@ -0,0 +1,130 @@ +From e2a2cb30bc4e85f462b817bac5393b3fee1ecf9f Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 21 Nov 2023 11:44:07 +0100 +Subject: [PATCH 3/7] [gdb/tdep] Fix catching syscall execve exit for arm + +When running test-case gdb.base/catch-syscall.exp on a pinebook (64-bit +aarch64 kernel, 32-bit userland) I run into: +... +(gdb) PASS: $exp: execve: syscall(s) execve appears in 'info breakpoints' +continue^M +Continuing.^M +^M +Catchpoint 18 (call to syscall execve), 0xf7726318 in execve () from \ + /lib/arm-linux-gnueabihf/libc.so.6^M +(gdb) PASS: gdb.base/catch-syscall.exp: execve: program has called execve +continue^M +Continuing.^M +process 32392 is executing new program: catch-syscall^M +Cannot access memory at address 0xf77c6a7c^M +(gdb) FAIL: $exp: execve: syscall execve has returned +... + +The memory error is thrown by arm_linux_get_syscall_number, when doing: +... + /* PC gets incremented before the syscall-stop, so read the + previous instruction. */ + unsigned long this_instr = + read_memory_unsigned_integer (pc - 4, 4, byte_order_for_code); +... + +The reason for the error is that we're stopped at the syscall exit of syscall +execve, and the pc is at the first insn of the new exec, which also happens to +be the first insn in the code segment, so consequently we cannot read the +previous insn. + +Fix this by detecting the situation by looking at the register state, similar +to what is done in aarch64_linux_get_syscall_number. + +Furthermore, catch the memory error by using safe_read_memory_unsigned_integer +and return -1 instead, matching the documented behaviour of +arm_linux_get_syscall_number. + +Finally, rather than using a hardcoded constant 11, introduce an ad-hoc +arm_sys_execve. + +Tested on pinebook. + +PR tdep/31071 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31071 +--- + gdb/arm-linux-tdep.c | 42 ++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 38 insertions(+), 4 deletions(-) + +diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c +index 33748731cfd..8116c1368ff 100644 +--- a/gdb/arm-linux-tdep.c ++++ b/gdb/arm-linux-tdep.c +@@ -813,6 +813,32 @@ arm_linux_sigreturn_next_pc (struct regcache *regcache, + return next_pc; + } + ++/* Return true if we're at execve syscall-exit-stop. */ ++ ++static bool ++is_execve_syscall_exit (struct regcache *regs) ++{ ++ ULONGEST reg = -1; ++ ++ /* Check that lr is 0. */ ++ regcache_cooked_read_unsigned (regs, ARM_LR_REGNUM, ®); ++ if (reg != 0) ++ return false; ++ ++ /* Check that r0-r8 is 0. */ ++ for (int i = 0; i <= 8; ++i) ++ { ++ reg = -1; ++ regcache_cooked_read_unsigned (regs, ARM_A1_REGNUM + i, ®); ++ if (reg != 0) ++ return false; ++ } ++ ++ return true; ++} ++ ++#define arm_sys_execve 11 ++ + /* At a ptrace syscall-stop, return the syscall number. This either + comes from the SWI instruction (OABI) or from r7 (EABI). + +@@ -830,6 +856,9 @@ arm_linux_get_syscall_number (struct gdbarch *gdbarch, + int is_thumb; + ULONGEST svc_number = -1; + ++ if (is_execve_syscall_exit (regs)) ++ return arm_sys_execve; ++ + regcache_cooked_read_unsigned (regs, ARM_PC_REGNUM, &pc); + regcache_cooked_read_unsigned (regs, ARM_PS_REGNUM, &cpsr); + is_thumb = (cpsr & t_bit) != 0; +@@ -845,9 +874,14 @@ arm_linux_get_syscall_number (struct gdbarch *gdbarch, + + /* PC gets incremented before the syscall-stop, so read the + previous instruction. */ +- unsigned long this_instr = +- read_memory_unsigned_integer (pc - 4, 4, byte_order_for_code); +- ++ unsigned long this_instr; ++ { ++ ULONGEST val; ++ if (!safe_read_memory_unsigned_integer (pc - 4, 4, byte_order_for_code, ++ &val)) ++ return -1; ++ this_instr = val; ++ } + unsigned long svc_operand = (0x00ffffff & this_instr); + + if (svc_operand) +@@ -1265,7 +1299,7 @@ arm_canonicalize_syscall (int syscall) + case 8: return gdb_sys_creat; + case 9: return gdb_sys_link; + case 10: return gdb_sys_unlink; +- case 11: return gdb_sys_execve; ++ case arm_sys_execve: return gdb_sys_execve; + case 12: return gdb_sys_chdir; + case 13: return gdb_sys_time; + case 14: return gdb_sys_mknod; +-- +2.35.3 + diff --git a/gdb-tdep-fix-gdb.base-watch-bitfields.exp-on-aarch64.patch b/gdb-tdep-fix-gdb.base-watch-bitfields.exp-on-aarch64.patch new file mode 100644 index 0000000..2b4fcd5 --- /dev/null +++ b/gdb-tdep-fix-gdb.base-watch-bitfields.exp-on-aarch64.patch @@ -0,0 +1,349 @@ +From 83b2b88c96f87a3649b4440f43a088dc6e292181 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 12 Mar 2024 17:08:18 +0100 +Subject: [PATCH 08/48] [gdb/tdep] Fix gdb.base/watch-bitfields.exp on aarch64 + +On aarch64-linux, with test-case gdb.base/watch-bitfields.exp I run into: +... +(gdb) continue^M +Continuing.^M +^M +Hardware watchpoint 2: -location q.a^M +^M +Old value = 1^M +New value = 0^M +main () at watch-bitfields.c:42^M +42 q.h--;^M +(gdb) FAIL: $exp: -location watch against bitfields: q.e: 0->5: continue +... + +In a minimal form, if we step past line 37 which sets q.e, and we have a +watchpoint set on q.e, it triggers: +... +$ gdb -q -batch watch-bitfields -ex "b 37" -ex run -ex "watch q.e" -ex step +Breakpoint 1 at 0x410204: file watch-bitfields.c, line 37. + +Breakpoint 1, main () at watch-bitfields.c:37 +37 q.e = 5; +Hardware watchpoint 2: q.e + +Hardware watchpoint 2: q.e + +Old value = 0 +New value = 5 +main () at /home/vries/gdb/src/gdb/testsuite/gdb.base/watch-bitfields.c:38 +38 q.f = 6; +... + +However, if we set in addition a watchpoint on q.a, the watchpoint on q.e +doesn't trigger. + +How does this happen? + +Bitfield q.a is just bit 0 of byte 0, and bitfield q.e is bit 4..7 of byte 1 +and bit 1 of byte 2. So, watch q.a should watch byte 0, and watch q.e should +watch bytes 1 and 2. + +Using "maint set show-debug-regs on" (and some more detailed debug prints) we +get: +... +WP2: addr=0x440028 (orig=0x440029), ctrl=0x000000d5, ref.count=1 + ctrl: enabled=1, offset=1, len=2 +WP3: addr=0x440028 (orig=0x440028), ctrl=0x00000035, ref.count=1 + ctrl: enabled=1, offset=0, len=1 +... +which matches that. + +When executing line 37, a hardware watchpoint trap triggers and we hit +aarch64_stopped_data_address with addr_trap == 0x440028: +... +(gdb) p /x addr_trap +$1 = 0x440028 +.... +and since the loop in aarch64_stopped_data_address walks backward, we check +WP3 first, which matches, and consequently target_stopped_by_watchpoint +returns true in watchpoints_triggered. + +Likewise for target_stopped_data_address, which also returns addr == 0x440028. +Watchpoints_triggered matches watchpoint q.a to that address, and sets +watch_triggered_yes. + +However, subsequently the value of q.a is checked, and it's the same value as +before (becase the insn in line 37 didn't change q.a), so the watchpoint +hardware trap is not reported to the user. + +The problem originates from that fact that aarch64_stopped_data_address picked +WP3 instead of WP2. + +There's something we can do about this. In the example above, both +target_stopped_by_watchpoint and target_stopped_data_address returned true. +Instead we can return true in target_stopped_by_watchpoint but false in +target_stopped_data_address. This lets watchpoints_triggered known that a +watchpoint was triggered, but we don't know where, and both watchpoints +get set to watch_triggered_unknown. + +Subsequently, the values of both q.a and q.e are checked, and since q.e is not +the same value as before, the watchpoint hardware trap is reported to the user. + +Note that this works well for regular (write) watchpoints (watch command), but +not for read watchpoints (rwatch command), because for those no value is +checked. Likewise for access watchpoints (awatch command). + +So, fix this by: +- passing a nullptr in aarch64_fbsd_nat_target::stopped_by_watchpoint and + aarch64_linux_nat_target::stopped_by_watchpoint to make clear we're not + interested in the stop address, +- introducing a two-phase approach in aarch64_stopped_data_address, where: + - phase one handles access and read watchpoints, as before, and + - phase two handles write watchpoints, where multiple matches cause: + - return true if addr_p == null, and + - return false if addr_p != null. + +Tested on aarch64-linux. + +Approved-By: Luis Machado + +PR tdep/31214 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31214 +--- + gdb/aarch64-fbsd-nat.c | 4 +- + gdb/aarch64-linux-nat.c | 4 +- + gdb/aarch64-nat.c | 132 ++++++++++++++++++++++++++----------- + gdb/nat/aarch64-hw-point.c | 25 +++++++ + gdb/nat/aarch64-hw-point.h | 2 + + 5 files changed, 123 insertions(+), 44 deletions(-) + +diff --git a/gdb/aarch64-fbsd-nat.c b/gdb/aarch64-fbsd-nat.c +index 38fb093f139..58518248248 100644 +--- a/gdb/aarch64-fbsd-nat.c ++++ b/gdb/aarch64-fbsd-nat.c +@@ -164,9 +164,7 @@ aarch64_fbsd_nat_target::stopped_data_address (CORE_ADDR *addr_p) + bool + aarch64_fbsd_nat_target::stopped_by_watchpoint () + { +- CORE_ADDR addr; +- +- return stopped_data_address (&addr); ++ return stopped_data_address (nullptr); + } + + /* Implement the "stopped_by_hw_breakpoint" target_ops method. */ +diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c +index c1d59b5d77c..768748a20db 100644 +--- a/gdb/aarch64-linux-nat.c ++++ b/gdb/aarch64-linux-nat.c +@@ -972,9 +972,7 @@ aarch64_linux_nat_target::stopped_data_address (CORE_ADDR *addr_p) + bool + aarch64_linux_nat_target::stopped_by_watchpoint () + { +- CORE_ADDR addr; +- +- return stopped_data_address (&addr); ++ return stopped_data_address (nullptr); + } + + /* Implement the "can_do_single_step" target_ops method. */ +diff --git a/gdb/aarch64-nat.c b/gdb/aarch64-nat.c +index ee8c5a1e21d..89d1ba6acc6 100644 +--- a/gdb/aarch64-nat.c ++++ b/gdb/aarch64-nat.c +@@ -231,46 +231,102 @@ bool + aarch64_stopped_data_address (const struct aarch64_debug_reg_state *state, + CORE_ADDR addr_trap, CORE_ADDR *addr_p) + { +- int i; +- +- for (i = aarch64_num_wp_regs - 1; i >= 0; --i) +- { +- const unsigned int offset +- = aarch64_watchpoint_offset (state->dr_ctrl_wp[i]); +- const unsigned int len = aarch64_watchpoint_length (state->dr_ctrl_wp[i]); +- const CORE_ADDR addr_watch = state->dr_addr_wp[i] + offset; +- const CORE_ADDR addr_watch_aligned = align_down (state->dr_addr_wp[i], 8); +- const CORE_ADDR addr_orig = state->dr_addr_orig_wp[i]; +- +- if (state->dr_ref_count_wp[i] +- && DR_CONTROL_ENABLED (state->dr_ctrl_wp[i]) +- && addr_trap >= addr_watch_aligned +- && addr_trap < addr_watch + len) +- { +- /* ADDR_TRAP reports the first address of the memory range +- accessed by the CPU, regardless of what was the memory +- range watched. Thus, a large CPU access that straddles +- the ADDR_WATCH..ADDR_WATCH+LEN range may result in an +- ADDR_TRAP that is lower than the +- ADDR_WATCH..ADDR_WATCH+LEN range. E.g.: +- +- addr: | 4 | 5 | 6 | 7 | 8 | +- |---- range watched ----| +- |----------- range accessed ------------| +- +- In this case, ADDR_TRAP will be 4. +- +- To match a watchpoint known to GDB core, we must never +- report *ADDR_P outside of any ADDR_WATCH..ADDR_WATCH+LEN +- range. ADDR_WATCH <= ADDR_TRAP < ADDR_ORIG is a false +- positive on kernels older than 4.10. See PR +- external/20207. */ ++ bool found = false; ++ for (int phase = 0; phase <= 1; ++phase) ++ for (int i = aarch64_num_wp_regs - 1; i >= 0; --i) ++ { ++ if (!(state->dr_ref_count_wp[i] ++ && DR_CONTROL_ENABLED (state->dr_ctrl_wp[i]))) ++ { ++ /* Watchpoint disabled. */ ++ continue; ++ } ++ ++ const enum target_hw_bp_type type ++ = aarch64_watchpoint_type (state->dr_ctrl_wp[i]); ++ if (type == hw_execute) ++ { ++ /* Watchpoint disabled. */ ++ continue; ++ } ++ ++ if (phase == 0) ++ { ++ /* Phase 0: No hw_write. */ ++ if (type == hw_write) ++ continue; ++ } ++ else ++ { ++ /* Phase 1: Only hw_write. */ ++ if (type != hw_write) ++ continue; ++ } ++ ++ const unsigned int offset ++ = aarch64_watchpoint_offset (state->dr_ctrl_wp[i]); ++ const unsigned int len ++ = aarch64_watchpoint_length (state->dr_ctrl_wp[i]); ++ const CORE_ADDR addr_watch = state->dr_addr_wp[i] + offset; ++ const CORE_ADDR addr_watch_aligned ++ = align_down (state->dr_addr_wp[i], 8); ++ const CORE_ADDR addr_orig = state->dr_addr_orig_wp[i]; ++ ++ /* ADDR_TRAP reports the first address of the memory range ++ accessed by the CPU, regardless of what was the memory ++ range watched. Thus, a large CPU access that straddles ++ the ADDR_WATCH..ADDR_WATCH+LEN range may result in an ++ ADDR_TRAP that is lower than the ++ ADDR_WATCH..ADDR_WATCH+LEN range. E.g.: ++ ++ addr: | 4 | 5 | 6 | 7 | 8 | ++ |---- range watched ----| ++ |----------- range accessed ------------| ++ ++ In this case, ADDR_TRAP will be 4. */ ++ if (!(addr_trap >= addr_watch_aligned ++ && addr_trap < addr_watch + len)) ++ { ++ /* Not a match. */ ++ continue; ++ } ++ ++ /* To match a watchpoint known to GDB core, we must never ++ report *ADDR_P outside of any ADDR_WATCH..ADDR_WATCH+LEN ++ range. ADDR_WATCH <= ADDR_TRAP < ADDR_ORIG is a false ++ positive on kernels older than 4.10. See PR ++ external/20207. */ ++ if (addr_p != nullptr) + *addr_p = addr_orig; +- return true; +- } +- } + +- return false; ++ if (phase == 0) ++ { ++ /* Phase 0: Return first match. */ ++ return true; ++ } ++ ++ /* Phase 1. */ ++ if (addr_p == nullptr) ++ { ++ /* First match, and we don't need to report an address. No need ++ to look for other matches. */ ++ return true; ++ } ++ ++ if (!found) ++ { ++ /* First match, and we need to report an address. Look for other ++ matches. */ ++ found = true; ++ continue; ++ } ++ ++ /* More than one match, and we need to return an address. No need to ++ look for further matches. */ ++ return false; ++ } ++ ++ return found; + } + + /* Define AArch64 maintenance commands. */ +diff --git a/gdb/nat/aarch64-hw-point.c b/gdb/nat/aarch64-hw-point.c +index 6747e61e026..3b8cdcba23b 100644 +--- a/gdb/nat/aarch64-hw-point.c ++++ b/gdb/nat/aarch64-hw-point.c +@@ -73,6 +73,31 @@ aarch64_watchpoint_length (unsigned int ctrl) + return retval; + } + ++/* Utility function that returns the type of a watchpoint according to the ++ content of a hardware debug control register CTRL. */ ++ ++enum target_hw_bp_type ++aarch64_watchpoint_type (unsigned int ctrl) ++{ ++ unsigned int type = DR_CONTROL_TYPE (ctrl); ++ ++ switch (type) ++ { ++ case 1: ++ return hw_read; ++ case 2: ++ return hw_write; ++ case 3: ++ return hw_access; ++ case 0: ++ /* Reserved for a watchpoint. It must behave as if the watchpoint is ++ disabled. */ ++ return hw_execute; ++ default: ++ gdb_assert_not_reached (""); ++ } ++} ++ + /* Given the hardware breakpoint or watchpoint type TYPE and its + length LEN, return the expected encoding for a hardware + breakpoint/watchpoint control register. */ +diff --git a/gdb/nat/aarch64-hw-point.h b/gdb/nat/aarch64-hw-point.h +index 2ff9ccb5c1c..71ae2864927 100644 +--- a/gdb/nat/aarch64-hw-point.h ++++ b/gdb/nat/aarch64-hw-point.h +@@ -73,6 +73,7 @@ + + #define DR_CONTROL_ENABLED(ctrl) (((ctrl) & 0x1) == 1) + #define DR_CONTROL_MASK(ctrl) (((ctrl) >> 5) & 0xff) ++#define DR_CONTROL_TYPE(ctrl) (((ctrl) >> 3) & 0x3) + + /* Structure for managing the hardware breakpoint/watchpoint resources. + DR_ADDR_* stores the address, DR_CTRL_* stores the control register +@@ -107,6 +108,7 @@ void aarch64_notify_debug_reg_change (ptid_t ptid, int is_watchpoint, + + unsigned int aarch64_watchpoint_offset (unsigned int ctrl); + unsigned int aarch64_watchpoint_length (unsigned int ctrl); ++enum target_hw_bp_type aarch64_watchpoint_type (unsigned int ctrl); + + int aarch64_handle_breakpoint (enum target_hw_bp_type type, CORE_ADDR addr, + int len, int is_insert, ptid_t ptid, +-- +2.35.3 + diff --git a/gdb-tdep-fix-gdb.base-watchpoint-running-on-arm-ppc6.patch b/gdb-tdep-fix-gdb.base-watchpoint-running-on-arm-ppc6.patch new file mode 100644 index 0000000..74340f0 --- /dev/null +++ b/gdb-tdep-fix-gdb.base-watchpoint-running-on-arm-ppc6.patch @@ -0,0 +1,76 @@ +From 1e64a66f72c79874016e78a4672b85cdeb506b9f Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 4 Jun 2024 09:30:03 +0000 +Subject: [PATCH] [gdb/tdep] Fix gdb.base/watchpoint-running on + {arm,ppc64le}-linux + +When running test-case gdb.base/watchpoint-running on ppc64le-linux, we get: +... +(gdb) watch global_var^M +warning: Error when detecting the debug register interface. \ + Debug registers will be unavailable.^M +Watchpoint 2: global_var^M +(gdb) FAIL: $exp: all-stop: hardware: watch global_var +FAIL: $exp: all-stop: hardware: watchpoint hit (timeout) +... + +The problem is that ppc_linux_dreg_interface::detect fails to detect the +hardware watchpoint interface, because the calls to ptrace return with errno +set to ESRCH. + +This is a feature of ptrace: if a call is done while the tracee is not +ptrace-stopped, it returns ESRCH. + +Indeed, in the test-case "watch global_var" is executed while the inferior is +running, and that triggers the first call to ppc_linux_dreg_interface::detect. + +And because the detection failure is cached, subsequent attempts at setting +hardware watchpoints will also fail, even if the tracee is ptrace-stopped. + +Fix this by calling target_can_use_hardware_watchpoint from +linux_init_ptrace_procfs, which is called from both: +- linux_nat_target::post_attach, and +- linux_nat_target::post_startup_inferior. + +By fixing this here, we also fix the same problem for arm-linux. + +Tested on ppc64le-linux and arm-linux. + +PR tdep/31834 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31834 +PR tdep/31705 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31705 + +(cherry picked from commit bbc92bfbf25ad42548100e31e491ed3c32fbfa3e) +--- + gdb/linux-nat.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c +index c8991cc3da4..47d74d27e11 100644 +--- a/gdb/linux-nat.c ++++ b/gdb/linux-nat.c +@@ -385,6 +385,18 @@ linux_init_ptrace_procfs (pid_t pid, int attached) + linux_ptrace_init_warnings (); + linux_proc_init_warnings (); + proc_mem_file_is_writable (); ++ ++ /* Some targets (for instance ppc and arm) may call ptrace to answer a ++ target_can_use_hardware_watchpoint query, and cache the result. However, ++ the ptrace call will fail with errno ESRCH if the tracee is not ++ ptrace-stopped, making the query fail. And if the caching mechanism does ++ not disregard an ESRCH result, all subsequent queries will also fail. ++ Call it now, where we known the tracee is ptrace-stopped. ++ ++ Other targets (for instance aarch64) do the relevant ptrace call and ++ caching in their implementation of post_attach and post_startup_inferior, ++ in which case this call is expected to have no effect. */ ++ target_can_use_hardware_watchpoint (bp_hardware_watchpoint, 1, 0); + } + + linux_nat_target::~linux_nat_target () + +base-commit: a6800d9c8145f25001dd39afc3571e3350573e81 +-- +2.35.3 + diff --git a/gdb-tdep-fix-gdb.base-watchpoint-unaligned.exp-on-aa.patch b/gdb-tdep-fix-gdb.base-watchpoint-unaligned.exp-on-aa.patch new file mode 100644 index 0000000..aed0238 --- /dev/null +++ b/gdb-tdep-fix-gdb.base-watchpoint-unaligned.exp-on-aa.patch @@ -0,0 +1,262 @@ +From 3efde6721b362fe0acad348443e4b961d7485717 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 14 Mar 2024 11:25:10 +0100 +Subject: [PATCH 09/48] [gdb/tdep] Fix gdb.base/watchpoint-unaligned.exp on + aarch64 + +On aarch64-linux, with test-case gdb.base/watchpoint-unaligned.exp I run into: +... +(gdb) watch data.u.size8twice[1]^M +Hardware watchpoint 241: data.u.size8twice[1]^M +(gdb) PASS: gdb.base/watchpoint-unaligned.exp: watch data.u.size8twice[1] +continue^M +Continuing.^M +FAIL: gdb.base/watchpoint-unaligned.exp: continue (timeout) +FAIL: gdb.base/watchpoint-unaligned.exp: size8twice write +... + +This happens as follows. + +We start the exec and set an 8-byte hardware watchpoint on +data.u.size8twice[1] at address 0x440048: +... +(gdb) p sizeof (data.u.size8twice[1]) +$1 = 8 +(gdb) p &data.u.size8twice[1] +$2 = (uint64_t *) 0x440048 +... + +We continue execution, and a 16-byte write at address 0x440040 triggers the +hardware watchpoint: +... + 4101c8: a9000801 stp x1, x2, [x0] +... + +When checking whether a watchpoint has triggered in +aarch64_stopped_data_address, we check against address 0x440040 (passed in +parameter addr_trap). This behaviour is documented: +... + /* ADDR_TRAP reports the first address of the memory range + accessed by the CPU, regardless of what was the memory + range watched. ... */ +... +and consequently the matching logic compares against an addr_watch_aligned: +... + && addr_trap >= addr_watch_aligned + && addr_trap < addr_watch + len) +... + +However, the comparison fails: +... +(gdb) p /x addr_watch_aligned +$3 = 0x440048 +(gdb) p addr_trap >= addr_watch_aligned +$4 = false +... + +Consequently, aarch64_stopped_data_address returns false, and +stopped_by_watchpoint returns false, and watchpoints_triggered returns 0, +which make infrun think it's looking at a delayed hardware +breakpoint/watchpoint trap: +... + [infrun] handle_signal_stop: stop_pc=0x4101c8 + [infrun] handle_signal_stop: delayed hardware breakpoint/watchpoint trap, ignoring +... +Infrun then ignores the trap and continues, but runs into the same situation +again and again, causing a hang which then causes the test timeout. + +Fix this by allowing a match 8 bytes below addr_watch_aligned. This +introduces the possibility for false positives, so we only do this for regular +"value changed" watchpoints. + +An earlier version of this patch worked by aligning addr_watch_aligned to 16 +instead of 8: +... +- const CORE_ADDR addr_watch_aligned = align_down (state->dr_addr_wp[i], 8); ++ const CORE_ADDR addr_watch_aligned = align_down (state->dr_addr_wp[i], 16); +... +but while that fixed the test-case, it didn't fix the problem completely, so +extend the test-case to check more scenarios. + +Tested on aarch64-linux. + +Tested-By: Luis Machado +Approved-By: Luis Machado + +PR tdep/29423 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29423 +--- + gdb/aarch64-nat.c | 17 +++- + gdb/testsuite/gdb.base/watchpoint-unaligned.c | 11 +-- + .../gdb.base/watchpoint-unaligned.exp | 78 ++++++++++++------- + 3 files changed, 68 insertions(+), 38 deletions(-) + +diff --git a/gdb/aarch64-nat.c b/gdb/aarch64-nat.c +index 89d1ba6acc6..a173e4e18d5 100644 +--- a/gdb/aarch64-nat.c ++++ b/gdb/aarch64-nat.c +@@ -269,7 +269,7 @@ aarch64_stopped_data_address (const struct aarch64_debug_reg_state *state, + = aarch64_watchpoint_length (state->dr_ctrl_wp[i]); + const CORE_ADDR addr_watch = state->dr_addr_wp[i] + offset; + const CORE_ADDR addr_watch_aligned +- = align_down (state->dr_addr_wp[i], 8); ++ = align_down (state->dr_addr_wp[i], AARCH64_HWP_MAX_LEN_PER_REG); + const CORE_ADDR addr_orig = state->dr_addr_orig_wp[i]; + + /* ADDR_TRAP reports the first address of the memory range +@@ -283,8 +283,19 @@ aarch64_stopped_data_address (const struct aarch64_debug_reg_state *state, + |---- range watched ----| + |----------- range accessed ------------| + +- In this case, ADDR_TRAP will be 4. */ +- if (!(addr_trap >= addr_watch_aligned ++ In this case, ADDR_TRAP will be 4. ++ ++ The access size also can be larger than that of the watchpoint ++ itself. For instance, the access size of an stp instruction is 16. ++ So, if we use stp to store to address p, and set a watchpoint on ++ address p + 8, the reported ADDR_TRAP can be p + 8 (observed on ++ RK3399 SOC). But it also can be p (observed on M1 SOC). Checking ++ for this situation introduces the possibility of false positives, ++ so we only do this for hw_write watchpoints. */ ++ const CORE_ADDR max_access_size = type == hw_write ? 16 : 8; ++ const CORE_ADDR addr_watch_base = addr_watch_aligned - ++ (max_access_size - AARCH64_HWP_MAX_LEN_PER_REG); ++ if (!(addr_trap >= addr_watch_base + && addr_trap < addr_watch + len)) + { + /* Not a match. */ +diff --git a/gdb/testsuite/gdb.base/watchpoint-unaligned.c b/gdb/testsuite/gdb.base/watchpoint-unaligned.c +index b60025a64f4..d854c376be9 100644 +--- a/gdb/testsuite/gdb.base/watchpoint-unaligned.c ++++ b/gdb/testsuite/gdb.base/watchpoint-unaligned.c +@@ -29,7 +29,7 @@ static volatile struct + uint32_t size4[2]; + uint16_t size2[4]; + uint8_t size1[8]; +- uint64_t size8twice[2]; ++ uint64_t size8twice[3]; + } + u; + } data; +@@ -44,13 +44,14 @@ write_size8twice (void) + static const uint64_t second = 2; + + #ifdef __aarch64__ ++ volatile void *p = &data.u.size8twice[offset]; + asm volatile ("stp %1, %2, [%0]" + : /* output */ +- : "r" (data.u.size8twice), "r" (first), "r" (second) /* input */ ++ : "r" (p), "r" (first), "r" (second) /* input */ + : "memory" /* clobber */); + #else +- data.u.size8twice[0] = first; +- data.u.size8twice[1] = second; ++ data.u.size8twice[offset] = first; ++ data.u.size8twice[offset + 1] = second; + #endif + } + +@@ -59,7 +60,7 @@ main (void) + { + volatile uint64_t local; + +- assert (sizeof (data) == 8 + 2 * 8); ++ assert (sizeof (data) == 8 + 3 * 8); + + write_size8twice (); + +diff --git a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp +index d31a9cdc2c8..c58704d033d 100644 +--- a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp ++++ b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp +@@ -151,38 +151,56 @@ foreach wpcount {4 7} { + gdb_assert $got_hit $test + } + +-if ![runto_main] { +- return -1 +-} +-gdb_breakpoint [gdb_get_line_number "final_return"] "Breakpoint $decimal at $hex" "final_return" +-set test {watch data.u.size8twice[1]} +-set wpnum 0 +-gdb_test_multiple $test $test { +- -re "Hardware watchpoint (\[0-9\]+): .*\r\n$gdb_prompt $" { +- set wpnum $expect_out(1,string) +- pass $gdb_test_name +- } +- -re "Watchpoint (\[0-9\]+): .*\r\n$gdb_prompt $" { +- if {[istarget "arm*-*-*"]} { +- untested $gdb_test_name +- } else { +- fail $gdb_test_name +- } +- } +-} +-if {$wpnum} { +- set test "continue" +- set got_hit 0 +- gdb_test_multiple $test $test { +- -re "\r\nCould not insert hardware watchpoint .*\r\n$gdb_prompt $" { ++# We've got an array with 3 8-byte elements. Do a store of 16 bytes, ++# to: ++# - elements 0 and 1 (offset == 0), and ++# - elements 1 and 2 (offset == 1). ++# For each case, check setting a watchpoint at: ++# - the first written element (index == 0), and ++# - the second element (index == 1). ++foreach_with_prefix offset { 0 1 } { ++ foreach_with_prefix index { 0 1 } { ++ ++ clean_restart $binfile ++ ++ if ![runto_main] { ++ return -1 + } +- -re "Hardware watchpoint $wpnum:.*New value = .*\r\n$gdb_prompt $" { +- set got_hit 1 +- send_gdb "continue\n" +- exp_continue ++ ++ gdb_test_no_output "set var offset = $offset" ++ gdb_breakpoint [gdb_get_line_number "final_return"] \ ++ "Breakpoint $decimal at $hex" "final_return" ++ set watch_index [expr $offset + $index] ++ set test "watch data.u.size8twice\[$watch_index\]" ++ set wpnum 0 ++ gdb_test_multiple $test $test { ++ -re "Hardware watchpoint (\[0-9\]+): .*\r\n$gdb_prompt $" { ++ set wpnum $expect_out(1,string) ++ pass $gdb_test_name ++ } ++ -re "Watchpoint (\[0-9\]+): .*\r\n$gdb_prompt $" { ++ if {[istarget "arm*-*-*"]} { ++ untested $gdb_test_name ++ } else { ++ fail $gdb_test_name ++ } ++ } + } +- -re " final_return .*\r\n$gdb_prompt $" { ++ if {$wpnum} { ++ set test "continue" ++ set got_hit 0 ++ gdb_test_multiple $test $test { ++ -re "\r\nCould not insert hardware watchpoint .*\r\n$gdb_prompt $" { ++ } ++ -re "Hardware watchpoint $wpnum:.*New value = .*\r\n$gdb_prompt $" { ++ set got_hit 1 ++ send_gdb "continue\n" ++ exp_continue ++ } ++ -re " final_return .*\r\n$gdb_prompt $" { ++ } ++ } ++ gdb_assert $got_hit "size8twice write" + } + } +- gdb_assert $got_hit "size8twice write" + } +-- +2.35.3 + diff --git a/gdb-tdep-fix-nr-array-elements-in-ppc64_aggregate_ca.patch b/gdb-tdep-fix-nr-array-elements-in-ppc64_aggregate_ca.patch new file mode 100644 index 0000000..0b91eaf --- /dev/null +++ b/gdb-tdep-fix-nr-array-elements-in-ppc64_aggregate_ca.patch @@ -0,0 +1,86 @@ +From 3f0c512dc37dbede372a018732d315726a56d10e Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 1 Nov 2023 08:07:15 +0100 +Subject: [PATCH] [gdb/tdep] Fix nr array elements in ppc64_aggregate_candidate + +On AlmaLinux 9.2 powerpc64le I run into: +... +(gdb) PASS: gdb.ada/array_return.exp: continuing to Create_Small_Float_Vector +finish^M +Run till exit from #0 pck.create_small_float_vector () at pck.adb:30^M +0x00000000100022d4 in p () at p.adb:25^M +25 Vector := Create_Small_Float_Vector;^M +Value returned is $3 = (2.80259693e-45, 2.80259693e-45)^M +(gdb) FAIL: gdb.ada/array_return.exp: value printed by finish of Create_Small_Float_Vector +... +while this is expected: +... +Value returned is $3 = (4.25, 4.25)^M +... + +The problem is here in ppc64_aggregate_candidate: +... + if (!get_array_bounds (type, &low_bound, &high_bound)) + return -1; + count *= high_bound - low_bound +... + +The array type (containing 2 elements) is: +... + type Small_Float_Vector is array (1 .. 2) of Float; +... +so we have: +... +(gdb) p low_bound +$1 = 1 +(gdb) p high_bound +$2 = 2 +... +but we calculate the number of elements in the array using +"high_bound - low_bound", which is 1. + +Consequently, gdb fails to correctly classify the type as a ELFv2 homogeneous +aggregate. + +Fix this by calculating the number of elements in the array by using +"high_bound - low_bound + 1" instead. + +Furthermore, high_bound can (in general, though perhaps not here) be also be +smaller than low_bound, so to be safe take that into account as well: +... + LONGEST nr_array_elements = (low_bound > high_bound + ? 0 + : (high_bound - low_bound + 1)); + count *= nr_array_elements; +... + +Tested on powerpc64le-linux. + +PR tdep/31015 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31015 +--- + gdb/ppc-sysv-tdep.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c +index 9cea63307e6..dc89201eed2 100644 +--- a/gdb/ppc-sysv-tdep.c ++++ b/gdb/ppc-sysv-tdep.c +@@ -1126,7 +1126,11 @@ ppc64_aggregate_candidate (struct type *type, + + if (!get_array_bounds (type, &low_bound, &high_bound)) + return -1; +- count *= high_bound - low_bound; ++ ++ LONGEST nr_array_elements = (low_bound > high_bound ++ ? 0 ++ : (high_bound - low_bound + 1)); ++ count *= nr_array_elements; + + /* There must be no padding. */ + if (count == 0) + +base-commit: b1136560e772dd4c74f1fbb41f6ba840b92fb9d6 +-- +2.35.3 + diff --git a/gdb-tdep-fix-reverse-execution-of-ldr-immediate-t4.patch b/gdb-tdep-fix-reverse-execution-of-ldr-immediate-t4.patch new file mode 100644 index 0000000..106bb08 --- /dev/null +++ b/gdb-tdep-fix-reverse-execution-of-ldr-immediate-t4.patch @@ -0,0 +1,80 @@ +From b8a8f319b30149f94823302d9120d83b9eee01a4 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 13 Feb 2024 09:10:54 +0100 +Subject: [PATCH 23/48] [gdb/tdep] Fix reverse execution of LDR(immediate) T4 + +When running test-case gdb.reverse/func-map-to-same-line.exp on arm-linux with +target board unix/-mthumb, we run into: +... +(gdb) reverse-step +func2 () at func-map-to-same-line.c:26 +26 { +(gdb) FAIL: gdb.reverse/func-map-to-same-line.exp: \ + column_info_flag=column-info: step-test: reverse-step into func2 +... + +The FAIL is caused by incorrect recording of this insn: +... +4f6: f85d 7b04 ldr.w r7, [sp], #4 +... + +The insn updates the sp, but we don't record this: +... +$ gdb -q -batch func-map-to-same-line \ + -ex "b *func2+8" \ + -ex run \ + -ex record \ + -ex "set debug record 2" \ + -ex stepi +Breakpoint 1 at 0x4f6: file func-map-to-same-line.c, line 27. + +Breakpoint 1, 0xaaaaa4f6 in func2 () at func-map-to-same-line.c:27 +27 } /* END FUNC2 */ +Process record: arm_process_record addr = 0xaaaaa4f6 +Process record: add register num = 15 to record list. +Process record: record_full_arch_list_add 0xabc6c460. +Process record: add register num = 7 to record list. +Process record: record_full_arch_list_add 0xabc3b868. +Process record: add register num = 25 to record list. +... +[ Note that sp is r13, and we see here only r15 (pc), r7, and r25 (ps). ] + +The problem is that the specific insn, an LDR(immediate) T4, is not handled in +thumb2_record_ld_word. + +Fix this by detecting the insn in thumb2_record_ld_word, and recording the +updated base register. + +Tested on arm-linux. + +Reported-By: Thiago Jung Bauermann +Approved-By: Luis Machado + +PR tdep/31278 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31278 +--- + gdb/arm-tdep.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c +index 04392115848..3b1682a2aea 100644 +--- a/gdb/arm-tdep.c ++++ b/gdb/arm-tdep.c +@@ -14156,6 +14156,14 @@ thumb2_record_ld_word (arm_insn_decode_record *thumb2_insn_r) + record_buf[1] = ARM_PS_REGNUM; + thumb2_insn_r->reg_rec_count = 2; + ++ if ((thumb2_insn_r->arm_insn & 0xfff00900) == 0xf8500900) ++ { ++ /* Detected LDR(immediate), T4, with write-back bit set. Record Rn ++ update. */ ++ record_buf[2] = bits (thumb2_insn_r->arm_insn, 16, 19); ++ thumb2_insn_r->reg_rec_count++; ++ } ++ + REG_ALLOC (thumb2_insn_r->arm_regs, thumb2_insn_r->reg_rec_count, + record_buf); + return ARM_RECORD_SUCCESS; +-- +2.35.3 + diff --git a/gdb-tdep-s390-add-arch15-record-replay-support.patch b/gdb-tdep-s390-add-arch15-record-replay-support.patch new file mode 100644 index 0000000..fcef18f --- /dev/null +++ b/gdb-tdep-s390-add-arch15-record-replay-support.patch @@ -0,0 +1,168 @@ +From 9afcf99e16a4adecc7d1a18c30bed65a29c96e52 Mon Sep 17 00:00:00 2001 +From: Andreas Arnez +Date: Tue, 19 Nov 2024 18:24:06 +0100 +Subject: [PATCH] [gdb/tdep] s390: Add arch15 record/replay support + +Enable recording of the new "arch15" instructions on z/Architecture +targets. +--- + gdb/s390-tdep.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 75 insertions(+), 3 deletions(-) + +diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c +index dcac407caef..e25bcfaf974 100644 +--- a/gdb/s390-tdep.c ++++ b/gdb/s390-tdep.c +@@ -4245,6 +4245,10 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + case 0xb917: /* LLGTR - load logical thirty one bits */ + case 0xb91c: /* MSGFR - multiply single 64<32 */ + case 0xb946: /* BCTGR - branch on count */ ++ case 0xb968: /* CLZG - count leading zeros */ ++ case 0xb969: /* CTZG - count trailing zeros */ ++ case 0xb96c: /* BEXTG - bit extract */ ++ case 0xb96d: /* BDEPG - bit deposit */ + case 0xb984: /* LLGCR - load logical character */ + case 0xb985: /* LLGHR - load logical halfword */ + case 0xb9e2: /* LOCGR - load on condition */ +@@ -5125,7 +5129,14 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + return -1; + break; + +- /* 0xc86-0xc8f undefined */ ++ case 0xc86: /* CAL - compare and load 32 */ ++ case 0xc87: /* CALG - compare and load 64 */ ++ case 0xc8f: /* CALGF - compare and load 64<32 */ ++ if (s390_record_gpr_g (gdbarch, regcache, inib[2])) ++ return -1; ++ if (record_full_arch_list_add_reg (regcache, S390_PSWM_REGNUM)) ++ return -1; ++ break; + + default: + goto UNKNOWN_OP; +@@ -5336,6 +5347,16 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + case 0xe33b: /* LZRF - load and zero rightmost byte */ + case 0xe351: /* MSY - multiply single */ + case 0xe358: /* LY - load */ ++ case 0xe360: /* LXAB - load indexed address (shift 0) */ ++ case 0xe361: /* LLXAB - load logical indexed address (shift 0) */ ++ case 0xe362: /* LXAH - load indexed address (shift 1) */ ++ case 0xe363: /* LLXAH - load logical indexed address (shift 1) */ ++ case 0xe364: /* LXAF - load indexed address (shift 2) */ ++ case 0xe365: /* LLXAF - load logical indexed address (shift 2) */ ++ case 0xe366: /* LXAG - load indexed address (shift 3) */ ++ case 0xe367: /* LLXAG - load logical indexed address (shift 3) */ ++ case 0xe368: /* LXAQ - load indexed address (shift 4) */ ++ case 0xe369: /* LLXAQ - load logical indexed address (shift 4) */ + case 0xe371: /* LAY - load address */ + case 0xe373: /* ICY - insert character */ + case 0xe376: /* LB - load byte */ +@@ -5448,7 +5469,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + break; + + /* 0xe35d undefined */ +- /* 0xe360-0xe36f undefined */ ++ /* 0xe36a-0xe36f undefined */ + + case 0xe372: /* STCY - store character */ + case 0xe3c3: /* STCH - store character high */ +@@ -5569,6 +5590,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + case 0xe750: /* VPOPCT - vector population count */ + case 0xe752: /* VCTZ - vector count trailing zeros */ + case 0xe753: /* VCLZ - vector count leading zeros */ ++ case 0xe754: /* VGEM - vector generate element masks */ + case 0xe756: /* VLR - vector load */ + case 0xe75f: /* VSEG -vector sign extend to doubleword */ + case 0xe760: /* VMRL - vector merge low */ +@@ -5602,6 +5624,8 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + case 0xe785: /* VBPERM - vector bit permute */ + case 0xe786: /* VSLD - vector shift left double by bit */ + case 0xe787: /* VSRD - vector shift right double by bit */ ++ case 0xe788: /* VEVAL - vector evaluate */ ++ case 0xe789: /* VBLEND - vector blend */ + case 0xe78b: /* VSTRS - vector string search */ + case 0xe78c: /* VPERM - vector permute */ + case 0xe78d: /* VSEL - vector select */ +@@ -5624,6 +5648,10 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + case 0xe7ad: /* VMALO - vector multiply and add logical odd */ + case 0xe7ae: /* VMAE - vector multiply and add even */ + case 0xe7af: /* VMAO - vector multiply and add odd */ ++ case 0xe7b0: /* VDL - vector divide logical */ ++ case 0xe7b1: /* VRL - vector remainder logical */ ++ case 0xe7b2: /* VD - vector divide */ ++ case 0xe7b3: /* VR - vector remainder */ + case 0xe7b4: /* VGFM - vector Galois field multiply sum */ + case 0xe7b8: /* VMSL - vector multiply sum logical */ + case 0xe7b9: /* VACCC - vector add with carry compute carry */ +@@ -5799,6 +5827,8 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + + /* 0xe747-0xe749 undefined */ + ++ case 0xe64a: /* VCVDQ - vector convert to decimal 128 bits */ ++ case 0xe64e: /* VCVBQ - vector convert to binary 128 bits */ + case 0xe651: /* VCLZDP - vector count leading zero digits */ + case 0xe654: /* VUPKZH - vector unpack zoned high */ + case 0xe658: /* VCVD - vector convert to decimal 32 bit */ +@@ -5839,6 +5869,7 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + break; + + case 0xe65f: /* VTP - vector test decimal */ ++ case 0xe67f: /* VTZ - vector test zoned */ + /* flags + FPC */ + if (record_full_arch_list_add_reg (regcache, S390_PSWM_REGNUM)) + return -1; +@@ -5932,7 +5963,48 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, + return -1; + break; + +- /* 0xeb15-0xeb1b undefined */ ++ case 0xeb16: /* PFCR - perform functions with concurrent results */ ++ if (record_full_arch_list_add_reg (regcache, S390_PSWM_REGNUM)) ++ return -1; ++ regcache_raw_read_unsigned (regcache, S390_R0_REGNUM, &tmp); ++ oaddr = s390_record_calc_disp (gdbarch, regcache, 0, insn[1], ++ ibyte[4]); ++ { ++ uint8_t fc = tmp & 0xff; ++ if (fc == 0) /* PFCR-QAF */ ++ { ++ if (record_full_arch_list_add_mem (oaddr, 16)) ++ return -1; ++ } ++ else if (fc >= 1 && fc <= 4) ++ { ++ /* Compare and swap and double/triple store. */ ++ int bytesize = fc & 1 ? 4 : 8; ++ int startbit = fc >= 3 ? 16 : 32; ++ if (record_full_arch_list_add_reg (regcache, ++ S390_R0_REGNUM + inib[2])) ++ return -1; ++ regcache_raw_read_unsigned (regcache, ++ S390_R0_REGNUM + inib[3], &tmp); ++ for (i = startbit; i < 64; i += 16) ++ { ++ oaddr = s390_record_calc_disp (gdbarch, regcache, 0, ++ (tmp >> i) & 0xffff, 0); ++ if (record_full_arch_list_add_mem (oaddr, bytesize)) ++ return -1; ++ } ++ } ++ else ++ { ++ gdb_printf (gdb_stdlog, ++ "Warning: Unknown PFCR FC %02x at %s.\n", ++ fc, paddress (gdbarch, addr)); ++ return -1; ++ } ++ } ++ break; ++ ++ /* 0xeb17-0xeb1b undefined */ + /* 0xeb1e-0xeb1f undefined */ + /* 0xeb22 undefined */ + + +base-commit: 029bb9a91184eae765dda5220ccfb29d7d02f395 +-- +2.43.0 + diff --git a/gdb-test-bt-cfi-without-die.patch b/gdb-test-bt-cfi-without-die.patch new file mode 100644 index 0000000..29b6bc0 --- /dev/null +++ b/gdb-test-bt-cfi-without-die.patch @@ -0,0 +1,214 @@ +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-test-bt-cfi-without-die.patch + +;; [delayed-symfile] Test a backtrace regression on CFIs without DIE (BZ 614604). +;;=fedoratest + +http://sourceware.org/ml/archer/2010-q3/msg00028.html + +On Wed, 25 Feb 2009 00:14:29 +0100, Jan Kratochvil wrote: +> commit 6a37c2b9962258ecf9299cc34a650e64a06acaa5 +> +> There was a regression on gdb.base/savedregs.exp. +> +> quick_addrmap/require_partial_symbols should be used even for the unwind debug +> info checking as its load has been also delayed by this branch. +[...] +> --- a/gdb/dwarf2-frame.c +> +++ b/gdb/dwarf2-frame.c +[...] +> @@ -1499,6 +1500,14 @@ dwarf2_frame_find_fde (CORE_ADDR *pc) +> struct dwarf2_fde *fde; +> CORE_ADDR offset; +> +> + if (objfile->quick_addrmap) +> + { +> + if (!addrmap_find (objfile->quick_addrmap, *pc)) +> + continue; +> + } +> + /* FIXME: Read-in only .debug_frame/.eh_frame without .debug_info? */ +> + require_partial_symbols (objfile); +> + + +but this has caused a different regression (as discussed in the confcall). + +QUICK_ADDRMAP is built only from .debug_aranges. But we can have existing +built .debug_aranges for CUs in OBJFILE but still some CUs do not need to have +DWARF at all while they can feature CFIs (.eh_frame or .debug_frame). +It has been described by Daniel Jacobowitz at: + Re: [2/4] RFC: check psymtabs_addrmap before reading FDEs + http://sourceware.org/ml/gdb-patches/2010-07/msg00012.html + +Sorry for this regression by me (in that fix of a different regression). + +Fixed it the "slow way" as this branch is now obsoleted by .gdb-index. + +No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu. + +Checked-in. + +Thanks, +Jan + +eb8df8566acc1ed963e3e9b77c13b9c2c3db03fb + +Test CFI is parsed even for range (function) not described by any DIE. + +https://bugzilla.redhat.com/show_bug.cgi?id=614028 + +gdb/ + * dwarf2-frame.c (dwarf2_frame_find_fde): Remove the + OBJFILE->QUICK_ADDRMAP check. New comment why. + +gdb/testsuite/ + * gdb.base/cfi-without-die.exp, gdb.base/cfi-without-die-main.c, + gdb.base/cfi-without-die-caller.c: New files. + +diff --git a/gdb/testsuite/gdb.base/cfi-without-die-caller.c b/gdb/testsuite/gdb.base/cfi-without-die-caller.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/cfi-without-die-caller.c +@@ -0,0 +1,28 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++typedef int (*callback_t) (void); ++ ++int ++caller (callback_t callback) ++{ ++ /* Ensure some frame content to push away the return address. */ ++ volatile const long one = 1; ++ ++ /* Modify the return value to prevent any tail-call optimization. */ ++ return (*callback) () - one; ++} +diff --git a/gdb/testsuite/gdb.base/cfi-without-die-main.c b/gdb/testsuite/gdb.base/cfi-without-die-main.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/cfi-without-die-main.c +@@ -0,0 +1,32 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++typedef int (*callback_t) (void); ++ ++extern int caller (callback_t callback); ++ ++int ++callback (void) ++{ ++ return 1; ++} ++ ++int ++main (void) ++{ ++ return caller (callback); ++} +diff --git a/gdb/testsuite/gdb.base/cfi-without-die.exp b/gdb/testsuite/gdb.base/cfi-without-die.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/cfi-without-die.exp +@@ -0,0 +1,71 @@ ++# Copyright 2010 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# Test CFI is parsed even for range (function) not described by any DIE. ++ ++set testfile cfi-without-die ++set srcmainfile ${testfile}-main.c ++set srccallerfile ${testfile}-caller.c ++set executable ${testfile} ++set objmainfile [standard_output_file ${testfile}-main.o] ++set objcallerfile [standard_output_file ${testfile}-caller.o] ++set binfile [standard_output_file ${executable}] ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srccallerfile}" ${objcallerfile} \ ++ object [list {additional_flags=-fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables}]] != "" ++ || [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" ${objmainfile} object {debug}] != "" ++ || [gdb_compile "${objmainfile} ${objcallerfile}" ${binfile} executable {}] != "" } { ++ untested ${testfile}.exp ++ return -1 ++} ++ ++clean_restart $executable ++ ++if ![runto callback] then { ++ fail "verify unwinding: Can't run to callback" ++ return 0 ++} ++set test "verify unwinding breaks without CFI" ++gdb_test_multiple "bt" $test { ++ -re " in \[?\]\[?\] .*\r\n$gdb_prompt $" { ++ # It may backtrace through some random frames even to main(). ++ pass $test ++ } ++ -re " in main .*\r\n$gdb_prompt $" { ++ fail $test ++ } ++ -re "\r\n$gdb_prompt $" { ++ pass $test ++ } ++} ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srccallerfile}" ${objcallerfile} \ ++ object [list {additional_flags=-fomit-frame-pointer -funwind-tables -fasynchronous-unwind-tables}]] != "" ++ || [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" ${objmainfile} object {debug}] != "" ++ || [gdb_compile "${objmainfile} ${objcallerfile}" ${binfile} executable {}] != "" } { ++ untested ${testfile}.exp ++ return -1 ++} ++ ++clean_restart $executable ++ ++if ![runto callback] then { ++ fail "test CFI without DIEs: Can't run to callback" ++ return 0 ++} ++# #0 callback () at ... ++# #1 0x00000000004004e9 in caller () ++# #2 0x00000000004004cd in main () at ... ++gdb_test "bt" "#0 +callback \[^\r\n\]+\r\n#1 \[^\r\n\]+ in caller \[^\r\n\]+\r\n#2 \[^\r\n\]+ in main \[^\r\n\]+" "verify unwindin works for CFI without DIEs" diff --git a/gdb-test-dw2-aranges.patch b/gdb-test-dw2-aranges.patch new file mode 100644 index 0000000..d88d3f4 --- /dev/null +++ b/gdb-test-dw2-aranges.patch @@ -0,0 +1,220 @@ +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-test-dw2-aranges.patch + +;; [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp. +;;=fedoratest + +[archer-tromey-delayed-symfile] + +commit 77fa7778a37b0d28a7e4e5235f074a10ecf1815d +Author: Jan Kratochvil +Date: Sat Aug 15 15:05:54 2009 +0200 + + Test for "handle incorrect aranges". + + readelf: + Contents of the .debug_aranges section: + + Length: 8 + Version: 2 + Offset into .debug_info: 0x0 + Pointer Size: 0 + Segment Size: 0 + + Address Length + Floating point exception + + * gdb.dwarf2/dw2-aranges.exp, gdb.dwarf2/dw2-aranges.S: New files. + +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.S b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S +@@ -0,0 +1,140 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2004, 2007, 2008, 2009 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++/* Test .debug_aranges containing zero address_size. */ ++ ++/* Dummy function to provide debug information for. */ ++ ++ .text ++.Lbegin_text1: ++ .globl main ++ .type main, %function ++main: ++.Lbegin_main: ++ .int 0 ++.Lend_main: ++ .size main, .-main ++.Lend_text1: ++ ++/* Debug information */ ++ ++ .section .debug_info ++.Lcu1_begin: ++ /* CU header */ ++ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */ ++.Lcu1_start: ++ .2byte 2 /* DWARF Version */ ++ .4byte .Labbrev1_begin /* Offset into abbrev section */ ++ .byte 4 /* Pointer size */ ++ ++ /* CU die */ ++ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */ ++ .4byte .Lend_text1 /* DW_AT_high_pc */ ++ .4byte .Lbegin_text1 /* DW_AT_low_pc */ ++ .ascii "file1.txt\0" /* DW_AT_name */ ++ .ascii "GNU C 3.3.3\0" /* DW_AT_producer */ ++ .byte 1 /* DW_AT_language (C) */ ++ ++ /* main */ ++ .uleb128 2 /* Abbrev: DW_TAG_subprogram */ ++ .byte 1 /* DW_AT_external */ ++ .byte 1 /* DW_AT_decl_file */ ++ .byte 2 /* DW_AT_decl_line */ ++ .ascii "main\0" /* DW_AT_name */ ++ .4byte .Ltype_int-.Lcu1_begin /* DW_AT_type */ ++ .4byte .Lbegin_main /* DW_AT_low_pc */ ++ .4byte .Lend_main /* DW_AT_high_pc */ ++ .byte 1 /* DW_AT_frame_base: length */ ++ .byte 0x55 /* DW_AT_frame_base: DW_OP_reg5 */ ++ ++.Ltype_int: ++ .uleb128 3 /* Abbrev: DW_TAG_base_type */ ++ .ascii "int\0" /* DW_AT_name */ ++ .byte 4 /* DW_AT_byte_size */ ++ .byte 5 /* DW_AT_encoding */ ++ ++ .byte 0 /* End of children of CU */ ++ ++.Lcu1_end: ++ ++/* Abbrev table */ ++ .section .debug_abbrev ++.Labbrev1_begin: ++ .uleb128 1 /* Abbrev code */ ++ .uleb128 0x11 /* DW_TAG_compile_unit */ ++ .byte 1 /* has_children */ ++ .uleb128 0x12 /* DW_AT_high_pc */ ++ .uleb128 0x1 /* DW_FORM_addr */ ++ .uleb128 0x11 /* DW_AT_low_pc */ ++ .uleb128 0x1 /* DW_FORM_addr */ ++ .uleb128 0x3 /* DW_AT_name */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0x25 /* DW_AT_producer */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0x13 /* DW_AT_language */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 2 /* Abbrev code */ ++ .uleb128 0x2e /* DW_TAG_subprogram */ ++ .byte 0 /* has_children */ ++ .uleb128 0x3f /* DW_AT_external */ ++ .uleb128 0xc /* DW_FORM_flag */ ++ .uleb128 0x3a /* DW_AT_decl_file */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .uleb128 0x3b /* DW_AT_decl_line */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .uleb128 0x3 /* DW_AT_name */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0x49 /* DW_AT_type */ ++ .uleb128 0x13 /* DW_FORM_ref4 */ ++ .uleb128 0x11 /* DW_AT_low_pc */ ++ .uleb128 0x1 /* DW_FORM_addr */ ++ .uleb128 0x12 /* DW_AT_high_pc */ ++ .uleb128 0x1 /* DW_FORM_addr */ ++ .uleb128 0x40 /* DW_AT_frame_base */ ++ .uleb128 0xa /* DW_FORM_block1 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 3 /* Abbrev code */ ++ .uleb128 0x24 /* DW_TAG_base_type */ ++ .byte 0 /* has_children */ ++ .uleb128 0x3 /* DW_AT_name */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0xb /* DW_AT_byte_size */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .uleb128 0x3e /* DW_AT_encoding */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++/* aranges table */ ++ .section .debug_aranges ++ .long .Laranges_end - 1f ++1: ++ .2byte 2 /* aranges Version */ ++ .4byte .Lcu1_begin - .debug_info /* Offset into .debug_info section */ ++ /* The GDB crasher is this zero value. */ ++ .byte 0 /* aranges address_size */ ++ .byte 0 /* aranges segment_size */ ++ ++.Laranges_end: +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp b/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp +@@ -0,0 +1,40 @@ ++# Copyright 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# Test .debug_aranges containing zero address_size. ++ ++# This test can only be run on targets which support DWARF-2 and use gas. ++# For now pick a sampling of likely targets. ++if {![istarget *-*-linux*] ++ && ![istarget *-*-gnu*] ++ && ![istarget *-*-elf*] ++ && ![istarget *-*-openbsd*] ++ && ![istarget arm-*-eabi*] ++ && ![istarget powerpc-*-eabi*]} { ++ return 0 ++} ++ ++set testfile "dw2-aranges" ++set srcfile ${testfile}.S ++set binfile [standard_output_file ${testfile}] ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {nodebug}] != "" } { ++ return -1 ++} ++ ++clean_restart $testfile ++ ++# Failed gdb_load would abort the testcase execution earlier. ++pass "file loaded" diff --git a/gdb-testsuite-ada-pie.patch b/gdb-testsuite-ada-pie.patch new file mode 100644 index 0000000..0a54bc6 --- /dev/null +++ b/gdb-testsuite-ada-pie.patch @@ -0,0 +1,121 @@ +From 6de9111c512de99fd8cb3ea89f9890b1d72f6ef0 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 21 Apr 2023 09:12:35 +0200 +Subject: [PATCH] Compile ada hello world for skip_ada_tests + +For openSUSE Leap 15.0 with gcc-PIE installed (which makes gcc create PIE +executables by default) we get: +... +FAIL: gdb.ada/O2_float_param.exp: compilation foo.adb +... + +The problem is that while gcc-PIE affects gcc, it does not affect gnatlink, +so it links in the libgnat.a, rather than libgnat_pic.a. [ This is +bsc#1115034. ] + +[ Without gcc-PIE, we have a related problem: if we run ada tests with +--target_board=unix/-fPIE/-pie, which makes sure PIE executables are generated +for c/c++ test-cases, still we get non-PIE ada executables, because gnatmake +does not pass -pie to gnatlink. And if gnatmake would pass -pie to gnatlink, +we'd run into the same FAIL as above because gnatlink does not use use +libgnat_pic.a when -pie is specified (this is PR gcc/87936). So, in order to +have ada tests generate PIE executables, we need +--target_board=unix/-fPIE/-largs/-pie/-lgnat_pic/-margs, which will not work +with c/c++ test-cases. ] + +For now, we check whether we can compile an ada hello world, and if not, +generate an UNSUPPORTED in either skip_ada_tests or gdb_compile_ada, to +not have this problem result in ~200 FAILs. + +gdb/testsuite/ChangeLog: + +2020-11-06 Tom de Vries + + * lib/ada.exp (gdb_compile_ada): Call gdb_can_compile_ada. + (gdb_can_compile_ada): New gdb_caching_proc. + * lib/gdb.exp: Add load_lib ada.exp. + (skip_ada_tests): Return 1 if !gdb_can_compile_ada. +--- + gdb/testsuite/lib/ada.exp | 31 +++++++++++++++++++++++++++++++ + gdb/testsuite/lib/gdb.exp | 8 ++++++++ + 2 files changed, 39 insertions(+) + +diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp +index 4bf1368f29f..7d8fbf01fbd 100644 +--- a/gdb/testsuite/lib/ada.exp ++++ b/gdb/testsuite/lib/ada.exp +@@ -90,12 +90,43 @@ proc gdb_compile_ada_1 {source dest type options} { + # compile was successful. + + proc gdb_compile_ada {source dest type options} { ++ if { [gdb_can_compile_ada] == 0 } { ++ global gdb_test_file_name ++ unsupported "$gdb_test_file_name" ++ return "Cannot compile ada" ++ } + set result [gdb_compile_ada_1 $source $dest $type $options] + + gdb_compile_test $source $result + return $result + } + ++gdb_caching_proc gdb_can_compile_ada {} { ++ set name "hello" ++ set dir "[pwd]/tmp-ada-hello-[pid]" ++ set src "$dir/$name.adb" ++ set dest "$dir/$name" ++ ++ set code { ++ with Ada.Text_IO; ++ ++ procedure Hello is ++ begin ++ Ada.Text_IO.Put_Line("Hello, world!"); ++ end Hello; ++ } ++ ++ file mkdir $dir ++ gdb_produce_source $src $code ++ set res [gdb_compile_ada_1 $src $dest executable {debug}] ++ file delete -force $dir ++ ++ if { $res != "" } { ++ return 0 ++ } ++ return 1 ++} ++ + # Like standard_testfile, but for Ada. Historically the Ada tests + # used a different naming convention from many of the other gdb tests, + # and this difference was preserved during the conversion to +diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp +index 990d0c8a70f..6c1f59ef4a6 100644 +--- a/gdb/testsuite/lib/gdb.exp ++++ b/gdb/testsuite/lib/gdb.exp +@@ -145,6 +145,7 @@ load_lib cache.exp + load_lib gdb-utils.exp + load_lib memory.exp + load_lib check-test-names.exp ++load_lib ada.exp + + # The path to the GDB binary to test. + global GDB +@@ -2538,6 +2539,13 @@ proc allow_ada_tests {} { + # Currently gdb_ada_compile doesn't support remote host. + return 0 + } ++ ++ if { [gdb_can_compile_ada] == 0 } { ++ global gdb_test_file_name ++ unsupported "$gdb_test_file_name" ++ return 0 ++ } ++ + return 1 + } + + +base-commit: af4a87e2b3c2ac5acae1e6f4405fc59e1218de74 +-- +2.35.3 + diff --git a/gdb-testsuite-add-gdb.dwarf2-backward-spec-inter-cu..patch b/gdb-testsuite-add-gdb.dwarf2-backward-spec-inter-cu..patch new file mode 100644 index 0000000..85f633f --- /dev/null +++ b/gdb-testsuite-add-gdb.dwarf2-backward-spec-inter-cu..patch @@ -0,0 +1,128 @@ +From 088088cf78b937cff973c95ec6da2d86ea173b48 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sun, 24 Sep 2023 12:30:10 +0200 +Subject: [PATCH 07/13] [gdb/testsuite] Add + gdb.dwarf2/backward-spec-inter-cu.exp + +Add another regression test for PR symtab/30846. + +Tested on x86_64-linux. + +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30846 +--- + .../gdb.dwarf2/backward-spec-inter-cu.exp | 103 ++++++++++++++++++ + 1 file changed, 103 insertions(+) + create mode 100644 gdb/testsuite/gdb.dwarf2/backward-spec-inter-cu.exp + +diff --git a/gdb/testsuite/gdb.dwarf2/backward-spec-inter-cu.exp b/gdb/testsuite/gdb.dwarf2/backward-spec-inter-cu.exp +new file mode 100644 +index 00000000000..59b3db50dbb +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/backward-spec-inter-cu.exp +@@ -0,0 +1,103 @@ ++# Copyright 2023 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# Check that the DWARF reader works with a a DW_AT_specification that ++# refers to an earlier DIE. Inter-cu variant of forward-spec.exp. ++ ++load_lib dwarf.exp ++ ++# This test can only be run on targets which support DWARF-2 and use gas. ++require dwarf2_support ++ ++standard_testfile main.c -debug.S ++ ++# Set up the DWARF for the test. ++set asm_file [standard_output_file $srcfile2] ++Dwarf::assemble $asm_file { ++ global srcfile ++ ++ declare_labels spec ++ ++ cu {} { ++ DW_TAG_compile_unit { ++ {DW_AT_language @DW_LANG_C_plus_plus} ++ } { ++ declare_labels myint ++ ++ myint: DW_TAG_base_type { ++ {DW_AT_byte_size 4 DW_FORM_sdata} ++ {DW_AT_encoding @DW_ATE_signed} ++ {DW_AT_name myint} ++ } ++ ++ DW_TAG_namespace { ++ {DW_AT_name ns} ++ } { ++ spec: DW_TAG_variable { ++ {DW_AT_name v} ++ {DW_AT_type :$myint} ++ {DW_AT_declaration 1 DW_FORM_flag_present} ++ } ++ } ++ } ++ } ++ ++ cu {} { ++ DW_TAG_compile_unit { ++ {DW_AT_language @DW_LANG_C_plus_plus} ++ } { ++ # The new indexer has special code to compute the full ++ # name of an object that uses a specification that appears ++ # later in the DWARF. ++ DW_TAG_variable { ++ {DW_AT_specification %$spec} ++ {DW_AT_location { ++ DW_OP_const1u 23 ++ DW_OP_stack_value ++ } SPECIAL_expr} ++ } ++ } ++ } ++} ++ ++if {[build_executable "failed to build executable" ${testfile} \ ++ [list $srcfile $asm_file] {nodebug}]} { ++ return -1 ++} ++ ++set eol "\r\n" ++set ws "\[ \t\]" ++ ++set worker_threads_list {} ++ ++# Exercises the intra-shard case. ++lappend worker_threads_list 0 ++ ++# Might exercise the inter-shard case. ++lappend worker_threads_list default ++ ++foreach_with_prefix worker_threads $worker_threads_list { ++ ++ clean_restart ++ ++ if { $worker_threads != "default" } { ++ gdb_test_no_output "maint set worker-threads $worker_threads" ++ } ++ ++ gdb_load $binfile ++ ++ gdb_test "maint print objfiles" "$eol$ws+qualified:$ws+ns::v$eol.*" \ ++ "v has parent ns" ++} +-- +2.35.3 + diff --git a/gdb-testsuite-add-gdb.dwarf2-forward-spec-inter-cu.e.patch b/gdb-testsuite-add-gdb.dwarf2-forward-spec-inter-cu.e.patch new file mode 100644 index 0000000..cd0ea71 --- /dev/null +++ b/gdb-testsuite-add-gdb.dwarf2-forward-spec-inter-cu.e.patch @@ -0,0 +1,128 @@ +From a022afb07305b50fd6372015bef6c51ae461c6a9 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sun, 24 Sep 2023 12:33:59 +0200 +Subject: [PATCH 06/13] [gdb/testsuite] Add + gdb.dwarf2/forward-spec-inter-cu.exp + +Add a regression test for PR symtab/30846. + +Tested on x86_64-linux. + +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30846 +--- + .../gdb.dwarf2/forward-spec-inter-cu.exp | 103 ++++++++++++++++++ + 1 file changed, 103 insertions(+) + create mode 100644 gdb/testsuite/gdb.dwarf2/forward-spec-inter-cu.exp + +diff --git a/gdb/testsuite/gdb.dwarf2/forward-spec-inter-cu.exp b/gdb/testsuite/gdb.dwarf2/forward-spec-inter-cu.exp +new file mode 100644 +index 00000000000..d8367b0a162 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/forward-spec-inter-cu.exp +@@ -0,0 +1,103 @@ ++# Copyright 2023 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# Check that the DWARF reader works with a a DW_AT_specification that ++# refers to a later DIE. Inter-cu variant of forward-spec.exp. ++ ++load_lib dwarf.exp ++ ++# This test can only be run on targets which support DWARF-2 and use gas. ++require dwarf2_support ++ ++standard_testfile main.c -debug.S ++ ++# Set up the DWARF for the test. ++set asm_file [standard_output_file $srcfile2] ++Dwarf::assemble $asm_file { ++ global srcfile ++ ++ declare_labels spec ++ ++ cu {} { ++ DW_TAG_compile_unit { ++ {DW_AT_language @DW_LANG_C_plus_plus} ++ } { ++ # The new indexer has special code to compute the full ++ # name of an object that uses a specification that appears ++ # later in the DWARF. ++ DW_TAG_variable { ++ {DW_AT_specification %$spec} ++ {DW_AT_location { ++ DW_OP_const1u 23 ++ DW_OP_stack_value ++ } SPECIAL_expr} ++ } ++ } ++ } ++ ++ cu {} { ++ DW_TAG_compile_unit { ++ {DW_AT_language @DW_LANG_C_plus_plus} ++ } { ++ declare_labels myint ++ ++ myint: DW_TAG_base_type { ++ {DW_AT_byte_size 4 DW_FORM_sdata} ++ {DW_AT_encoding @DW_ATE_signed} ++ {DW_AT_name myint} ++ } ++ ++ DW_TAG_namespace { ++ {DW_AT_name ns} ++ } { ++ spec: DW_TAG_variable { ++ {DW_AT_name v} ++ {DW_AT_type :$myint} ++ {DW_AT_declaration 1 DW_FORM_flag_present} ++ } ++ } ++ } ++ } ++} ++ ++if {[build_executable "failed to build executable" ${testfile} \ ++ [list $srcfile $asm_file] {nodebug}]} { ++ return -1 ++} ++ ++set eol "\r\n" ++set ws "\[ \t\]" ++ ++set worker_threads_list {} ++ ++# Exercises the intra-shard case. ++lappend worker_threads_list 0 ++ ++# Might exercise the inter-shard case. ++lappend worker_threads_list default ++ ++foreach_with_prefix worker_threads $worker_threads_list { ++ ++ clean_restart ++ ++ if { $worker_threads != "default" } { ++ gdb_test_no_output "maint set worker-threads $worker_threads" ++ } ++ ++ gdb_load $binfile ++ ++ gdb_test "maint print objfiles" "$eol$ws+qualified:$ws+ns::v$eol.*" \ ++ "v has parent ns" ++} +-- +2.35.3 + diff --git a/gdb-testsuite-add-gdb.suse-debranding.exp.patch b/gdb-testsuite-add-gdb.suse-debranding.exp.patch new file mode 100644 index 0000000..1edf545 --- /dev/null +++ b/gdb-testsuite-add-gdb.suse-debranding.exp.patch @@ -0,0 +1,68 @@ +From b08bf94f170dd39db21cf8f62941f1866b6978c0 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 16 Feb 2023 11:36:47 +0100 +Subject: [PATCH 080/155] Add gdb.suse/debranding.exp + +--- + gdb/testsuite/gdb.suse/debranding.exp | 49 +++++++++++++++++++++++++++ + 1 file changed, 49 insertions(+) + create mode 100644 gdb/testsuite/gdb.suse/debranding.exp + +diff --git a/gdb/testsuite/gdb.suse/debranding.exp b/gdb/testsuite/gdb.suse/debranding.exp +new file mode 100644 +index 00000000000..cdee10b75a7 +--- /dev/null ++++ b/gdb/testsuite/gdb.suse/debranding.exp +@@ -0,0 +1,49 @@ ++# Copyright 2023 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# There's a problem with dumping the entire output into gdb.log ++# on SLE-11, so redirect to file instead. Also means the gdb.log ++# is smaller. ++set f [standard_output_file "gdb-strings.txt"] ++ ++# Not using remote_exec due to using file redirection. ++set cmd "exec strings $GDB > $f" ++set status [catch $cmd msg] ++verbose -log "status: $status" ++verbose -log "msg: $msg" ++gdb_assert { $status == 0 } ++ ++set fp [open $f r] ++set output [read $fp] ++close $fp ++ ++set re {^.*(?:fedora|red[^a-z]?hat).*$} ++set matches [regexp -line -nocase -all -inline $re $output] ++ ++set disallowed_matches 0 ++set allowed_re "warning: deprecated Red Hat reloc" ++foreach match $matches { ++ if { [regexp -nocase $allowed_re $match] } { ++ verbose -log "allowed_match: '$match'" ++ continue ++ } ++ ++ verbose -log "disallowed_match: '$match'" ++ incr disallowed_matches ++} ++ ++gdb_assert { $disallowed_matches == 0 } ++ ++remote_file build delete $f +-- +2.35.3 + diff --git a/gdb-testsuite-add-gdb.suse-zypper-hint.exp.patch b/gdb-testsuite-add-gdb.suse-zypper-hint.exp.patch new file mode 100644 index 0000000..b1d3bf2 --- /dev/null +++ b/gdb-testsuite-add-gdb.suse-zypper-hint.exp.patch @@ -0,0 +1,101 @@ +gdb-testsuite-add-gdb.suse-zypper-hint.exp + +[gdb/testsuite] Add gdb.suse/zypper-hint.exp + +--- + gdb/testsuite/gdb.suse/zypper-hint.c | 25 ++++++++++++++++ + gdb/testsuite/gdb.suse/zypper-hint.exp | 55 ++++++++++++++++++++++++++++++++++ + 2 files changed, 80 insertions(+) + +diff --git a/gdb/testsuite/gdb.suse/zypper-hint.c b/gdb/testsuite/gdb.suse/zypper-hint.c +new file mode 100644 +index 00000000000..e179788f04f +--- /dev/null ++++ b/gdb/testsuite/gdb.suse/zypper-hint.c +@@ -0,0 +1,25 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2021 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++#include ++ ++int ++main (void) ++{ ++ printf ("hello\n"); ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.suse/zypper-hint.exp b/gdb/testsuite/gdb.suse/zypper-hint.exp +new file mode 100644 +index 00000000000..c2b9a1134bd +--- /dev/null ++++ b/gdb/testsuite/gdb.suse/zypper-hint.exp +@@ -0,0 +1,55 @@ ++# Copyright 2021 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++standard_testfile .c ++ ++if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { ++ return -1 ++} ++ ++clean_restart ${binfile} ++ ++gdb_test_no_output "set build-id-verbose 1" ++ ++set test "zypper hint printed" ++if { ![gdb_breakpoint main qualified] } { ++ unresolved $test ++ return -1 ++} ++ ++gdb_run_cmd ++ ++set re_64 \ ++ "Missing separate debuginfos, use: zypper install glibc-debuginfo-" ++set re_32 \ ++ "Missing separate debuginfos, use: zypper install glibc-32bit-debuginfo-" ++ ++set hexno0x "\[0-9A-Fa-f\]+" ++set re_nolibrpm \ ++ [multi_line \ ++ "Missing separate debuginfo for .*libc.so.*" \ ++ "Try: zypper install -C \"debuginfo\\(build-id\\)=$hexno0x\""] ++ ++gdb_test_multiple "" $test { ++ -re -wrap ($re_64|$re_32).* { ++ pass "$gdb_test_name (librpm)" ++ } ++ -re -wrap $re_nolibrpm.* { ++ pass "$gdb_test_name (no librpm)" ++ } ++} ++ ++# To give some background information in case the previous test failed. ++gdb_test "info shared" diff --git a/gdb-testsuite-add-missing-include-in-gdb.base-ctf-pt.patch b/gdb-testsuite-add-missing-include-in-gdb.base-ctf-pt.patch new file mode 100644 index 0000000..61dfe6b --- /dev/null +++ b/gdb-testsuite-add-missing-include-in-gdb.base-ctf-pt.patch @@ -0,0 +1,51 @@ +From 4e9077b7e451bd87e48e9868519079a5a7070106 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 2 Apr 2024 16:22:46 +0200 +Subject: [PATCH 29/48] [gdb/testsuite] Add missing include in + gdb.base/ctf-ptype.c + +On fedora rawhide, when running test-case gdb.base/ctf-ptype.exp, I get: +... +gdb compile failed, ctf-ptype.c: In function 'main': +ctf-ptype.c:242:29: error: implicit declaration of function 'malloc' \ + [-Wimplicit-function-declaration] + 242 | v_char_pointer = (char *) malloc (1); + | ^~~~~~ +ctf-ptype.c:1:1: note: include '' or provide a declaration of 'malloc' + +++ |+#include + 1 | /* This test program is part of GDB, the GNU debugger. +... + +Fix this by adding the missing include. + +Tested on aarch64-linux. +--- + gdb/testsuite/gdb.base/ctf-ptype.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/ctf-ptype.c b/gdb/testsuite/gdb.base/ctf-ptype.c +index cc4e98a234f..0cea44701b9 100644 +--- a/gdb/testsuite/gdb.base/ctf-ptype.c ++++ b/gdb/testsuite/gdb.base/ctf-ptype.c +@@ -24,6 +24,8 @@ + * First the basic C types. + */ + ++#include ++ + #if !defined (__STDC__) && !defined (_AIX) + #define signed /**/ + #endif +@@ -234,9 +236,6 @@ func_type v_func_type; + + int main () + { +- /* Ensure that malloc is a pointer type; avoid use of "void" and any include files. */ +-/* extern char *malloc();*/ +- + /* Some of the tests in ptype.exp require invoking malloc, so make + sure it is linked in to this program. */ + v_char_pointer = (char *) malloc (1); +-- +2.35.3 + diff --git a/gdb-testsuite-add-missing-include-in-gdb.base-rtld-s.patch b/gdb-testsuite-add-missing-include-in-gdb.base-rtld-s.patch new file mode 100644 index 0000000..79b4b4b --- /dev/null +++ b/gdb-testsuite-add-missing-include-in-gdb.base-rtld-s.patch @@ -0,0 +1,47 @@ +From a2889f1e3f71589fee9454c0aa772ce1bc540db3 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 28 Mar 2024 06:51:59 +0100 +Subject: [PATCH 35/48] [gdb/testsuite] Add missing include in + gdb.base/rtld-step.exp + +On fedora rawhide, with test-case gdb.base/rtld-step.exp I get: +... +static-pie-static-libc.c: In function '_start':^M +static-pie-static-libc.c:1:22: error: \ + implicit declaration of function '_exit' [-Wimplicit-function-declaration]^M + 1 | void _start (void) { _exit (0); }^M + | ^~~~~^M +compiler exited with status 1 + ... +UNTESTED: gdb.base/rtld-step.exp: failed to compile \ + (-static-pie not supported or static libc missing) +... + +Fix this by adding the missing include. + +Tested on aarch64-linux. + +Approved-by: Kevin Buettner +--- + gdb/testsuite/gdb.base/rtld-step.exp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.base/rtld-step.exp b/gdb/testsuite/gdb.base/rtld-step.exp +index 9a6c76d191a..bd3f89769b8 100644 +--- a/gdb/testsuite/gdb.base/rtld-step.exp ++++ b/gdb/testsuite/gdb.base/rtld-step.exp +@@ -86,7 +86,10 @@ set rtld_flags [list debug additional_flags=[list -static-pie -fPIE \ + -nostdlib -static -lc]] + + if { ![gdb_can_simple_compile static-pie-static-libc \ +- "void _start (void) { _exit (0); }" \ ++ { ++ #include ++ void _start (void) { _exit (0); } ++ } \ + executable $rtld_flags] } { + set reason "-static-pie not supported or static libc missing" + untested "failed to compile ($reason)" +-- +2.35.3 + diff --git a/gdb-testsuite-add-missing-includes-in-gdb.trace-coll.patch b/gdb-testsuite-add-missing-includes-in-gdb.trace-coll.patch new file mode 100644 index 0000000..6793bce --- /dev/null +++ b/gdb-testsuite-add-missing-includes-in-gdb.trace-coll.patch @@ -0,0 +1,60 @@ +From 4a08080ba59f4f66bf062a9015f9e51c765b05b5 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 29 Mar 2024 07:47:30 +0100 +Subject: [PATCH 31/48] [gdb/testsuite] Add missing includes in + gdb.trace/collection.c + +On fedora rawhide, with test-case gdb.trace/collection.exp, I get: +... +gdb compile failed, collection.c: In function 'strings_test_func': +collection.c:227:13: error: implicit declaration of function 'malloc' \ + [-Wimplicit-function-declaration] + 227 | longloc = malloc(500); + | ^~~~~~ +collection.c:1:1: note: \ + include '' or provide a declaration of 'malloc' + +++ |+#include + 1 | /* This testcase is part of GDB, the GNU debugger. + +collection.c:228:3: error: implicit declaration of function 'strcpy' \ + [-Wimplicit-function-declaration] + 228 | strcpy(longloc, ... ); + | ^~~~~~ +collection.c:1:1: note: include '' or provide a declaration of \ + 'strcpy' + +++ |+#include + 1 | /* This testcase is part of GDB, the GNU debugger. +collection.c:230:8: error: implicit declaration of function 'strlen' \ + [-Wimplicit-function-declaration] + 230 | i += strlen (locstr); + | ^~~~~~ +collection.c:230:8: note: include '' or provide a declaration of \ + 'strlen' +... + +Fix this by adding the missing includes. + +Tested on aarch64-linux. + +Approved-By: John Baldwin +--- + gdb/testsuite/gdb.trace/collection.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/gdb/testsuite/gdb.trace/collection.c b/gdb/testsuite/gdb.trace/collection.c +index 3b5484748af..4ef93a3fa33 100644 +--- a/gdb/testsuite/gdb.trace/collection.c ++++ b/gdb/testsuite/gdb.trace/collection.c +@@ -19,6 +19,9 @@ + * Test program for trace collection + */ + ++#include ++#include ++ + /* + * Typedefs + */ +-- +2.35.3 + diff --git a/gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch b/gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch new file mode 100644 index 0000000..b2826a4 --- /dev/null +++ b/gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch @@ -0,0 +1,45 @@ +From 08ce0d63c343f7db9a504d37de25391a997b46e2 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 8 Jan 2024 13:01:50 +0100 +Subject: [PATCH] [gdb/testsuite] Add missing -no-prompt-anchor in + gdb.base/vfork-follow-parent.exp + +When running test-case gdb.base/vfork-follow-parent.exp it passes fine, but +when running it with "taskset -c 0" I run into: +... +(gdb) inferior 1^M +[Switching to inferior 1 [process 26606] (vfork-follow-parent-exit)]^M +[Switching to thread 1.1 (process 26606)]^M +(gdb) Reading symbols from vfork-follow-parent-exit...^M +FAIL: $exp: exec_file=vfork-follow-parent-exit: target-non-stop=on: \ + non-stop=off: resolution_method=schedule-multiple: inferior 1 (timeout) +... + +Fix this by using -no-prompt-anchor. + +Tested on x86_64-linux. + +PR testsuite/31166 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31166 +--- + gdb/testsuite/gdb.base/vfork-follow-parent.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.base/vfork-follow-parent.exp b/gdb/testsuite/gdb.base/vfork-follow-parent.exp +index 89c38001dac..ee6f2835d8e 100644 +--- a/gdb/testsuite/gdb.base/vfork-follow-parent.exp ++++ b/gdb/testsuite/gdb.base/vfork-follow-parent.exp +@@ -64,7 +64,7 @@ proc do_test { resolution_method } { + gdb_test "set schedule-multiple on" + gdb_test "continue" "$::inferior_exited_re normally.*" \ + "continue to end of inferior 2" +- gdb_test "inferior 1" ".*Switching to inferior 1.*" ++ gdb_test -no-prompt-anchor "inferior 1" ".*Switching to inferior 1.*" + gdb_test "print unblock_parent = 1" " = 1" + } else { + error "invalid resolution method: $resolution_method" + +base-commit: 19185006cfe0901da907da4f09fbc197aba976a2 +-- +2.35.3 + diff --git a/gdb-testsuite-add-pr-gdb-26967-kfail-in-two-more-tes.patch b/gdb-testsuite-add-pr-gdb-26967-kfail-in-two-more-tes.patch new file mode 100644 index 0000000..1ee0ff4 --- /dev/null +++ b/gdb-testsuite-add-pr-gdb-26967-kfail-in-two-more-tes.patch @@ -0,0 +1,167 @@ +From fb2b155e33f5a21259c52685ee9b24f75ac66e75 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 20 Mar 2024 19:23:48 +0100 +Subject: [PATCH 10/48] [gdb/testsuite] Add PR gdb/26967 KFAIL in two more + test-cases + +On aarch64-linux (debian 12), when running test-case +gdb.base/longjmp-until-in-main.exp, I run into: +... +(gdb) until 33^M +warning: Breakpoint address adjusted from 0x70f727c678928489 to 0xfff727c678928489.^M +Warning:^M +Cannot insert breakpoint 0.^M +Cannot access memory at address 0xfff727c678928489^M +^M +0x0000fffff7e3a580 in siglongjmp () from /lib/aarch64-linux-gnu/libc.so.6^M +(gdb) FAIL: gdb.base/longjmp-until-in-main.exp: until $line, in main +... + +This is PR gdb/26967: no longjmp probe is available: +... +(gdb) info probes stap libc ^longjmp$^M +No probes matched.^M +... +and glibc applies pointer mangling which makes it fairly difficult for gdb to +get the longjmp target. + +There's a KFAIL for this in test-case gdb.base/longjmp.exp, added in commit +b5e7cd5cd3d ("[gdb/testsuite] Add KFAILs in gdb.base/longjmp.exp"). + +Factor out new proc have_longjmp_probe, and use it to add similar KFAIL in +this and one more test-case. + +Tested on aarch64-linux. + +Approved-By: Tom Tromey +--- + .../gdb.base/longjmp-until-in-main.exp | 24 ++++++++++++++++--- + gdb/testsuite/gdb.base/longjmp.exp | 11 +-------- + .../premature-dummy-frame-removal.exp | 22 ++++++++++++++++- + gdb/testsuite/lib/gdb.exp | 19 +++++++++++++++ + 4 files changed, 62 insertions(+), 14 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/longjmp-until-in-main.exp b/gdb/testsuite/gdb.base/longjmp-until-in-main.exp +index c0635f23345..6167989319a 100644 +--- a/gdb/testsuite/gdb.base/longjmp-until-in-main.exp ++++ b/gdb/testsuite/gdb.base/longjmp-until-in-main.exp +@@ -35,10 +35,28 @@ if {![runto_main]} { + return + } + ++set have_longjmp_probe [have_longjmp_probe] ++ + delete_breakpoints + + set until_to_line [gdb_get_line_number "until to here"] + +-gdb_test "until $until_to_line" \ +- " until to here .*" \ +- "until \$line, in main" ++set re_cannot_insert_bp \ ++ [multi_line \ ++ "Warning:" \ ++ "Cannot insert breakpoint $::decimal\\." \ ++ "Cannot access memory at address $::hex"] ++ ++set test "until \$line, in main" ++gdb_test_multiple "until $until_to_line" $test { ++ -re -wrap "\r\n$re_cannot_insert_bp\r\n.*" { ++ if { $have_longjmp_probe } { ++ fail $gdb_test_name ++ } else { ++ kfail gdb/26967 $gdb_test_name ++ } ++ } ++ -re -wrap " until to here .*" { ++ pass $gdb_test_name ++ } ++} +diff --git a/gdb/testsuite/gdb.base/longjmp.exp b/gdb/testsuite/gdb.base/longjmp.exp +index f74891aa7ca..0420f4df675 100644 +--- a/gdb/testsuite/gdb.base/longjmp.exp ++++ b/gdb/testsuite/gdb.base/longjmp.exp +@@ -62,16 +62,7 @@ proc do_test { with_probes } { + # + # We detect the different failure modes and kfail these. + +- set have_longjmp_probe 0 +- gdb_test_multiple "info probes stap libc ^longjmp$" "" { +- -re -wrap "No probes matched\\." { +- pass $gdb_test_name +- } +- -re -wrap "\r\nstap\[ \t\]+libc\[ \t\]+longjmp\[ \t\]+.*" { +- pass $gdb_test_name +- set have_longjmp_probe 1 +- } +- } ++ set have_longjmp_probe [have_longjmp_probe] + + if { $with_probes } { + if { !$have_longjmp_probe } { +diff --git a/gdb/testsuite/gdb.base/premature-dummy-frame-removal.exp b/gdb/testsuite/gdb.base/premature-dummy-frame-removal.exp +index fe906cefb14..6979345ee45 100644 +--- a/gdb/testsuite/gdb.base/premature-dummy-frame-removal.exp ++++ b/gdb/testsuite/gdb.base/premature-dummy-frame-removal.exp +@@ -49,7 +49,27 @@ if {![runto_main]} { + set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py] + gdb_test_no_output "source ${pyfile}" "load python file" + +-gdb_test "p some_func ()" " = 0" ++set have_longjmp_probe [have_longjmp_probe] ++ ++set re_cannot_insert_bp \ ++ [multi_line \ ++ "Warning:" \ ++ "Cannot insert breakpoint $::decimal\\." \ ++ "Cannot access memory at address $::hex"] ++ ++gdb_test_multiple "p some_func ()" "" { ++ -re -wrap "\r\n$re_cannot_insert_bp\r\n.*" { ++ if { $have_longjmp_probe } { ++ fail $gdb_test_name ++ } else { ++ kfail gdb/26967 $gdb_test_name ++ return 0 ++ } ++ } ++ -re -wrap " = 0" { ++ pass $gdb_test_name ++ } ++} + + # When frame debugging is turned on, this test has (previously) + # revealed some crashes due to the Python frame unwinder trying to +diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp +index 21967550cf6..70c2db4ac84 100644 +--- a/gdb/testsuite/lib/gdb.exp ++++ b/gdb/testsuite/lib/gdb.exp +@@ -4615,6 +4615,25 @@ proc skip_libstdcxx_probe_tests {} { + return [skip_libstdcxx_probe_tests_prompt "$gdb_prompt $"] + } + ++# Return 1 if libc supports the longjmp probe. Note that we're not using ++# gdb_caching_proc because the probe may have been disabled. ++ ++proc have_longjmp_probe {} { ++ set have_probe -1 ++ gdb_test_multiple "info probes stap libc ^longjmp$" "" { ++ -re -wrap "No probes matched\\." { ++ set have_probe 0 ++ } ++ -re -wrap "\r\nstap\[ \t\]+libc\[ \t\]+longjmp\[ \t\]+.*" { ++ set have_probe 1 ++ } ++ } ++ if { $have_probe == -1 } { ++ error "failed to get libc longjmp probe status" ++ } ++ return $have_probe ++} ++ + # Helper for gdb_is_target_* procs. TARGET_NAME is the name of the target + # we're looking for (used to build the test name). TARGET_STACK_REGEXP + # is a regexp that will match the output of "maint print target-stack" if +-- +2.35.3 + diff --git a/gdb-testsuite-avoid-intermittent-failures-on-a-debug.patch b/gdb-testsuite-avoid-intermittent-failures-on-a-debug.patch new file mode 100644 index 0000000..c31a50d --- /dev/null +++ b/gdb-testsuite-avoid-intermittent-failures-on-a-debug.patch @@ -0,0 +1,59 @@ +From 729d6b050f41d1d058c0f22f2c767995f5441b7a Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Sun, 27 Oct 2024 08:55:16 +0000 +Subject: [PATCH] gdb/testsuite: avoid intermittent failures on a debuginfod + test + +I saw a failure in gdb.debuginfod/build-id-no-debug-warning.exp which +I could only produce one time. + +Normally the test output looks like this: + + file /tmp/build/gdb/testsuite/outputs/gdb.debuginfod/build-id-no-debug-warning/.build-id/0c/30f589cc4f2c0fb22c8914d042ddf39c9a3885.debug + Reading symbols from /tmp/build/gdb/testsuite/outputs/gdb.debuginfod/build-id-no-debug-warning/.build-id/0c/30f589cc4f2c0fb22c8914d042ddf39c9a3885.debug... + Downloading separate debug info for /tmp/build/gdb/testsuite/outputs/gdb.debuginfod/build-id-no-debug-warning/.build-id/0c/30f589cc4f2c0fb22c8914d042ddf39c9a3885.debug... + Reading symbols from /tmp/build/gdb/testsuite/outputs/gdb.debuginfod/build-id-no-debug-warning/.client_cache/0c30f589cc4f2c0fb22c8914d042ddf39c9a3885/debuginfo... + (gdb) PASS: gdb.debuginfod/build-id-no-debug-warning.exp: local_debuginfod: debuginfod running, info downloaded, no war + +But one time I saw this: + + file /tmp/build/gdb/testsuite/outputs/gdb.debuginfod/build-id-no-debug-warning/.build-id/0c/30f589cc4f2c0fb22c8914d042ddf39c9a3885.debug + Reading symbols from /tmp/build/gdb/testsuite/outputs/gdb.debuginfod/build-id-no-debug-warning/.build-id/0c/30f589cc4f2c0fb22c8914d042ddf39c9a3885.debug... + Downloading 6.77 K separate debug info for /tmp/build/gdb/testsuite/outputs/gdb.debuginfod/build-id-no-debug-warning/.build-id/0c/30f589cc4f2c0fb22c8914d042ddf39c9a3885.debug... + Reading symbols from /tmp/build/gdb/testsuite/outputs/gdb.debuginfod/build-id-no-debug-warning/.client_cache/0c30f589cc4f2c0fb22c8914d042ddf39c9a3885/debuginfo... + (gdb) FAIL: gdb.debuginfod/build-id-no-debug-warning.exp: local_debuginfod: debuginfod running, info downloaded, no warnings + +The difference is the "Downloading separate debug info for ..." line +has gained an extra '6.77 K' component. When I got the FAIL the +machine was under heavy load, so I suspect everything was running +pretty slow. I think the size is only added when the debuginfod +download is taking its time. + +Anyway, the test in question is not expecting to see a size, which is +why it failed. + +Every other debuginfod test does allow for an optional size being +printed, so lets update this test to also accept an optional size, +this should prevent failures like this in the future. +--- + gdb/testsuite/gdb.debuginfod/build-id-no-debug-warning.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.debuginfod/build-id-no-debug-warning.exp b/gdb/testsuite/gdb.debuginfod/build-id-no-debug-warning.exp +index 8ee3bb0e78c..fcadfddd293 100644 +--- a/gdb/testsuite/gdb.debuginfod/build-id-no-debug-warning.exp ++++ b/gdb/testsuite/gdb.debuginfod/build-id-no-debug-warning.exp +@@ -148,7 +148,7 @@ proc_with_prefix local_debuginfod { } { + gdb_test "file ${build_id_debug_file}" \ + [multi_line \ + "Reading symbols from ${build_id_debug_file}\\.\\.\\." \ +- "Downloading separate debug info for ${build_id_debug_file}\\.\\.\\." \ ++ "Downloading\[^\r\n\]*separate debug info for ${build_id_debug_file}\\.\\.\\." \ + "Reading symbols from ${cache}/\[^\r\n\]+\\.\\.\\.(?:\r\nExpanding full symbols from \[^\r\n\]+)*"] \ + "debuginfod running, info downloaded, no warnings" + } + +base-commit: 6cfb7bf81be3ab6f131dbc6a27eefca516cf7517 +-- +2.43.0 + diff --git a/gdb-testsuite-call-ldd-version-in-gdb.testsuite-dump.patch b/gdb-testsuite-call-ldd-version-in-gdb.testsuite-dump.patch new file mode 100644 index 0000000..a20c617 --- /dev/null +++ b/gdb-testsuite-call-ldd-version-in-gdb.testsuite-dump.patch @@ -0,0 +1,39 @@ +From dedb6d4ce0478d053b7e786d73f298c8e72f1f99 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 18 Jan 2024 11:14:19 +0100 +Subject: [PATCH 44/48] [gdb/testsuite] Call ldd --version in + gdb.testsuite/dump-system-info.exp + +Once in a while I'm looking at the gdb.log of an entire testsuite run, and I'm +trying to establish what glibc version is used. Sometimes this is possible, +sometimes not. + +Make this easy by calling ldd --version in test-case +gdb.testsuite/dump-system-info.exp, which for instance on openSUSE Leap 15.4 +gives: +... +$ ldd --version +ldd (GNU libc) 2.31 + ... +$ +... + +Tested on x86_64-linux. + +Approved-By: Tom Tromey +--- + gdb/testsuite/gdb.testsuite/dump-system-info.exp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gdb/testsuite/gdb.testsuite/dump-system-info.exp b/gdb/testsuite/gdb.testsuite/dump-system-info.exp +index 1a28b29b1c7..e3eb9eee73a 100644 +--- a/gdb/testsuite/gdb.testsuite/dump-system-info.exp ++++ b/gdb/testsuite/gdb.testsuite/dump-system-info.exp +@@ -36,3 +36,4 @@ proc dump_info {cmd {what ""}} { + dump_info "cat /proc/cpuinfo" "Cpuinfo" + dump_info "uname -a" + dump_info "lsb_release -a" ++dump_info "ldd --version" +-- +2.35.3 + diff --git a/gdb-testsuite-factor-out-proc-get_portnum.patch b/gdb-testsuite-factor-out-proc-get_portnum.patch new file mode 100644 index 0000000..bf62489 --- /dev/null +++ b/gdb-testsuite-factor-out-proc-get_portnum.patch @@ -0,0 +1,98 @@ +From 2e5c943519de45144a880b8ce0d693dfd13f4650 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sat, 4 May 2024 10:41:09 +0200 +Subject: [PATCH 16/48] [gdb/testsuite] Factor out proc get_portnum + +In gdbserver_start, we have some code that determines what port number to use: +... + # Port id -- either specified in baseboard file, or managed here. + if [target_info exists gdb,socketport] { + set portnum [target_info gdb,socketport] + } else { + # Bump the port number to avoid conflicts with hung ports. + incr portnum + } +... + +Factor this out into a new proc get_portnum. + +Tested on aarch64-linux. + +Approved-By: Tom Tromey +--- + gdb/testsuite/lib/gdbserver-support.exp | 40 ++++++++++++++++++------- + 1 file changed, 29 insertions(+), 11 deletions(-) + +diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp +index 30d94fd7eb6..8aaca946b7d 100644 +--- a/gdb/testsuite/lib/gdbserver-support.exp ++++ b/gdb/testsuite/lib/gdbserver-support.exp +@@ -129,8 +129,31 @@ proc gdb_target_cmd { args } { + return [expr $res == 0 ? 0 : 1] + } + +-global portnum +-set portnum "2345" ++# Return a usable port number. ++ ++proc get_portnum {} { ++ if { [target_info exists gdb,socketport] } { ++ # Hard-coded in target board. ++ return [target_info gdb,socketport] ++ } ++ ++ # Not hard-coded in target board. Return increasing port numbers, ++ # starting at $initial_portnum, to avoid conflicts with hung ports. ++ set initial_portnum 2345 ++ ++ # Currently available port number. ++ global portnum ++ ++ # Initialize, if necessary. ++ if { ![info exists portnum] } { ++ set portnum $initial_portnum ++ } ++ ++ # Return currently available port number, and update it. ++ set res $portnum ++ incr portnum ++ return $res ++} + + # Locate the gdbserver binary. Returns "" if gdbserver could not be found. + +@@ -247,16 +270,10 @@ proc gdbserver_default_get_comm_port { port } { + # Returns the target protocol and socket to connect to. + + proc gdbserver_start { options arguments } { +- global portnum + global GDB_TEST_SOCKETHOST + + # Port id -- either specified in baseboard file, or managed here. +- if [target_info exists gdb,socketport] { +- set portnum [target_info gdb,socketport] +- } else { +- # Bump the port number to avoid conflicts with hung ports. +- incr portnum +- } ++ set portnum [get_portnum] + + # Extract the local and remote host ids from the target board struct. + if { [info exists GDB_TEST_SOCKETHOST] } { +@@ -372,10 +389,11 @@ proc gdbserver_start { options arguments } { + -re "Listening on" { } + -re "Can't (bind address|listen on socket): Address already in use\\.\r\n" { + verbose -log "Port $portnum is already in use." +- if ![target_info exists gdb,socketport] { ++ set other_portnum [get_portnum] ++ if { $other_portnum != $portnum } { + # Bump the port number to avoid the conflict. + wait -i $expect_out(spawn_id) +- incr portnum ++ set portnum $other_portnum + continue + } + } +-- +2.35.3 + diff --git a/gdb-testsuite-factor-out-proc-lock_dir.patch b/gdb-testsuite-factor-out-proc-lock_dir.patch new file mode 100644 index 0000000..a3aab5c --- /dev/null +++ b/gdb-testsuite-factor-out-proc-lock_dir.patch @@ -0,0 +1,63 @@ +From a9cc672af5f81034f4189446aa656c08ea10e2ac Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sat, 4 May 2024 10:41:09 +0200 +Subject: [PATCH 19/48] [gdb/testsuite] Factor out proc lock_dir + +In lib/rocm.exp we have: +... +set gpu_lock_filename $objdir/gpu-parallel.lock +... + +This decides both the lock file name and directory. + +Factor out a new proc lock_dir that decides on the directory, leaving just: +... +set gpu_lock_filename gpu-parallel.lock +... + +Tested on aarch64-linux. + +Approved-By: Tom Tromey +--- + gdb/testsuite/lib/gdb-utils.exp | 7 +++++++ + gdb/testsuite/lib/rocm.exp | 2 +- + 2 files changed, 8 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/lib/gdb-utils.exp b/gdb/testsuite/lib/gdb-utils.exp +index 3dc4b3a3ebc..63f6b8c3698 100644 +--- a/gdb/testsuite/lib/gdb-utils.exp ++++ b/gdb/testsuite/lib/gdb-utils.exp +@@ -177,10 +177,17 @@ proc lock_file_release {info} { + } + } + ++# Return directory where we keep lock files. ++ ++proc lock_dir {} { ++ return $objdir ++} ++ + # Run body under lock LOCK_FILE. + + proc with_lock { lock_file body } { + if {[info exists ::GDB_PARALLEL]} { ++ set lock_file [file join [lock_dir] $lock_file] + set lock_rc [lock_file_acquire $lock_file] + } + +diff --git a/gdb/testsuite/lib/rocm.exp b/gdb/testsuite/lib/rocm.exp +index 86ec29567da..a6608664f24 100644 +--- a/gdb/testsuite/lib/rocm.exp ++++ b/gdb/testsuite/lib/rocm.exp +@@ -105,7 +105,7 @@ gdb_caching_proc allow_hipcc_tests {} { + + # The lock file used to ensure that only one GDB has access to the GPU + # at a time. +-set gpu_lock_filename $objdir/gpu-parallel.lock ++set gpu_lock_filename gpu-parallel.lock + + # Run body under the GPU lock. Also calls gdb_exit before releasing + # the GPU lock. +-- +2.35.3 + diff --git a/gdb-testsuite-factor-out-proc-with_lock.patch b/gdb-testsuite-factor-out-proc-with_lock.patch new file mode 100644 index 0000000..19f606b --- /dev/null +++ b/gdb-testsuite-factor-out-proc-with_lock.patch @@ -0,0 +1,160 @@ +From d96f9a0ef44eb3a3f41e2a478b817c1d00e6e0a1 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sat, 4 May 2024 10:41:09 +0200 +Subject: [PATCH 18/48] [gdb/testsuite] Factor out proc with_lock + +Factor out proc with_lock from with_rocm_gpu_lock, and move required procs +lock_file_acquire and lock_file_release to lib/gdb-utils.exp. + +Tested on aarch64-linux. + +Approved-By: Tom Tromey +--- + gdb/testsuite/lib/gdb-utils.exp | 59 +++++++++++++++++++++++++++++++++ + gdb/testsuite/lib/rocm.exp | 55 +----------------------------- + 2 files changed, 60 insertions(+), 54 deletions(-) + +diff --git a/gdb/testsuite/lib/gdb-utils.exp b/gdb/testsuite/lib/gdb-utils.exp +index a010e14fc04..3dc4b3a3ebc 100644 +--- a/gdb/testsuite/lib/gdb-utils.exp ++++ b/gdb/testsuite/lib/gdb-utils.exp +@@ -138,3 +138,62 @@ proc version_compare { l1 op l2 } { + } + return 1 + } ++ ++# Acquire lock file LOCKFILE. Tries forever until the lock file is ++# successfully created. ++ ++proc lock_file_acquire {lockfile} { ++ verbose -log "acquiring lock file: $::subdir/${::gdb_test_file_name}.exp" ++ while {true} { ++ if {![catch {open $lockfile {WRONLY CREAT EXCL}} rc]} { ++ set msg "locked by $::subdir/${::gdb_test_file_name}.exp" ++ verbose -log "lock file: $msg" ++ # For debugging, put info in the lockfile about who owns ++ # it. ++ puts $rc $msg ++ flush $rc ++ return [list $rc $lockfile] ++ } ++ after 10 ++ } ++} ++ ++# Release a lock file. ++ ++proc lock_file_release {info} { ++ verbose -log "releasing lock file: $::subdir/${::gdb_test_file_name}.exp" ++ ++ if {![catch {fconfigure [lindex $info 0]}]} { ++ if {![catch { ++ close [lindex $info 0] ++ file delete -force [lindex $info 1] ++ } rc]} { ++ return "" ++ } else { ++ return -code error "Error releasing lockfile: '$rc'" ++ } ++ } else { ++ error "invalid lock" ++ } ++} ++ ++# Run body under lock LOCK_FILE. ++ ++proc with_lock { lock_file body } { ++ if {[info exists ::GDB_PARALLEL]} { ++ set lock_rc [lock_file_acquire $lock_file] ++ } ++ ++ set code [catch {uplevel 1 $body} result] ++ ++ if {[info exists ::GDB_PARALLEL]} { ++ lock_file_release $lock_rc ++ } ++ ++ if {$code == 1} { ++ global errorInfo errorCode ++ return -code $code -errorinfo $errorInfo -errorcode $errorCode $result ++ } else { ++ return -code $code $result ++ } ++} +diff --git a/gdb/testsuite/lib/rocm.exp b/gdb/testsuite/lib/rocm.exp +index fcdf665aef9..86ec29567da 100644 +--- a/gdb/testsuite/lib/rocm.exp ++++ b/gdb/testsuite/lib/rocm.exp +@@ -107,68 +107,15 @@ gdb_caching_proc allow_hipcc_tests {} { + # at a time. + set gpu_lock_filename $objdir/gpu-parallel.lock + +-# Acquire lock file LOCKFILE. Tries forever until the lock file is +-# successfully created. +- +-proc lock_file_acquire {lockfile} { +- verbose -log "acquiring lock file: $::subdir/${::gdb_test_file_name}.exp" +- while {true} { +- if {![catch {open $lockfile {WRONLY CREAT EXCL}} rc]} { +- set msg "locked by $::subdir/${::gdb_test_file_name}.exp" +- verbose -log "lock file: $msg" +- # For debugging, put info in the lockfile about who owns +- # it. +- puts $rc $msg +- flush $rc +- return [list $rc $lockfile] +- } +- after 10 +- } +-} +- +-# Release a lock file. +- +-proc lock_file_release {info} { +- verbose -log "releasing lock file: $::subdir/${::gdb_test_file_name}.exp" +- +- if {![catch {fconfigure [lindex $info 0]}]} { +- if {![catch { +- close [lindex $info 0] +- file delete -force [lindex $info 1] +- } rc]} { +- return "" +- } else { +- return -code error "Error releasing lockfile: '$rc'" +- } +- } else { +- error "invalid lock" +- } +-} +- + # Run body under the GPU lock. Also calls gdb_exit before releasing + # the GPU lock. + + proc with_rocm_gpu_lock { body } { +- if {[info exists ::GDB_PARALLEL]} { +- set lock_rc [lock_file_acquire $::gpu_lock_filename] +- } +- +- set code [catch {uplevel 1 $body} result] ++ with_lock $::gpu_lock_filename $body + + # In case BODY returned early due to some testcase failing, and + # left GDB running, debugging the GPU. + gdb_exit +- +- if {[info exists ::GDB_PARALLEL]} { +- lock_file_release $lock_rc +- } +- +- if {$code == 1} { +- global errorInfo errorCode +- return -code $code -errorinfo $errorInfo -errorcode $errorCode $result +- } else { +- return -code $code $result +- } + } + + # Return true if all the devices support debugging multiple processes +-- +2.35.3 + diff --git a/gdb-testsuite-fix-error-in-gdb.server-server-kill-py.patch b/gdb-testsuite-fix-error-in-gdb.server-server-kill-py.patch new file mode 100644 index 0000000..cef9974 --- /dev/null +++ b/gdb-testsuite-fix-error-in-gdb.server-server-kill-py.patch @@ -0,0 +1,54 @@ +From b33811a85ff53af77cdad995ad8cb50431c8c362 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 30 May 2024 12:56:35 +0200 +Subject: [PATCH] [gdb/testsuite] Fix error in + gdb.server/server-kill-python.exp + +With test-case gdb.server/server-kill-python.exp, I sometimes run into: +... +builtin_spawn gdb -nw -nx -q -iex set height 0 -iex set width 0 \ + -data-directory data-directory^M +kill^M +(gdb) kill^M +file /home/abuild/rpmbuild/BUILD/gdb-14.2/build-x86_64-suse-linux/gdb/testsuite.unix.-m64.-fno-PIE.-no-pie/outputs/gdb.server/server-kill-python/server-kill-python^M +The program is not being run.^M +(gdb) ERROR: Couldn't load server-kill-python into GDB. +... + +The problem is that the spawn produces a prompt, but it's not explicitly +consumed. + +This is a regression since commit 0f077fcae0f ("[gdb/testsuite] Simplify +gdb.server/server-kill-python.exp"). + +Fix this by consuming the initial prompt. + +PR testsuite/31819 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31819 +Fixes: 0f077fcae0f ("[gdb/testsuite] Simplify gdb.server/server-kill-python.exp" +--- + gdb/testsuite/gdb.server/server-kill-python.exp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/gdb/testsuite/gdb.server/server-kill-python.exp b/gdb/testsuite/gdb.server/server-kill-python.exp +index 778880984ec..c0768558eeb 100644 +--- a/gdb/testsuite/gdb.server/server-kill-python.exp ++++ b/gdb/testsuite/gdb.server/server-kill-python.exp +@@ -63,6 +63,12 @@ if {[gdb_spawn_with_cmdline_opts \ + return + } + ++gdb_test_multiple "" "initial prompt" { ++ -re "^$gdb_prompt $" { ++ pass $gdb_test_name ++ } ++} ++ + gdb_load $binfile + gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport + + +base-commit: 3faa0f850b27f64f08ad4ec5987f711be8862851 +-- +2.35.3 + diff --git a/gdb-testsuite-fix-gdb.ada-verylong.exp-on-32-bit-tar.patch b/gdb-testsuite-fix-gdb.ada-verylong.exp-on-32-bit-tar.patch new file mode 100644 index 0000000..807b5f1 --- /dev/null +++ b/gdb-testsuite-fix-gdb.ada-verylong.exp-on-32-bit-tar.patch @@ -0,0 +1,84 @@ +From d9a17115fbeb8d4c1780677bb57edf0fe8448038 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 2 Apr 2024 16:14:39 +0200 +Subject: [PATCH 30/48] [gdb/testsuite] Fix gdb.ada/verylong.exp on 32-bit + target + +In an aarch32-linux chroot on an aarch64-linux system, I run into: +... +(gdb) print x^M +$1 = 9223372036854775807^M +(gdb) FAIL: gdb.ada/verylong.exp: print x +... + +A passing version on aarch64-linux looks like: +... +(gdb) print x^M +$1 = 170141183460469231731687303715884105727^M +(gdb) PASS: gdb.ada/verylong.exp: print x +... + +The difference is caused by the size of the type Long_Long_Long_Integer, which +is: +- a 128-bit signed on 64-bit targets, and +- a 64-bit signed on 32-bit target. + +Fix this by detecting the size of the Long_Long_Long_Integer type, and +handling it. + +Tested on aarch64-linux and aarch32-linux. + +Approved-By: Tom Tromey + +PR testsuite/31574 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31574 + +[1] https://gcc.gnu.org/onlinedocs/gnat_rm/Implementation-Defined-Characteristics.html +--- + gdb/testsuite/gdb.ada/verylong.exp | 28 +++++++++++++++++++++------- + 1 file changed, 21 insertions(+), 7 deletions(-) + +diff --git a/gdb/testsuite/gdb.ada/verylong.exp b/gdb/testsuite/gdb.ada/verylong.exp +index d1fa968015b..4b83e0bd467 100644 +--- a/gdb/testsuite/gdb.ada/verylong.exp ++++ b/gdb/testsuite/gdb.ada/verylong.exp +@@ -29,15 +29,29 @@ clean_restart ${testfile} + set bp_location [gdb_get_line_number "START" ${testdir}/prog.adb] + runto "prog.adb:$bp_location" + +-gdb_test "print x" " = 170141183460469231731687303715884105727" +-gdb_test "print x / 2" " = 85070591730234615865843651857942052863" +-gdb_test "print (x / 4) * 2" " = 85070591730234615865843651857942052862" ++set lll_int_size 0 ++gdb_test_multiple "ptype Long_Long_Long_Integer" "" { ++ -re -wrap "type = <8-byte integer>" { ++ set lll_int_size 8 ++ set max 9223372036854775807 ++ } ++ -re -wrap "type = <16-byte integer>" { ++ set lll_int_size 16 ++ set max 170141183460469231731687303715884105727 ++ } ++} ++ ++require {expr $lll_int_size == 8 || $lll_int_size == 16} ++ ++gdb_test "print x" " = $max" ++gdb_test "print x / 2" " = [expr $max / 2]" ++gdb_test "print (x / 4) * 2" " = [expr ($max / 4) * 2]" + gdb_test "print x - x" " = 0" +-gdb_test "print x - 99 + 1" " = 170141183460469231731687303715884105629" +-gdb_test "print -x" " = -170141183460469231731687303715884105727" +-gdb_test "print +x" " = 170141183460469231731687303715884105727" ++gdb_test "print x - 99 + 1" " = [expr $max - 99 + 1]" ++gdb_test "print -x" " = -$max" ++gdb_test "print +x" " = $max" + + gdb_test "print 170141183460469231731687303715884105727" \ + " = 170141183460469231731687303715884105727" +-gdb_test "print x = 170141183460469231731687303715884105727" \ ++gdb_test "print x = $max" \ + " = true" +-- +2.35.3 + diff --git a/gdb-testsuite-fix-gdb.base-eh_return.exp.patch b/gdb-testsuite-fix-gdb.base-eh_return.exp.patch new file mode 100644 index 0000000..fc0c4df --- /dev/null +++ b/gdb-testsuite-fix-gdb.base-eh_return.exp.patch @@ -0,0 +1,80 @@ +From 7ee7b011e0c846a77cb4d1dde3a3c625412f1733 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 25 Jan 2024 16:25:07 +0100 +Subject: [PATCH 11/48] [gdb/testsuite] Fix gdb.base/eh_return.exp + +On Fedora rawhide aarch64, I run into: +... +(gdb) PASS: gdb.base/eh_return.exp: set breakpoint on address +run ^M +Starting program: eh_return ^M +[Thread debugging using libthread_db enabled]^M +Using host libthread_db library "/lib64/libthread_db.so.1".^M +[Inferior 1 (process 1113051) exited normally]^M +(gdb) FAIL: gdb.base/eh_return.exp: hit breakpoint (the program exited) +... + +This happens as follows: the test-case sets a breakpoint on the last +instruction of function eh2: +... +(gdb) break *0x00000000004103ec^M +... +and expects to hit the breakpoint, but instead the "br x6" is taken: +... + 0x00000000004103e0 <+176>: cbz x4, 0x4103ec ^M + 0x00000000004103e4 <+180>: add sp, sp, x5^M + 0x00000000004103e8 <+184>: br x6^M + 0x00000000004103ec <+188>: ret^M +... + +In contrast, with fedora f39 we have: +... + 0x00000000004103bc <+156>: ldp x2, x3, [sp, #48]^M + 0x00000000004103c0 <+160>: ldp x29, x30, [sp, #16]^M + 0x00000000004103c4 <+164>: add sp, sp, #0x50^M + 0x00000000004103c8 <+168>: add sp, sp, x4^M + 0x00000000004103cc <+172>: ret^M + +... +and the breakpoint is reached. + +Fix this by detecting that the breakpoint is not hit, and declaring the test +unsupported. + +Tested on aarch64-linux. + +Approved-By: Tom Tromey + +PR testsuite/31291 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31291 +--- + gdb/testsuite/gdb.base/eh_return.exp | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.base/eh_return.exp b/gdb/testsuite/gdb.base/eh_return.exp +index bced409547b..7d566b1ddc2 100644 +--- a/gdb/testsuite/gdb.base/eh_return.exp ++++ b/gdb/testsuite/gdb.base/eh_return.exp +@@ -79,4 +79,18 @@ gdb_assert [gdb_breakpoint "*$address" no-message] "set breakpoint on address" + # breakpoint, so instead, run to the breakpoint. + gdb_run_cmd + +-gdb_test "" "Breakpoint .*" "hit breakpoint" ++set test "hit breakpoint" ++gdb_expect { ++ -re "Breakpoint .*\r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re "$inferior_exited_re normally.*\r\n$gdb_prompt $" { ++ unsupported $test ++ } ++ -re "\r\n$gdb_prompt $" { ++ fail $test ++ } ++ default { ++ fail $test ++ } ++} +-- +2.35.3 + diff --git a/gdb-testsuite-fix-gdb.base-ending-run.exp-on-manjaro.patch b/gdb-testsuite-fix-gdb.base-ending-run.exp-on-manjaro.patch new file mode 100644 index 0000000..26f3954 --- /dev/null +++ b/gdb-testsuite-fix-gdb.base-ending-run.exp-on-manjaro.patch @@ -0,0 +1,58 @@ +From 5f7c4f7a435571d535c2372b999e1017eefb15c4 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 28 Mar 2024 08:26:31 +0100 +Subject: [PATCH 33/48] [gdb/testsuite] Fix gdb.base/ending-run.exp on manjaro + linux + +On aarch64-linux, using the manjaro linux distro, I run into: +... +(gdb) next^M +32 }^M +(gdb) next^M +0x0000fffff7d67b80 in ?? () from /usr/lib/libc.so.6^M +(gdb) FAIL: gdb.base/ending-run.exp: step out of main +... + +What happens here is described in detail in this clause: +... + -re "0x.*\\?\\? \\(\\) from /lib/powerpc.*$gdb_prompt $" { + # This case occurs on Powerpc when gdb steps out of main and the + # needed debug info files are not loaded on the system, preventing + # GDB to determine which function it reached (__libc_start_call_main). + # Ideally, the target system would have the necessary debugging + # information, but in its absence, GDB's behavior is as expected. + ... + } +... +but the clause only matches for powerpc. + +Fix this by: +- making the regexp generic enough to also match /usr/lib/libc.so.6, and +- updating the comment to not mention powerpc. + +Tested on aarch64-linux. + +PR testsuite/31450 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31450 +--- + gdb/testsuite/gdb.base/ending-run.exp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp +index 070dcc6f190..76701d33e19 100644 +--- a/gdb/testsuite/gdb.base/ending-run.exp ++++ b/gdb/testsuite/gdb.base/ending-run.exp +@@ -206,8 +206,8 @@ gdb_test_multiple "next" "step out of main" { + # This is what happens on system using uClibc. + pass "step out of main" + } +- -re "0x.*\\?\\? \\(\\) from /lib/powerpc.*$gdb_prompt $" { +- # This case occurs on Powerpc when gdb steps out of main and the ++ -re -wrap "$hex in \\?\\? \\(\\) from \[^\r\n\]+" { ++ # This case occurs when gdb steps out of main and the + # needed debug info files are not loaded on the system, preventing + # GDB to determine which function it reached (__libc_start_call_main). + # Ideally, the target system would have the necessary debugging +-- +2.35.3 + diff --git a/gdb-testsuite-fix-gdb.base-list-no-debug.exp-on-debi.patch b/gdb-testsuite-fix-gdb.base-list-no-debug.exp-on-debi.patch new file mode 100644 index 0000000..443bf3e --- /dev/null +++ b/gdb-testsuite-fix-gdb.base-list-no-debug.exp-on-debi.patch @@ -0,0 +1,103 @@ +From 2235f362eba0387f0404620676dd29637ff17738 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sun, 17 Mar 2024 16:48:43 +0100 +Subject: [PATCH 39/48] [gdb/testsuite] Fix gdb.base/list-no-debug.exp on + debian + +On debian 12, aarch64-linux I run into: +... +(gdb) list .^M +No symbol table is loaded. Use the "file" command.^M +(gdb) FAIL: gdb.base/list-nodebug.exp: first 'list .' +... + +The test-case expects some debug info, but none for main. Instead, there's no +debug info at all. + +Fix this by adding another source file to the test-case, and compiling it with +debug info. + +Tested on aarch64-linux. + +Approved-By: Andrew Burgess + +PR testsuite/31290 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31290 +--- + gdb/testsuite/gdb.base/list-nodebug-2.c | 24 ++++++++++++++++++++++++ + gdb/testsuite/gdb.base/list-nodebug.c | 7 +++++-- + gdb/testsuite/gdb.base/list-nodebug.exp | 9 ++++++--- + 3 files changed, 35 insertions(+), 5 deletions(-) + create mode 100644 gdb/testsuite/gdb.base/list-nodebug-2.c + +diff --git a/gdb/testsuite/gdb.base/list-nodebug-2.c b/gdb/testsuite/gdb.base/list-nodebug-2.c +new file mode 100644 +index 00000000000..861e6149071 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/list-nodebug-2.c +@@ -0,0 +1,24 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2024 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++extern int foo (void); ++ ++int ++foo (void) ++{ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.base/list-nodebug.c b/gdb/testsuite/gdb.base/list-nodebug.c +index 078517c011e..d4ae6787310 100644 +--- a/gdb/testsuite/gdb.base/list-nodebug.c ++++ b/gdb/testsuite/gdb.base/list-nodebug.c +@@ -15,7 +15,10 @@ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +-int main () ++extern int foo (void); ++ ++int ++main (void) + { +- return 0; ++ return foo (); + } +diff --git a/gdb/testsuite/gdb.base/list-nodebug.exp b/gdb/testsuite/gdb.base/list-nodebug.exp +index 08de05423af..942a282083a 100644 +--- a/gdb/testsuite/gdb.base/list-nodebug.exp ++++ b/gdb/testsuite/gdb.base/list-nodebug.exp +@@ -16,10 +16,13 @@ + # Test that using the command "list" in a file with no debug information + # will not crash GDB and will give reasonable output. + +-standard_testfile .c ++standard_testfile .c -2.c + +-if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ +- {nodebug}]} { ++if { [prepare_for_testing_full "failed to prepare" \ ++ [list \ ++ $testfile {} \ ++ $srcfile {nodebug} \ ++ $srcfile2 {debug}]] } { + return -1 + } + +-- +2.35.3 + diff --git a/gdb-testsuite-fix-gdb.base-step-over-syscall.exp-with-m32-amd-case.patch b/gdb-testsuite-fix-gdb.base-step-over-syscall.exp-with-m32-amd-case.patch new file mode 100644 index 0000000..5b3cbb9 --- /dev/null +++ b/gdb-testsuite-fix-gdb.base-step-over-syscall.exp-with-m32-amd-case.patch @@ -0,0 +1,71 @@ +[gdb/testsuite] Fix gdb.base/step-over-syscall.exp with -m32, AMD case + +On an OBS machine with openSUSE Leap 15.2 and target board unix/-m32 I run +into: +... +(gdb) x/2i $pc^M +=> 0xf7fd5155 <__kernel_vsyscall+5>: syscall ^M + 0xf7fd5157 <__kernel_vsyscall+7>: int $0x80^M +(gdb) PASS: gdb.base/step-over-syscall.exp: fork: displaced=off: \ + pc before/after syscall instruction +stepi^M +[Detaching after fork from child process 19924]^M +0xf7fd5159 in __kernel_vsyscall ()^M +1: x/i $pc^M +=> 0xf7fd5159 <__kernel_vsyscall+9>: pop %ebp^M +(gdb) PASS: gdb.base/step-over-syscall.exp: fork: displaced=off: stepi fork insn +print /x $pc^M +$2 = 0xf7fd5159^M +(gdb) PASS: gdb.base/step-over-syscall.exp: fork: displaced=off: pc after stepi +FAIL: gdb.base/step-over-syscall.exp: fork: displaced=off: \ + pc after stepi matches insn addr a +fter syscall +... + +This is essentially a duplicate of the problem solved by commit 14852123287 +"[gdb/testsuite] Fix gdb.base/step-over-syscall.exp with -m32", only here the +insn before "int $0x80" is syscall instead of sysenter. + +The background here is that we're executing this code in the linux kernel +(from ./arch/x86/entry/vdso/vdso32/system_call.S): +... + #define SYSENTER_SEQUENCE "movl %esp, %ebp; sysenter" + #define SYSCALL_SEQUENCE "movl %ecx, %ebp; syscall" + + /* If SYSENTER (Intel) or SYSCALL32 (AMD) is available, use it. */ + ALTERNATIVE_2 "", SYSENTER_SEQUENCE, X86_FEATURE_SYSENTER32, \ + SYSCALL_SEQUENCE, X86_FEATURE_SYSCALL32 + ALTERNATIVE "", SYSENTER_SEQUENCE, X86_FEATURE_SEP +... +and depending on the active feature, we either have sysenter or syscall. + +Fix this by recognizing the "syscall", "int $0x80" sequence. + +Tested on x86_64-linux. + +--- + gdb/testsuite/gdb.base/step-over-syscall.exp | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/step-over-syscall.exp b/gdb/testsuite/gdb.base/step-over-syscall.exp +index ecfb7be481d..a4821d7cd5a 100644 +--- a/gdb/testsuite/gdb.base/step-over-syscall.exp ++++ b/gdb/testsuite/gdb.base/step-over-syscall.exp +@@ -162,12 +162,13 @@ proc setup { syscall } { + } + + # If we encounter a sequence: +- # 0xf7fd5155 <__kernel_vsyscall+5>: sysenter ++ # 0xf7fd5155 <__kernel_vsyscall+5>: sysenter / syscall + # 0xf7fd5157 <__kernel_vsyscall+7>: int $0x80 + # 0xf7fd5159 <__kernel_vsyscall+9>: pop %ebp +- # then a stepi at sysenter will step over the int insn, so make sure +- # next_insn_addr points after the int insn. +- if { $actual_syscall_insn == "sysenter" } { ++ # then a stepi at sysenter/syscall will step over the int insn, ++ # so make sure next_insn_addr points after the int insn. ++ if { $actual_syscall_insn == "sysenter" ++ || $actual_syscall_insn == "syscall" } { + set test "pc after sysenter instruction" + set re_int_insn "\[ \t\]*int\[ \t\]\[^\r\n\]*" + set re [multi_line \ diff --git a/gdb-testsuite-fix-gdb.cp-namespace.exp-with-read1.patch b/gdb-testsuite-fix-gdb.cp-namespace.exp-with-read1.patch new file mode 100644 index 0000000..64e0052 --- /dev/null +++ b/gdb-testsuite-fix-gdb.cp-namespace.exp-with-read1.patch @@ -0,0 +1,57 @@ +From 818f70aa9a6c17ddc79ac33f80c1a3e4df30ea14 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sun, 14 Jan 2024 09:36:12 +0100 +Subject: [PATCH 46/48] [gdb/testsuite] Fix gdb.cp/namespace.exp with read1 + +With check-read1 we run into: +... +(gdb) break DNE>::DNE^M +Function "DNE>::DNE" not defined.^M +Make breakpoint pending on future shared library load? (y or [n]) y^M +Breakpoint 9 (DNE>::DNE) pending.^M +n^M +(gdb) FAIL: gdb.cp/namespace.exp: br malformed '>' (got interactive prompt) +n^M +... + +The question is supposed to be handled by the question and response arguments +to this gdb_test call: +... +gdb_test "break DNE>::DNE" "" "br malformed \'>\'" \ + "Make breakpoint pending on future shared library load?.*" "y" +... +but both this and the builtin handling in gdb_test_multiple triggers. + +The cause of this is that the question argument regexp is incomplete. + +Fix this by making sure that the entire question is matched in the regexp: +... +set yn_re [string_to_regexp {(y or [n])}] + ... + "Make breakpoint pending on future shared library load\\? $yn_re " "Y" +... + +Tested on x86_64-linux. +--- + gdb/testsuite/gdb.cp/namespace.exp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/gdb/testsuite/gdb.cp/namespace.exp b/gdb/testsuite/gdb.cp/namespace.exp +index a9de09f087d..b1c7403f2c6 100644 +--- a/gdb/testsuite/gdb.cp/namespace.exp ++++ b/gdb/testsuite/gdb.cp/namespace.exp +@@ -251,8 +251,9 @@ gdb_test "print AAA::ALPHA" "\\$\[0-9\].* = AAA::ALPHA" + gdb_test "whatis ::C::CClass::NestedClass" "type = C::CClass::NestedClass" + gdb_test "whatis ::C::CClass::NestedClass *" "type = C::CClass::NestedClass \\*" + ++set yn_re [string_to_regexp {(y or [n])}] + # Break on functions with a malformed name. + gdb_test "break DNE>::DNE" "" "br malformed \'>\'" \ +- "Make breakpoint pending on future shared library load?.*" "y" ++ "Make breakpoint pending on future shared library load\\? $yn_re " "Y" + gdb_test "break DNE)::DNE" "" "br malformed \')\'" \ +- "Make breakpoint pending on future shared library load?.*" "y" ++ "Make breakpoint pending on future shared library load\\? $yn_re " "Y" +-- +2.35.3 + diff --git a/gdb-testsuite-fix-gdb.dwarf2-dw2-gas-workaround.exp.patch b/gdb-testsuite-fix-gdb.dwarf2-dw2-gas-workaround.exp.patch new file mode 100644 index 0000000..99a0948 --- /dev/null +++ b/gdb-testsuite-fix-gdb.dwarf2-dw2-gas-workaround.exp.patch @@ -0,0 +1,41 @@ +From 254988c36fe592e89af5d92e1d35a6eb4b09cbb0 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 6 Nov 2023 08:32:54 +0100 +Subject: [PATCH 2/2] [gdb/testsuite] Fix gdb.dwarf2/dw2-gas-workaround.exp + +Recently added test-case gdb.dwarf2/dw2-gas-workaround.exp: +- passes when gdb is configured using $(cd ../src; pwd)/configure, but +- fails when using ../src/configure. + +Fix this by making the matching more precise: +... +- -re -wrap "$objdir.*" { ++ -re -wrap "name_for_id = $objdir/$srcfile\r\n.*" { +... +such that we only fail on the line: +... +[symtab-create] start_subfile: name = dw2-lines.c, name_for_id = \ + /data/vries/gdb/leap-15-4/build/gdb/testsuite/dw2-lines.c^M +... + +Reported-By: Carl Love +--- + gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp b/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp +index ca2b10f23b3..7d5375a920a 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp ++++ b/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp +@@ -83,7 +83,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \ + + gdb_test_no_output "set debug symtab-create 1" + gdb_test_multiple "ptype bar" "" { +- -re -wrap "$objdir.*" { ++ -re -wrap "name_for_id = $objdir/$srcfile\r\n.*" { + fail $gdb_test_name + } + -re -wrap "" { +-- +2.35.3 + diff --git a/gdb-testsuite-fix-gdb.fortran-array-bounds.exp-on-ar.patch b/gdb-testsuite-fix-gdb.fortran-array-bounds.exp-on-ar.patch new file mode 100644 index 0000000..fce13ed --- /dev/null +++ b/gdb-testsuite-fix-gdb.fortran-array-bounds.exp-on-ar.patch @@ -0,0 +1,95 @@ +From a6f598be3d0477c5c59bd490573a5d457949658e Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 7 Jun 2024 08:12:34 +0200 +Subject: [PATCH] [gdb/testsuite] Fix gdb.fortran/array-bounds.exp on arm + +When running test-case gdb.fortran/array-bounds.exp on arm-linux, we run into: +... +(gdb) print &foo^M +$1 = (PTR TO -> ( real(kind=4) (0:1) )) 0xfffef008^M +(gdb) FAIL: gdb.fortran/array-bounds.exp: print &foo +print &bar^M +$2 = (PTR TO -> ( real(kind=4) (-1:0) )) 0xfffef010^M +(gdb) FAIL: gdb.fortran/array-bounds.exp: print &bar +... + +This is due to gcc PR debug/54934. + +The test-case contains a kfail for this, which is only activated for +x86_64/i386. + +Fix this by enabling the kfail for all ilp32 targets. + +Also: +- change the kfail into an xfail, because gdb is not at fault here, and +- limit the xfail to the gfortran compiler. + +Tested on arm-linux. + +(cherry picked from commit f9478936896ada7786e8d68622f6e6ff78b97b0d) +--- + gdb/testsuite/gdb.fortran/array-bounds.exp | 45 +++++++++++++++------- + 1 file changed, 31 insertions(+), 14 deletions(-) + +diff --git a/gdb/testsuite/gdb.fortran/array-bounds.exp b/gdb/testsuite/gdb.fortran/array-bounds.exp +index e3f2603a118..a9d6011aed4 100644 +--- a/gdb/testsuite/gdb.fortran/array-bounds.exp ++++ b/gdb/testsuite/gdb.fortran/array-bounds.exp +@@ -31,21 +31,38 @@ if {![fortran_runto_main]} { + return + } + +-# Convenience proc to setup for KFAIL +-proc kfail_if {exp bugid triplet} { +- if {$exp} { +- setup_kfail $bugid $triplet ++# GCC outputs incorrect range debug info for -m32, gcc PR debug/54934. ++set expect_xfail \ ++ [expr \ ++ [test_compiler_info {gfortran-*} f90] \ ++ && [is_ilp32_target]] ++ ++set re_ok [string_to_regexp (4294967296:4294967297)] ++set re_xfail [string_to_regexp (0:1)] ++gdb_test_multiple "print &foo" "" { ++ -re -wrap $re_ok.* { ++ pass $gdb_test_name ++ } ++ -re -wrap $re_xfail.* { ++ if { $expect_xfail } { ++ xfail $gdb_test_name ++ } else { ++ fail $gdb_test_name ++ } + } + } + +-# GCC outputs incorrect range debug info for -m32. +-set expect_fail false +-if {[is_ilp32_target] && ([istarget "i\[34567\]86-*-linux*"] +- || [istarget "x86_64-*-linux*"])} { +- set expect_fail true ++set re_ok [string_to_regexp (-4294967297:-4294967296)] ++set re_xfail [string_to_regexp (-1:0)] ++gdb_test_multiple "print &bar" "" { ++ -re -wrap $re_ok.* { ++ pass $gdb_test_name ++ } ++ -re -wrap $re_xfail.* { ++ if { $expect_xfail } { ++ xfail $gdb_test_name ++ } else { ++ fail $gdb_test_name ++ } ++ } + } +- +-kfail_if $expect_fail "gcc/54934" "*-*-*" +-gdb_test "print &foo" {.*\(4294967296:4294967297\).*} +-kfail_if $expect_fail "gcc/54934" "*-*-*" +-gdb_test "print &bar" {.*\(-4294967297:-4294967296\).*} + +base-commit: 4c7dab250c3581e691c2da87395e80244074d8bf +-- +2.35.3 + diff --git a/gdb-testsuite-fix-gdb.mi-mi-dprintf.exp-with-read1.patch b/gdb-testsuite-fix-gdb.mi-mi-dprintf.exp-with-read1.patch new file mode 100644 index 0000000..1115c0c --- /dev/null +++ b/gdb-testsuite-fix-gdb.mi-mi-dprintf.exp-with-read1.patch @@ -0,0 +1,72 @@ +From 80b0afed39702c7a25d68f6b28427f92c5db6d80 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sun, 14 Jan 2024 10:21:46 +0100 +Subject: [PATCH 45/48] [gdb/testsuite] Fix gdb.mi/mi-dprintf.exp with read1 + +When running test-case gdb.mi/mi-dprintf.exp with check-read1, I run into: +... +(gdb) ^M +PASS: gdb.mi/mi-dprintf.exp: gdb: mi 2nd dprintf stop +-data-evaluate-expression stderr^M +^done,value="0x7ffff7e4a420 <_IO_2_1_stderr_>"^M +(gdb) FAIL: gdb.mi/mi-dprintf.exp: stderr symbol check +... + +The problem is in proc mi_gdb_is_stderr_available: +... +proc mi_gdb_is_stderr_available {} { + set has_stderr_symbol false + gdb_test_multiple "-data-evaluate-expression stderr" "stderr symbol check" { + -re "\\^error,msg=\"'stderr' has unknown type; cast it to its declared type\"\r\n$::mi_gdb_prompt$" { + } + -re "$::mi_gdb_prompt$" { + set has_stderr_symbol true + } + } +... +which uses a gdb_test_multiple that is supposed to use the mi prompt, but +doesn't use -prompt to indicate this. Consequently, the default patterns use +the regular gdb prompt, which trigger earlier than the two custom patterns +which use "$::mi_gdb_prompt$". + +Fix this by adding the missing -prompt "$::mi_gdb_prompt$" arguments. + +While we're at it, make the gdb_test_multiple call a bit more readable by +using variables, and by using -wrap. + +Tested on x86_64-linux, with: +- gcc and clang (to trigger both the has_stderr_symbol true and false cases) +- make check and make check-read1. +--- + gdb/testsuite/lib/mi-support.exp | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp +index 540eb3371c6..1b702e8a3bb 100644 +--- a/gdb/testsuite/lib/mi-support.exp ++++ b/gdb/testsuite/lib/mi-support.exp +@@ -2956,13 +2956,18 @@ proc foreach_mi_ui_mode { var_name body } { + # Check if GDB has information about the stderr symbol. + proc mi_gdb_is_stderr_available {} { + set has_stderr_symbol false +- gdb_test_multiple "-data-evaluate-expression stderr" "stderr symbol check" { +- -re "\\^error,msg=\"'stderr' has unknown type; cast it to its declared type\"\r\n$::mi_gdb_prompt$" { ++ ++ set cmd "-data-evaluate-expression stderr" ++ set test "stderr symbol check" ++ set msg_re {"'stderr' has unknown type; cast it to its declared type"} ++ gdb_test_multiple $cmd $test -prompt "$::mi_gdb_prompt$" { ++ -re -wrap "\\^error,msg=$msg_re" { + # Default value of false is fine. + } +- -re "$::mi_gdb_prompt$" { ++ -re -wrap "" { + set has_stderr_symbol true + } + } ++ + return $has_stderr_symbol + } +-- +2.35.3 + diff --git a/gdb-testsuite-fix-gdb.server-server-connect.exp-for-.patch b/gdb-testsuite-fix-gdb.server-server-connect.exp-for-.patch new file mode 100644 index 0000000..7606cae --- /dev/null +++ b/gdb-testsuite-fix-gdb.server-server-connect.exp-for-.patch @@ -0,0 +1,74 @@ +From 237a0ec8a20cc5e233d630a43d9cacd2774a564d Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 20 Mar 2024 19:31:24 +0100 +Subject: [PATCH 37/48] [gdb/testsuite] Fix gdb.server/server-connect.exp for + missing ipv6 + +On a system without ipv6 support enabled, when running test-case +gdb.server/server-connect.exp, it takes about 4 minutes, and I get: +... +builtin_spawn gdbserver --once ::1:2347 server-connect^M +Can't open socket: Address family not supported by protocol.^M +Exiting^M +PASS: gdb.server/server-connect.exp: tcp6: start gdbserver +target remote tcp6:::1:2347^M +A program is being debugged already. Kill it? (y or n) y^M +could not connect: Address family not supported by protocol.^M +(gdb) FAIL: gdb.server/server-connect.exp: tcp6: connect to gdbserver using tcp6:::1 +... + +Fix this by: +- recognizing the error message in gdbserver_start, and returning an empty list + to signal unsupported, and +- handling the unsupported response in the test-case. + +This brings testing time down to 2 seconds, and gets me: +... +UNSUPPORTED: gdb.server/server-connect.exp: tcp6: start gdbserver +UNSUPPORTED: gdb.server/server-connect.exp: tcp6-with-brackets: start gdbserver +UNSUPPORTED: gdb.server/server-connect.exp: udp6: start gdbserver +UNSUPPORTED: gdb.server/server-connect.exp: udp6-with-brackets: start gdbserver +... + +Tested on aarch64-linux. + +Approved-By: Tom Tromey + +PR testsuite/31502 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31502 +--- + gdb/testsuite/gdb.server/server-connect.exp | 3 +++ + gdb/testsuite/lib/gdbserver-support.exp | 3 +++ + 2 files changed, 6 insertions(+) + +diff --git a/gdb/testsuite/gdb.server/server-connect.exp b/gdb/testsuite/gdb.server/server-connect.exp +index 1f5b9a27cf4..ffdfaa89154 100644 +--- a/gdb/testsuite/gdb.server/server-connect.exp ++++ b/gdb/testsuite/gdb.server/server-connect.exp +@@ -88,6 +88,9 @@ save_vars { GDB_TEST_SOCKETHOST } { + } else { + if { $gdbserver_should_fail } { + fail "$test: gdbserver should fail but did not" ++ } elseif { [llength $res] == 0 } { ++ unsupported $test ++ continue + } else { + pass "$test" + } +diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp +index a3cccf54a72..d065fb36764 100644 +--- a/gdb/testsuite/lib/gdbserver-support.exp ++++ b/gdb/testsuite/lib/gdbserver-support.exp +@@ -429,6 +429,9 @@ proc gdbserver_start { options arguments } { + -re ".*: cannot resolve name: .*\r\n" { + error "gdbserver cannot resolve name." + } ++ -re "Can't open socket: Address family not supported by protocol." { ++ return {} ++ } + timeout { + error "Timeout waiting for gdbserver response." + } +-- +2.35.3 + diff --git a/gdb-testsuite-fix-gdbserver-pid-in-gdb.server-server.patch b/gdb-testsuite-fix-gdbserver-pid-in-gdb.server-server.patch new file mode 100644 index 0000000..d96e679 --- /dev/null +++ b/gdb-testsuite-fix-gdbserver-pid-in-gdb.server-server.patch @@ -0,0 +1,117 @@ +From 7357f73483cfe8f3e8ec2dd9ca2fb3d52206055a Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 17 Apr 2024 11:45:02 +0200 +Subject: [PATCH 28/48] [gdb/testsuite] Fix gdbserver pid in + gdb.server/server-kill-python.exp + +The commit ed32754a8c7 ("[gdb/testsuite] Fix gdb.server/multi-ui-errors.exp for +remote target") intended to addresss the problem that this command: +... +set gdbserver_pid [exp_pid -i $server_spawn_id] +... +does not return the pid of the gdbserver for remote target, but rather the one +of the ssh client session. + +To fix this, it added another way of getting the gdbserver_pid. + +For the trivial case of non-remote target, the PID found by either method +should be identical, but if we compare those by adding +"puts [exec ps -p $gdbserver_pid]" we get: +... + PID TTY TIME CMD +31711 pts/8 00:00:00 gdbserver + PID TTY TIME CMD +31718 pts/8 00:00:00 server-kill-pyt +... + +The problem is that while the gdbserver PID is supposed to be read from the +result of "gdb.execute ('p server_pid')" in the python script, instead it's +taken from: +... +Process server-kill-python created; pid = 31718^M +... + +Fix this by moving the printing of the gdbserver PID out of the python script. + +Also double-check the two methods against each other, in the cases that they +should match. + +Tested on x86_64-linux. + +PR testsuite/31633 +https://sourceware.org/bugzilla/show_bug.cgi?id=31633 +--- + .../gdb.server/server-kill-python.exp | 37 +++++++++++-------- + 1 file changed, 21 insertions(+), 16 deletions(-) + +diff --git a/gdb/testsuite/gdb.server/server-kill-python.exp b/gdb/testsuite/gdb.server/server-kill-python.exp +index dcb6eddd6eb..778880984ec 100644 +--- a/gdb/testsuite/gdb.server/server-kill-python.exp ++++ b/gdb/testsuite/gdb.server/server-kill-python.exp +@@ -37,7 +37,7 @@ set host_binfile [gdb_remote_download host $binfile] + set res [gdbserver_spawn "${target_binfile}"] + set gdbserver_protocol [lindex $res 0] + set gdbserver_gdbport [lindex $res 1] +-set gdbserver_pid [exp_pid -i $server_spawn_id] ++set gdbserver_pid_check [exp_pid -i $server_spawn_id] + + set break_linenr [gdb_get_line_number "@@XX@@ Inferior Starting @@XX@@"] + +@@ -48,9 +48,6 @@ puts $fd \ + "import gdb + + def do_gdb_stuff (): +- gdb.execute ('break $srcfile:$break_linenr') +- gdb.execute ('continue') +- gdb.execute ('p server_pid') + gdb.execute ('continue') + + do_gdb_stuff()" +@@ -68,24 +65,32 @@ if {[gdb_spawn_with_cmdline_opts \ + + gdb_load $binfile + gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport +-send_gdb "source $host_file1\n" ++ ++gdb_test "break $srcfile:$break_linenr" + + # Get the gdbserver PID. + set gdbserver_pid 0 +- +-# Wait for the inferior to start up. +-with_spawn_id $server_spawn_id { +- gdb_test_multiple "" "get gdbserver PID" { +- -re " = ($decimal)\r\n" { +- set gdbserver_pid $expect_out(1,string) +- pass $gdb_test_name +- } ++gdb_test "continue" ++gdb_test_multiple "print server_pid" "get gdbserver PID" { ++ -re -wrap " = ($decimal)" { ++ set gdbserver_pid $expect_out(1,string) ++ pass $gdb_test_name + } ++} + +- if { $gdbserver_pid == 0 } { +- return +- } ++if { $gdbserver_pid == 0 } { ++ return ++} ++ ++if { ![is_remote target] && $gdbserver_pid != $gdbserver_pid_check } { ++ error "Failed to get correct gdbserver pid" ++} + ++send_gdb "source $host_file1\n" ++ ++ ++# Wait for the inferior to start up. ++with_spawn_id $server_spawn_id { + gdb_test_multiple "" "ensure inferior is running" { + -re "@@XX@@ Inferior Starting @@XX@@" { + pass $gdb_test_name +-- +2.35.3 + diff --git a/gdb-testsuite-fix-license-text-in-gdb.reverse-map-to.patch b/gdb-testsuite-fix-license-text-in-gdb.reverse-map-to.patch new file mode 100644 index 0000000..7bbae1c --- /dev/null +++ b/gdb-testsuite-fix-license-text-in-gdb.reverse-map-to.patch @@ -0,0 +1,49 @@ +From 5b840a3cb41ada4cee1456d16993809abeb30eda Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 22 Feb 2024 12:09:14 +0100 +Subject: [PATCH 43/48] [gdb/testsuite] Fix license text in + gdb.reverse/map-to-same-line.{c,exp} + +I noticed in gdb.reverse/map-to-same-line.{c,exp} that the license urls are +using some kind of indirection via urldefense.proofpoint.com. + +Fix this by removing this indirection. + +Tested on x86_64-linux. + +PR testsuite/31358 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31358 +--- + gdb/testsuite/gdb.reverse/map-to-same-line.c | 2 +- + gdb/testsuite/gdb.reverse/map-to-same-line.exp | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gdb/testsuite/gdb.reverse/map-to-same-line.c b/gdb/testsuite/gdb.reverse/map-to-same-line.c +index 3086e849231..f6b4f10dbf7 100644 +--- a/gdb/testsuite/gdb.reverse/map-to-same-line.c ++++ b/gdb/testsuite/gdb.reverse/map-to-same-line.c +@@ -11,7 +11,7 @@ + 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 . */ ++ along with this program. If not, see . */ + + /* The purpose of this test is to create a DWARF line table that contains two + or more entries for the same line. When stepping (forwards or backwards), +diff --git a/gdb/testsuite/gdb.reverse/map-to-same-line.exp b/gdb/testsuite/gdb.reverse/map-to-same-line.exp +index 63f8c9c76b3..1510cf98d0c 100644 +--- a/gdb/testsuite/gdb.reverse/map-to-same-line.exp ++++ b/gdb/testsuite/gdb.reverse/map-to-same-line.exp +@@ -11,7 +11,7 @@ + # 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 . ++# along with this program. If not, see . + + # When stepping (forwards or backwards), GDB should step over the entire line + # and not just a particular entry in the line table. This test was added to +-- +2.35.3 + diff --git a/gdb-testsuite-fix-missing-return-type-in-gdb.linespe.patch b/gdb-testsuite-fix-missing-return-type-in-gdb.linespe.patch new file mode 100644 index 0000000..25083c5 --- /dev/null +++ b/gdb-testsuite-fix-missing-return-type-in-gdb.linespe.patch @@ -0,0 +1,40 @@ +From 3e4d764ebb264f0c9153c6fd3727f67d4454ae9b Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 29 Mar 2024 07:47:30 +0100 +Subject: [PATCH 32/48] [gdb/testsuite] Fix missing return type in + gdb.linespec/break-asm-file.c + +On fedora rawhide, when running test-case gdb.linespec/break-asm-file.exp, I +get: +... +gdb compile failed, break-asm-file.c:21:8: error: \ + return type defaults to 'int' [-Wimplicit-int] + 21 | static func() + | ^~~~ +... + +Fix this by adding the missing return type. + +Tested on aarch64-linux. + +Approved-By: John Baldwin +--- + gdb/testsuite/gdb.linespec/break-asm-file.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.linespec/break-asm-file.c b/gdb/testsuite/gdb.linespec/break-asm-file.c +index 41f0904fc84..e7bdc26b1ec 100644 +--- a/gdb/testsuite/gdb.linespec/break-asm-file.c ++++ b/gdb/testsuite/gdb.linespec/break-asm-file.c +@@ -18,7 +18,7 @@ + void func3(); + void func2(); + +-static func() ++static void func() + { + } + +-- +2.35.3 + diff --git a/gdb-testsuite-fix-regexp-in-vgdb_start.patch b/gdb-testsuite-fix-regexp-in-vgdb_start.patch new file mode 100644 index 0000000..2591fa6 --- /dev/null +++ b/gdb-testsuite-fix-regexp-in-vgdb_start.patch @@ -0,0 +1,66 @@ +From acc30323a8bc8aa04d404356e96b003a9a30543f Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 25 Jan 2024 16:36:09 +0100 +Subject: [PATCH 06/48] [gdb/testsuite] Fix regexp in vgdb_start + +On Fedora 39 aarch64 I run into: +... +(gdb) target remote | vgdb --wait=2 --max-invoke-ms=2500 --pid=2114437^M +Remote debugging using | vgdb --wait=2 --max-invoke-ms=2500 --pid=2114437^M +relaying data between gdb and process 2114437^M +warning: remote target does not support file transfer, \ + attempting to access files from local filesystem.^M +Reading symbols from /lib/ld-linux-aarch64.so.1...^M +_start () at ../sysdeps/aarch64/dl-start.S:22^M +warning: 22 ../sysdeps/aarch64/dl-start.S: No such file or directory^M +(gdb) FAIL: gdb.base/valgrind-infcall.exp: target remote for vgdb +... + +For contrast, on openSUSE Leap 15.4 x86_64 I have: +... +(gdb) target remote | vgdb --wait=2 --max-invoke-ms=2500 --pid=18797^M +Remote debugging using | vgdb --wait=2 --max-invoke-ms=2500 --pid=18797^M +relaying data between gdb and process 18797^M +warning: remote target does not support file transfer, \ + attempting to access files from local filesystem.^M +Reading symbols from /lib64/ld-linux-x86-64.so.2...^M +(No debugging symbols found in /lib64/ld-linux-x86-64.so.2)^M +0x0000000004002550 in _start () from /lib64/ld-linux-x86-64.so.2^M +(gdb) PASS: gdb.base/valgrind-infcall.exp: target remote for vgdb +... + +The fail happens in vgdb_start because the regexp only matches the +"in _start ()" variant, not the "_start () at": +... + gdb_test "$vgdbcmd" " in \\.?_start .*" "target remote for vgdb" +... +Which variant you get is determined by presence of debug info. + +Fix this by also matching the "_start () at" variant. + +Tested aarch64-linux and x86_64-linux. + +Approved-By: Tom Tromey +--- + gdb/testsuite/lib/valgrind.exp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/lib/valgrind.exp b/gdb/testsuite/lib/valgrind.exp +index a1cd85a7b09..f9096663509 100644 +--- a/gdb/testsuite/lib/valgrind.exp ++++ b/gdb/testsuite/lib/valgrind.exp +@@ -92,7 +92,10 @@ proc vgdb_start { {active_at_startup 1} } { + set vgdbcmd "target remote | vgdb --wait=2 --max-invoke-ms=2500 --pid=$vgdbpid" + + if { $active_at_startup } { +- gdb_test "$vgdbcmd" " in \\.?_start .*" "target remote for vgdb" ++ set start_re1 " in \\.?_start " ++ set start_re2 "\\.?_start \\(\\) at " ++ gdb_test "$vgdbcmd" "($start_re1|$start_re2).*" \ ++ "target remote for vgdb" + } else { + # Let $binfile run a bit before attaching. This is a bit of a hack, + # in that it lets test-case valgrind-infcall-2.exp run to the point of +-- +2.35.3 + diff --git a/gdb-testsuite-fix-spurious-fails-with-examine-backwa.patch b/gdb-testsuite-fix-spurious-fails-with-examine-backwa.patch new file mode 100644 index 0000000..a786701 --- /dev/null +++ b/gdb-testsuite-fix-spurious-fails-with-examine-backwa.patch @@ -0,0 +1,221 @@ +From 8bf7fdfc16f5d5fd9a94c233c0c41d307ba86cd2 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 21 Nov 2023 13:15:29 +0100 +Subject: [PATCH 04/48] [gdb/testsuite] Fix spurious FAILs with + examine-backward.exp, again + +Commit 59a561480d5 ("Fix spurious FAILs with examine-backward.exp") describes +the problem that: +... +The test case examine-backward.exp issues the command "x/-s" after the end +of the first string in TestStrings, but without making sure that this +string is preceded by a string terminator. Thus GDB may spuriously print +some random characters from before that string, and then the test fails. +... + +The commit fixes the problem by adding a Barrier variable before the TestStrings +variable: +... ++const char Barrier[] = { 0x0 }; + const char TestStrings[] = { +... + +There is however no guarantee that Barrier is placed immediately before +TestStrings. + +Before recent commit 169fe7ab54b ("Change gdb.base/examine-backwards.exp for +AIX.") on x86_64-linux, I see: +... +0000000000400660 R Barrier +0000000000400680 R TestStrings +... + +So while the Barrier variable is the first before the TestStrings variable, +it's not immediately preceding TestStrings. + +After commit 169fe7ab54b: +... +0000000000402259 B Barrier +0000000000402020 D TestStrings +... +they're not even in the same section anymore. + +Fix this reliably by adding the zero in the array itself: +... +char TestStringsBase[] = { + 0x0, + ... +}; +char *TestStrings = &TestStringsBase[1]; +... +and do likewise for TestStringsH and TestStringsW. + +Tested on x86_64-linux. + +PR testsuite/31064 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31064 +--- + gdb/testsuite/gdb.base/examine-backward.c | 35 ++++++++++++++------- + gdb/testsuite/gdb.base/examine-backward.exp | 18 +++++------ + 2 files changed, 33 insertions(+), 20 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/examine-backward.c b/gdb/testsuite/gdb.base/examine-backward.c +index 354c2e2f323..5549cc20a4a 100644 +--- a/gdb/testsuite/gdb.base/examine-backward.c ++++ b/gdb/testsuite/gdb.base/examine-backward.c +@@ -32,15 +32,12 @@ literals. The content of each array is the same as followings: + }; + */ + +-/* This is here just to ensure we have a null character before +- TestStrings, to avoid showing garbage when we look for strings +- backwards from TestStrings. */ ++unsigned char TestStringsBase[] = { ++ /* This is here just to ensure we have a null character before ++ TestStrings, to avoid showing garbage when we look for strings ++ backwards from TestStrings. */ ++ 0x0, + +-unsigned char Barrier[] = { +- 0x00, +-}; +- +-unsigned char TestStrings[] = { + 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, + 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, + 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, +@@ -54,7 +51,14 @@ unsigned char TestStrings[] = { + 0x00 + }; + +-short TestStringsH[] = { ++unsigned char *TestStrings = &TestStringsBase[1]; ++ ++short TestStringsHBase[] = { ++ /* This is here just to ensure we have a null character before ++ TestStringsH, to avoid showing garbage when we look for strings ++ backwards from TestStringsH. */ ++ 0x0, ++ + 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, + 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, + 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, +@@ -67,7 +71,14 @@ short TestStringsH[] = { + 0x0000 + }; + +-int TestStringsW[] = { ++short *TestStringsH = &TestStringsHBase[1]; ++ ++int TestStringsWBase[] = { ++ /* This is here just to ensure we have a null character before ++ TestStringsW, to avoid showing garbage when we look for strings ++ backwards from TestStringsW. */ ++ 0x0, ++ + 0x00000041, 0x00000042, 0x00000043, 0x00000044, + 0x00000045, 0x00000046, 0x00000047, 0x00000048, + 0x00000049, 0x0000004a, 0x0000004b, 0x0000004c, +@@ -89,11 +100,13 @@ int TestStringsW[] = { + 0x00000000 + }; + ++int *TestStringsW = &TestStringsWBase[1]; ++ + int + main (void) + { + /* Clang++ eliminates the variables if nothing references them. */ +- int dummy = Barrier[0] + TestStrings[0] + TestStringsH[0] + TestStringsW[0]; ++ int dummy = TestStrings[0] + TestStringsH[0] + TestStringsW[0]; + + /* Backward disassemble test requires at least 20 instructions in + this function. Adding a simple bubble sort. */ +diff --git a/gdb/testsuite/gdb.base/examine-backward.exp b/gdb/testsuite/gdb.base/examine-backward.exp +index 7c8a08c0726..4e197d7d725 100644 +--- a/gdb/testsuite/gdb.base/examine-backward.exp ++++ b/gdb/testsuite/gdb.base/examine-backward.exp +@@ -145,7 +145,7 @@ gdb_test_no_output "set charset ASCII" + + with_test_prefix "char-width=1, print-max=20" { + gdb_test_no_output "set print elements 20" +- gdb_test_sequence "x/6s &TestStrings" "take 6 strings forward" { ++ gdb_test_sequence "x/6s TestStrings" "take 6 strings forward" { + "\"ABCDEFGHIJKLMNOPQRST\"\.\.\." + "\"UVWXYZ\"" + "\"\"" +@@ -162,7 +162,7 @@ with_test_prefix "char-width=1, print-max=20" { + "\"[^\"]+\"" + "\"01234567890123456789\"\.\.\." + } +- gdb_test_sequence "x/6s &TestStrings" "take 6 strings forward again" { ++ gdb_test_sequence "x/6s TestStrings" "take 6 strings forward again" { + "\"ABCDEFGHIJKLMNOPQRST\"\.\.\." + "\"UVWXYZ\"" + "\"\"" +@@ -187,7 +187,7 @@ with_test_prefix "char-width=1, print-max=20" { + + with_test_prefix "char-width=2, print-max=20" { + gdb_test_no_output "set print elements 20" +- gdb_test_sequence "x/6sh &TestStringsH" "take 6 strings forward" { ++ gdb_test_sequence "x/6sh TestStringsH" "take 6 strings forward" { + "u\"ABCDEFGHIJKLMNOPQRST\"\.\.\." + "u\"UVWXYZ\"" + "u\"\"" +@@ -204,7 +204,7 @@ with_test_prefix "char-width=2, print-max=20" { + "u\"[^\"]+\"" + "u\"01234567890123456789\"\.\.\." + } +- gdb_test_sequence "x/6sh &TestStringsH" "take 6 strings forward again" { ++ gdb_test_sequence "x/6sh TestStringsH" "take 6 strings forward again" { + "u\"ABCDEFGHIJKLMNOPQRST\"\.\.\." + "u\"UVWXYZ\"" + "u\"\"" +@@ -229,7 +229,7 @@ with_test_prefix "char-width=2, print-max=20" { + + with_test_prefix "char-width=4, print-max=20" { + gdb_test_no_output "set print elements 20" +- gdb_test_sequence "x/6sw &TestStringsW" "take 6 strings forward" { ++ gdb_test_sequence "x/6sw TestStringsW" "take 6 strings forward" { + "U\"ABCDEFGHIJKLMNOPQRST\"\.\.\." + "U\"UVWXYZ\"" + "U\"\"" +@@ -246,7 +246,7 @@ with_test_prefix "char-width=4, print-max=20" { + "U\"[^\"]+\"" + "U\"01234567890123456789\"\.\.\." + } +- gdb_test_sequence "x/6sw &TestStringsW" "take 6 strings forward again" { ++ gdb_test_sequence "x/6sw TestStringsW" "take 6 strings forward again" { + "U\"ABCDEFGHIJKLMNOPQRST\"\.\.\." + "U\"UVWXYZ\"" + "U\"\"" +@@ -271,7 +271,7 @@ with_test_prefix "char-width=4, print-max=20" { + + with_test_prefix "char-width=2, print-max=0" { + gdb_test_no_output "set print elements 0" +- gdb_test_sequence "x/6sh &TestStringsH" "take 6 strings forward" { ++ gdb_test_sequence "x/6sh TestStringsH" "take 6 strings forward" { + "u\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"" + "u\"\"" + "u\"\"" +@@ -289,7 +289,7 @@ with_test_prefix "char-width=2, print-max=0" { + "u\"012345678901234567890123456789\"" + "u\"!!!!!!\"" + } +- gdb_test_sequence "x/6sh &TestStringsH" "take 6 strings forward again" { ++ gdb_test_sequence "x/6sh TestStringsH" "take 6 strings forward again" { + "u\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"" + "u\"\"" + "u\"\"" +@@ -314,7 +314,7 @@ with_test_prefix "char-width=2, print-max=0" { + + with_test_prefix "char-width=1, print-max=4" { + gdb_test_no_output "set print elements 4" +- gdb_test_sequence "x/9s &TestStrings" "take 9 strings forward" { ++ gdb_test_sequence "x/9s TestStrings" "take 9 strings forward" { + "\"ABCD\"\.\.\." + "\"EFGH\"\.\.\." + "\"IJKL\"\.\.\." +-- +2.35.3 + diff --git a/gdb-testsuite-fix-test-case-gdb.threads-attach-stopp.patch b/gdb-testsuite-fix-test-case-gdb.threads-attach-stopp.patch new file mode 100644 index 0000000..beef20a --- /dev/null +++ b/gdb-testsuite-fix-test-case-gdb.threads-attach-stopp.patch @@ -0,0 +1,65 @@ +From 3596f8119753089d8dd8c0aff800dbf2e283a111 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 28 Mar 2024 08:26:31 +0100 +Subject: [PATCH 34/48] [gdb/testsuite] Fix test-case + gdb.threads/attach-stopped.exp on manjaro linux + +When running test-case gdb.threads/attach-stopped.exp on aarch64-linux, using +the manjaro linux distro, I get: +... + (gdb) thread apply all bt^M + ^M + Thread 2 (Thread 0xffff8d8af120 (LWP 278116) "attach-stopped"):^M + #0 0x0000ffff8d964864 in clock_nanosleep () from /usr/lib/libc.so.6^M + #1 0x0000ffff8d969cac in nanosleep () from /usr/lib/libc.so.6^M + #2 0x0000ffff8d969b68 in sleep () from /usr/lib/libc.so.6^M + #3 0x0000aaaade370828 in func (arg=0x0) at attach-stopped.c:29^M + #4 0x0000ffff8d930aec in ?? () from /usr/lib/libc.so.6^M + #5 0x0000ffff8d99a5dc in ?? () from /usr/lib/libc.so.6^M + ^M + Thread 1 (Thread 0xffff8db62020 (LWP 278111) "attach-stopped"):^M + #0 0x0000ffff8d92d2d8 in ?? () from /usr/lib/libc.so.6^M + #1 0x0000ffff8d9324b8 in ?? () from /usr/lib/libc.so.6^M + #2 0x0000aaaade37086c in main () at attach-stopped.c:45^M + (gdb) FAIL: gdb.threads/attach-stopped.exp: threaded: attach2 to stopped bt +... + +The problem is that the test-case expects to see start_thread: +... + gdb_test "thread apply all bt" ".*sleep.*start_thread.*" \ + "$threadtype: attach2 to stopped bt" +... +but lack of symbols makes that impossible. + +Fix this by allowing " in ?? () from " as well. + +Tested on aarch64-linux. + +PR testsuite/31451 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31451 +--- + gdb/testsuite/gdb.threads/attach-stopped.exp | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite/gdb.threads/attach-stopped.exp +index acdfcb5d8c5..b28fbd1a3d3 100644 +--- a/gdb/testsuite/gdb.threads/attach-stopped.exp ++++ b/gdb/testsuite/gdb.threads/attach-stopped.exp +@@ -54,10 +54,12 @@ proc corefunc { threadtype } { + } + + # ".*sleep.*clone.*" would fail on s390x as bt stops at START_THREAD there. ++ set test "$threadtype: attach2 to stopped bt" + if {[string equal $threadtype threaded]} { +- gdb_test "thread apply all bt" ".*sleep.*start_thread.*" "$threadtype: attach2 to stopped bt" ++ gdb_test "thread apply all bt" \ ++ ".*sleep.*(start_thread| in \\?\\? \\(\\) from ).*" $test + } else { +- gdb_test "bt" ".*sleep.*main.*" "$threadtype: attach2 to stopped bt" ++ gdb_test "bt" ".*sleep.*main.*" $test + } + + gdb_exit +-- +2.35.3 + diff --git a/gdb-testsuite-fix-test-in-gdb.python-py-finish-break.patch b/gdb-testsuite-fix-test-in-gdb.python-py-finish-break.patch new file mode 100644 index 0000000..b977f01 --- /dev/null +++ b/gdb-testsuite-fix-test-in-gdb.python-py-finish-break.patch @@ -0,0 +1,67 @@ +From 7658c4d52562eef199e30fcd2da7da9a56d5d9b3 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 27 Feb 2024 16:18:32 +0100 +Subject: [PATCH 41/48] [gdb/testsuite] Fix test in + gdb.python/py-finish-breakpoint.exp + +With test-case gdb.python/py-finish-breakpoint.exp, we run into: +... +(gdb) python print (finishbp_default.hit_count) +Traceback (most recent call last): + File "", line 1, in +RuntimeError: Breakpoint 3 is invalid. +Error while executing Python code. +(gdb) PASS: gdb.python/py-finish-breakpoint.exp: normal conditions: \ + check finishBP on default frame has been hit +... + +The test producing the pass is: +... + gdb_test "python print (finishbp_default.hit_count)" "1.*" \ + "check finishBP on default frame has been hit" +... +so the pass is produced because the 1 in "line 1" matches "1.*". + +Temporary breakpoints are removed when hit, and consequently accessing the +hit_count attribute of a temporary python breakpoint (gdb.Breakpoint class) is +not possible, and as per spec we get a RuntimeError. + +So the RuntimeError is correct, and not specific to finish breakpoints. + +The test presumably attempts to match: +... +(gdb) python print (finishbp_default.hit_count) +1 +... +but most likely this output was never produced by any gdb version. + +Fix this by checking whether the finishbp_default breakpoint has hit by +checking that finishbp_default.is_valid() is False. + +Tested on aarch64-linux. + +Approved-By: Tom Tromey + +PR testsuite/31391 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31391 +--- + gdb/testsuite/gdb.python/py-finish-breakpoint.exp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp +index e5a46874afd..687b9ad38cb 100644 +--- a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp ++++ b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp +@@ -73,7 +73,8 @@ with_test_prefix "normal conditions" { + "check MyFinishBreakpoint hit" + gdb_test "python print (finishbp.return_value)" "-5.*" "check return_value" + +- gdb_test "python print (finishbp_default.hit_count)" "1.*" "check finishBP on default frame has been hit" ++ gdb_test "python print (finishbp_default.is_valid())" "False" \ ++ "check finishBP on default frame has been hit" + gdb_test "python print (finishbp.is_valid())" "False.*"\ + "ensure that finish bp is invalid afer normal hit" + +-- +2.35.3 + diff --git a/gdb-testsuite-fix-timeout-in-gdb.tui-resize-2.exp.patch b/gdb-testsuite-fix-timeout-in-gdb.tui-resize-2.exp.patch new file mode 100644 index 0000000..62d57ab --- /dev/null +++ b/gdb-testsuite-fix-timeout-in-gdb.tui-resize-2.exp.patch @@ -0,0 +1,76 @@ +From 56ab56c61f7cba5ed919dfae49c4c8671be8e6b5 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 31 May 2024 10:19:35 +0200 +Subject: [PATCH] [gdb/testsuite] Fix timeout in gdb.tui/resize-2.exp + +When running test-case gdb.tui/resize-2.exp with taskset -c 0, I sometimes run +into: +... +tui disable^[[40;1H^M(gdb) PASS: $exp: tui disable +^M^[[K(gdb) FAIL: $exp: two prompt redisplays after resize (timeout) +... + +The test-case does "Term::resize 24 80 0" while having the settings of an +earlier "Term::resize 40 90", so both dimensions change. + +When TUI is enabled, we call Term::resize with wait_for_msg == 1, and the proc: +- calls stty to change one dimension, +- waits for the message (enabled by "maint set tui-resize-message on") + confirming the resize has happened, +- calls stty to change the other dimension, and again +- waits for the message confirming the resize has happened. + +Since TUI is disabled, we call Term::resize with wait_for_msg == 0 because the +message is not printed, so stty is called twice, and afterwards we check for +the results of the two resizes, which is the test that is failing. + +The problem is that not waiting for a response after each stty call opens up +the possibility of the responses being merged. + +Fix this by calling Term::resize twice, changing one dimension at a time, and +waiting for a single prompt redisplay after each one. + +Tested on x86_64-linux. + +PR testsuite/31822 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31822 +--- + gdb/testsuite/gdb.tui/resize-2.exp | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +diff --git a/gdb/testsuite/gdb.tui/resize-2.exp b/gdb/testsuite/gdb.tui/resize-2.exp +index 0f1f0b9eb1e..729e1ee23f9 100644 +--- a/gdb/testsuite/gdb.tui/resize-2.exp ++++ b/gdb/testsuite/gdb.tui/resize-2.exp +@@ -59,11 +59,23 @@ gdb_test_multiple "tui disable" "" { + } + } + +-# Resize with TUI disabled, so don't wait for the resize message. ++# Resize with TUI disabled, so don't wait for the resize message. Instead, ++# do it in two steps, and wait for a prompt redisplay for each. If we do ++# this in one step, it's unpredictable how may prompt redisplays we'll get. ++Term::resize 24 90 0 ++set screen_dim { 0 0 90 24 } ++ ++gdb_test_multiple "" "prompt redisplays after first resize" { ++ -re "\r.*$gdb_prompt $" { ++ pass $gdb_test_name ++ } ++} ++ + Term::resize 24 80 0 + set screen_dim { 0 0 80 24 } +-gdb_test_multiple "" "two prompt redisplays after resize" { +- -re "\r.*$gdb_prompt \r.*$gdb_prompt $" { ++ ++gdb_test_multiple "" "prompt redisplays after second resize" { ++ -re "\r.*$gdb_prompt $" { + pass $gdb_test_name + } + } + +base-commit: 9736d941f271a6c3c14dcbeb5ad03a5fc4106b45 +-- +2.35.3 + diff --git a/gdb-testsuite-fix-typo-in-gdb.base-catch-syscall.exp.patch b/gdb-testsuite-fix-typo-in-gdb.base-catch-syscall.exp.patch new file mode 100644 index 0000000..22bd445 --- /dev/null +++ b/gdb-testsuite-fix-typo-in-gdb.base-catch-syscall.exp.patch @@ -0,0 +1,52 @@ +From 22655d76bc767d938dc9a72e0f50816a2f97f4c0 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sun, 31 Dec 2023 09:39:45 +0100 +Subject: [PATCH 47/48] [gdb/testsuite] Fix typo in gdb.base/catch-syscall.exp + +On aarch64-linux with a gdb build without libexpat, I run into: +... +(gdb) PASS: gdb.base/catch-syscall.exp: determine pipe syscall: \ + catch syscall 59 +continue +Continuing. + +Catchpoint 5 (call to syscall 59), 0x0000fffff7e04578 in pipe () from \ + /lib64/libc.so.6 +(gdb) FAIL: gdb.base/catch-syscall.exp: determine pipe syscall: continue +... + +In the test-case, this pattern handles either the syscall name or number for +the pipe syscall: +... + -re -wrap "Catchpoint $decimal \\(call to syscall (pipe|$SYS_pipe)\\).*" { +... +but the pattern for the pipe2 syscall mistakenly uses SYS_pipe instead of +SYS_pipe2: +... + -re -wrap "Catchpoint $decimal \\(call to syscall (pipe2|$SYS_pipe)\\).*" { +... +and consequently doesn't handle the pipe2 syscall number. + +Fix the typo by using SYS_pipe2 instead. + +Tested on aarch64-linux. +--- + gdb/testsuite/gdb.base/catch-syscall.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp +index 0588cb35d87..f7d499cb10b 100644 +--- a/gdb/testsuite/gdb.base/catch-syscall.exp ++++ b/gdb/testsuite/gdb.base/catch-syscall.exp +@@ -752,7 +752,7 @@ proc setup_all_syscalls {} { + pass $gdb_test_name + set ok 1 + } +- -re -wrap "Catchpoint $decimal \\(call to syscall (pipe2|$SYS_pipe)\\).*" { ++ -re -wrap "Catchpoint $decimal \\(call to syscall (pipe2|$SYS_pipe2)\\).*" { + lappend all_syscalls pipe2 + pass $gdb_test_name + set ok 1 +-- +2.35.3 + diff --git a/gdb-testsuite-fix-valgrind-tests-on-debian.patch b/gdb-testsuite-fix-valgrind-tests-on-debian.patch new file mode 100644 index 0000000..d1453cd --- /dev/null +++ b/gdb-testsuite-fix-valgrind-tests-on-debian.patch @@ -0,0 +1,54 @@ +From 489d8a4ff8c5998dad5a55694e346532695c911b Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 26 Mar 2024 17:32:09 +0100 +Subject: [PATCH 36/48] [gdb/testsuite] Fix valgrind tests on debian + +On debian 12, I run into: +... +(gdb) target remote | vgdb --wait=2 --max-invoke-ms=2500 --pid=618591^M +Remote debugging using | vgdb --wait=2 --max-invoke-ms=2500 --pid=618591^M +relaying data between gdb and process 618591^M +warning: remote target does not support file transfer, \ + attempting to access files from local filesystem.^M +Reading symbols from /lib/ld-linux-aarch64.so.1...^M +(No debugging symbols found in /lib/ld-linux-aarch64.so.1)^M +0x000000000401a980 in ?? () from /lib/ld-linux-aarch64.so.1^M +(gdb) FAIL: gdb.base/valgrind-infcall.exp: target remote for vgdb +... + +The problem is that we're expecting to match either of these regexps: +... + set start_re1 " in \\.?_start " + set start_re2 "\\.?_start \\(\\) at " +... +but there are no dwarf or elf symbols present. + +Fix this by also allowing: +... + set start_re3 "$::hex in \\?\\? \\(\\) from " +... + +Tested on aarch64-linux. + +Approved-By: Tom Tromey +--- + gdb/testsuite/lib/valgrind.exp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/lib/valgrind.exp b/gdb/testsuite/lib/valgrind.exp +index f9096663509..52ef603a803 100644 +--- a/gdb/testsuite/lib/valgrind.exp ++++ b/gdb/testsuite/lib/valgrind.exp +@@ -94,7 +94,8 @@ proc vgdb_start { {active_at_startup 1} } { + if { $active_at_startup } { + set start_re1 " in \\.?_start " + set start_re2 "\\.?_start \\(\\) at " +- gdb_test "$vgdbcmd" "($start_re1|$start_re2).*" \ ++ set start_re3 "$::hex in \\?\\? \\(\\) from " ++ gdb_test "$vgdbcmd" "($start_re1|$start_re2|$start_re3).*" \ + "target remote for vgdb" + } else { + # Let $binfile run a bit before attaching. This is a bit of a hack, +-- +2.35.3 + diff --git a/gdb-testsuite-further-handle-long-filenames-in-gdb.b.patch b/gdb-testsuite-further-handle-long-filenames-in-gdb.b.patch new file mode 100644 index 0000000..b21d5a9 --- /dev/null +++ b/gdb-testsuite-further-handle-long-filenames-in-gdb.b.patch @@ -0,0 +1,49 @@ +From dba128204017c9a12b3b6840bf1e3a6fec83f3e4 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 26 Feb 2024 15:59:47 +0100 +Subject: [PATCH 42/48] [gdb/testsuite] Further handle long filenames in + gdb.base/startup-with-shell.exp + +In commit 52498004a34 ("gdb/testsuite: handle long filenames in +gdb.base/startup-with-shell.exp") we fixed a FAIL reported by the Linaro CI: +... +(gdb) print argv[1] +$1 = 0xfffed978 "/startup-with-shell/unique-file.unique-e"... +(gdb) FAIL: gdb.base/startup-with-shell.exp: startup_with_shell = on; \ + run_args = *.unique-extension: first argument expanded +... + +PR testsuite/31410 reports a similar failure: +... +(gdb) print argv[1] +$1 = 0xfffeda96 "/startup-with-shell/*.unique-extens"... +(gdb) FAIL: gdb.base/startup-with-shell.exp: startup_with_shell = off; \ + run_args = *.unique-extension: first argument not expanded +... + +Fix this in the same way, using "set print characters unlimited". + +Tested on x86_64-linux. + +Approved-By: Tom Tromey + +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31410 +--- + gdb/testsuite/gdb.base/startup-with-shell.exp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gdb/testsuite/gdb.base/startup-with-shell.exp b/gdb/testsuite/gdb.base/startup-with-shell.exp +index 51b1e4fa922..24135972b72 100644 +--- a/gdb/testsuite/gdb.base/startup-with-shell.exp ++++ b/gdb/testsuite/gdb.base/startup-with-shell.exp +@@ -65,6 +65,7 @@ with_test_prefix "startup_with_shell = on; run_args = *.unique-extension" { + + with_test_prefix "startup_with_shell = off; run_args = *.unique-extension" { + initial_setup_simple "off" "$unique_file_dir/*.unique-extension" ++ gdb_test_no_output "set print characters unlimited" + gdb_test "print argv\[1\]" "\\\$$decimal = $hex \"$unique_file_dir/\\\*\.unique-extension\"" \ + "first argument not expanded" + } +-- +2.35.3 + diff --git a/gdb-testsuite-handle-core-without-build-id-in-gdb.ba.patch b/gdb-testsuite-handle-core-without-build-id-in-gdb.ba.patch new file mode 100644 index 0000000..7969335 --- /dev/null +++ b/gdb-testsuite-handle-core-without-build-id-in-gdb.ba.patch @@ -0,0 +1,66 @@ +From 163358e7c426183521d34c96e6959f615862ff1f Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 20 Mar 2024 19:29:18 +0100 +Subject: [PATCH 38/48] [gdb/testsuite] Handle core without build-id in + gdb.base/corefile-buildid.exp + +On aarch64-linux (debian 12), when running test-case gdb.base/corefile-buildid.exp, I get: +... +expecting exec file "debugdir-exec/.build-id/ec/f10ec5d39648774f8c35d3cf757c8db52f5163" +info files^M +Local core dump file:^M + `build-exec/corefile-buildid.core', file type elf64-littleaarch64.^M + 0x0000aaaac1d70000 - 0x0000aaaac1d71000 is load1^M + ... + 0x0000ffffffa8b000 - 0x0000ffffffaac000 is load16^M +(gdb) FAIL: gdb.base/corefile-buildid.exp: exec: info files +... + +The problem is that the test-case expect the build-id to be available in the +core file, while it isn't. + +Fix this by detecting that the build-id isn't available in the core file using eu-readelf, as in +gdb.base/coredump-filter-build-id.exp. + +Tested on aarch64-linux. + +Approved-By: Tom Tromey +--- + gdb/testsuite/gdb.base/corefile-buildid.exp | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.base/corefile-buildid.exp b/gdb/testsuite/gdb.base/corefile-buildid.exp +index 3c2702e0cd3..630e812bd6b 100644 +--- a/gdb/testsuite/gdb.base/corefile-buildid.exp ++++ b/gdb/testsuite/gdb.base/corefile-buildid.exp +@@ -217,7 +217,7 @@ proc locate_exec_from_core_build_id {corefile buildid suffix \ + # of shared and/or stripped/.debug executables. + + proc do_corefile_buildid_tests {args} { +- global binfile testfile srcfile execdir sharedir ++ global binfile testfile srcfile execdir sharedir hex + + # Parse options. + parse_args [list {sepdebug} {shared}] +@@ -266,6 +266,18 @@ proc do_corefile_buildid_tests {args} { + } + verbose -log "corefile is $corefile" + ++ if { [catch "exec [gdb_find_eu-unstrip] -n --core $corefile" output] == 0 } { ++ set line [lindex [split $output "\n"] 0] ++ set binfile_re (?:[string_to_regexp $program_to_run]|\\\[(?:exe|pie)\\\]) ++ if { ![regexp "^${hex}\\+${hex} \[a-f0-9\]+@${hex}.*$binfile_re$" $line] } { ++ unsupported "build id for exec" ++ return ++ } ++ } else { ++ unsupported "eu-unstrip execution" ++ return ++ } ++ + # Grab the build-id from the binary, removing ".debug" from the end. + set buildid [build_id_debug_filename_get $program_to_run] + if {$buildid == ""} { +-- +2.35.3 + diff --git a/gdb-testsuite-handle-pac-marker.patch b/gdb-testsuite-handle-pac-marker.patch new file mode 100644 index 0000000..b357c75 --- /dev/null +++ b/gdb-testsuite-handle-pac-marker.patch @@ -0,0 +1,213 @@ +From f70536d3f72601b286967ed3031a3fb1ce0c834f Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 4 Jan 2024 13:42:45 +0100 +Subject: [PATCH 02/48] [gdb/testsuite] Handle PAC marker + +On aarch64-linux, I run into: +... +FAIL: gdb.base/annota1.exp: backtrace from shlibrary (timeout) +... +due to the PAC marker showing up: +... +^Z^Zframe-address^M +0x000000000041025c [PAC]^M +^Z^Zframe-address-end^M +... + +In the docs the marker is documented as follows: +... +When GDB is debugging the AArch64 architecture, and the program is using the +v8.3-A feature Pointer Authentication (PAC), then whenever the link register +$lr is pointing to an PAC function its value will be masked. When GDB prints +a backtrace, any addresses that required unmasking will be postfixed with the +marker [PAC]. When using the MI, this is printed as part of the addr_flags +field. +... + +Update the test-case to allow the PAC marker. + +Likewise in a few other test-cases. + +While we're at it, rewrite the affected pattern pat_begin in annota1.exp into +a more readable form. Likewise for the corresponding pat_end. + +Tested on aarch64-linux. + +Approved-By: Luis Machado + +PR testsuite/31202 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31202 +--- + gdb/testsuite/gdb.base/annota1.exp | 47 ++++++++++++++++++- + gdb/testsuite/gdb.cp/exception.exp | 8 ++-- + .../gdb.dwarf2/entry-value-typedef.exp | 2 +- + .../gdb.mi/mi-catch-cpp-exceptions.exp | 2 +- + gdb/testsuite/gdb.mi/mi-syn-frame.exp | 2 +- + .../gdb.threads/pthread_cond_wait.exp | 2 +- + gdb/testsuite/gdb.threads/tls.exp | 2 +- + 7 files changed, 54 insertions(+), 11 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp +index 3c2bbb43761..d8552b5be85 100644 +--- a/gdb/testsuite/gdb.base/annota1.exp ++++ b/gdb/testsuite/gdb.base/annota1.exp +@@ -286,9 +286,52 @@ gdb_test_multiple "continue" "continue to printf" { + # annotate-frame-address + # annotate-frame-address-end + # +-set pat_begin "\r\n\032\032post-prompt\r\n\r\n\032\032frame-begin 0 $hex\r\n.0 \r\n(\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n)*\032\032frame-function-name\r\n.*printf(@.*)?\r\n\032\032frame-args\r\n \\(.*frame-end\r\n\r\n\032\032frame-begin 1 $hex\r\n.1 \r\n\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n" ++set pat_begin \ ++ [list \ ++ "\r\n\032\032post-prompt\r\n" \ ++ "\r\n\032\032frame-begin 0 $hex\r\n" \ ++ ".0 \r\n" \ ++ "(" \ ++ "\032\032frame-address\r\n" \ ++ "${hex}( \\\[PAC\\\])?" \ ++ "\r\n\032\032frame-address-end\r\n" \ ++ " in \r\n" \ ++ ")*" \ ++ "\032\032frame-function-name\r\n" \ ++ ".*printf(@.*)?" \ ++ "\r\n\032\032frame-args\r\n" \ ++ " \\(.*frame-end\r\n" \ ++ "\r\n\032\032frame-begin 1 $hex\r\n" \ ++ ".1 " \ ++ "\r\n\032\032frame-address\r\n" \ ++ "${hex}( \\\[PAC\\\])?" \ ++ "\r\n\032\032frame-address-end\r\n" \ ++ " in " \ ++ "\r\n\032\032frame-function-name\r\n" \ ++ "main" \ ++ "\r\n\032\032frame-args\r\n" \ ++ " \\(\\)" \ ++ "\r\n\032\032frame-source-begin\r\n" \ ++ " at " \ ++ "\r\n\032\032frame-source-file\r\n"] ++ ++set pat_begin [join $pat_begin ""] ++ ++set pat_end \ ++ [list \ ++ "\r\n\032\032frame-source-file-end\r\n" \ ++ ":" \ ++ "\r\n\032\032frame-source-line\r\n" \ ++ ".*" \ ++ "\r\n\032\032frame-source-end\r\n\r\n" \ ++ "\r\n\032\032frame-end\r\n" \ ++ "(" \ ++ "\r\n\032\032frame-begin .*\r\n" \ ++ "\r\n\032\032frame-end\r\n" \ ++ ")*" \ ++ "$gdb_prompt$"] + +-set pat_end "\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032frame-end\r\n(\r\n\032\032frame-begin .*\r\n\r\n\032\032frame-end\r\n)*$gdb_prompt$" ++set pat_end [join $pat_end ""] + + gdb_test_multiple "backtrace" "backtrace from shlibrary" { + -re "$pat_begin$escapedsrcfile$pat_end" { +diff --git a/gdb/testsuite/gdb.cp/exception.exp b/gdb/testsuite/gdb.cp/exception.exp +index 2c7ef7793ee..03dd0cb3aeb 100644 +--- a/gdb/testsuite/gdb.cp/exception.exp ++++ b/gdb/testsuite/gdb.cp/exception.exp +@@ -111,7 +111,7 @@ gdb_test "continue" \ + + set name "backtrace after first throw" + gdb_test_multiple "backtrace" $name { +- -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_throw\[\[:>:\]\].*#\[0-9\]+${ws}$hex in foo \\(i=20\\) at .*${srcfile}:\[0-9\]+\r\n#\[0-9\]+${ws}$hex in main \\(.*\\) at .*${srcfile}:\[0-9\]+\r\n$gdb_prompt $" { ++ -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_throw\[\[:>:\]\].*#\[0-9\]+${ws}$hex (\\\[PAC\\\] )?in foo \\(i=20\\) at .*${srcfile}:\[0-9\]+\r\n#\[0-9\]+${ws}$hex in main \\(.*\\) at .*${srcfile}:\[0-9\]+\r\n$gdb_prompt $" { + # Either __cxxabiv1::__cxa_throw or __cxa_throw can be printed + # depending on debug info presence. + pass $name +@@ -129,7 +129,7 @@ gdb_test "continue" \ + + set name "backtrace after first catch" + gdb_test_multiple "backtrace" $name { +- -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_begin_catch\[\[:>:\]\].*#\[0-9\]+${ws}$hex in main \\(.*\\) at .*$srcfile:\[0-9\]+\r\n$gdb_prompt $" { ++ -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_begin_catch\[\[:>:\]\].*#\[0-9\]+${ws}$hex (\\\[PAC\\\] )?in main \\(.*\\) at .*$srcfile:\[0-9\]+\r\n$gdb_prompt $" { + pass $name + } + } +@@ -148,7 +148,7 @@ gdb_test "continue" \ + + set name "backtrace after second throw" + gdb_test_multiple "backtrace" $name { +- -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_throw\[\[:>:\]\].*#\[0-9\]+${ws}$hex in foo \\(i=20\\) at .*${srcfile}:\[0-9\]+\r\n#\[0-9\]+${ws}$hex in main \\(.*\\) at .*${srcfile}:\[0-9\]+\r\n$gdb_prompt $" { ++ -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_throw\[\[:>:\]\].*#\[0-9\]+${ws}$hex (\\\[PAC\\\] )?in foo \\(i=20\\) at .*${srcfile}:\[0-9\]+\r\n#\[0-9\]+${ws}$hex in main \\(.*\\) at .*${srcfile}:\[0-9\]+\r\n$gdb_prompt $" { + pass $name + } + } +@@ -164,7 +164,7 @@ gdb_test "continue" \ + + set name "backtrace after second catch" + gdb_test_multiple "backtrace" $name { +- -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_begin_catch\[\[:>:\]\].*#\[0-9\]+${ws}$hex in main \\(.*\\) at .*$srcfile:\[0-9\]+\r\n$gdb_prompt $" { ++ -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_begin_catch\[\[:>:\]\].*#\[0-9\]+${ws}$hex (\\\[PAC\\\] )?in main \\(.*\\) at .*$srcfile:\[0-9\]+\r\n$gdb_prompt $" { + pass $name + } + } +diff --git a/gdb/testsuite/gdb.dwarf2/entry-value-typedef.exp b/gdb/testsuite/gdb.dwarf2/entry-value-typedef.exp +index b56c9ceab6a..3d25e2a50b9 100644 +--- a/gdb/testsuite/gdb.dwarf2/entry-value-typedef.exp ++++ b/gdb/testsuite/gdb.dwarf2/entry-value-typedef.exp +@@ -42,4 +42,4 @@ gdb_test "continue" "Catchpoint $::decimal \\(exception thrown\\).*" + + # Without the corresponding fix, GDB would hit an internal error before + # printing the frame for main. +-gdb_test "backtrace" " $::hex in func \\(t=t@entry=@$::hex: 1234\\).* $::hex in main .*" ++gdb_test "backtrace" " $::hex (\\\[PAC\\\] )?in func \\(t=t@entry=@$::hex: 1234\\).* $::hex in main .*" +diff --git a/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp b/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp +index 595ae929e9a..1f119ec3a87 100644 +--- a/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp ++++ b/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp +@@ -68,7 +68,7 @@ proc continue_to_next_exception { func line testname } { + mi_expect_stop "exception-caught" ".*" ".*" ".*" ".*" \ + {} "run until an exception is caught: $testname" + mi_gdb_test "-stack-list-frames 1 1" \ +- "\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"${func}\",.*,line=\"${line}\".*\}\\\]" \ ++ "\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",(addr_flags=\"PAC\",)?func=\"${func}\",.*,line=\"${line}\".*\}\\\]" \ + "check previous frame: $testname" + } + +diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.exp b/gdb/testsuite/gdb.mi/mi-syn-frame.exp +index 40df312a1cc..dd484cd80fa 100644 +--- a/gdb/testsuite/gdb.mi/mi-syn-frame.exp ++++ b/gdb/testsuite/gdb.mi/mi-syn-frame.exp +@@ -76,7 +76,7 @@ mi_gdb_test "406-data-evaluate-expression have_a_very_merry_interrupt()" \ + # in this next output. + + mi_gdb_test "407-stack-list-frames" \ +- "407\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"handler\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"\"\},.*frame=\{level=\"$decimal\",addr=\"$hex\",func=\"have_a_very_merry_interrupt\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\}.*\\\]" \ ++ "407\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"handler\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"\"\},.*frame=\{level=\"$decimal\",addr=\"$hex\",(addr_flags=\"PAC\",)?func=\"have_a_very_merry_interrupt\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\}.*\\\]" \ + "list stack frames, with signal handler and dummy frame" + + +diff --git a/gdb/testsuite/gdb.threads/pthread_cond_wait.exp b/gdb/testsuite/gdb.threads/pthread_cond_wait.exp +index ff3097cb519..b29be9e4191 100644 +--- a/gdb/testsuite/gdb.threads/pthread_cond_wait.exp ++++ b/gdb/testsuite/gdb.threads/pthread_cond_wait.exp +@@ -51,7 +51,7 @@ global decimal + # + # This is a "backtrace break" ("btb"): + # +-set btb "\[^\r\n\]+\[\r\n\]+\#${decimal}\[ \t\]+${hex} in " ++set btb "\[^\r\n\]+\[\r\n\]+\#${decimal}\[ \t\]+${hex} (\\\[PAC\\\] )?in " + + # One of the threads is blocked on a call to pthread_cond_wait, and + # we want to verify that we are able to get a sensible backtrace for +diff --git a/gdb/testsuite/gdb.threads/tls.exp b/gdb/testsuite/gdb.threads/tls.exp +index 89f6fb89bac..91a7f80b438 100644 +--- a/gdb/testsuite/gdb.threads/tls.exp ++++ b/gdb/testsuite/gdb.threads/tls.exp +@@ -132,7 +132,7 @@ proc check_thread_stack {number spin_threads spin_threads_level} { + } + send_gdb "where\n" + gdb_expect { +- -re ".*(\[0-9\]+)\[ \t\]+$hex in spin \\(vp=(0x\[0-9a-f\]+).*\r\n$gdb_prompt $" { ++ -re ".*(\[0-9\]+)\[ \t\]+$hex (\\\[PAC\\\] )?in spin \\(vp=(0x\[0-9a-f\]+).*\r\n$gdb_prompt $" { + if {[info exists tarr($number)]} { + fail "backtrace of thread number $number in spin" + } else { +-- +2.35.3 + diff --git a/gdb-testsuite-make-gdb.base-solib-search.exp-more-ro.patch b/gdb-testsuite-make-gdb.base-solib-search.exp-more-ro.patch new file mode 100644 index 0000000..0ce3dc5 --- /dev/null +++ b/gdb-testsuite-make-gdb.base-solib-search.exp-more-ro.patch @@ -0,0 +1,93 @@ +From 17ab80b7af4c388c44d0981d76de396d85bcba76 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 8 Jan 2024 10:37:44 +0100 +Subject: [PATCH 05/48] [gdb/testsuite] Make gdb.base/solib-search.exp more + robust + +On aarch64-linux, with gcc 13.2.1, I run into: +... + (gdb) backtrace^M + #0 break_here () at solib-search.c:30^M + #1 0x0000fffff7f20194 in lib2_func4 () at solib-search-lib2.c:50^M + #2 0x0000fffff7f70194 in lib1_func3 () at solib-search-lib1.c:50^M + #3 0x0000fffff7f20174 in lib2_func2 () at solib-search-lib2.c:30^M + #4 0x0000fffff7f70174 in lib1_func1 () at solib-search-lib1.c:30^M + #5 0x00000000004101b4 in main () at solib-search.c:23^M + (gdb) PASS: gdb.base/solib-search.exp: \ + backtrace (with wrong libs) (data collection) + FAIL: gdb.base/solib-search.exp: backtrace (with wrong libs) +... + +The FAIL is generated by this code in the test-case: +... + if { $expect_fail } { + # If the backtrace output is correct the test isn't sufficiently + # testing what it should. + if { $count == $total_expected } { + set fail 1 + } +... + +The test-case: +- builds two versions of two shared libs, a "right" and "wrong" version, the + difference being an additional dummy function (called spacer function), +- uses the "right" version to generate a core file, +- uses the "wrong" version to interpret the core file, and +- generates a backtrace. + +The intent is that the backtrace is incorrect due to using the "wrong" +version, but actually it's correct. This is because the spacer functions +aren't large enough. + +Fix this by increasing the size of the spacer functions by adding a dummy +loop, after which we have, as expected, an incorrect backtrace: +... + (gdb) backtrace^M + #0 break_here () at solib-search.c:30^M + #1 0x0000fffff7f201c0 in ?? ()^M + #2 0x0000fffff7f20174 in lib2_func2 () at solib-search-lib2.c:30^M + #3 0x0000fffff7f20174 in lib2_func2 () at solib-search-lib2.c:30^M + #4 0x0000fffff7f70174 in lib1_func1 () at solib-search-lib1.c:30^M + #5 0x00000000004101b4 in main () at solib-search.c:23^M + (gdb) PASS: gdb.base/solib-search.exp: \ + backtrace (with wrong libs) (data collection) + PASS: gdb.base/solib-search.exp: backtrace (with wrong libs) +... + +Tested on aarch64-linux. +--- + gdb/testsuite/gdb.base/solib-search-lib1.c | 3 +++ + gdb/testsuite/gdb.base/solib-search-lib2.c | 3 +++ + 2 files changed, 6 insertions(+) + +diff --git a/gdb/testsuite/gdb.base/solib-search-lib1.c b/gdb/testsuite/gdb.base/solib-search-lib1.c +index 76338a8e216..6a4cc9aa1a7 100644 +--- a/gdb/testsuite/gdb.base/solib-search-lib1.c ++++ b/gdb/testsuite/gdb.base/solib-search-lib1.c +@@ -39,6 +39,9 @@ lib1_func1 (void) + void + lib1_spacer (void) + { ++ int i; ++ for (i = 0; i < 10; ++i) ++ ; + } + + #endif +diff --git a/gdb/testsuite/gdb.base/solib-search-lib2.c b/gdb/testsuite/gdb.base/solib-search-lib2.c +index bf7c7bd071c..fb004d7377f 100644 +--- a/gdb/testsuite/gdb.base/solib-search-lib2.c ++++ b/gdb/testsuite/gdb.base/solib-search-lib2.c +@@ -39,6 +39,9 @@ lib2_func2 (void) + void + lib2_spacer (void) + { ++ int i; ++ for (i = 0; i < 10; ++i) ++ ; + } + + #endif +-- +2.35.3 + diff --git a/gdb-testsuite-make-portnum-a-persistent-global.patch b/gdb-testsuite-make-portnum-a-persistent-global.patch new file mode 100644 index 0000000..1d264ba --- /dev/null +++ b/gdb-testsuite-make-portnum-a-persistent-global.patch @@ -0,0 +1,68 @@ +From 81f752e905f9ef4d0f2e046acf3fabcddf952057 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sat, 4 May 2024 10:41:09 +0200 +Subject: [PATCH 17/48] [gdb/testsuite] Make portnum a persistent global + +When instrumenting get_portnum using: +... + puts "PORTNUM: $res" +... +and running: +... +$ cd build/gdb +$ make check TESTS=gdb.server/*.exp +... +we get: +... +Running gdb.server/target-exec-file.exp ... +PORTNUM: 2345 +Running gdb.server/stop-reply-no-thread-multi.exp ... +PORTNUM: 2345 +PORTNUM: 2346 +PORTNUM: 2347 +PORTNUM: 2348 +PORTNUM: 2349 +PORTNUM: 2350 +... + +So, while get_portnum does return increasing numbers in a single test-case, it +restarts at each test-case. + +This is a regression since the introduction of persistent globals. + +Fix this by using "gdb_persistent_global portnum", such that we get: +... +Running gdb.server/target-exec-file.exp ... +PORTNUM: 2345 +Running gdb.server/stop-reply-no-thread-multi.exp ... +PORTNUM: 2346 +PORTNUM: 2347 +PORTNUM: 2348 +PORTNUM: 2349 +PORTNUM: 2350 +PORTNUM: 2351 +... + +Tested on aarch64-linux. + +Approved-By: Tom Tromey +--- + gdb/testsuite/lib/gdbserver-support.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp +index 8aaca946b7d..4f7effaacf7 100644 +--- a/gdb/testsuite/lib/gdbserver-support.exp ++++ b/gdb/testsuite/lib/gdbserver-support.exp +@@ -142,7 +142,7 @@ proc get_portnum {} { + set initial_portnum 2345 + + # Currently available port number. +- global portnum ++ gdb_persistent_global portnum + + # Initialize, if necessary. + if { ![info exists portnum] } { +-- +2.35.3 + diff --git a/gdb-testsuite-move-gpu-parallel.lock-to-cache-dir.patch b/gdb-testsuite-move-gpu-parallel.lock-to-cache-dir.patch new file mode 100644 index 0000000..604a3c8 --- /dev/null +++ b/gdb-testsuite-move-gpu-parallel.lock-to-cache-dir.patch @@ -0,0 +1,42 @@ +From 40ffee49122d3856292d2374c25f619805f76f1f Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sat, 4 May 2024 10:41:09 +0200 +Subject: [PATCH 20/48] [gdb/testsuite] Move gpu-parallel.lock to cache dir + +The lock directory returned by lock_dir is currently $objdir. + +It seems possible to leave a stale lock file that blocks progress in a +following run. + +Fix this by using a directory that is guaranteed to be initially empty when +using GDB_PARALLEL, like temp or cache. + +In gdb/testsuite/README I found: +... +cache in particular is used to share data across invocations of runtest +... +which seems appropriate, so let's use cache for this. + +Tested on aarch64-linux. + +Approved-By: Tom Tromey +--- + gdb/testsuite/lib/gdb-utils.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/lib/gdb-utils.exp b/gdb/testsuite/lib/gdb-utils.exp +index 63f6b8c3698..cfaa7905997 100644 +--- a/gdb/testsuite/lib/gdb-utils.exp ++++ b/gdb/testsuite/lib/gdb-utils.exp +@@ -180,7 +180,7 @@ proc lock_file_release {info} { + # Return directory where we keep lock files. + + proc lock_dir {} { +- return $objdir ++ return [make_gdb_parallel_path cache] + } + + # Run body under lock LOCK_FILE. +-- +2.35.3 + diff --git a/gdb-testsuite-prevent-compilation-fails-with-unix-fpie-pie.patch b/gdb-testsuite-prevent-compilation-fails-with-unix-fpie-pie.patch new file mode 100644 index 0000000..d239794 --- /dev/null +++ b/gdb-testsuite-prevent-compilation-fails-with-unix-fpie-pie.patch @@ -0,0 +1,132 @@ +From 469aebc4403f2135d02cb15dba1739264a4c1a17 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 21 Apr 2023 18:01:00 +0200 +Subject: [PATCH 1/2] Prevent compilation fails with unix/-fPIE/-pie + +A regular test-case will produce an executable, and depending on the compiler +default, it will be a PIE or not. A test-case can force one or the other +using the pie and nopie options. + +However, when running with target board unix/-fPIE/-pie, the nopie option will +have no effect, and likewise for target board unix/-fno-PIE/-no-pie and the +pie option. + +When say we run test-case gdb.base/attach-pie-noexec.exp, which passes the pie +option with target board unix/-fno-PIE/-no-pie we get: +... + Running src/gdb/testsuite/gdb.base/attach-pie-noexec.exp ... + gdb compile failed, pie failed to generate PIE executable + + === gdb Summary === + + # of untested testcases 1 +... + +However, this works only when we actually manage to generate an executable. + +There are other test-cases, like f.i. gdb.arch/amd64-disp-step.exp that +specify nopie, but will generate a compilation failure with target board +unix/-fPIE/-pie due to using a hard-coded .S file: +... + Running src/gdb/testsuite/gdb.arch/amd64-disp-step.exp ... + gdb compile failed, ld: outputs/gdb.arch/amd64-disp-step/amd64-disp-step0.o: \ + relocation R_X86_64_32S against `.text' can not be used when making a PIE \ + object; recompile with -fPIE + collect2: error: ld returned 1 exit status + + === gdb Summary === + + # of untested testcases 1 +... + +Hide this compilation error by: +- adding a gdb_caching_proc pie_forced, and +- using it in gdb_compile to bail out before even trying compilation +such that we simply have: +... +UNTESTED: gdb.arch/amd64-disp-step.exp: failed to prepare +... + +Likewise, add nopie_forced. + +Tested on x86_64-linux. +--- + gdb/testsuite/lib/gdb.exp | 53 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 53 insertions(+) + +diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp +index 6c1f59ef4a6..09bb7cc30e4 100644 +--- a/gdb/testsuite/lib/gdb.exp ++++ b/gdb/testsuite/lib/gdb.exp +@@ -5519,6 +5519,17 @@ proc gdb_compile {source dest type options} { + set options [lreplace $options $macros $macros $flag] + } + ++ if { $pie != -1 && [nopie_forced] } { ++ set result "pie unsupported" ++ verbose -log "gdb_compile: $result" ++ return $result ++ } ++ if { $nopie != -1 && [pie_forced] } { ++ set result "nopie unsupported" ++ verbose -log "gdb_compile: $result" ++ return $result ++ } ++ + if { $type == "executable" } { + if { ([istarget "*-*-mingw*"] + || [istarget "*-*-*djgpp"] +@@ -9608,6 +9619,48 @@ gdb_caching_proc linker_supports_image_base_flag {} { + } + + ++# Helper function for pie_forced. ++proc pie_forced_0 { } { return 0 } ++ ++# Return 1 if nopie fails to prevent a PIE, 0 if nopie prevented a PIE, ++# and -1 if an error occurred. ++gdb_caching_proc pie_forced {} { ++ set me "pie_forced" ++ set src { int main() { return 0; } } ++ # gdb_compile calls pie_forced when nopie is passed, so pretend it ++ # returns 0, to allow us to find out the actual pie_forced value. ++ with_override pie_forced pie_forced_0 { ++ gdb_simple_compile $me $src executable nopie ++ } ++ set res [exec_is_pie $obj] ++ if { $res == -1 } { ++ return -1 ++ } ++ set res [expr $res == 1] ++ return $res ++} ++ ++# Helper function for nopie_forced. ++proc nopie_forced_0 {} { return 0 } ++ ++# Return 1 if pie fails to generated a PIE, 0 if pie generated a PIE, ++# and -1 if an error occurred. ++gdb_caching_proc nopie_forced {} { ++ set me "nopie_forced" ++ set src { int main() { return 0; } } ++ # gdb_compile calls nopie_forced when pie is passed, so pretend it ++ # returns 0, to allow us to find out the actual nopie_forced value. ++ with_override nopie_forced nopie_forced_0 { ++ gdb_simple_compile $me $src executable pie ++ } ++ set res [exec_is_pie $obj] ++ if { $res == -1 } { ++ return -1 ++ } ++ set res [expr $res == 0] ++ return $res ++} ++ + # Return 1 if compiler supports scalar_storage_order attribute, otherwise + # return 0. + gdb_caching_proc supports_scalar_storage_order_attribute {} { + +base-commit: adfcabe4cc43766996a61bdf08ce1e9db7f18dcc +-- +2.35.3 + diff --git a/gdb-testsuite-remove-spurious-in-save_vars.patch b/gdb-testsuite-remove-spurious-in-save_vars.patch new file mode 100644 index 0000000..63cdf99 --- /dev/null +++ b/gdb-testsuite-remove-spurious-in-save_vars.patch @@ -0,0 +1,53 @@ +From d3fbb4d91ba2784df267fe1ac2e9ec42581a6fac Mon Sep 17 00:00:00 2001 +From: Simon Marchi +Date: Mon, 15 Jan 2024 16:23:42 +0000 +Subject: [PATCH] gdb/testsuite: remove spurious $ in save_vars + +I noticed that running the whole testsuite in serial mode (which means +all the .exp files are ran in the same TCL environment, one after the +other) with the native-extended-gdbserver board caused some weird +failures, for instance a lot of internal errors in the reverse tests, +like: + + continue^M + Continuing.^M + /home/jenkins/workspace/binutils-gdb_master_linuxbuild/platform/deb12-amd64/target_board/native-extended-gdbserver/src/binutils-gdb/gdb/remot e.c:6922: internal-error: resume: Assertion `scope_ptid == inferior_ptid' failed.^M + A problem internal to GDB has been detected,^M + further debugging may prove unreliable.^M + ----- Backtrace -----^M + FAIL: gdb.reverse/break-precsave.exp: run to end of main (GDB internal error) + +This only happens after running gdb.multi/attach-while-running.exp. +That test does not restore GDBFLAGS properly when it's done, it leaves +`-ex \"maint set target-non-stop on\""` in there, which breaks some +subsequent tests. The problem is that this line: + + save_vars { $::GDBFLAGS } { + +should not use a `$` before the variable name. Passes the content of +`::GDBFLAGS` to save_vars, which is not what we want. We want to pass +the `::GDBFLAGS` string. Fix that. + +Change-Id: I5ad32c527795fd10d0d94020e4fd15cebaca3a77 +--- + gdb/testsuite/gdb.multi/attach-while-running.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.multi/attach-while-running.exp b/gdb/testsuite/gdb.multi/attach-while-running.exp +index d3e0d462413..8fce34eaa65 100644 +--- a/gdb/testsuite/gdb.multi/attach-while-running.exp ++++ b/gdb/testsuite/gdb.multi/attach-while-running.exp +@@ -46,7 +46,7 @@ if { [build_executable "failed to prepare" ${testfile} ${srcfile}] } { + } + + proc do_test {} { +- save_vars { $::GDBFLAGS } { ++ save_vars { ::GDBFLAGS } { + append ::GDBFLAGS " -ex \"maint set target-non-stop on\"" + clean_restart $::binfile + } + +base-commit: 08ce0d63c343f7db9a504d37de25391a997b46e2 +-- +2.35.3 + diff --git a/gdb-testsuite-reset-errcnt-and-warncnt-in-default_gd.patch b/gdb-testsuite-reset-errcnt-and-warncnt-in-default_gd.patch new file mode 100644 index 0000000..68f087e --- /dev/null +++ b/gdb-testsuite-reset-errcnt-and-warncnt-in-default_gd.patch @@ -0,0 +1,68 @@ +From 37b67fd94ed38959fecc67847666b758b29fe31c Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 27 Feb 2024 16:24:15 +0100 +Subject: [PATCH 40/48] [gdb/testsuite] Reset errcnt and warncnt in + default_gdb_init + +Say we do: +... +$ make check RUNTESTFLAGS="gdb.dap/ada-nested.exp gdb.dap/pause.exp" +... +and add a perror at the end of pause.exp: +... + dap_shutdown ++ ++perror "foo" +... + +We run into: +... +UNRESOLVED: gdb.dap/ada-nested.exp: compilation prog.adb +... + +This happens because the perror increases the errcnt, which is not reset at +the end of the test-case, and consequently the first pass in the following +test-case is changed into an unresolved. + +Version 1.6.3 of dejagnu contains a fix which produces an unresolved at the +end of the test-case, which does reset the errcnt, but this is with version +1.6.1. + +Furthermore, we reset the errcnt in clean_restart, but the pass is produced +before, so that doesn't help either. + +Fix this by resetting errcnt and warncnt in default_gdb_init. + +Tested on x86_64-linux. + +Approved-By: Tom Tromey + +PR testsuite/31351 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31351 +--- + gdb/testsuite/lib/gdb.exp | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp +index 70c2db4ac84..990d0c8a70f 100644 +--- a/gdb/testsuite/lib/gdb.exp ++++ b/gdb/testsuite/lib/gdb.exp +@@ -6851,6 +6851,15 @@ proc default_gdb_init { test_file_name } { + return [uplevel 1 ::gdb_tcl_unknown $args] + } + } ++ ++ # Dejagnu version 1.6.3 and later produce an unresolved at the end of a ++ # testcase if an error triggered, resetting errcnt and warncnt to 0, in ++ # order to avoid errors in one test-case influencing the following ++ # test-case. Do this manually here, to support older versions. ++ global errcnt ++ global warncnt ++ set errcnt 0 ++ set warncnt 0 + } + + # Return a path using GDB_PARALLEL. +-- +2.35.3 + diff --git a/gdb-testsuite-simplify-gdb.server-server-kill-python.patch b/gdb-testsuite-simplify-gdb.server-server-kill-python.patch new file mode 100644 index 0000000..3156050 --- /dev/null +++ b/gdb-testsuite-simplify-gdb.server-server-kill-python.patch @@ -0,0 +1,65 @@ +From afab95df8ff5b3bc57e3cacca813df987ce84af2 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 17 Apr 2024 11:45:02 +0200 +Subject: [PATCH 27/48] [gdb/testsuite] Simplify + gdb.server/server-kill-python.exp + +In test-case gdb.server/server-kill-python.exp we have: +... +if {[gdb_spawn_with_cmdline_opts \ + "-quiet -iex \"set height 0\" -iex \"set width 0\" -ex \"source $host_file1\""] != 0} { + fail "spawn" + return +} +... + +I reproduced the problem by reverting the fix at the commit adding both the +fix and the test-case, and the reproduced the same problem using: +... +(gdb) source $host_file1 +... +so there doesn't seem to be a specific need to source the python file using +"-ex". + +Simplify the test-case by sourcing the python file using send_gdb. + +This also allow us to simplify the python script. + +Tested on x86_64-linux. +--- + gdb/testsuite/gdb.server/server-kill-python.exp | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/gdb/testsuite/gdb.server/server-kill-python.exp b/gdb/testsuite/gdb.server/server-kill-python.exp +index ae85791c770..dcb6eddd6eb 100644 +--- a/gdb/testsuite/gdb.server/server-kill-python.exp ++++ b/gdb/testsuite/gdb.server/server-kill-python.exp +@@ -48,8 +48,6 @@ puts $fd \ + "import gdb + + def do_gdb_stuff (): +- gdb.execute ('file $host_binfile') +- gdb.execute ('target $gdbserver_protocol $gdbserver_gdbport') + gdb.execute ('break $srcfile:$break_linenr') + gdb.execute ('continue') + gdb.execute ('p server_pid') +@@ -63,11 +61,15 @@ set host_file1 [gdb_remote_download host $file1] + # Now start GDB, sourcing the python command file we generated above. + # Set the height and width so we don't end up at a paging prompt. + if {[gdb_spawn_with_cmdline_opts \ +- "-quiet -iex \"set height 0\" -iex \"set width 0\" -ex \"source $host_file1\""] != 0} { ++ "-quiet -iex \"set height 0\" -iex \"set width 0\""] != 0} { + fail "spawn" + return + } + ++gdb_load $binfile ++gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport ++send_gdb "source $host_file1\n" ++ + # Get the gdbserver PID. + set gdbserver_pid 0 + +-- +2.35.3 + diff --git a/gdb-testsuite-use-find_gnatmake-instead-of-gdb_find_.patch b/gdb-testsuite-use-find_gnatmake-instead-of-gdb_find_.patch new file mode 100644 index 0000000..f25dcd8 --- /dev/null +++ b/gdb-testsuite-use-find_gnatmake-instead-of-gdb_find_.patch @@ -0,0 +1,139 @@ +From 6914ab446b7eb9b284b6bfef8d04c3bacafcaa97 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 18 Apr 2024 17:02:13 +0200 +Subject: [PATCH 26/48] [gdb/testsuite] Use find_gnatmake instead of + gdb_find_gnatmake + +On SLE-11, with an older dejagnu version, I ran into: +... +Running gdb.ada/mi_prot.exp ... +UNRESOLVED: gdb.ada/mi_prot.exp: \ + testcase aborted due to invalid command name: gdb_find_gnatmake +ERROR: tcl error sourcing gdb.ada/mi_prot.exp. +ERROR: invalid command name "gdb_find_gnatmake" + while executing +"::gdb_tcl_unknown gdb_find_gnatmake" + ("uplevel" body line 1) + invoked from within +"uplevel 1 ::gdb_tcl_unknown $args" + (procedure "::unknown" line 5) + invoked from within +"gdb_find_gnatmake" + (procedure "gnatmake_version_at_least" line 2) + invoked from within +... + +Proc gdb_find_gnatmake is actually a backup for find_gnatmake: +... +if {[info procs find_gnatmake] == ""} { + rename gdb_find_gnatmake find_gnatmake +... +so gnatmake_version_at_least should use find_gnatmake instead. + +For a recent dejagnu with find_gnatmake, gdb_find_gnatmake is kept, and we +don't run into this error. + +For an older dejagnu without find_gnatmake, gdb_find_gnatmake is renamed to +find_gnatmake, and we do run into the error. + +It's confusing that we're using the gdb_ prefix for gdb_find_gnatmake, it +seems something legitimate to use. Maybe we should use future_ or gdb_future_ +prefix instead to make this more clear, but I've left that alone for now. + +Fix this by: +- triggering the same error with a recent dejagnu by removing + gdb_find_gnatmake unless used (and likewise for other procs in future.exp), + and +- using find_gnatmake in gnatmake_version_at_least. + +Tested on x86_64-linux. + +Approved-By: Tom Tromey + +PR testsuite/31647 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31647 +--- + gdb/testsuite/lib/ada.exp | 2 +- + gdb/testsuite/lib/future.exp | 15 +++++++++++++++ + 2 files changed, 16 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp +index d45d75994dd..4bf1368f29f 100644 +--- a/gdb/testsuite/lib/ada.exp ++++ b/gdb/testsuite/lib/ada.exp +@@ -151,7 +151,7 @@ proc find_ada_tool {tool} { + # Return 1 if gnatmake is at least version $MAJOR.x.x + + proc gnatmake_version_at_least { major } { +- set gnatmake [gdb_find_gnatmake] ++ set gnatmake [find_gnatmake] + set gnatmake [lindex [split $gnatmake] 0] + if {[catch {exec $gnatmake --version} output]} { + return 0 +diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp +index 807053b8f94..204e11effa4 100644 +--- a/gdb/testsuite/lib/future.exp ++++ b/gdb/testsuite/lib/future.exp +@@ -694,12 +694,16 @@ if {[info procs find_gnatmake] == ""} { + rename gdb_find_gnatmake find_gnatmake + set use_gdb_compile(ada) 1 + gdb_note [join [list $note_prefix "Ada" $note_suffix] ""] ++} else { ++ rename gdb_find_gnatmake "" + } + + if {[info procs find_gfortran] == ""} { + rename gdb_find_gfortran find_gfortran + set use_gdb_compile(fortran) 1 + gdb_note [join [list $note_prefix "Fortran" $note_suffix] ""] ++} else { ++ rename gdb_find_gfortran "" + } + + if {[info procs find_go_linker] == ""} { +@@ -707,24 +711,33 @@ if {[info procs find_go_linker] == ""} { + rename gdb_find_go_linker find_go_linker + set use_gdb_compile(go) 1 + gdb_note [join [list $note_prefix "Go" $note_suffix] ""] ++} else { ++ rename gdb_find_go "" ++ rename gdb_find_go_linker "" + } + + if {[info procs find_gdc] == ""} { + rename gdb_find_gdc find_gdc + set use_gdb_compile(d) 1 + gdb_note [join [list $note_prefix "D" $note_suffix] ""] ++} else { ++ rename gdb_find_gdc "" + } + + if {[info procs find_rustc] == ""} { + rename gdb_find_rustc find_rustc + set use_gdb_compile(rust) 1 + gdb_note [join [list $note_prefix "Rust" $note_suffix] ""] ++} else { ++ rename gdb_find_rustc "" + } + + if {[info procs find_hipcc] == ""} { + rename gdb_find_hipcc find_hipcc + set use_gdb_compile(hip) 1 + gdb_note [join [list $note_prefix "HIP" $note_suffix] ""] ++} else { ++ rename gdb_find_hipcc "" + } + + # If dejagnu's default_target_compile is missing support for any language, +@@ -732,6 +745,8 @@ if {[info procs find_hipcc] == ""} { + if { [array size use_gdb_compile] != 0 } { + catch {rename default_target_compile dejagnu_default_target_compile} + rename gdb_default_target_compile default_target_compile ++} else { ++ rename gdb_default_target_compile "" + } + + +-- +2.35.3 + diff --git a/gdb-testsuite-use-more-progbits-for-arm.patch b/gdb-testsuite-use-more-progbits-for-arm.patch new file mode 100644 index 0000000..bba4283 --- /dev/null +++ b/gdb-testsuite-use-more-progbits-for-arm.patch @@ -0,0 +1,858 @@ +From d9951c3c9ea2e542d071710e9706ed505046fe36 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 24 Nov 2023 15:41:22 +0100 +Subject: [PATCH 48/48] [gdb/testsuite] Use more %progbits for arm + +On pinebook I ran into: +... +Running gdb.tui/tui-layout-asm-short-prog.exp ... +gdb compile failed, gdb.tui/tui-layout-asm-short-prog.S: Assembler messages: +gdb.tui/tui-layout-asm-short-prog.S:23: Error: \ + junk at end of line, first unrecognized character is `,' +... + +Fix this by using %progbits instead of @progbits for arm. + +Approved-by: Luis Machado + +Tested on x86_64-linux and pinebook. +--- + gdb/testsuite/gdb.arch/pr25124.S | 2 +- + gdb/testsuite/gdb.base/dup-sect.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dup-psym.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-bad-elf-other.S | 8 ++++++++ + gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-basic.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S | 4 ++++ + .../gdb.dwarf2/dw2-case-insensitive-debug.S | 8 ++++++++ + gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-compressed.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-const.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-cu-size.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-entry-value.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-filename.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-icycle.S | 12 ++++++++++++ + gdb/testsuite/gdb.dwarf2/dw2-inheritance.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-inline-param.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-intercu.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-intermix.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-noloc.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-op-call.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-param-error.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-producer.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-strp.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-unresolved.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/fission-reread.S | 4 ++++ + .../gdb.dwarf2/frame-inlined-in-outer-frame.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/mac-fileno.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/pr11465.S | 4 ++++ + gdb/testsuite/gdb.dwarf2/pr13961.S | 4 ++++ + gdb/testsuite/gdb.linespec/break-asm-file.exp | 4 ++-- + .../{break-asm-file0.s => break-asm-file0.S} | 12 ++++++++---- + .../{break-asm-file1.s => break-asm-file1.S} | 8 ++++++-- + gdb/testsuite/gdb.mi/dw2-ref-missing-frame.S | 4 ++++ + gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S | 4 ++++ + 59 files changed, 253 insertions(+), 9 deletions(-) + rename gdb/testsuite/gdb.linespec/{break-asm-file0.s => break-asm-file0.S} (96%) + rename gdb/testsuite/gdb.linespec/{break-asm-file1.s => break-asm-file1.S} (97%) + +diff --git a/gdb/testsuite/gdb.arch/pr25124.S b/gdb/testsuite/gdb.arch/pr25124.S +index a7ed1a02472..27b4e683488 100644 +--- a/gdb/testsuite/gdb.arch/pr25124.S ++++ b/gdb/testsuite/gdb.arch/pr25124.S +@@ -33,4 +33,4 @@ main: + mov r0, #0 + bx lr + .size main, .-main +- .section .note.GNU-stack,"",@progbits ++ .section .note.GNU-stack,"",%progbits +diff --git a/gdb/testsuite/gdb.base/dup-sect.S b/gdb/testsuite/gdb.base/dup-sect.S +index e374d578dc0..c51bc91d6d8 100644 +--- a/gdb/testsuite/gdb.base/dup-sect.S ++++ b/gdb/testsuite/gdb.base/dup-sect.S +@@ -20,4 +20,8 @@ var1: .byte 1 + + .section sect2, "a" + var2: .byte 2 ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dup-psym.S b/gdb/testsuite/gdb.dwarf2/dup-psym.S +index ec180e65080..4e50c0fe885 100644 +--- a/gdb/testsuite/gdb.dwarf2/dup-psym.S ++++ b/gdb/testsuite/gdb.dwarf2/dup-psym.S +@@ -197,4 +197,8 @@ func_cu1: + .byte 1 + + .Lline1_end: ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S +index f0276adf3be..e1fccd1979f 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S +@@ -149,4 +149,8 @@ LELTP: + .uleb128 0x1 + .byte 0x1 + LELT: ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S +index 59dd26c3c85..2ff445e36a4 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S +@@ -149,4 +149,8 @@ LELTP: + .uleb128 0x1 + .byte 0x1 + LELT: ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.S b/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.S +index 960a97c39a8..d58c8bfedf8 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.S +@@ -53,4 +53,8 @@ debug_end: + .byte 0x0 + .byte 0x0 + .byte 0x0 ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.S b/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.S +index 2c62b613c57..dc6b86648bd 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.S +@@ -375,4 +375,8 @@ + + .section .debug_line + .Ldebug_line0: ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.S b/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.S +index 8b88ba6d1ef..45cd7c42fb8 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.S +@@ -246,4 +246,8 @@ func_cu2: + .byte 1 + + .Lline1_end: ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-elf-other.S b/gdb/testsuite/gdb.dwarf2/dw2-bad-elf-other.S +index d90d4e2b4ac..192bfac844f 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-bad-elf-other.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-elf-other.S +@@ -15,7 +15,11 @@ + + .section ".other", "x" + .global some_func, some_func_end ++#ifdef __arm__ ++ .type some_func, %function ++#else + .type some_func, @function ++#endif + nop + nop + nop +@@ -27,4 +31,8 @@ some_func: + .size some_func,.-some_func + some_func_end: + nop ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.S b/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.S +index d7654bb1c14..10ea1ae24cb 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.S +@@ -71,4 +71,8 @@ debug_end: + .byte 0x0 + .byte 0x0 + .byte 0x0 ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-basic.S b/gdb/testsuite/gdb.dwarf2/dw2-basic.S +index 372ab23cb3b..7b37162b037 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-basic.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-basic.S +@@ -197,4 +197,8 @@ func_cu1: + .byte 1 + + .Lline1_end: ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S b/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S +index 39e462b7149..ffe29d17a3a 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S +@@ -154,4 +154,8 @@ debug_end: + .byte 0x0 + .byte 0x0 + .byte 0x0 ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S +index 1059ace3b3e..84e6ee9a485 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S +@@ -60,7 +60,11 @@ + /* The .debug_names-based index support depends on + .debug_aranges generated by GCC. (.gdb_index includes a + gdb-generated map instead.) */ ++#ifdef __arm__ ++ .section .debug_aranges,"",%progbits ++#else + .section .debug_aranges,"",@progbits ++#endif + .4byte .Laranges_end - .Laranges_start // Length of Address Ranges Info + .Laranges_start: + .2byte 0x2 // DWARF Version +@@ -126,4 +130,8 @@ + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S b/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S +index 8a8ecfc397b..4d626817f1a 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S +@@ -239,4 +239,8 @@ gcc43: .globl gcc43 + .uleb128 1 + .byte 1 + .Lgcc43_end: ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-compressed.S b/gdb/testsuite/gdb.dwarf2/dw2-compressed.S +index 509fbea4a3b..14cf286f393 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-compressed.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-compressed.S +@@ -218,4 +218,8 @@ func_cu1: + .byte 0x9c + .byte 0x00 + .byte 0x92 ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-const.S b/gdb/testsuite/gdb.dwarf2/dw2-const.S +index dfc882ac530..ff81c18732d 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-const.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-const.S +@@ -249,4 +249,8 @@ func_cu1: + .byte 1 + + .Lline1_end: ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.S b/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.S +index 070f24b407d..e217c736dd8 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.S +@@ -113,4 +113,8 @@ + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-cu-size.S b/gdb/testsuite/gdb.dwarf2/dw2-cu-size.S +index 99465e2c015..b6f8a2117b3 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-cu-size.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-cu-size.S +@@ -107,4 +107,8 @@ + + .byte 0x0 /* Terminator .debug_abbrev + section. */ ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S b/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S +index d0bdce9ef8b..e4d13a8cd04 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S +@@ -74,4 +74,8 @@ dieb: + .byte 0x0 + + .byte 0x0 ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.S b/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.S +index 973d5020342..d4fdb1d3077 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.S +@@ -617,4 +617,8 @@ + .byte 0x0 + .byte 0x0 + ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.S b/gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.S +index 781b87e7115..f44db05f266 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.S +@@ -31,4 +31,8 @@ main_end: + .section .debug_abbrev + .Ldebug_abbrev0: + .byte 0x0 ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.S b/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.S +index d78b7e87ff5..5e08776ba39 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.S +@@ -106,4 +106,8 @@ var: .4byte 1 + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ ++#ifdef __arm__ ++ .type some_func, %function ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.S b/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.S +index ea8dd092cb0..e4678d86695 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.S +@@ -80,4 +80,8 @@ dieb: + .byte 0x0 + + .byte 0x0 ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-entry-value.S b/gdb/testsuite/gdb.dwarf2/dw2-entry-value.S +index 82d4549b8b5..5fdfeecbb09 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-entry-value.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-entry-value.S +@@ -102,4 +102,8 @@ loclist: + .byte 0x0 + .byte 0x0 + .byte 0x0 ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-filename.S b/gdb/testsuite/gdb.dwarf2/dw2-filename.S +index 1cdd94a12f5..a1f0867aed5 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-filename.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-filename.S +@@ -51,4 +51,8 @@ + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.S b/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.S +index f954c4f7cc7..67ba8a47d37 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.S +@@ -252,4 +252,8 @@ debug_info_seg3_end: + .byte 0x08 /* DW_FORM_string. */ + .2byte 0x0000 /* End abbrev. */ + .byte 0x00 /* End abbrev table. */ ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-icycle.S b/gdb/testsuite/gdb.dwarf2/dw2-icycle.S +index 8856eb6e5d3..e432f629cae 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-icycle.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-icycle.S +@@ -18,7 +18,11 @@ + .text + + .Ltext0: ++#ifdef __arm__ ++ .type p__top__middle__inside.3062, %function ++#else + .type p__top__middle__inside.3062, @function ++#endif + p__top__middle__inside.3062: + .LFB4: + .file 1 "p.adb" +@@ -26,7 +30,11 @@ p__top__middle__inside.3062: + .LBE6: + + .globl p__top ++#ifdef __arm__ ++ .type p__top, %function ++#else + .type p__top, @function ++#endif + p__top: + .LFB2: + .4byte 0 +@@ -246,4 +254,8 @@ p__top: + .Lline1_begin: + .byte 0 + ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inheritance.S b/gdb/testsuite/gdb.dwarf2/dw2-inheritance.S +index f83762503ac..1585d8ac576 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-inheritance.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-inheritance.S +@@ -96,4 +96,8 @@ + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-param.S b/gdb/testsuite/gdb.dwarf2/dw2-inline-param.S +index 540bbb38342..c460dddb732 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-param.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-param.S +@@ -150,4 +150,8 @@ + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intercu.S b/gdb/testsuite/gdb.dwarf2/dw2-intercu.S +index a068ba116f9..2cdc3049bc0 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-intercu.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-intercu.S +@@ -314,4 +314,8 @@ func_cu1: + .byte 1 + + .Lline1_end: ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intermix.S b/gdb/testsuite/gdb.dwarf2/dw2-intermix.S +index a9a474e2b7c..010bdb22454 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-intermix.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-intermix.S +@@ -198,4 +198,8 @@ func_cu1: + .byte 1 + + .Lline1_end: ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.S b/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.S +index aa3ec9d486c..8a16022bd8f 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.S +@@ -132,4 +132,8 @@ c: .4byte 0 + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S b/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S +index 4169f720837..cbc1c87bb91 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S +@@ -115,4 +115,8 @@ func2: + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.S b/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.S +index 82236a7091a..6289c36f01e 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.S +@@ -121,4 +121,8 @@ die221: + .string "GNU Modula-2 0.78 (20100402) grafted onto GCC 4.1.2" + .LASF2: + .string "" ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-noloc.S b/gdb/testsuite/gdb.dwarf2/dw2-noloc.S +index 4b742437b56..d9e31d30ed9 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-noloc.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-noloc.S +@@ -324,4 +324,8 @@ resolvable: + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S +index 93abcf6e09a..57c58123fb8 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S +@@ -178,4 +178,8 @@ inner: + .byte 1 + + .Lline1_end: ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S +index 6031ad26d93..99ff8c1151e 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S +@@ -209,4 +209,8 @@ outer_after: + .byte 1 + + .Lline1_end: ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-op-call.S b/gdb/testsuite/gdb.dwarf2/dw2-op-call.S +index 2ae7bae9a4b..e5bba2cf053 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-op-call.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-op-call.S +@@ -166,4 +166,8 @@ loclist: + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.S b/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.S +index 003732618b2..6983f0ed675 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.S +@@ -130,4 +130,8 @@ aa551234: .byte 0xaa, 0x55, 0x12, 0x34 + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-param-error.S b/gdb/testsuite/gdb.dwarf2/dw2-param-error.S +index 3c7ca3c8ad3..a8b8155b966 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-param-error.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-param-error.S +@@ -106,4 +106,8 @@ debug_end: + .byte 0x0 + .byte 0x0 + .byte 0x0 ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-producer.S b/gdb/testsuite/gdb.dwarf2/dw2-producer.S +index ca63697e90d..30338ebd652 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-producer.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-producer.S +@@ -198,4 +198,8 @@ func_cu1: + .byte 1 + + .Lline1_end: ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.S b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.S +index 1091dbc895e..3e3502a441b 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.S +@@ -149,4 +149,8 @@ + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.S b/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.S +index f199994bcdf..5844ebe4f6d 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.S +@@ -167,4 +167,8 @@ d: + .string "sizetype" + .LASF1: + .string "char" ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S b/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S +index d19ee72ebf3..c94147430c3 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S +@@ -397,4 +397,8 @@ loclist: + .byte 1 + + .Lline1_end: ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.S b/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.S +index 8ea03b126ac..6d4a7be3834 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.S +@@ -66,4 +66,8 @@ debug_end: + .byte 0x0 + .byte 0x0 + .byte 0x0 ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-strp.S b/gdb/testsuite/gdb.dwarf2/dw2-strp.S +index dd4eb4fe46a..e0e27ce7548 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-strp.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-strp.S +@@ -176,4 +176,8 @@ + .string "hello world!\n" + .Lemptyname: + .string "" ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unresolved.S b/gdb/testsuite/gdb.dwarf2/dw2-unresolved.S +index c52852d7463..2a0a8de6793 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-unresolved.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-unresolved.S +@@ -178,4 +178,8 @@ SYMBOL(var): .byte 2 + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.S b/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.S +index f2fb3c39a23..2abb4f7ee25 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.S ++++ b/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.S +@@ -90,4 +90,8 @@ + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.S b/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.S +index d4b4bb64a3c..4678c0fe0f2 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.S ++++ b/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.S +@@ -85,4 +85,8 @@ types_start: + .byte 0x0 + .byte 0x0 + .byte 0x0 ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/fission-reread.S b/gdb/testsuite/gdb.dwarf2/fission-reread.S +index bdb20e76330..6171453c4a5 100644 +--- a/gdb/testsuite/gdb.dwarf2/fission-reread.S ++++ b/gdb/testsuite/gdb.dwarf2/fission-reread.S +@@ -460,4 +460,8 @@ SYMBOL(main): + .Ldebug_addr0: + .4byte .LFB0 /* DW_AT_low_pc */ + .4byte SYMBOL(baz) /* DW_AT_location */ ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S +index 7e5971c50c9..a41b2851394 100644 +--- a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S ++++ b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S +@@ -164,4 +164,8 @@ __start_high_pc: + + .global __cu_high_pc + __cu_high_pc: ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/mac-fileno.S b/gdb/testsuite/gdb.dwarf2/mac-fileno.S +index 77730401515..71401bc81c7 100644 +--- a/gdb/testsuite/gdb.dwarf2/mac-fileno.S ++++ b/gdb/testsuite/gdb.dwarf2/mac-fileno.S +@@ -209,4 +209,8 @@ func_cu1: + .uleb128 0x0 /* Included from line number 0 */ + .uleb128 0x0 /* Filename we just started (bug: number too small) */ + .byte 0x0 /* end of CU's macro information */ ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/pr11465.S b/gdb/testsuite/gdb.dwarf2/pr11465.S +index 5308abebee0..b974f0e9c63 100644 +--- a/gdb/testsuite/gdb.dwarf2/pr11465.S ++++ b/gdb/testsuite/gdb.dwarf2/pr11465.S +@@ -360,4 +360,8 @@ die149: .uleb128 0x16 /* DW_TAG_variable */ + .LASF4: + .string "GNU C++ 4.4.2" + .ident "GCC: (GNU) 4.4.2" ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.dwarf2/pr13961.S b/gdb/testsuite/gdb.dwarf2/pr13961.S +index fc9d7afa838..4c1162591c3 100644 +--- a/gdb/testsuite/gdb.dwarf2/pr13961.S ++++ b/gdb/testsuite/gdb.dwarf2/pr13961.S +@@ -378,4 +378,8 @@ SYMBOL(main): + .LASF3: + .string "main" + ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.S b/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.S +index 684b9d93541..e37b04a4219 100644 +--- a/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.S ++++ b/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.S +@@ -163,4 +163,8 @@ + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +diff --git a/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S b/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S +index d577804e4bb..461e322628a 100644 +--- a/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S ++++ b/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S +@@ -20,4 +20,8 @@ _start: + .rept 5 + nop + .endr ++#ifdef __arm__ ++ .section .note.GNU-stack,"",%progbits ++#else + .section .note.GNU-stack,"",@progbits ++#endif +-- +2.35.3 + diff --git a/gdb-testsuite-use-unique-portnum-in-parallel-testing-check-slash-slash-case.patch b/gdb-testsuite-use-unique-portnum-in-parallel-testing-check-slash-slash-case.patch new file mode 100644 index 0000000..fb67c05 --- /dev/null +++ b/gdb-testsuite-use-unique-portnum-in-parallel-testing-check-slash-slash-case.patch @@ -0,0 +1,95 @@ +From f24d498c972be365c72c99f14ada42e3a300b3c4 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sat, 4 May 2024 10:41:09 +0200 +Subject: [PATCH 22/48] [gdb/testsuite] Use unique portnum in parallel testing + (check//% case) + +Make target check//% is the gdb variant of a similar gcc make target [1]. + +When running tests using check//%: +... +$ cd build/gdb +$ make check//unix/{-fPIE/-pie,-fno-PIE/-no-pie} -j2 TESTS=gdb.server/*.exp +... +we get: +... +$ cat build/gdb/testsuite.unix.-fPIE.-pie/cache/portnum +2427 +$ cat build/gdb/testsuite.unix.-fno-PIE.-no-pie/cache/portnum +2423 +... + +The problem is that there are two portnum files used in parallel. + +Fix this by: +- creating a common lockdir build/gdb/testsuite.lockdir for make target + check//%, +- passing this down to the runtests invocations using variable GDB_LOCK_DIR, + and +- using GDB_LOCK_DIR in lock_dir. + +Tested on aarch64-linux. + +Approved-By: Tom Tromey + +PR testsuite/31632 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31632 + +[1] https://gcc.gnu.org/install/test.html +--- + gdb/Makefile.in | 8 ++++++-- + gdb/testsuite/lib/gdb-utils.exp | 5 +++++ + 2 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/gdb/Makefile.in b/gdb/Makefile.in +index 68e10cf47d8..f742eb5d009 100644 +--- a/gdb/Makefile.in ++++ b/gdb/Makefile.in +@@ -1971,6 +1971,10 @@ check-parallel: force + $(MAKE) $(TARGET_FLAGS_TO_PASS) check-parallel; \ + else true; fi + ++testsuite.lockdir: force ++ rm -rf $@ ++ mkdir -p $@ ++ + # The idea is to parallelize testing of multilibs, for example: + # make -j3 check//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu} + # will run 3 concurrent sessions of check, eventually testing all 10 +@@ -1979,7 +1983,7 @@ check-parallel: force + # used, this rule will harmlessly fail to match. Used FORCE_PARALLEL to + # prevent serialized checking due to the passed RUNTESTFLAGS. + # FIXME: use config.status --config not --version, when available. +-check//%: force ++check//%: force testsuite.lockdir + @if [ -f testsuite/config.status ]; then \ + rootme=`pwd`; export rootme; \ + rootsrc=`cd $(srcdir); pwd`; export rootsrc; \ +@@ -1997,7 +2001,7 @@ check//%: force + ); \ + else :; fi && cd $$testdir && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) \ +- RUNTESTFLAGS="--target_board=$$variant $(RUNTESTFLAGS)" \ ++ RUNTESTFLAGS="GDB_LOCK_DIR=$$rootme/testsuite.lockdir --target_board=$$variant $(RUNTESTFLAGS)" \ + FORCE_PARALLEL=$(if $(FORCE_PARALLEL),1,$(if $(RUNTESTFLAGS),,1)) \ + "$$target"; \ + else true; fi +diff --git a/gdb/testsuite/lib/gdb-utils.exp b/gdb/testsuite/lib/gdb-utils.exp +index cfaa7905997..7fd613e0b8f 100644 +--- a/gdb/testsuite/lib/gdb-utils.exp ++++ b/gdb/testsuite/lib/gdb-utils.exp +@@ -180,6 +180,11 @@ proc lock_file_release {info} { + # Return directory where we keep lock files. + + proc lock_dir {} { ++ if { [info exists ::GDB_LOCK_DIR] } { ++ # When using check//. ++ return $::GDB_LOCK_DIR ++ } ++ + return [make_gdb_parallel_path cache] + } + +-- +2.35.3 + diff --git a/gdb-testsuite-use-unique-portnum-in-parallel-testing.patch b/gdb-testsuite-use-unique-portnum-in-parallel-testing.patch new file mode 100644 index 0000000..c9b5ee4 --- /dev/null +++ b/gdb-testsuite-use-unique-portnum-in-parallel-testing.patch @@ -0,0 +1,102 @@ +From c8bf6704e64be92816527e9f3f3b582046e214c9 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sat, 4 May 2024 10:41:09 +0200 +Subject: [PATCH 21/48] [gdb/testsuite] Use unique portnum in parallel testing + +When instrumenting get_portnum using: +... +puts "PORTNUM: $res" +... +and running: +... +$ cd build/gdb +$ make check-parallel -j2 TESTS=gdb.server/*.exp +... +we run into: +... +Running gdb.server/abspath.exp ... +PORTNUM: 2345 +... +and: +... +Running gdb.server/bkpt-other-inferior.exp ... +PORTNUM: 2345 +... + +This is because the test-cases are run in independent runtest invocations. + +Fix this by handling the parallel case in get_portnum using: +- a file $objdir/cache/portnum to keep the portnum variable, and +- a file $objdir/cache/portnum.lock to serialize access to it. + +Tested on aarch64-linux. + +Approved-By: Tom Tromey +--- + gdb/testsuite/lib/gdbserver-support.exp | 47 ++++++++++++++++++++----- + 1 file changed, 38 insertions(+), 9 deletions(-) + +diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp +index 4f7effaacf7..a3cccf54a72 100644 +--- a/gdb/testsuite/lib/gdbserver-support.exp ++++ b/gdb/testsuite/lib/gdbserver-support.exp +@@ -141,18 +141,47 @@ proc get_portnum {} { + # starting at $initial_portnum, to avoid conflicts with hung ports. + set initial_portnum 2345 + +- # Currently available port number. +- gdb_persistent_global portnum ++ if { ![info exists ::GDB_PARALLEL] } { ++ # Sequential case. + +- # Initialize, if necessary. +- if { ![info exists portnum] } { +- set portnum $initial_portnum ++ # Currently available port number. ++ gdb_persistent_global portnum ++ ++ # Initialize, if necessary. ++ if { ![info exists portnum] } { ++ set portnum $initial_portnum ++ } ++ ++ # Return currently available port number, and update it. ++ set res $portnum ++ incr portnum ++ return $res ++ } ++ ++ # Parallel case. ++ with_lock portnum.lock { ++ # Keep portnum file alongside the lock that guards it. ++ set portnum_file [lock_dir]/portnum ++ ++ if { [file exists $portnum_file] } { ++ set fd [open $portnum_file r] ++ set portnum [read $fd] ++ close $fd ++ ++ set portnum [string trim $portnum] ++ } else { ++ # Initialize. ++ set portnum $initial_portnum ++ } ++ ++ set next_portnum [expr $portnum + 1] ++ ++ set fd [open $portnum_file w] ++ puts $fd $next_portnum ++ close $fd + } + +- # Return currently available port number, and update it. +- set res $portnum +- incr portnum +- return $res ++ return $portnum + } + + # Locate the gdbserver binary. Returns "" if gdbserver could not be found. +-- +2.35.3 + diff --git a/gdb-tui-allow-command-window-of-1-or-2-lines.patch b/gdb-tui-allow-command-window-of-1-or-2-lines.patch new file mode 100644 index 0000000..c67b949 --- /dev/null +++ b/gdb-tui-allow-command-window-of-1-or-2-lines.patch @@ -0,0 +1,80 @@ +From 02616ce7c5571e5b2680cad52f8c58b27f77b2a5 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 9 Nov 2023 09:04:39 +0100 +Subject: [PATCH 4/6] [gdb/tui] Allow command window of 1 or 2 lines + +When starting TUI in a terminal with 2 lines (likewise with 1 line): +... +$ echo $LINES +2 +$ gdb -q -tui +... +we run into this assert in tui_apply_current_layout: +... + /* This should always be made visible by a layout. */ + gdb_assert (TUI_CMD_WIN != nullptr); +... + +The problem is that for the command window: +- the minimum height is 3 (the default), but +- the maximum height is only 2 because there are only 2 lines. + +This discrepancy eventually leads to a call to newwin in make_window with: +... +(gdb) p height +$1 = 3 +(gdb) p width +$2 = 66 +(gdb) p y +$3 = -1 +(gdb) p x +$4 = 0 +(gdb) +... +which results in a nullptr, which eventually triggers the assert. + +The easiest way to fix this is to change the minimum height of the command +window to 1. However, that would also change behaviour for the case that the +screen size is 3 lines or more. For instance, in gdb.tui/winheight.exp the +number of lines in the terminal is 24, and the test-case checks that the user +cannot increase the source window height to the point that the command window +height would be less than 3. + +Fix this by calculating the minimum height of the command window as follows: +- the default (3) if max_height () allows it, and +- max_height () otherwise. + +Tested on x86_64-linux. + +PR tui/31044 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31044 +--- + gdb/tui/tui-command.h | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/gdb/tui/tui-command.h b/gdb/tui/tui-command.h +index f6842880bb2..e8c96ecee30 100644 +--- a/gdb/tui/tui-command.h ++++ b/gdb/tui/tui-command.h +@@ -57,6 +57,18 @@ struct tui_cmd_window : public tui_win_info + /* The command window can't be made invisible. */ + } + ++ /* Compute the minimum height of this window. */ ++ virtual int min_height () const override ++ { ++ int preferred_min = tui_win_info::min_height (); ++ int max = max_height (); ++ /* If there is enough space to accommodate the preferred minimum height, ++ use it. Otherwise, use as much as possible. */ ++ return (preferred_min <= max ++ ? preferred_min ++ : max); ++ } ++ + int start_line = 0; + + protected: +-- +2.35.3 + diff --git a/gdb-tui-enable-work-around-libncurses-segfault.patch b/gdb-tui-enable-work-around-libncurses-segfault.patch new file mode 100644 index 0000000..ff7a907 --- /dev/null +++ b/gdb-tui-enable-work-around-libncurses-segfault.patch @@ -0,0 +1,47 @@ +diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c +index 828e42bccf7..551a72e3992 100644 +--- a/gdb/tui/tui.c ++++ b/gdb/tui/tui.c +@@ -57,7 +57,7 @@ + + /* Tells whether the TUI is active or not. */ + bool tui_active = false; +-static bool tui_finish_init = true; ++static int tui_init = -1; + + enum tui_key_mode tui_current_key_mode = TUI_COMMAND_MODE; + +@@ -363,7 +363,13 @@ tui_enable (void) + /* To avoid to initialize curses when gdb starts, there is a deferred + curses initialization. This initialization is made only once + and the first time the curses mode is entered. */ +- if (tui_finish_init) ++ if (tui_init == 0) ++ { ++ /* Initalization failed before, just throw a generic error, don't try ++ again. Workaround for segfault in libncurses5 bsc#1179210. */ ++ error (_("Cannot enable the TUI")); ++ } ++ else if (tui_init == -1) + { + WINDOW *w; + SCREEN *s; +@@ -383,6 +389,8 @@ tui_enable (void) + if (!gdb_stderr->isatty ()) + error (_("Cannot enable the TUI when output is not a terminal")); + ++ tui_init = 0; ++ + s = newterm (NULL, stdout, stdin); + #ifdef __MINGW32__ + /* The MinGW port of ncurses requires $TERM to be unset in order +@@ -435,7 +443,8 @@ tui_enable (void) + tui_set_win_focus_to (TUI_SRC_WIN); + keypad (TUI_CMD_WIN->handle.get (), TRUE); + wrefresh (TUI_CMD_WIN->handle.get ()); +- tui_finish_init = false; ++ ++ tui_init = 1; + } + else + { diff --git a/gdb-tui-fix-resizing-of-terminal-to-1-or-2-lines.patch b/gdb-tui-fix-resizing-of-terminal-to-1-or-2-lines.patch new file mode 100644 index 0000000..d5a084b --- /dev/null +++ b/gdb-tui-fix-resizing-of-terminal-to-1-or-2-lines.patch @@ -0,0 +1,147 @@ +From c55a452eaf9390d5659d3205f762aa2cb84511e1 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 9 Nov 2023 09:05:01 +0100 +Subject: [PATCH 6/6] [gdb/tui] Fix resizing of terminal to 1 or 2 lines + +When starting TUI in a terminal with 3 lines: +... +$ echo $LINES +3 +$ gdb -q -tui +... +and resizing the terminal to 2 lines we run into a segfault. + +The problem is that for the source window: +- the minimum height is 3 (the default), but +- the maximum height is only 2 because there are only 2 lines. + +This discrepancy eventually leads to a call to newwin in make_window with: +... +(gdb) p height +$1 = 3 +(gdb) p width +$2 = 56 +(gdb) p y +$3 = -1 +(gdb) p x +$4 = 0 +... +which results in a nullptr. + +This violates the assumption here in tui_apply_current_layout: +.... + /* Get the new list of currently visible windows. */ + std::vector new_tui_windows; + applied_layout->get_windows (&new_tui_windows); +... +that get_windows only returns visible windows, which leads to tui_windows +holding a dangling pointer, which results in the segfault. + +Fix this by: +- making sure get_windows only returns visible windows, and +- detecting the situation and dropping windows from the layout if + there's no room for them. + +Tested on x86_64-linux. + +PR tui/31044 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31044 +--- + gdb/testsuite/gdb.tui/resize.exp | 9 +++++++++ + gdb/tui/tui-layout.c | 22 ++++++++++++++++++++-- + gdb/tui/tui-layout.h | 6 +++++- + 3 files changed, 34 insertions(+), 3 deletions(-) + +diff --git a/gdb/testsuite/gdb.tui/resize.exp b/gdb/testsuite/gdb.tui/resize.exp +index 60d5116886b..e15f8a2f507 100644 +--- a/gdb/testsuite/gdb.tui/resize.exp ++++ b/gdb/testsuite/gdb.tui/resize.exp +@@ -39,3 +39,12 @@ Term::check_contents "source at startup" "\\|.*21 *return 0" + + Term::resize 40 90 + Term::check_box "source box after resize" 0 0 90 26 ++ ++# Check that resizing to less than 3 lines doesn't cause problems. ++foreach lines { 2 1 } { ++ with_test_prefix lines=$lines { ++ Term::resize $lines 90 0 ++ Term::wait_for "" ++ Term::check_region_contents "has prompt" 0 0 90 $lines "$gdb_prompt" ++ } ++} +diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c +index 27abee02087..362c1447910 100644 +--- a/gdb/tui/tui-layout.c ++++ b/gdb/tui/tui-layout.c +@@ -442,6 +442,13 @@ tui_layout_window::apply (int x_, int y_, int width_, int height_, + width = width_; + height = height_; + gdb_assert (m_window != nullptr); ++ if (width == 0 || height == 0) ++ { ++ /* The window was dropped, so it's going to be deleted, reset the ++ soon to be dangling pointer. */ ++ m_window = nullptr; ++ return; ++ } + m_window->resize (height, width, x, y); + } + +@@ -823,6 +830,7 @@ tui_layout_split::apply (int x_, int y_, int width_, int height_, + int available_size = m_vertical ? height : width; + int last_index = -1; + int total_weight = 0; ++ int prev = -1; + for (int i = 0; i < m_splits.size (); ++i) + { + bool cmd_win_already_exists = TUI_CMD_WIN != nullptr; +@@ -854,6 +862,14 @@ tui_layout_split::apply (int x_, int y_, int width_, int height_, + info[i].max_size = info[i].min_size; + } + ++ if (info[i].min_size > info[i].max_size) ++ { ++ /* There is not enough room for this window, drop it. */ ++ info[i].min_size = 0; ++ info[i].max_size = 0; ++ continue; ++ } ++ + if (info[i].min_size == info[i].max_size) + available_size -= info[i].min_size; + else +@@ -864,10 +880,12 @@ tui_layout_split::apply (int x_, int y_, int width_, int height_, + + /* Two adjacent boxed windows will share a border, making a bit + more size available. */ +- if (i > 0 +- && m_splits[i - 1].layout->last_edge_has_border_p () ++ if (prev != -1 ++ && m_splits[prev].layout->last_edge_has_border_p () + && m_splits[i].layout->first_edge_has_border_p ()) + info[i].share_box = true; ++ ++ prev = i; + } + + /* If last_index is set then we have a window that is not of a fixed +diff --git a/gdb/tui/tui-layout.h b/gdb/tui/tui-layout.h +index 206f1117445..ec013a3f051 100644 +--- a/gdb/tui/tui-layout.h ++++ b/gdb/tui/tui-layout.h +@@ -185,7 +185,11 @@ class tui_layout_window : public tui_layout_base + /* See tui_layout_base::get_windows. */ + void get_windows (std::vector *windows) override + { +- windows->push_back (m_window); ++ if (m_window != nullptr && m_window->is_visible ()) ++ { ++ /* Only get visible windows. */ ++ windows->push_back (m_window); ++ } + } + + protected: +-- +2.35.3 + diff --git a/gdb-tui-fix-wmaybe-uninitialized-in-tui_find_disasse.patch b/gdb-tui-fix-wmaybe-uninitialized-in-tui_find_disasse.patch new file mode 100644 index 0000000..01738b0 --- /dev/null +++ b/gdb-tui-fix-wmaybe-uninitialized-in-tui_find_disasse.patch @@ -0,0 +1,57 @@ +From 0f2bdd8648e47e10334f8cc8e47b277d4064d0a2 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 13 Nov 2023 09:31:20 +0100 +Subject: [PATCH 3/6] [gdb/tui] Fix Wmaybe-uninitialized in + tui_find_disassembly_address +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When building gdb with -O2, we run into: +... +gdb/tui/tui-disasm.c: In function ‘CORE_ADDR tui_find_disassembly_address \ + (gdbarch*, CORE_ADDR, int)’: +gdb/tui/tui-disasm.c:293:7: warning: ‘last_addr’ may be used uninitialized \ + in this function [-Wmaybe-uninitialized] + if (last_addr < pc) + ^~ +... + +The warning triggers since commit 72535eb14bd ("[gdb/tui] Fix segfault in +tui_find_disassembly_address"). + +Fix the warning by ensuring that last_addr is initialized at the point of +use: +... ++ last_addr = asm_lines.back ().addr; + if (last_addr < pc) +... + +Tested on x86_64-linux. +--- + gdb/tui/tui-disasm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c +index 03c78aa1291..bbbc92c8183 100644 +--- a/gdb/tui/tui-disasm.c ++++ b/gdb/tui/tui-disasm.c +@@ -281,7 +281,6 @@ tui_find_disassembly_address (struct gdbarch *gdbarch, CORE_ADDR pc, int from) + /* Take the best possible match we have. */ + new_low = *possible_new_low; + next_addr = tui_disassemble (gdbarch, asm_lines, new_low, max_lines); +- last_addr = asm_lines.back ().addr; + gdb_assert (asm_lines.size () >= max_lines); + } + +@@ -290,6 +289,7 @@ tui_find_disassembly_address (struct gdbarch *gdbarch, CORE_ADDR pc, int from) + We keep the disassembled instructions in the 'lines' window + and shift it downward (increasing its addresses). */ + int pos = max_lines - 1; ++ last_addr = asm_lines.back ().addr; + if (last_addr < pc) + do + { +-- +2.35.3 + diff --git a/gdb.changes b/gdb.changes new file mode 100644 index 0000000..fd5e6ba --- /dev/null +++ b/gdb.changes @@ -0,0 +1,6149 @@ +------------------------------------------------------------------- +Thu Jan 23 08:11:26 UTC 2025 - Tom de Vries + +- Add "BuildRequires: libgo23" to fix unresolved for factory. + +------------------------------------------------------------------- +Mon Jan 20 14:22:22 UTC 2025 - Andreas Schwab + +- riscv-lrsc.patch: Fix stepping over atomic sequences + +------------------------------------------------------------------- +Tue Dec 17 16:11:55 UTC 2024 - Tom de Vries + +- Maintenance script qa.sh: + * Add PR29770 xfail (glibc). + * Add PR31229 kfail. + +------------------------------------------------------------------- +Wed Dec 11 18:13:33 UTC 2024 - Tom de Vries + +- Maintenance script qa.sh: + * Add PR32446 kfail. + * Add to be investigated FAILs on Leap 15.6 ppc64le. + +------------------------------------------------------------------- +Tue Dec 10 08:19:28 UTC 2024 - Tom de Vries + +- Patches added: + * gdb-testsuite-avoid-intermittent-failures-on-a-debug.patch +- Maintenance script qa.sh: + * Add PR32439 kfail. + +------------------------------------------------------------------- +Mon Dec 9 14:09:01 UTC 2024 - Tom de Vries + +- Patches added (jsc#PED-10258): + * gdb-tdep-s390-add-arch15-record-replay-support.patch + +------------------------------------------------------------------- +Mon Dec 2 16:05:47 UTC 2024 - Tom de Vries + +- Patches added (jsc#PED-10751): + * s390-provide-ibm-z16-arch14-instruction-descriptions.patch + * gdb-s390-add-arch14-record-replay-support.patch +- Maintenance script qa.sh: + * Add PR32407 kfail. + +------------------------------------------------------------------- +Thu Aug 29 05:55:04 UTC 2024 - Tom de Vries + +- Maintenance script qa.sh: + * Move PR26867 kfail from kfail_factory to kfail. + * Merge PR28468 kfail with PR26867 kfail. + +------------------------------------------------------------------- +Wed Aug 28 08:12:30 UTC 2024 - Tom de Vries + +- Maintenance script qa.sh: + * Restore yama ptrace_scope == 1 kfails, + aaa_base-yama-enable-ptrace doesn't work. + * Enable yama ptrace_scope == 1 kfails for SLFO. + * Add PR32121 kfail. + * Drop Leap 15.3 and 15.4, add Leap 15.6. + * Replace ALP with SLFO. + * Move PR28468 kfail from kfail_factory to kfail. + +------------------------------------------------------------------- +Wed Jun 19 13:11:11 UTC 2024 - Tom de Vries + +- Maintenance script qa.sh: + * Remove python2 related PR29245 kfail. + * Remove PR30518 kfail. + * Remove yama ptrace_scope == 1 kfails. + * Remove PR28065 kfail. +- Patches added (swo#32081): + * gdb-symtab-return-correct-reader-for-top-level-cu-in.patch +- Add "BuildRequires: aaa_base-yama-enable-ptrace" on tumbleweed. +- Maintenance script qa-local.sh: + * Add SLFO and Leap 15.6, drop Leap 15.3 and 15.4 and ALP. + +------------------------------------------------------------------- +Wed Jun 19 09:46:17 UTC 2024 - Tom de Vries + +- Mention changes in GDB 14: + * GDB now supports the AArch64 Scalable Matrix Extension 2 + (SME2), which includes a new 512 bit lookup table register + named ZT0. + * GDB now supports the AArch64 Scalable Matrix Extension (SME), + which includes a new matrix register named ZA, a new thread + register TPIDR2 and a new vector length register SVG + (streaming vector granule). GDB also supports tracking ZA + state across signal frames. Some features are still under + development or are dependent on ABI specs that are still in + alpha stage. For example, manual function calls with ZA state + don't have any special handling, and tracking of SVG changes + based on DWARF information is still not implemented, but there + are plans to do so in the future. + * GDB now recognizes the NO_COLOR environment variable and + disables styling according to the spec. See + https://no-color.org/. Styling can be re-enabled with + "set style enabled on". + * The AArch64 'org.gnu.gdb.aarch64.pauth' Pointer Authentication + feature string has been deprecated in favor of the + 'org.gnu.gdb.aarch64.pauth_v2' feature string. + * GDB now has some support for integer types larger than 64 bits. + * Multi-target feature configuration. + GDB now supports the individual configuration of remote + targets' feature sets. Based on the current selection of a + target, the commands 'set remote -packet (on|off|auto)' + and 'show remote -packet' can be used to configure a + target's feature packet and to display its configuration, + respectively. + * GDB has initial built-in support for the Debugger Adapter + Protocol. + * For the break command, multiple uses of the 'thread' or 'task' + keywords will now give an error instead of just using the + thread or task id from the last instance of the keyword. E.g.: + break foo thread 1 thread 2 + will now give an error rather than using 'thread 2'. + * For the watch command, multiple uses of the 'task' keyword will + now give an error instead of just using the task id from the + last instance of the keyword. E.g.: + watch my_var task 1 task 2 + will now give an error rather than using 'task 2'. The + 'thread' keyword already gave an error when used multiple times + with the watch command, this remains unchanged. + * The 'set print elements' setting now helps when printing large + arrays. If an array would otherwise exceed max-value-size, but + 'print elements' is set such that the size of elements to print + is less than or equal to 'max-value-size', GDB will now still + print the array, however only 'max-value-size' worth of data + will be added into the value history. + * For both the break and watch commands, it is now invalid to use + both the 'thread' and 'task' keywords within the same command. + For example the following commnds will now give an error: + break foo thread 1 task 1 + watch var thread 2 task 3 + * The printf command now accepts a '%V' output format which will + format an expression just as the 'print' command would. Print + options can be placed withing '[...]' after the '%V' to modify + how the value is printed. E.g: + printf "%V", some_array + printf "%V[-array-indexes on]", some_array + will print the array without, or with array indexes included, + just as the array would be printed by the 'print' command. + This functionality is also available for dprintf when + dprintf-style is 'gdb'. + * When the printf command requires a string to be fetched from + the inferior, GDB now uses the existing 'max-value-size' + setting to the limit the memory allocated within GDB. The + default 'max-value-size' is 64k. To print longer strings you + should increase 'max-value-size'. + * The Ada 2022 Enum_Rep and Enum_Val attributes are now + supported. + * The Ada 2022 target name symbol ('@') is now supported by the + Ada expression parser. + * The 'list' command now accepts '.' as an argument, which tells + GDB to print the location around the point of execution within + the current frame. If the inferior hasn't started yet, the + command will print around the beginning of the 'main' function. + * Using the 'list' command with no arguments in a situation where + the command would attempt to list past the end of the file now + warns the user that the end of file has been reached, refers + the user to the newly added '.' argument + * Breakpoints can now be inferior-specific. This is similar to + the existing thread-specific breakpoint support. Breakpoint + conditions can include the 'inferior' keyword followed by an + inferior id (as displayed in the 'info inferiors' output). + It is invalid to use the 'inferior' keyword with either the + 'thread' or 'task' keywords when creating a breakpoint. + * New convenience function "$_shell", to execute a shell command + and return the result. This lets you run shell commands in + expressions. Some examples: + (gdb) p $_shell("true") + $1 = 0 + (gdb) p $_shell("false") + $2 = 1 + (gdb) break func if $_shell("some command") == 0 + * New commands: + * set debug breakpoint on|off + show debug breakpoint + Print additional debug messages about breakpoint insertion + and removal. + * maintenance print record-instruction [ N ] + Print the recorded information for a given instruction. If N + is not given prints how GDB would undo the last instruction + executed. If N is negative, prints how GDB would undo the + N-th previous instruction, and if N is positive, it prints + how GDB will redo the N-th following instruction. + * maintenance info frame-unwinders + List the frame unwinders currently in effect, starting with + the highest priority. + * maintenance wait-for-index-cache + Wait until all pending writes to the index cache have + completed. + * set always-read-ctf on|off + show always-read-ctf + When off, CTF is only read if DWARF is not present. When on, + CTF is read regardless of whether DWARF is present. Off by + default. + * info main + Get main symbol to identify entry point into program. + * set tui mouse-events [on|off] + show tui mouse-events + When on (default), mouse clicks control the TUI and can be + accessed by Python extensions. When off, mouse clicks are + handled by the terminal, enabling terminal-native text + selection. + * MI changes: + * MI version 1 has been removed. + * mi now reports 'no-history' as a stop reason when hitting the + end of the reverse execution history. + * When creating a thread-specific breakpoint using the '-p' + option, the -break-insert command would report the 'thread' + field twice in the reply. The content of both fields was + always identical. This has now been fixed; the 'thread' + field will be reported just once for thread-specific + breakpoints, or not at all for breakpoints without a thread + restriction. The same is also true for the 'task' field of + an Ada task-specific breakpoint. + * It is no longer possible to create a thread-specific + breakpoint for a thread that doesn't exist using + '-break-insert -p ID'. Creating breakpoints for + non-existent threads is not allowed when using the CLI, that + the MI allowed it was a long standing bug, which has now + been fixed. + * The '--simple-values' argument to the + '-stack-list-arguments','-stack-list-locals', + '-stack-list-variables', and '-var-list-children' commands now + takes reference types into account: that is, a value is now + considered simple if it is neither an array, structure, or + union, nor a reference to an array, structure, or union. + (Previously all references were considered simple.) Support + for this feature can be verified by using the + '-list-features' command, which should contain + "simple-values-ref-types". + * The -break-insert command now accepts a '-g thread-group-id' + option to allow for the creation of inferior-specific + breakpoints. + * The bkpt tuple, which appears in breakpoint-created + notifications, and in the result of the -break-insert + command can now include an optional 'inferior' field for both + the main breakpoint, and each location, when the breakpoint + is inferior-specific. + * Python API: + * gdb.ThreadExitedEvent added. Emits a ThreadEvent. + * The gdb.unwinder.Unwinder.name attribute is now read-only. + * The name argument passed to gdb.unwinder.Unwinder.__init__ + must now be of type 'str' otherwise a TypeError will be + raised. + * The gdb.unwinder.Unwinder.enabled attribute can now only + accept values of type 'bool'. Changing this attribute will + now invalidate GDB's frame-cache, which means GDB will need + to rebuild its frame-cache when next required - either with, + or without the particular unwinder, depending on how + 'enabled' was changed. + * New methods added to the gdb.PendingFrame class. These + methods have the same behaviour as the corresponding + methods on gdb.Frame. The new methods are: + * gdb.PendingFrame.name: Return the name for the frame's + function, or None. + * gdb.PendingFrame.is_valid: Return True if the pending + frame object is valid. + * gdb.PendingFrame.pc: Return the $pc register value for + this frame. + * gdb.PendingFrame.language: Return a string containing the + language for this frame, or None. + * gdb.PendingFrame.find_sal: Return a gdb.Symtab_and_line + object for the current location within the pending frame, + or None. + * gdb.PendingFrame.block: Return a gdb.Block for the current + pending frame, or None. + * gdb.PendingFrame.function: Return a gdb.Symbol for the + current pending frame, or None. + * The frame-id passed to gdb.PendingFrame.create_unwind_info + can now use either an integer or a gdb.Value object for each + of its 'sp', 'pc', and 'special' attributes. + * A new class gdb.unwinder.FrameId has been added. Instances + of this class are constructed with 'sp' (stack-pointer) and + 'pc' (program-counter) values, and can be used as the + frame-id when calling gdb.PendingFrame.create_unwind_info. + * It is now no longer possible to sub-class the + gdb.disassembler.DisassemblerResult type. + * The Disassembler API from the gdb.disassembler module has + been extended to include styling support: + * The DisassemblerResult class can now be initialized with a + list of parts. Each part represents part of the + disassembled instruction along with the associated style + information. This list of parts can be accessed with the + new DisassemblerResult.parts property. + * New constants gdb.disassembler.STYLE_* representing all the + different styles part of an instruction might have. + * New methods DisassembleInfo.text_part and + DisassembleInfo.address_part which are used to create the + new styled parts of a disassembled instruction. + * Changes are backwards compatible, the older API can still + be used to disassemble instructions without styling. + * New function gdb.execute_mi(COMMAND, [ARG]...), that invokes + a GDB/MI command and returns the output as a Python + dictionary. + * New function gdb.block_signals(). This returns a context + manager that blocks any signals that GDB needs to handle + itself. + * New class gdb.Thread. This is a subclass of threading.Thread + that calls gdb.block_signals in its "start" method. + * gdb.parse_and_eval now has a new "global_context" parameter. + This can be used to request that the parse only examine + global symbols. + * gdb.Inferior now has a new "arguments" attribute. This holds + the command-line arguments to the inferior, if known. + * gdb.Inferior now has a new "main_name" attribute. This holds + the name of the inferior's "main", if known. + * gdb.Inferior now has new methods "clear_env", "set_env", and + "unset_env". These can be used to modify the inferior's + environment before it is started. + * gdb.Value now has the 'assign' method. + * gdb.Value now has the 'to_array' method. This converts an + array-like Value to an array. + * gdb.Progspace now has the new method "objfile_for_address". + This returns the gdb.Objfile, if any, that covers a given + address. + * gdb.Breakpoint now has an "inferior" attribute. If the + Breakpoint object is inferior specific then this attribute + holds the inferior-id (an integer). If the Breakpoint + object is not inferior specific, then this field contains + None. This field can be written too. + * gdb.Type now has the "is_array_like" and "is_string_like" + methods. These reflect GDB's internal idea of whether a + type might be array- or string-like, even if they do not + have the corresponding type code. + * gdb.ValuePrinter is a new class that can be used as the base + class for the result of applying a pretty-printer. As a + base class, it signals to gdb that the printer may implement + new pretty-printer methods. + * New attribute Progspace.symbol_file. This attribute holds + the gdb.Objfile that corresponds to Progspace.filename (when + Progspace.filename is not None), otherwise, this attribute is + itself None. + * New attribute Progspace.executable_filename. This attribute + holds a string containing a file name set by the "exec-file" + or "file" commands, or None if no executable file is set. + This isn't the exact string passed by the user to these + commands; the file name will have been partially resolved to + an absolute file name. + * A new executable_changed event registry is available. This + event emits ExecutableChangedEvent objects, which have + 'progspace' (a gdb.Progspace) and 'reload' (a Boolean) + attributes. This event is emitted when + gdb.Progspace.executable_filename changes. + * New event registries gdb.events.new_progspace and + gdb.events.free_progspace, these emit NewProgspaceEvent and + FreeProgspaceEvent event types respectively. Both of these + event types have a single 'progspace' attribute, which is + the gdb.Progspace that is either being added to GDB, or + removed from GDB. + * gdb.LazyString now implements the __str__ method. + * New method gdb.Frame.static_link that returns the outer + frame of a nested function frame. + +------------------------------------------------------------------- +Tue Jun 18 12:20:33 UTC 2024 - Tom de Vries + +- Fix mention of gdb-exp-redo-cast-handling-for-indirection.patch. + +------------------------------------------------------------------- +Thu Jun 13 09:26:39 UTC 2024 - Tom de Vries + +- Maintenance script qa-remote.sh: + * Filter out SLE-11. +- Maintenance script qa.sh: + * Add gdb.guile/scm-breakpoint.exp kfail. + * Fix kfail_powerpc64le_sle12 selection. + +------------------------------------------------------------------- +Thu Jun 13 07:07:11 UTC 2024 - Tom de Vries + +- Patches dropped: + * fix-gdb.threads-threads-after-exec.exp-race.patch + * add-maint-info-linux-lwps-command.patch +- Patches added: + * gdb-python-fix-gdb.python-py-disasm.exp-on-arm-linux.patch + * gdb-testsuite-fix-gdb.fortran-array-bounds.exp-on-ar.patch + * gdb-python-make-gdb.unwindinfo.add_saved_register-mo-fixup.patch + * gdb-exp-redo-cast-handling-for-indirection.patch + * gdb-tdep-fix-gdb.base-watchpoint-running-on-arm-ppc6.patch + +------------------------------------------------------------------- +Sat Jun 1 06:10:43 UTC 2024 - Tom de Vries + +- Maintenance script qa.sh: + * Add PR31831 kfail. + * Expand PR28617 kfail. + * Expand PR28561 kfail. + * Expand PR19675 kfail. +- Patches dropped: + * gdb-linux-delete-all-other-lwps-immediately-on-ptrac.patch + +------------------------------------------------------------------- +Fri May 31 06:27:25 UTC 2024 - Tom de Vries + +- Patches added: + * gdb-build-fix-gdbserver-linux-aarch64-low.cc-build.patch + * powerpc-fix-test-gdb.ada-finish-large.exp.patch + * gdb-testsuite-fix-timeout-in-gdb.tui-resize-2.exp.patch +- Maintenance script qa.sh: + * Remove PR26761 kfail. + * Add PR31061, PR31823, PR31825, PR31826, PR31827 and PR31564 + kfail. + * Remove PKRU-related kfails. + * Improve report format for known clean configs. + * Add more configs as known clean. + * Expand scope of PR29253 kfail. + +------------------------------------------------------------------- +Wed May 1 07:32:34 UTC 2024 - Tom de Vries + +- Rebase to 14.2 release (fedora rawhide @ 779f05e). + * Replace gdb-13.2.tar.bz2 with gdb-14.2.tar.bz2. +- Maintenance script import-fedora.sh: + * Drop patch skips: + * gdb-6.5-BEA-testsuite.patch +- Maintenance script qa-local.sh: + * Drop SLE-11. GDB 14.2 requires MPFR, and the SLE-11 version + (2.3.2) is older than required (3.1.0+). + * Add ALP. + * Update version to 14.2. +- Maintenance script qa.sh: + * Add PR30480, PR31440, PR31806 kfail. + * Add PR31810, PR31809, PR31811 kfail. + * Expand gdb.base/rtld-step.exp kfail. + * Add gdb.threads/thread-specific-bp.exp kfail. +- Fedora patches updated: + * gdb-6.3-gstack-20050411.patch + * gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch + * gdb-6.6-buildid-locate-rpm.patch + * gdb-6.6-buildid-locate-solib-missing-ids.patch + * gdb-6.6-buildid-locate.patch + * gdb-6.6-testsuite-timeouts.patch + * gdb-core-open-vdso-warning.patch + * gdb-fedora-libncursesw.patch + * gdb-linux_perf-bundle.patch + * gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch + * gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch + * gdb-rhbz-2232086-generate-gdb-index-consistently.patch +- Fedora patches removed: + * gdb-binutils29988-read_indexed_address.patch + * gdb-bz2196395-debuginfod-legacy-openssl-crash.patch + * gdb-bz2237392-dwarf-obstack-allocation.patch + * gdb-bz2237515-debuginfod-double-free.patch + * gdb-rhbz1773651-gdb-index-internal-error.patch + * gdb-rhbz2160211-excessive-core-file-warnings.patch + * gdb-rhbz2192105-ftbs-dangling-pointer + * gdb-rhbz2233961-CVE-2022-4806.patch + * gdb-rhbz2233965-memory-leak.patch +- Fedora patches added: + * gdb-ftbs-swapped-calloc-args.patch + * gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch + * gdb-rhbz2250652-gdbpy_gil.patch + * gdb-rhbz2261580-intrusive_list-assertion-fix.patch +- Fedora fixup patches added: + * fixup-skip-tests.patch +- Fedora fixup patches updated: + * fixup-gdb-linux_perf-bundle.patch +- Patches updated: + * gdb-symtab-work-around-pr-gas-29517.patch + * gdb-symtab-work-around-gas-pr28629.patch + * gdb-testsuite-ada-pie.patch + * gdb-python-finishbreakpoint-update.patch + * gdb-testsuite-prevent-compilation-fails-with-unix-fpie-pie.patch + * gdb-fix-segfault-in-for_each_block-part-1.patch + * gdb-fix-segfault-in-for_each_block-part-2.patch + * gdb-symtab-don-t-defer-backward-refs-inter-cu-intra-.patch + * gdb-symtab-factor-out-m_deferred_entries-usage.patch + * gdb-symtab-factor-out-m_die_range_map-usage.patch + * gdb-symtab-fix-dw_tag_inlined_subroutine-entries-in-.patch + * gdb-symtab-handle-nullptr-parent-in-parent_map-set_p.patch + * gdb-symtab-keep-track-of-all-parents-for-cooked-inde.patch + * gdb-symtab-keep-track-of-processed-dies-in-shard.patch + * gdb-symtab-recurse-into-c-dw_tag_subprogram-dies-for.patch + * gdb-symtab-refactor-condition-in-scan_attributes.patch + * gdb-symtab-resolve-deferred-entries-inter-shard-case.patch + * gdb-symtab-resolve-deferred-entries-intra-shard-case.patch +- Patches added: + * gdb-symtab-work-around-pr-gas-29517-dwarf2-case.patch + * fix-the-gdb.ada-inline-section-gc.exp-test.patch + * gdb-testsuite-handle-pac-marker.patch + * change-gdb.base-examine-backwards.exp-for-aix.patch + * gdb-testsuite-fix-spurious-fails-with-examine-backwa.patch + * gdb-testsuite-make-gdb.base-solib-search.exp-more-ro.patch + * gdb-testsuite-fix-regexp-in-vgdb_start.patch + * powerpc-and-aarch64-fix-reverse-stepping-failure.patch + * gdb-tdep-fix-gdb.base-watch-bitfields.exp-on-aarch64.patch + * gdb-tdep-fix-gdb.base-watchpoint-unaligned.exp-on-aa.patch + * gdb-testsuite-add-pr-gdb-26967-kfail-in-two-more-tes.patch + * gdb-testsuite-fix-gdb.base-eh_return.exp.patch + * fixup-powerpc-and-aarch64-fix-reverse-stepping-failu.patch + * gdb-exp-fix-printing-of-out-of-bounds-struct-members.patch + * gdb-fix-heap-use-after-free-in-select_event_lwp.patch + * fix-regression-on-aarch64-linux-gdbserver.patch + * gdb-testsuite-factor-out-proc-get_portnum.patch + * gdb-testsuite-make-portnum-a-persistent-global.patch + * gdb-testsuite-factor-out-proc-with_lock.patch + * gdb-testsuite-factor-out-proc-lock_dir.patch + * gdb-testsuite-move-gpu-parallel.lock-to-cache-dir.patch + * gdb-testsuite-use-unique-portnum-in-parallel-testing.patch + * gdb-testsuite-use-unique-portnum-in-parallel-testing-check-slash-slash-case.patch + * gdb-tdep-fix-reverse-execution-of-ldr-immediate-t4.patch + * gdb-exp-fix-cast-handling-for-indirection.patch + * gdb-remote-fix-abort-on-remote_close_error.patch + * gdb-testsuite-use-find_gnatmake-instead-of-gdb_find_.patch + * gdb-testsuite-simplify-gdb.server-server-kill-python.patch + * gdb-testsuite-fix-gdbserver-pid-in-gdb.server-server.patch + * gdb-testsuite-add-missing-include-in-gdb.base-ctf-pt.patch + * gdb-testsuite-fix-gdb.ada-verylong.exp-on-32-bit-tar.patch + * gdb-testsuite-add-missing-includes-in-gdb.trace-coll.patch + * gdb-testsuite-fix-missing-return-type-in-gdb.linespe.patch + * gdb-testsuite-fix-gdb.base-ending-run.exp-on-manjaro.patch + * gdb-testsuite-fix-test-case-gdb.threads-attach-stopp.patch + * gdb-testsuite-add-missing-include-in-gdb.base-rtld-s.patch + * gdb-testsuite-fix-valgrind-tests-on-debian.patch + * gdb-testsuite-fix-gdb.server-server-connect.exp-for-.patch + * gdb-testsuite-handle-core-without-build-id-in-gdb.ba.patch + * gdb-testsuite-fix-gdb.base-list-no-debug.exp-on-debi.patch + * gdb-testsuite-reset-errcnt-and-warncnt-in-default_gd.patch + * gdb-testsuite-fix-test-in-gdb.python-py-finish-break.patch + * gdb-testsuite-further-handle-long-filenames-in-gdb.b.patch + * gdb-testsuite-fix-license-text-in-gdb.reverse-map-to.patch + * gdb-testsuite-call-ldd-version-in-gdb.testsuite-dump.patch + * gdb-testsuite-fix-gdb.mi-mi-dprintf.exp-with-read1.patch + * gdb-testsuite-fix-gdb.cp-namespace.exp-with-read1.patch + * gdb-testsuite-fix-typo-in-gdb.base-catch-syscall.exp.patch + * gdb-testsuite-use-more-progbits-for-arm.patch + * gdb-testsuite-fix-gdb.dwarf2-dw2-gas-workaround.exp.patch + * gdb-testsuite-add-gdb.dwarf2-backward-spec-inter-cu..patch + * gdb-testsuite-add-gdb.dwarf2-forward-spec-inter-cu.e.patch + * gdb-symtab-workaround-pr-gas-31115.patch + * gdb-arm-remove-tpidruro-register-from-non-freebsd-ta.patch + * gdb-tdep-fix-catching-syscall-execve-exit-for-arm.patch + * gdb-arm-fix-epilogue-frame-id.patch + * gdb-linux-delete-all-other-lwps-immediately-on-ptrac.patch + * add-maint-info-linux-lwps-command.patch + * fix-gdb.threads-threads-after-exec.exp-race.patch + * rs6000-unwind-on-each-instruction-fix.patch + * gdb-python-make-gdb.unwindinfo.add_saved_register-mo.patch + * gdb-arm-remove-thumb-bit-in-arm_adjust_breakpoint_ad.patch + * gdb-testsuite-fix-error-in-gdb.server-server-kill-py.patch +- Patches dropped: + * remove-some-unnecessary-includes-from-exp.y.patch + * gdb-testsuite-fix-gdb.gdb-python-helper.exp-with-o2-.patch + * gdb-testsuite-simplify-gdb.base-unwind-on-each-insn..patch + * gdb-testsuite-handle-output-after-prompt-in-gdb.thre.patch + * gdb-testsuite-add-xfail-in-gdb.arch-i386-pkru.exp.patch + * gdb-testsuite-factor-out-proc-linux_kernel_version.patch + * gdb-testsuite-add-xfail-in-gdb.python-py-record-btra.patch + * gdb-testsuite-fix-gdb.threads-schedlock.exp-on-fast-.patch + * gdb-testsuite-simplify-gdb.arch-amd64-disp-step-avx..patch + * gdb-testsuite-fix-gdb.threads-schedlock.exp-for-gcc-.patch + * gdb-testsuite-add-xfail-case-in-gdb.python-py-record.patch + * aarch64-avoid-initializers-for-vlas.patch + * gdb-tdep-aarch64-fix-frame-address-of-last-insn.patch + * fix-pr30369-regression-on-aarch64-arm-pr30506.patch + * gdb-testsuite-fix-breakpoint-regexp-in-gdb.ada-out_o.patch + * gdb-testsuite-relax-breakpoint-count-check-in-gdb.py.patch + * gdb-testsuite-fix-buffer-overflow-in-gdb.base-signed.patch + * gdb-testsuite-require-syscall-time-in-gdb.reverse-ti.patch + * gdb-testsuite-handle-missing-gdc-in-gdb.dlang-dlang-.patch + * gdb-testsuite-add-basic-lmap-for-tcl-8.6.patch + * gdb-testsuite-fix-gdb.rust-watch.exp-on-ppc64le.patch + * gdb-testsuite-fix-gdb.python-py-breakpoint.exp-timeo.patch + * powerpc-fix-for-gdb.reverse-finish-precsave.exp-and-.patch + * powerpc-regression-fix-for-reverse-finish-command.patch + * gdb-testsuite-don-t-use-string-cat-in-gdb.dwarf2-dw2.patch + * move-step_until-procedure.patch + * gdb-testsuite-fix-gdb.arch-i386-signal.exp-on-x86_64.patch + * gdb-testsuite-fix-regexps-in-gdb.base-step-over-sysc.patch + * gdb-testsuite-add-kfail-for-pr-ada-30908.patch + * gdb-testsuite-fix-gdb.ada-mi_task_arg.exp-with-newer.patch + * gdb-testsuite-fix-gdb.cp-m-static.exp-regression-on-.patch + * gdb-symtab-fix-line-number-of-static-const-class-mem.patch + * gdb-symtab-handle-pu-in-iterate_over_some_symtabs.patch + * gdb-testsuite-fix-gdb.dwarf2-nullptr_t.exp-with-cc-w.patch + * gdb-symtab-fix-too-many-symbols-in-gdbpy_lookup_stat.patch + * gdb-support-rseq-auxvs.patch + * gdb-testsuite-add-xfail-for-gdb-29965-in-gdb.threads.patch + * gdb-cli-handle-pending-c-after-rl_callback_read_char.patch + * gdb-testsuite-add-have_host_locale.patch + * gdb-symtab-find-main-language-without-symtab-expansi.patch + * gdb-symtab-don-t-deduplicate-variables-in-gdb-index.patch + * xcoffread.c-fix-werror-dangling-pointer-issue-with-m.patch + * avoid-manual-memory-management-in-go-lang.c.patch + * gdb-go-handle-v3-go_0-mangled-prefix.patch + * gdb-symtab-handle-self-reference-die.patch + * gdb-symtab-handle-self-reference-in-inherit_abstract.patch + * gdb-symtab-add-optimized-out-static-var-to-cooked-in.patch + * gdb-testsuite-fix-gdb.python-py-breakpoint.exp-with-.patch + * gdb-tui-fix-segfault-in-tui_find_disassembly_address.patch + * gdb-testsuite-add-wait_for_msg-arg-to-term-resize-fi.patch + * gdb-testsuite-fix-gdb-server-ext-run-exp-for-obs.patch + * gdb-testsuite-work-around-skip_prologue-problems-in-gdb.threads-process-dies-while-detaching.exp.patch + +------------------------------------------------------------------- +Wed Apr 24 13:07:21 UTC 2024 - Tom de Vries + +- Maintenance script qa.sh: + * Add PR31671 unresolved. + * Add unresolved for yama ptrace_scope == 1. + * Limit PR31648 unresolved to SLE-11. + +------------------------------------------------------------------- +Thu Apr 18 14:00:01 UTC 2024 - Tom de Vries + +- Patch added (swo#31524, bsc#1222188): + * make-pascal_language-print_type-handle-varstring-nul.patch +- Renable gcc-fortran for SLE-11. +- Use system compiler (gcc 4.3.4) for testing all languages on + SLE-11. +- Maintenance script qa.sh: + * Ignore all fails for SLE-11. +- Maintenance script import-fedora.sh: + * Use %patch -P N instead of deprecated %patchN. + * Drop patch skips: + * gdb-6.5-readline-long-line-crash-test.patch + * gdb-6.7-charsign-test.patch + * gdb-test-ivy-bridge.patch + * gdb-ppc-power7-test.patch + * gdb-6.3-bz140532-ppc-unwinding-test.patch +- Patches added (import from fedora rawhide @ a27201b): + * gdb-bz2196395-debuginfod-legacy-openssl-crash.patch + * gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch + * gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch + * gdb-rhbz-2232086-generate-gdb-index-consistently.patch + * gdb-rhbz-2232086-reduce-size-of-gdb-index.patch + * gdb-rhbz2232086-refactor-selftest-support.patch +- Patches updated (import from fedora rawhide @ a27201b): + * gdb-6.6-buildid-locate-rpm.patch + * gdb-6.6-buildid-locate.patch + * gdb-fedora-libncursesw.patch + * gdb-rhbz2233961-CVE-2022-4806.patch + * gdb-rhbz2233965-memory-leak.patch +- Patches updated: + * gdb-6.6-buildid-locate-rpm-suse.patch +- Patches deleted (import from fedora rawhide @ a27201b): + * gdb-rhbz1553104-s390x-arch12-test.patch + * gdb-lineno-makeup-test.patch + * gdb-6.3-bz202689-exec-from-pthread-test.patch + * gdb-6.5-bz109921-DW_AT_decl_file-test.patch + * gdb-6.5-ia64-libunwind-leak-test.patch + * gdb-6.5-last-address-space-byte-test.patch + * gdb-6.5-missed-trap-on-step-test.patch + * gdb-6.5-sharedlibrary-path.patch + * gdb-6.7-testsuite-stable-results.patch + * gdb-6.8-bz442765-threaded-exec-test.patch + * gdb-ccache-workaround.patch + * gdb-opcodes-clflushopt-test.patch + * gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch + * gdb-rhbz1350436-type-printers-error.patch + * gdb-rhbz2196395-debuginfod-legacy-openssl-crash.patch + * gdb-rhel5.9-testcase-xlf-var-inside-mod.patch + * gdb-test-pid0-core.patch +- Patches deleted: + * fixup-gdb-rhbz1553104-s390x-arch12-test.patch + * fixup-2-gdb-rhbz1553104-s390x-arch12-test.patch + * fixup-gdb-lineno-makeup-test.patch + * fixup-gdb-6.6-buildid-locate-rpm.patch +- Remove commented out mention of dropped patch + gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch. + +------------------------------------------------------------------- +Thu Apr 18 08:21:00 UTC 2024 - Tom de Vries + +- Maintenance script qa.sh: + * Add PR31648 KFAIL. + * Handle yama ptrace_scope == 1. + +------------------------------------------------------------------- +Wed Apr 10 08:22:47 UTC 2024 - Tom de Vries + +- Patches added (bsc#1220490): + * fixup-gdb-6.6-buildid-locate-rpm.patch + +------------------------------------------------------------------- +Wed Mar 20 09:53:08 UTC 2024 - Richard Biener + +- Avoid using a %gcc macro to support using gcc 4.8 for building + on SLE11. Use the regular language compilers for testing. + +------------------------------------------------------------------- +Tue Feb 27 11:24:51 UTC 2024 - Dominique Leuenberger + +- Use %patch -P N instead of deprecated %patchN. + +------------------------------------------------------------------- +Wed Jan 10 13:40:34 UTC 2024 - Tom de Vries + +- Maintenance script qa.sh: + * Add PR31214 kfail. + * Add kfail for fails in gdb.reverse/solib-precsave.exp / + gdb.reverse/solib-reverse.exp fixed by commit fe6356def67 + ("PowerPC and aarch64: Fix reverse stepping failure"). + * Extend PR31004 kfail. +- Don't require %{python}-base for gdb-testresults package. +- Fix debuginfod handling: + * Enable for sle_version >= 150400 (bsc#1185605, jsc#PED-1149, + jsc#PED-1138), SLE15-SP4 and later. + * Enable for suse_version >= 1600, ALP and Tumbleweed. + * Add back "BuildRequires: libdebuginfod1" to prevent selecting + dummy variant. + * Add "BuildRequires: debuginfod-client" to prevent unresolved + due to conflict with dummy variant. + * Add --with-debuginfod=yes to prevent silently dropping support. +- Patches added (backport from master): + * gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch + * gdb-testsuite-remove-spurious-in-save_vars.patch + +------------------------------------------------------------------- +Wed Dec 13 14:58:14 UTC 2023 - Tom de Vries + +- Patches added (backport from gdb-patches, swo#30728): + * gdb-symtab-refactor-condition-in-scan_attributes.patch + * gdb-symtab-factor-out-m_die_range_map-usage.patch + * gdb-symtab-handle-nullptr-parent-in-parent_map-set_p.patch + * gdb-symtab-factor-out-m_deferred_entries-usage.patch + * gdb-symtab-resolve-deferred-entries-inter-shard-case.patch + * gdb-symtab-keep-track-of-processed-dies-in-shard.patch + * gdb-symtab-resolve-deferred-entries-intra-shard-case.patch + * gdb-symtab-don-t-defer-backward-refs-inter-cu-intra-.patch + * gdb-symtab-recurse-into-c-dw_tag_subprogram-dies-for.patch + * gdb-symtab-keep-track-of-all-parents-for-cooked-inde.patch + * gdb-symtab-fix-dw_tag_inlined_subroutine-entries-in-.patch + +------------------------------------------------------------------- +Mon Nov 13 14:08:08 UTC 2023 - Tom de Vries + +- Maintenance script qa.sh: + * Update PR31004 kfail. +- Patches added (backport from gdb-patches): + * gdb-fix-segfault-in-for_each_block-part-1.patch + +------------------------------------------------------------------- +Tue Oct 31 11:59:43 UTC 2023 - Tom de Vries + +- Maintenance script qa.sh: + * Update PR28561 kfail. + * Remove PR31015 kfail. + * Remove PR30547 kfail. +- Patches added (backport from master): + * gdb-symtab-add-producer_is_gas.patch + * gdb-symtab-work-around-gas-pr28629.patch + * gdb-tdep-fix-nr-array-elements-in-ppc64_aggregate_ca.patch + * gdb-testsuite-fix-gdb.python-py-breakpoint.exp-with-.patch + * gdb-tui-fix-segfault-in-tui_find_disassembly_address.patch + * gdb-tui-fix-wmaybe-uninitialized-in-tui_find_disasse.patch + * gdb-testsuite-add-wait_for_msg-arg-to-term-resize-fi.patch +- Patches added (backport from gdb-patches): + * gdb-fix-segfault-in-for_each_block-part-2.patch + * gdb-tui-allow-command-window-of-1-or-2-lines.patch + * gdb-tui-fix-resizing-of-terminal-to-1-or-2-lines.patch + +------------------------------------------------------------------- +Tue Oct 31 09:02:42 UTC 2023 - Tom de Vries + +- Maintenance script qa.sh: + * Remove PR28467, PR29418, PR29420, PR29814 and PR29408 kfail. + * Remove gdb.tui/tui-layout-asm-short-prog.exp kfail. + * Remove commit f68eca29d3b, 29004660c94, 301fe55e9c4, + 4d88ae0c7b5, e7d69e72bfd, 8b272d7671f, 85819864f7c, 167f3beb655 + and a0eda3df5b7 kfails. + * Add PR31015 kfail. + * Remove PR29793 kfail. + * Remove gdb.arch/powerpc-bcl-prologue.exp kfail. + * Remove PR29813 and PR29816 kfail. + +------------------------------------------------------------------- +Sun Oct 29 18:57:21 UTC 2023 - Tom de Vries + +- Maintenance script qa.sh: + * Update PR28561 kfail. + * Update PR29781 kfail. +- Maintenance script qa-local.sh: + * Add "Verify quilt setup" step. +- Patches added (backport from master): + * gdb-symtab-handle-self-reference-die.patch + * gdb-symtab-handle-self-reference-in-inherit_abstract.patch + * gdb-symtab-add-optimized-out-static-var-to-cooked-in.patch + +------------------------------------------------------------------- +Thu Oct 26 12:51:55 UTC 2023 - Tom de Vries + +- Maintenance script qa.sh: + * Add comment to kfail for PR30528. + * Add UNRESOLVED kfail for gdb.base/gcore-excessive-memory.exp. + * Add UNRESOLVED kfail for PR31001. + * Remove PR27238 kfail. + * Add powerpc64le hw watchpoint kfails. + * Add PR31004 kfail. + * Add PR30531 kfail. +- Patches added (backport from master): + * xcoffread.c-fix-werror-dangling-pointer-issue-with-m.patch + * avoid-manual-memory-management-in-go-lang.c.patch + * gdb-go-handle-v3-go_0-mangled-prefix.patch + +------------------------------------------------------------------- +Thu Oct 26 09:24:04 UTC 2023 - Tom de Vries + +- Patches added (backport from master): + * gdb-symtab-don-t-deduplicate-variables-in-gdb-index.patch +- Patches dropped (requires unsupported command): + * gdb-testsuite-add-wait-for-index-cache-in-gdb.dwarf2.patch +- Maintenance script qa.sh: + * Added PR30528 kfail. + +------------------------------------------------------------------- +Tue Oct 24 13:39:35 UTC 2023 - Tom de Vries + +- Patches added (manual import from fedora rawhide @ 52a4dab): + * gdb-rhbz1773651-gdb-index-internal-error.patch +- Patches added (backport from master): + * gdb-support-rseq-auxvs.patch + * gdb-symtab-fix-line-number-of-static-const-class-mem.patch + * gdb-symtab-fix-too-many-symbols-in-gdbpy_lookup_stat.patch + * gdb-symtab-handle-pu-in-iterate_over_some_symtabs.patch + * gdb-symtab-work-around-pr-gas-29517.patch + * gdb-testsuite-add-kfail-for-pr-ada-30908.patch + * gdb-testsuite-add-xfail-for-gdb-29965-in-gdb.threads.patch + * gdb-testsuite-fix-gdb.ada-mi_task_arg.exp-with-newer.patch + * gdb-testsuite-fix-gdb.arch-i386-signal.exp-on-x86_64.patch + * gdb-testsuite-fix-gdb.cp-m-static.exp-regression-on-.patch + * gdb-testsuite-fix-gdb.dwarf2-nullptr_t.exp-with-cc-w.patch + * gdb-testsuite-fix-regexps-in-gdb.base-step-over-sysc.patch + * gdb-symtab-find-main-language-without-symtab-expansi.patch + * gdb-testsuite-add-wait-for-index-cache-in-gdb.dwarf2.patch +- Patches moved (from "Backport from gdb-patches" to + "Backports from master, available in next release"): + * gdb-cli-handle-pending-c-after-rl_callback_read_char.patch + * gdb-testsuite-add-have_host_locale.patch +- Maintenance script qa.sh: + * Remove PR28463, PR28108, PR29247 and PR29160 kfails. + * Remove PR30540, PR30908, PR29965 kfails. + * Remove gdb.ada/mi_task_arg.exp kfail. +- Limit "Suggests: %{python}-Pygments" to SLE-15 and later. + +------------------------------------------------------------------- +Sat Oct 21 08:05:18 UTC 2023 - Tom de Vries + +- Mention import-fedora.sh to fix warning. +- Maintenance script qa.sh: + * Update kfail for PR28561. + +------------------------------------------------------------------- +Fri Oct 20 10:43:32 UTC 2023 - Tom de Vries + +- Maintenance script import-fedora.sh: + * New script. Move skipped patches list from gdb.spec to script. +- Update to fedora 38 @ 82cc8e0. +- Patch renamed: + * pass-const-frame_info_ptr-reference-for-skip_-langua.patch -> + gdb-rhbz2192105-ftbs-dangling-pointer +- Patches added: + * gdb-bz2237392-dwarf-obstack-allocation.patch + * gdb-bz2237515-debuginfod-double-free.patch + * gdb-rhbz2160211-excessive-core-file-warnings.patch + * gdb-rhbz2196395-debuginfod-legacy-openssl-crash.patch + * gdb-rhbz2233961-CVE-2022-4806.patch + * gdb-rhbz2233965-memory-leak.patch +- Maintenance script qa-local.sh: + * Add openSUSE_Leap_15.5 and openSUSE_Factory_LegacyX86. + * Add "List configs" item. + * Skip i586 for SLE-11. +- Maintenance script qa.sh: + * Make sure exit status is 0 + +------------------------------------------------------------------- +Wed Sep 27 09:22:47 UTC 2023 - Tom de Vries + +- Add "Suggests: %{python}-Pygments". +- Maintenance script qa.sh: + * Note investigation of some ada test-cases. + * Update PR30547 kfail. + * Add PR28561 kfail. + * Update PKRU-related kfail. + * Use openSUSE_Factory_LegacyX86.i586 instead of + openSUSE_Factory.i586. + * Remove PR27813 kfail and corresponding todo. + +------------------------------------------------------------------- +Sun Aug 20 00:41:09 UTC 2023 - Luciano Santos + +- Drop libdebuginfod1 BuildRequires/Recommends. The former isn't + needed because there's a build requirement on libdebuginfod-devel + already, which will pull the shared library. And the latter, + because it's bogus since RPM auto generated dependency will take + care of that requirement. + +------------------------------------------------------------------- +Wed Jun 14 06:23:42 UTC 2023 - Tom de Vries + +- Patches added (master backports): + * pass-const-frame_info_ptr-reference-for-skip_-langua.patch +- Maintenance script qa.sh: + * Add PR30543 kfail. + * Remove PR29793 kfail. + +------------------------------------------------------------------- +Mon Jun 12 08:36:48 UTC 2023 - Tom de Vries + +- Patches added (master backports): + * fix-pr30369-regression-on-aarch64-arm-pr30506.patch + * gdb-tdep-aarch64-fix-frame-address-of-last-insn.patch + * gdb-testsuite-fix-breakpoint-regexp-in-gdb.ada-out_o.patch + * gdb-testsuite-relax-breakpoint-count-check-in-gdb.py.patch + * gdb-testsuite-fix-buffer-overflow-in-gdb.base-signed.patch + * gdb-testsuite-require-syscall-time-in-gdb.reverse-ti.patch + * gdb-testsuite-handle-missing-gdc-in-gdb.dlang-dlang-.patch + * gdb-testsuite-add-basic-lmap-for-tcl-8.6.patch + * gdb-testsuite-fix-gdb.rust-watch.exp-on-ppc64le.patch + * gdb-testsuite-fix-gdb.python-py-breakpoint.exp-timeo.patch + * powerpc-fix-for-gdb.reverse-finish-precsave.exp-and-.patch + * powerpc-regression-fix-for-reverse-finish-command.patch + * gdb-testsuite-don-t-use-string-cat-in-gdb.dwarf2-dw2.patch + * move-step_until-procedure.patch +- Patches added (gdb-patches backport): + * gdb-testsuite-add-have_host_locale.patch +- Patches added (fedora patch fixups): + * fixup-gdb-6.3-gstack-20050411.patch + * fixup-gdb-6.3-attach-see-vdso-test.patch + * fixup-gdb-lineno-makeup-test.patch + * fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch +- Patches dropped: + * gdb-ppc-power7-test.patch + * gdb-rhbz1156192-recursive-dlopen-test.patch + * gdb-6.3-bz140532-ppc-unwinding-test.patch +- Maintenance script qa.sh: + * Add PR30540, PR30537, PR30021 and PR30542 KFAILs. + * Add gdb.base/gcore-excessive-memory.exp internal error. + * Update gdb.base/inline-frame-cycle-unwind.exp KFAIL comment. + +------------------------------------------------------------------- +Fri Jun 9 06:26:02 UTC 2023 - Tom de Vries + +- Patches added (master backports): + * aarch64-avoid-initializers-for-vlas.patch + +------------------------------------------------------------------- +Tue Jun 6 06:00:11 UTC 2023 - Tom de Vries + +- Rebase to 13.2 release (fedora 38 @ fc4e284) + * Replace gdb-12.1.tar.bz2 with gdb-13.2.tar.bz2. +- Patches dropped: + * add-elfcompress_zstd.patch + * binutils-gdb-support-zstd-compressed-debug-section.patch + * fix-comparison-of-unsigned-long-int-to-int-in-record_linux_system_call.patch + * fix-core-file-detach-crash-corefiles-29275.patch + * fix-for-gdb.base-solib-search.exp-test.patch + * fix-gdb-build-elf-support-check-lzstd.patch + * fixup-gdb-rhbz1325795-framefilters-test.patch + * gdb-6.3-focus-cmd-prev-test.patch + * gdb-6.3-inheritancetest-20050726.patch + * gdb-6.3-test-dtorfix-20050121.patch + * gdb-6.3-test-movedir-20050125.patch + * gdb-6.3-threaded-watchpoints2-20050225.patch + * gdb-6.6-buildid-locate-rpm-scl.patch + * gdb-6.6-bz230000-power6-disassembly-test.patch + * gdb-add-gdb-syscalls-makefile.patch + * gdb-add-support-for-readline-8.2.patch + * gdb-bz601887-dwarf4-rh-test.patch + * gdb-disable-commit-resumed-in-target_kill.patch + * gdb-fix-assert-in-handle_jit_event.patch + * gdb-fix-assert-when-quitting-gdb-while-a-thread-is-stepping.patch + * gdb-fix-for-gdb.base-eof-exit.exp-test-failures.patch + * gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch + * gdb-fortran-frame-string.patch + * gdb-handle-pending-c-after-rl_callback_read_char.patch + * gdb-improved-eof-handling-when-using-readline-7.patch + * gdb-physname-pr11734-test.patch + * gdb-physname-pr12273-test.patch + * gdb-record-handle-statx-system-call.patch + * gdb-rhbz1325795-framefilters-test.patch + * gdb-rhbz1398387-tab-crash-test.patch + * gdb-runtest-pie-override.patch + * gdb-symtab-fix-handling-of-dw_tag_unspecified_type.patch + * gdb-tdep-fix-powerpc-ieee-128-bit-format-arg-passing.patch + * gdb-tdep-handle-pipe2-syscall-for-amd64.patch + * gdb-tdep-support-catch-syscall-pipe2-for-i386.patch + * gdb-tdep-update-syscalls-ppc64-ppc-linux.xml.patch + * gdb-test-expr-cumulative-archer.patch + * gdb-testsuite-add-kfail-in-gdb.threads-fork-plus-threads.exp.patch + * gdb-testsuite-add-new-gdb_attach-to-check-attach-command.patch + * gdb-testsuite-address-test-failures-in-gdb.mi-mi-multi-commands.exp.patch + * gdb-testsuite-detect-change-instead-of-init-in-gdb.mi-mi-var-block.exp.patch + * gdb-testsuite-enable-some-test-cases-for-x86_64-m32.patch + * gdb-testsuite-fix-fail-in-gdb.threads-fork-and-threads.exp.patch + * gdb-testsuite-fix-gdb.ada-literals.exp-with-aarch64.patch + * gdb-testsuite-fix-gdb.base-break-idempotent.exp-on-ppc.patch + * gdb-testsuite-fix-gdb.base-catch-syscall.exp-with-with-expat-no.patch + * gdb-testsuite-fix-gdb.base-catch-syscall.exp-without-enable-targets.patch + * gdb-testsuite-fix-gdb.base-infoline-reloc-main-from-.patch + * gdb-testsuite-fix-gdb.base-nested-subp-2-3-.exp-with.patch + * gdb-testsuite-fix-gdb.dwarf2-dw2-dir-file-name.exp-w.patch + * gdb-testsuite-fix-gdb.dwarf2-dw2-out-of-range-end-of-seq.exp-on-aarch64.patch + * gdb-testsuite-fix-gdb.dwarf2-dw2-unspecified-type-foo.c-with-m32.patch + * gdb-testsuite-fix-gdb.mi-mi-sym-info.exp-on-opensuse-tumbleweed.patch + * gdb-testsuite-fix-gdb.opt-clobbered-registers-o2.exp-with-gcc-12.patch + * gdb-testsuite-fix-gdb.reverse-i387-env-reverse.exp-for-pie.patch + * gdb-testsuite-fix-gdb.reverse-test_ioctl_tcsetsw.exp-with-libc-debuginfo.patch + * gdb-testsuite-fix-gdb.threads-killed-outside.exp-on-aarch64.patch + * gdb-testsuite-fix-have_mpx-test.patch + * gdb-testsuite-fix-occasional-failure-in-gdb.mi-mi-multi-commands.exp.patch + * gdb-testsuite-fix-test-failure-when-building-against-readline-v7.patch + * gdb-testsuite-handle-init-errors-in-gdb.mi-user-selected-context-sync.exp.patch + * gdb-testsuite-handle-missing-.note.gnu-stack.patch + * gdb-testsuite-handle-older-python-in-gdb.python-py-send-packet.py.patch + * gdb-testsuite-handle-pipe2-syscall-in-gdb.base-catch-syscall.exp.patch + * gdb-testsuite-handle-quotes-in-gdb_py_module_available.patch + * gdb-testsuite-handle-unordered-dict-in-gdb.python-py-mi-cmd.exp.patch + * gdb-testsuite-refactor-gdb.threads-detach-step-over.exp.patch + * gdb-testsuite-remove-attach-test-from-can_spawn_for_attach.patch + * gdb-testsuite-remove-global-declarations-in-gdb.threads-detach-step-over.exp.patch + * gdb-testsuite-remove-target-limits-in-gdb.base-catch-syscall.exp.patch + * gdb-testsuite-skip-gdb.fortran-namelist.exp-for-gfortran-4.8.patch + * gdb-testsuite-support-recording-of-getrandom.patch + * gdb-testsuite-workaround-unnecessary-.s-file-with-gfortran-4.8.patch + * gdb-update-syscalls-amd64-i386-linux.xml.patch + * gdbserver-switch-to-right-process-in-find_one_thread.patch + * make-gdb.ada-float-bits.exp-more-generic.patch + * powerpc-add-support-for-ieee-128-bit-format.patch + * powerpc-correct-the-gdb-ioctl-values-for-tcgets-tcsets-tcsetsw-and-tcsetsf.patch + * powerpc-fix-for-gdb.base-eh_return.exp.patch + * powerpc-fix-gdb.base-watchpoint.exp-on-power-9.patch + * powerpc-update-expected-floating-point-output-for-gdb.arch-altivec-regs.exp-and-gdb.arch-vsx-regs.exp.patch +- Patches added: + * fixup-gdb-bz634108-solib_address.patch + * gdb-binutils29988-read_indexed_address.patch + * gdb-cli-handle-pending-c-after-rl_callback_read_char.patch + * gdb-rhbz2177655-aarch64-pauth-valid-regcache.patch + * gdb-rhbz2183595-rustc-inside_main.patch + * gdb-testsuite-fix-gdb.gdb-python-helper.exp-with-o2-.patch + * gdb-testsuite-handle-output-after-prompt-in-gdb.thre.patch + * gdb-testsuite-simplify-gdb.base-unwind-on-each-insn..patch + * remove-some-unnecessary-includes-from-exp.y.patch + * gdb-testsuite-fix-gdb.rust-main-crash.exp.patch +- Patches modified: + * gdb-6.3-bz140532-ppc-unwinding-test.patch + * gdb-6.3-gstack-20050411.patch + * gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch + * gdb-6.6-buildid-locate-rpm-suse.patch + * gdb-6.6-buildid-locate-rpm.patch + * gdb-6.6-buildid-locate-solib-missing-ids.patch + * gdb-6.6-buildid-locate.patch + * gdb-6.7-testsuite-stable-results.patch + * gdb-ccache-workaround.patch + * gdb-core-open-vdso-warning.patch + * gdb-fedora-libncursesw.patch + * gdb-gcore-bash.patch + * gdb-linux_perf-bundle.patch + * gdb-testsuite-ada-pie.patch + * gdb-testsuite-add-xfail-in-gdb.arch-i386-pkru.exp.patch + * gdb-testsuite-factor-out-proc-linux_kernel_version.patch + * gdb-testsuite-prevent-compilation-fails-with-unix-fpie-pie.patch +- Maintenance script qa.sh: + * Add -i586 and -x86_64. + * Add KFAILs for PR29040, PR30521, PR30180, PR30518, PR30519. + * Update some KFAIL patterns. + * Add some factory KFAILs. + * Add gdb.base/longjmp-until-in-main.exp in PR26967 KFAILs. +- Maintenance script qa-local.sh: + * Factor out version variable, update to 13.2. + * Try to give reason for build failure. + * Use -$arch as argument to qa.sh. + +------------------------------------------------------------------- + +Mon May 22 21:01:44 UTC 2023 - Dirk Müller + +- disable werror as a workaround for deprecation warnings with + python 3.11 (bsc#1211052) + +------------------------------------------------------------------- + +Fri Apr 7 07:48:58 UTC 2023 - Tom de Vries + +- Revert to singlespec multibuild. + +------------------------------------------------------------------- +Tue Apr 4 13:27:03 UTC 2023 - Tom de Vries + +- Add multispec _multibuild. + +------------------------------------------------------------------- +Tue Apr 4 11:29:35 UTC 2023 - Tom de Vries + +- Don't use multibuild. + +------------------------------------------------------------------- +Tue Apr 4 08:47:10 UTC 2023 - Tom de Vries + +- Fix license, again (bsc#1210081). + +------------------------------------------------------------------- +Fri Mar 3 12:41:21 UTC 2023 - Tom de Vries + +- Maintenance script qa.sh: + * Expand kfail pattern for PR29897. + * Add PR29965 kfail. + +------------------------------------------------------------------- +Thu Mar 2 08:28:32 UTC 2023 - Tom de Vries + +- Re-enable testing all test-cases, undoing accidental change in + previous commit. +- Add --with=for_chroot. + +------------------------------------------------------------------- +Thu Feb 16 10:57:10 UTC 2023 - Tom de Vries + +- Patches dropped (bsc#1207712): + * gdb-container-rh-pkg.patch +- Patches added (bsc#1207712): + * gdb-testsuite-add-gdb.suse-debranding.exp.patch +- Patches added (test-case fix): + * gdb-testsuite-fix-gdb.dwarf2-dw2-dir-file-name.exp-w.patch +- Patches added (fedora patch fixup): + * fixup-gdb-test-dw2-aranges.patch +- Patches added (master backports): + * gdb-testsuite-add-xfail-in-gdb.arch-i386-pkru.exp.patch + * gdb-testsuite-add-xfail-in-gdb.python-py-record-btra.patch + * gdb-testsuite-factor-out-proc-linux_kernel_version.patch + * gdb-testsuite-fix-gdb.base-infoline-reloc-main-from-.patch + * gdb-testsuite-fix-gdb.base-nested-subp-2-3-.exp-with.patch + * gdb-testsuite-fix-gdb.threads-schedlock.exp-on-fast-.patch + * gdb-testsuite-handle-missing-.note.gnu-stack.patch + * gdb-testsuite-simplify-gdb.arch-amd64-disp-step-avx..patch + * gdb-testsuite-fix-gdb.threads-schedlock.exp-for-gcc-.patch + * gdb-testsuite-add-xfail-case-in-gdb.python-py-record.patch + * add-elfcompress_zstd.patch + * binutils-gdb-support-zstd-compressed-debug-section.patch + * fix-gdb-build-elf-support-check-lzstd.patch +- Patches removed (dropped by fedora): + * gdb-test-ivy-bridge.patch +- Disable "BuildRequires: %{gcc}-fortran" for SLE-11. +- Maintenance script qa-local.sh: + * Add SLE-11 to configs. + * Build with --no-verify. +- Maintenance script qa.sh: + * Add -sle11. + +------------------------------------------------------------------- +Tue Dec 13 10:39:19 UTC 2022 - Tom de Vries + +- Maintenance script qa.sh: + * Re-enable PR26284 kfails. + * Remove mention of PR28275. + * Add PR29897 kfail. +- Mention CVE-2018-7208 and CVE-2017-16829. + +------------------------------------------------------------------- +Tue Dec 13 09:52:56 UTC 2022 - Tom de Vries + +- Mention SLE-21561, bnc#1081527, and bnc#1068950. + +------------------------------------------------------------------- +Thu Dec 1 15:20:21 UTC 2022 - Tom de Vries + +- Patches added (gdb 12 release branch backports): + * gdb-disable-commit-resumed-in-target_kill.patch + * gdb-fix-assert-when-quitting-gdb-while-a-thread-is-stepping.patch + * gdb-testsuite-add-new-gdb_attach-to-check-attach-command.patch + * gdb-testsuite-refactor-gdb.threads-detach-step-over.exp.patch + * gdb-testsuite-remove-global-declarations-in-gdb.threads-detach-step-over.exp.patch + * gdbserver-switch-to-right-process-in-find_one_thread.patch +- Patches removed: + * gdb-testsuite-fix-race-in-gdb.threads-detach-step-over.exp.patch +- Maintenance script qa.sh: + * Disable PR26284 kfails. + * Add PR29841 kfails. + * Add kfail_powerpc64le_sle12, kfail_s390 and kfail_s390x. + * Add -s390 and -s390x. + * Add gdb.base/gdb-rhbz1156192-recursive-dlopen.exp kfail. + * Add PR26967 kfails. + * Move PR27027 kfails from kfail_factory to kfail. + * Add -ppc64le alias for -powerpc64le. + * Add gdb.threads/interrupt-while-step-over.exp kfail. + * Add gdb.tui/tui-layout-asm-short-prog.exp kfail. + * Add unix/-fPIE/-fpie overrides -static kfails. + * Add gdb.guile/scm-disasm.exp kfail. + * Add gdb.base/gnu_vector.exp to existing kfail. + * Add gdb.guile/scm-symtab.exp kfail. + * Add gdb.base/write_mem.exp kfail. + +------------------------------------------------------------------- +Tue Nov 22 15:03:04 UTC 2022 - Tom de Vries + +- Maintenance script qa.sh: + - Add openSUSE Leap 15.4 ppc64le to known clean configs. + +------------------------------------------------------------------- +Wed Nov 16 13:49:01 UTC 2022 - Tom de Vries + +- Maintenance script qa.sh: + - Update PR26363 internal error pattern. + - Add PR29790 kfail. + - Add -powerpc64le option. + - Generalize PR26915 kfail patterns. + - Move PR28478 patterns from kfail_factory to kfail. + - Add PR29781 and PR27813 kfails. + - Add SLE-15 ppc64le to known clean configs. + +------------------------------------------------------------------- +Tue Nov 15 08:14:11 UTC 2022 - Tom de Vries + +- Maintenance script qa-remote.sh: + * Use qa.sh alongside qa-remote.sh. +- Maintenance script qa.sh: + * Add PR29783 internal error. +- Patch removed (intended effect not observed): + * gdb-fix-watchpoints-triggered.patch + +------------------------------------------------------------------- +Fri Nov 11 12:06:44 UTC 2022 - Tom de Vries + +- Maintenance script qa.sh: + * Handle librpm == "" and nolibrpm == "". +- Maintenance script qa-remote.sh: + * Make "Get remote testsuite results" even more verbose. + * Make hardcoded pattern gdb-testresults-12.1-*.*.rpm more + generic. + * Add missing setting of rpm variable in "Getting rpms" case. +- Patches added (backport from trunk): + * gdb-testsuite-fix-gdb.base-break-idempotent.exp-on-ppc.patch + * powerpc-fix-gdb.base-watchpoint.exp-on-power-9.patch + +------------------------------------------------------------------- +Fri Oct 21 08:03:27 UTC 2022 - Tom de Vries + +- Maintenance script qa-remote.sh: + * Make "Get remote testsuite results" more verbose. + +------------------------------------------------------------------- +Wed Oct 19 16:35:34 UTC 2022 - Tom de Vries + +- Patches added (swo#29277): + * gdb-fix-assert-in-handle_jit_event.patch +- Maintenance script qa.sh: + * Add PR29706 and PR28617 kfails. + +------------------------------------------------------------------- +Thu Sep 29 08:25:06 UTC 2022 - Fabian Vogt + +- Add patch to fix build with readline 8.2: + * gdb-add-support-for-readline-8.2.patch + +------------------------------------------------------------------- +Wed Sep 28 11:50:45 UTC 2022 - Tom de Vries + +- Patches added: + * gdb-testsuite-fix-gdb.mi-mi-sym-info.exp-on-opensuse-tumbleweed.patch +- Maintenance script qa.sh: + * Add PR26873 kfails. + +------------------------------------------------------------------- +Fri Sep 23 09:46:57 UTC 2022 - Tom de Vries + +- Maintenance script qa-remote.sh: + * Make rpm matching yet more precise. +- Update patch: + * gdb-tdep-fix-powerpc-ieee-128-bit-format-arg-passing.patch +- Add patches: + * gdb-handle-pending-c-after-rl_callback_read_char.patch + * gdb-testsuite-fix-have_mpx-test.patch + * gdb-symtab-fix-handling-of-dw_tag_unspecified_type.patch + * gdb-testsuite-fix-gdb.dwarf2-dw2-unspecified-type-foo.c-with-m32.patch + +------------------------------------------------------------------- +Thu Sep 22 13:38:31 UTC 2022 - Dirk Müller + +- use python3-xml if python is python3 + +------------------------------------------------------------------- +Fri Sep 2 09:13:08 UTC 2022 - Tom de Vries + +- Maintenance script qa.sh: + * Generalize PR29405 kfails. +- Maintenance script qa-remote.sh: + * Make rpm matching more precise. +- Patches added: + * gdb-tdep-fix-powerpc-ieee-128-bit-format-arg-passing.patch + +------------------------------------------------------------------- +Mon Aug 22 02:58:00 UTC 2022 - Martin LiÅ¡ka + +- Enable debuginfod for all archs as we index all TW RPM files. +- Recommend libdebuginfod1 when one installs gdb so that + it can utilize debuginfod server by default. + +------------------------------------------------------------------- +Tue Aug 2 12:01:23 UTC 2022 - Tom de Vries + +- Fix build with gcc 13 by using -Wno-error=enum-int-mismatch. + +------------------------------------------------------------------- +Sat Jul 30 07:24:23 UTC 2022 - Tom de Vries + +- Maintenance script qa.sh: + * Add SLE-12/x86_64 to "known clean configs". + * Add fail for PR29405. + * Add fail for PR26915. + +------------------------------------------------------------------- +Fri Jul 29 06:53:15 UTC 2022 - Tom de Vries + +- Patches added: + * gdb-testsuite-fix-gdb.threads-killed-outside.exp-on-aarch64.patch +- Maintenance script qa.sh: + * Remove PR29247 internal-error. + * Add SLE-15/aarch64 to "known clean configs". + +------------------------------------------------------------------- +Thu Jul 28 05:48:21 UTC 2022 - Tom de Vries + +- Patches added: + * gdb-fix-watchpoints-triggered.patch +- Maintenance script qa.sh: + * Add kfails for PR25038, PR29253, and PR29423. + * Remove gdb.mi/mi-var-invalidate-shlib.exp kfails. +- Mention qa-local.sh, qa-remote.sh and README.qa as sources. + +------------------------------------------------------------------- +Wed Jul 27 06:26:34 UTC 2022 - Tom de Vries + +- Maintenance script qa-local.sh: + * Use have_combo consistently. +- Maintenance script qa.sh: + * Add kfail_aarch64. + * Add PR29419/PR29409 kfails. + * Update PR29247 kfails. +- Patches added: + * make-gdb.ada-float-bits.exp-more-generic.patch + * gdb-testsuite-fix-gdb.ada-literals.exp-with-aarch64.patch + +------------------------------------------------------------------- +Tue Jul 26 06:56:40 UTC 2022 - Tom de Vries + +- Actually apply fixup-gdb-test-bt-cfi-without-die.patch and + fixup-2-gdb-rhbz1553104-s390x-arch12-test.patch. + +------------------------------------------------------------------- +Mon Jul 25 20:28:02 UTC 2022 - Tom de Vries + +- Also remove gdb-6.5-readline-long-line-crash-test.patch from + patches list in gdb.spec. + +------------------------------------------------------------------- +Mon Jul 25 08:11:07 UTC 2022 - Tom de Vries + +- Patches added: + * powerpc-add-support-for-ieee-128-bit-format.patch + * powerpc-correct-the-gdb-ioctl-values-for-tcgets-tcsets-tcsetsw-and-tcsetsf.patch + * gdb-testsuite-remove-target-limits-in-gdb.base-catch-syscall.exp.patch + * powerpc-fix-for-gdb.base-eh_return.exp.patch + * fix-comparison-of-unsigned-long-int-to-int-in-record_linux_system_call.patch + * gdb-testsuite-fix-gdb.reverse-test_ioctl_tcsetsw.exp-with-libc-debuginfo.patch + * fixup-gdb-test-bt-cfi-without-die.patch + * fix-core-file-detach-crash-corefiles-29275.patch + * gdb-testsuite-fix-gdb.dwarf2-dw2-out-of-range-end-of-seq.exp-on-aarch64.patch + * gdb-testsuite-fix-gdb.base-catch-syscall.exp-without-enable-targets.patch + * gdb-testsuite-fix-gdb.base-catch-syscall.exp-with-with-expat-no.patch + * fix-for-gdb.base-solib-search.exp-test.patch +- Patch removed: + * gdb-6.7-ppc-clobbered-registers-O2-test.patch + * gdb-6.5-readline-long-line-crash-test.patch +- Patches updated: + * gdb-tdep-update-syscalls-ppc64-ppc-linux.xml.patch + * gdb-testsuite-handle-pipe2-syscall-in-gdb.base-catch-syscall.exp.patch + +------------------------------------------------------------------- +Wed Jun 22 14:31:30 UTC 2022 - Tom de Vries + +- Maintenance script qa.sh: + * Add PR28504 KFAILs. + * Make .sum file matching less complex. + * Add fedora test-case kfail. +- Maintenance script qa-local.sh: + * Fix incorrect path name. +- Update comments in gdb.spec. +- Patches added: + * powerpc-update-expected-floating-point-output-for-gdb.arch-altivec-regs.exp-and-gdb.arch-vsx-regs.exp.patch + +------------------------------------------------------------------- +Wed Jun 22 12:41:23 UTC 2022 - Tom de Vries + +- Patches updated: + * gdb-testsuite-support-recording-of-getrandom.patch + (add aarch64 part) +- Maintenance script qa.sh: + * Add i586 to known clean configs. + +------------------------------------------------------------------- +Tue Jun 21 21:22:58 UTC 2022 - Tom de Vries + +- Patches added: + * gdb-testsuite-enable-some-test-cases-for-x86_64-m32.patch + * gdb-testsuite-fix-gdb.reverse-i387-env-reverse.exp-for-pie.patch + * gdb-testsuite-support-recording-of-getrandom.patch +- Patches updated: + * gdb-record-handle-statx-system-call.patch +- Maintenance script qa.sh: + * Allow only two summary files, for i586. + * Add i586 KFAILs. +- Maintenance script qa-local.sh: + * Add i586. + +------------------------------------------------------------------- +Thu Jun 16 13:23:31 UTC 2022 - Tom de Vries + +- Maintenance script qa-local.sh: + * Fix rpm pathname. +- Maintenance script qa-remote.sh: + * Skip stale config openSUSE_Leap_15.2. +- Maintenance script qa.sh: + * Drop known clean config: Leap 15.2 x86_64. + +------------------------------------------------------------------- +Mon Jun 13 09:37:45 UTC 2022 - Tom de Vries + +- Maintenance script qa-local.sh: + * Add cleanup step. + * Add "build all configs without testsuite" step. + * For "build all configs with testsuite" step, redirect output + to log and produce PASS/FAIL line, and make sure buildroot is + removed also in case of missing rpm. + * Use "--clean --trust-all-projects" for osc build commands. +* Drop openSUSE_Leap_15.2. +- Maintenance script qa.sh: + * Rename argument 6 to -local. + * Add PR29247 KFAILs. + * Update internal-error regexps. +- New maintenance script qa-remote.sh. +- Add "build all configs without testsuite" step in README.qa. +- Patches added (backport from trunk): + * gdb-testsuite-remove-attach-test-from-can_spawn_for_attach.patch +- README.qa: + * Add remote qa entry. + * Update local qa entry: + * Add notes entry. + * Other updates to match changes in qa-local.sh. + +------------------------------------------------------------------- +Mon Jun 13 03:16:35 UTC 2022 - Tom de Vries + +- Fix installed but unpackaged /usr/share/info/ctf-spec.info.gz. + +------------------------------------------------------------------- +Sat Jun 11 22:51:37 UTC 2022 - Tom de Vries + +- Rebase to 12.1 release (as in fedora 36 @ 89947a7): + * DBX mode is deprecated, and will be removed in GDB 13. + + * GDB 12 is the last release of GDB that will support building against + Python 2. From GDB 13, it will only be possible to build GDB itself + with Python 3 support. + + * Improved C++ template support: + GDB now treats functions/types involving C++ templates like it does function + overloads. Users may omit parameter lists to set breakpoints on families of + template functions, including types/functions composed of multiple template types: + (gdb) break template_func(template_1, int) + The above will set breakpoints at every function `template_func' where + the first function parameter is any template type named `template_1' and + the second function parameter is `int'. + TAB completion also gains similar improvements. + + * New commands: + + maint set backtrace-on-fatal-signal on|off + maint show backtrace-on-fatal-signal + This setting is 'on' by default. When 'on' GDB will print a limited + backtrace to stderr in the situation where GDB terminates with a + fatal signal. This only supported on some platforms where the + backtrace and backtrace_symbols_fd functions are available. + + set source open on|off + show source open + This setting, which is on by default, controls whether GDB will try + to open source code files. Switching this off will stop GDB trying + to open and read source code files, which can be useful if the files + are located over a slow network connection. + + set varsize-limit + show varsize-limit + These are now deprecated aliases for "set max-value-size" and + "show max-value-size". + + task apply [all | TASK-IDS...] [FLAG]... COMMAND + Like "thread apply", but applies COMMAND to Ada tasks. + + watch [...] task ID + Watchpoints can now be restricted to a specific Ada task. + + maint set internal-error backtrace on|off + maint show internal-error backtrace + maint set internal-warning backtrace on|off + maint show internal-warning backtrace + GDB can now print a backtrace of itself when it encounters either an + internal-error, or an internal-warning. This is on by default for + internal-error and off by default for internal-warning. + + set logging on|off + Deprecated and replaced by "set logging enabled on|off". + + set logging enabled on|off + show logging enabled + These commands set or show whether logging is enabled or disabled. + + exit + You can now exit GDB by using the new command "exit", in addition to + the existing "quit" command. + + set debug threads on|off + show debug threads + Print additional debug messages about thread creation and deletion. + + set debug linux-nat on|off + show debug linux-nat + These new commands replaced the old 'set debug lin-lwp' and 'show + debug lin-lwp' respectively. Turning this setting on prints debug + messages relating to GDB's handling of native Linux inferiors. + + maint flush source-cache + Flush the contents of the source code cache. + + maint set gnu-source-highlight enabled on|off + maint show gnu-source-highlight enabled + Whether GDB should use the GNU Source Highlight library for adding + styling to source code. When off, the library will not be used, even + when available. When GNU Source Highlight isn't used, or can't add + styling to a particular source file, then the Python Pygments + library will be used instead. + + set suppress-cli-notifications (on|off) + show suppress-cli-notifications + This controls whether printing the notifications is suppressed for CLI. + CLI notifications occur when you change the selected context + (i.e., the current inferior, thread and/or the frame), or when + the program being debugged stops (e.g., because of hitting a + breakpoint, completing source-stepping, an interrupt, etc.). + + set style disassembler enabled on|off + show style disassembler enabled + If GDB is compiled with Python support, and the Python Pygments + package is available, then, when this setting is on, disassembler + output will have styling applied. + + set ada source-charset + show ada source-charset + Set the character set encoding that is assumed for Ada symbols. Valid + values for this follow the values that can be passed to the GNAT + compiler via the '-gnati' option. The default is ISO-8859-1. + + * Changed commands: + + print + Printing of floating-point values with base-modifying formats like + /x has been changed to display the underlying bytes of the value in + the desired base. This was GDB's documented behavior, but was never + implemented correctly. + + maint packet + This command can now print a reply, if the reply includes + non-printable characters. Any non-printable characters are printed + as escaped hex, e.g. \x?? where '??' is replaces with the value of + the non-printable character. + + clone-inferior + The clone-inferior command now ensures that the TTY, CMD and ARGS + settings are copied from the original inferior to the new one. + All modifications to the environment variables done using the 'set + environment' or 'unset environment' commands are also copied to the new + inferior. + + set debug lin-lwp on|off + show debug lin-lwp + These commands have been removed from GDB. The new command 'set + debug linux-nat' and 'show debug linux-nat' should be used + instead. + + info win + This command now includes information about the width of the tui + windows in its output. + + * GDB's Ada parser now supports an extension for specifying the exact + byte contents of a floating-point literal. This can be useful for + setting floating-point registers to a precise value without loss of + precision. The syntax is an extension of the based literal syntax. + Use, e.g., "16lf#0123abcd#" -- the number of "l"s controls the width + of the floating-point type, and the "f" is the marker for floating + point. + + * MI changes: + + ** The '-add-inferior' with no option flags now inherits the + connection of the current inferior, this restores the behaviour of + GDB as it was prior to GDB 10. + + ** The '-add-inferior' command now accepts a '--no-connection' + option, which causes the new inferior to start without a + connection. + + * Python API: + + ** New function gdb.add_history(), which takes a gdb.Value object + and adds the value it represents to GDB's history list. An + integer, the index of the new item in the history list, is + returned. + + ** New function gdb.history_count(), which returns the number of + values in GDB's value history. + + ** New gdb.events.gdb_exiting event. This event is called with a + gdb.GdbExitingEvent object which has the read-only attribute + 'exit_code', which contains the value of the GDB exit code. This + event is triggered once GDB decides it is going to exit, but + before GDB starts to clean up its internal state. + + ** New function gdb.architecture_names(), which returns a list + containing all of the possible Architecture.name() values. Each + entry is a string. + + ** New function gdb.Architecture.integer_type(), which returns an + integer type given a size and a signed-ness. + + ** New gdb.TargetConnection object type that represents a connection + (as displayed by the 'info connections' command). A sub-class, + gdb.RemoteTargetConnection, is used to represent 'remote' and + 'extended-remote' connections. + + ** The gdb.Inferior type now has a 'connection' property which is an + instance of gdb.TargetConnection, the connection used by this + inferior. This can be None if the inferior has no connection. + + ** New 'gdb.events.connection_removed' event registry, which emits a + 'gdb.ConnectionEvent' when a connection is removed from GDB. + This event has a 'connection' property, a gdb.TargetConnection + object for the connection being removed. + + ** New gdb.connections() function that returns a list of all + currently active connections. + + ** New gdb.RemoteTargetConnection.send_packet(PACKET) method. This + is equivalent to the existing 'maint packet' CLI command; it + allows a user specified packet to be sent to the remote target. + + ** New function gdb.host_charset(), returns a string, which is the + name of the current host charset. + + ** New gdb.set_parameter(NAME, VALUE). This sets the gdb parameter + NAME to VALUE. + + ** New gdb.with_parameter(NAME, VALUE). This returns a context + manager that temporarily sets the gdb parameter NAME to VALUE, + then resets it when the context is exited. + + ** The gdb.Value.format_string method now takes a 'styling' + argument, which is a boolean. When true, the returned string can + include escape sequences to apply styling. The styling will only + be present if styling is otherwise turned on in GDB (see 'help + set styling'). When false, which is the default if the argument + is not given, then no styling is applied to the returned string. + + ** New read-only attribute gdb.InferiorThread.details, which is + either a string, containing additional, target specific thread + state information, or None, if there is no such additional + information. + + ** New read-only attribute gdb.Type.is_scalar, which is True for + scalar types, and False for all other types. + + ** New read-only attribute gdb.Type.is_signed. This attribute + should only be read when Type.is_scalar is True, and will be True + for signed types, and False for all other types. Attempting to + read this attribute for non-scalar types will raise a ValueError. + + ** It is now possible to add GDB/MI commands implemented in Python. + +- Update libipt to v2.0.5. +- Patches added: + * gdb-6.3-rh-testversion-20041202.patch + * gdb-6.5-BEA-testsuite.patch + * gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch + * gdb-6.7-charsign-test.patch + * gdb-6.8-bz466901-backtrace-full-prelinked.patch + * gdb-fix-for-gdb.base-eof-exit.exp-test-failures.patch + * gdb-improved-eof-handling-when-using-readline-7.patch + * gdb-libexec-add-index.patch + * gdb-tdep-detect-get_pc_thunk-call-in-i386-prologue.patch + * gdb-testsuite-address-test-failures-in-gdb.mi-mi-multi-commands.exp.patch + * gdb-testsuite-detect-change-instead-of-init-in-gdb.mi-mi-var-block.exp.patch + * gdb-testsuite-fix-gdb.opt-clobbered-registers-o2.exp-with-gcc-12.patch + * gdb-testsuite-fix-occasional-failure-in-gdb.mi-mi-multi-commands.exp.patch + * gdb-testsuite-fix-test-failure-when-building-against-readline-v7.patch + * gdb-testsuite-handle-older-python-in-gdb.python-py-send-packet.py.patch + * gdb-testsuite-handle-quotes-in-gdb_py_module_available.patch + * gdb-testsuite-handle-unordered-dict-in-gdb.python-py-mi-cmd.exp.patch + * gdb-testsuite-skip-gdb.fortran-namelist.exp-for-gfortran-4.8.patch + * gdb-testsuite-workaround-unnecessary-.s-file-with-gfortran-4.8.patch +- Patches dropped: + * aarch64-make-gdbserver-register-set-selection-dynamic.patch + * fix-build-with-current-gcc-el_explicit-location-always-non-null.patch + * fix-gdb.base-sigstep.exp-test-for-ppc.patch + * fix-gdb.multi-multi-term-settings.exp-race.patch + * fixup-2-gdb-6.6-buildid-locate.patch + * fixup-gdb-6.6-buildid-locate.patch + * gdb-6.3-inferior-notification-20050721.patch + * gdb-ada-fix-assert-in-ada_is_unconstrained_packed_array_type.patch + * gdb-build-add-cxx_dialect-to-cxx.patch + * gdb-build-make-c-exp.y-work-with-bison-3.8.patch + * gdb-doc-fix-print-inferior-events-default.patch + * gdb-exp-improve-error-reading-variable-message.patch + * gdb-fortran-handle-dw-at-string-length-with-loclistptr.patch + * gdb-r_version-check.patch + * gdb-rhbz1976887-field-location-kind.patch + * gdb-rhbz2012976-paper-over-fortran-lex-problems.patch + * gdb-symtab-add-call_site_eq-and-call_site_hash.patch + * gdb-symtab-c-ify-call_site.patch + * gdb-symtab-fix-htab_find_slot-call-in-read_call_site_scope.patch + * gdb-symtab-fix-segfault-in-search_one_symtab.patch + * gdb-symtab-remove-compunit_call_site_htab.patch + * gdb-symtab-use-unrelocated-addresses-in-call_site.patch + * gdb-tdep-fix-avx512-m32-support-in-gdbserver.patch + * gdb-tdep-rs6000-don-t-skip-system-call-in-skip_prologue.patch + * gdb-test-for-rhbz1976887.patch + * gdb-testsuite-add-gdb.arch-ppc64-break-on-_exit.exp.patch + * gdb-testsuite-add-gdb.opt-break-on-_exit.exp.patch + * gdb-testsuite-add-gdb.testsuite-dump-system-info.exp.patch + * gdb-testsuite-add-missing-wait-in-gdb.base-signals-state-child.exp.patch + * gdb-testsuite-add-nopie-in-two-test-cases.patch + * gdb-testsuite-detect-no-mpx-support.patch + * gdb-testsuite-disable-inferior-output-in-gdb.base-foll-vfork.exp.patch + * gdb-testsuite-don-t-error-when-trying-to-unset-last_spawn_tty_name.patch + * gdb-testsuite-factor-out-dump_info-in-gdb.testsuite-dump-system-info.exp.patch + * gdb-testsuite-fix-assembly-comments-in-gdb.dwarf2-clang-debug-names.exp.tcl.patch + * gdb-testsuite-fix-data-alignment-in-gdb.arch-i386-avx-sse-.exp.patch + * gdb-testsuite-fix-fail-in-gdb.base-annota1.exp.patch + * gdb-testsuite-fix-fail-in-gdb.tui-basic.exp.patch + * gdb-testsuite-fix-fail-in-gdb.tui-corefile-run.exp.patch + * gdb-testsuite-fix-gdb.ada-big_packed_array.exp-xfail-for-m32.patch + * gdb-testsuite-fix-gdb.arch-i386-pkru.exp-on-linux.patch + * gdb-testsuite-fix-gdb.base-annota1.exp-with-pie.patch + * gdb-testsuite-fix-gdb.base-dcache-flush.exp.patch + * gdb-testsuite-fix-gdb.gdb-selftest.exp.patch + * gdb-testsuite-fix-gdb.guile-scm-type.exp-with-gcc-4.8.patch + * gdb-testsuite-fix-gdb.python-py-events.exp.patch + * gdb-testsuite-fix-gdb.server-server-kill.exp-with-m32.patch + * gdb-testsuite-fix-gdb.threads-check-libthread-db.exp-with-glibc-2.34.patch + * gdb-testsuite-fix-gdb.threads-linux-dp.exp.patch + * gdb-testsuite-fix-gdb.threads-thread-specific-bp.exp.patch + * gdb-testsuite-fix-port-detection-in-gdb.debuginfod-fetch_src_and_symbols.exp.patch + * gdb-testsuite-fix-regexp-in-gdb.base-foll-vfork.exp.patch + * gdb-testsuite-fix-stepi-test-cases-with-unix-m32-fpie-pie.patch + * gdb-testsuite-handle-recursive-internal-problem-in-gdb_internal_error_resync.patch + * gdb-testsuite-handle-runto-fail-in-gdb.mi-mi-var-cp.exp.patch + * gdb-testsuite-handle-sigill-in-two-gdb.arch-powerpc-test-cases.patch + * gdb-testsuite-handle-supports_memtag-in-gdb.base-gdb-caching-proc.exp.patch + * gdb-testsuite-make-gdb.base-annota1.exp-more-robust.patch + * gdb-testsuite-refactor-regexp-in-gdb.base-annota1.exp.patch + * gdb-testsuite-support-fpie-fno-pie-pie-no-pie-in-gdb_compile_rust.patch + * gdb-testsuite-update-test-gdb.base-step-over-syscall.exp.patch + * gdb-testsuite-use-compiler-generated-instead-of-gas-generated-stabs.patch + * gdb-tui-fix-breakpoint-display-functionality.patch + * ibm-z-add-another-arch14-instruction.patch + * ibm-z-remove-lpswey-parameter.patch +- Patched updated: + * gdb-6.3-gstack-20050411.patch + * gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch + * gdb-6.6-buildid-locate-rpm-librpm-workaround.patch + * gdb-6.6-buildid-locate-rpm-scl.patch + * gdb-6.6-buildid-locate-rpm.patch + * gdb-6.6-buildid-locate-solib-missing-ids.patch + * gdb-6.6-buildid-locate.patch + * gdb-cli-add-ignore-errors-command.patch + * gdb-container-rh-pkg.patch + * gdb-core-open-vdso-warning.patch + * gdb-fedora-libncursesw.patch + * gdb-gcore-bash.patch + * gdb-linux_perf-bundle.patch + * gdb-testsuite-handle-init-errors-in-gdb.mi-user-selected-context-sync.exp.patch +- Add BuildRequires python-xml. +- Maintenance script qa.sh: + * Add -sle-12 and -factory options. + * Handle *.-fPIE.-pie.sum files. + * Add KFAILs for PRs 26292, 29238, 25059, 29240, 29241, 29244, + 29245, 29160, 29196. + * Move PR27539 KFAILs from kfail_factory to kfail. +- New maintenance script qa-local.sh. +- New file README.qa. + +------------------------------------------------------------------- +Mon May 9 12:05:38 UTC 2022 - Tom de Vries + +- Patches added (trunk backport): + * gdb-testsuite-detect-no-mpx-support.patch + * gdb-testsuite-handle-init-errors-in-gdb.mi-user-selected-context-sync.exp.patch + * gdb-add-gdb-syscalls-makefile.patch +- Patches added (ml backport): + * gdb-update-syscalls-amd64-i386-linux.xml.patch + * gdb-record-handle-statx-system-call.patch +- Patches added (to be upstreamed): + * gdb-tdep-update-syscalls-ppc64-ppc-linux.xml.patch +- Maintenance script qa.sh: + * Add another KFAIL for PR27027. + * Remove PR28461 KFAIL. + +------------------------------------------------------------------- +Wed May 4 13:49:10 UTC 2022 - Tom de Vries + +- patches added (trunk backport): + * gdb-testsuite-make-gdb.base-annota1.exp-more-robust.patch + * gdb-testsuite-fix-gdb.base-annota1.exp-with-pie.patch +- patches added (gdb-patches ml backport): + * gdb-tdep-handle-pipe2-syscall-for-amd64.patch + * gdb-testsuite-handle-pipe2-syscall-in-gdb.base-catch-syscall.exp.patch + * gdb-tdep-support-catch-syscall-pipe2-for-i386.patch +- Maintenance script qa.sh: + * Add Leap 15.4 x86_64 to know good configs. + +------------------------------------------------------------------- +Fri Apr 29 13:27:04 UTC 2022 - Martin LiÅ¡ka + +- Remove dependency on binutils-gold as the package will be removed + in the future. Gold linker is unmaintained by the upstream project. + +------------------------------------------------------------------- +Thu Apr 14 09:24:07 UTC 2022 - Tom de Vries + +- Fix unresolved BuildRequires fpc for Leap 15.4/i586. + +------------------------------------------------------------------- +Fri Feb 25 14:53:56 UTC 2022 - Tom de Vries + +- Patch added (backport from master): + * fix-build-with-current-gcc-el_explicit-location-always-non-null.patch + +------------------------------------------------------------------- +Fri Feb 11 15:15:58 UTC 2022 - Tom de Vries + +- Maintenance script qa.sh: + * Add KFAILs for PR28667. + +------------------------------------------------------------------- +Mon Feb 7 15:15:58 UTC 2022 - Tom de Vries + +- Patches added (jsc#SLE-22287): + * ibm-z-add-another-arch14-instruction.patch + * ibm-z-remove-lpswey-parameter.patch +- Fedora fixup patch added: + * fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch + +------------------------------------------------------------------- +Thu Feb 3 12:22:35 UTC 2022 - Andreas Schwab + +- gdb-r_version-check.patch: gdb: Don't assume r_ldsomap when r_version > + 1 on Linux + +------------------------------------------------------------------- +Mon Dec 6 17:19:44 UTC 2021 - Tom de Vries + +- Patches added (swo#28323): + gdb-ada-fix-assert-in-ada_is_unconstrained_packed_array_type.patch + +------------------------------------------------------------------- +Tue Nov 30 10:45:32 UTC 2021 - Tom de Vries + +- Patches added (swo#27028, swo#27257): + * gdb-testsuite-fix-gdb.arch-i386-pkru.exp-on-linux.patch + * gdb-tdep-fix-avx512-m32-support-in-gdbserver.patch + +------------------------------------------------------------------- +Fri Nov 26 14:04:38 UTC 2021 - Tom de Vries + +- Patch added (swo#28539, bsc#1192285): + * gdb-symtab-fix-segfault-in-search_one_symtab.patch + +------------------------------------------------------------------- +Mon Nov 22 19:40:55 UTC 2021 - Tom de Vries + +- Patches removed: + * gdb-testsuite-debug-gdb.arch-i386-sse.exp.patch + +------------------------------------------------------------------- +Mon Nov 22 17:47:57 UTC 2021 - Tom de Vries + +- Maintenance script qa.sh: + - Drop openSUSE Leap 15.1. + - Add KFAILs for PR28617. + +------------------------------------------------------------------- +Mon Nov 22 09:25:32 UTC 2021 - Tom de Vries + +- Fix SLE-12 x86_64 unresolvable by removing BuildRequire gcc-java. + +------------------------------------------------------------------- +Mon Nov 22 09:00:45 UTC 2021 - Tom de Vries + +- Fix openSUSE_Factory_ARM armv7l unresolvable by not doing + BuildRequire babeltrace-devel. + +------------------------------------------------------------------- + +Mon Nov 22 08:24:21 UTC 2021 - Tom de Vries + +- Fix SLE-12 x86_64 unresolvable by not doing BuildRequire + babeltrace-devel. + +------------------------------------------------------------------- +Fri Nov 19 15:31:46 UTC 2021 - Tom de Vries + +- Patches added (backport from master): + * gdb-testsuite-add-missing-wait-in-gdb.base-signals-state-child.exp.patch +- Add BuildRequire libsource-highlight. + +------------------------------------------------------------------- +Thu Nov 18 14:01:30 UTC 2021 - Tom de Vries + +- Maintenance script qa.sh: + - Add KFAIL. +- Patches updated (increase sleep time): + * gdb-testsuite-fix-race-in-gdb.threads-detach-step-over.exp.patch +- Patches added (debug hard to reproduce failure): + * gdb-testsuite-debug-gdb.arch-i386-sse.exp.patch + +------------------------------------------------------------------- +Thu Nov 18 11:45:00 UTC 2021 - Tom de Vries + +- Maintenance script qa.sh: + - Add internal-error KFAILs. + - Rewrite gdb.suse check to distinguish between: + "zypper hint printed (librpm)" and + "zypper hint printed (no librpm)". + +------------------------------------------------------------------- +Tue Nov 16 15:50:08 UTC 2021 - Tom de Vries + +- Patch updated (zypper hint doesn't use librpm on SLE-11): + * gdb-testsuite-add-gdb.suse-zypper-hint.exp.patch + +------------------------------------------------------------------- +Thu Nov 11 10:36:08 UTC 2021 - Tom de Vries + +- Patches added (backports from trunk): + * gdb-testsuite-add-gdb.opt-break-on-_exit.exp.patch + * gdb-tdep-rs6000-don-t-skip-system-call-in-skip_prologue.patch + * gdb-testsuite-fix-stepi-test-cases-with-unix-m32-fpie-pie.patch + * gdb-testsuite-fix-assembly-comments-in-gdb.dwarf2-clang-debug-names.exp.tcl.patch + * gdb-doc-fix-print-inferior-events-default.patch + * gdb-testsuite-fix-gdb.guile-scm-type.exp-with-gcc-4.8.patch + * gdb-testsuite-add-gdb.arch-ppc64-break-on-_exit.exp.patch + * gdb-testsuite-don-t-error-when-trying-to-unset-last_spawn_tty_name.patch + * gdb-exp-improve-error-reading-variable-message.patch + * fix-gdb.base-sigstep.exp-test-for-ppc.patch + * gdb-testsuite-fix-regexp-in-gdb.base-foll-vfork.exp.patch +- Patches added (backports from ml): + * gdb-testsuite-disable-inferior-output-in-gdb.base-foll-vfork.exp.patch +- Maintenance script qa.sh: + - Add -m32/-pie to known clean configs. + - Add kfail for PR28467. + +------------------------------------------------------------------- +Tue Nov 9 15:54:58 UTC 2021 - Tom de Vries + +- Fix empty patch: + * gdb-testsuite-fix-fail-in-gdb.tui-basic.exp.patch + +------------------------------------------------------------------- +Tue Nov 9 08:05:16 UTC 2021 - Tom de Vries + +- Limit SLE extra targets to SLE targets. +- Add avr-elf and pru-elf to openSUSE extra targets. + +------------------------------------------------------------------- +Mon Nov 8 14:53:20 UTC 2021 - Tom de Vries + +- Maintenance script qa.sh: + * Add note. + * Add KFAIL, improve KFAIL patterns. +- Patch updated: + * gdb-testsuite-fix-data-alignment-in-gdb.arch-i386-avx-sse-.exp.patch + * gdb-testsuite-fix-race-in-gdb.threads-detach-step-over.exp.patch + +------------------------------------------------------------------- +Sat Nov 6 09:25:28 UTC 2021 - Tom de Vries + +- Replace patch (patch from mailing list, fix SLE-11 apply failure): + * gdb-tdep-aarch64-make-gdbserver-register-set-selection-dynamic.patch + with (now backported from release branch): + * aarch64-make-gdbserver-register-set-selection-dynamic.patch +- Patches added: + * gdb-testsuite-fix-data-alignment-in-gdb.arch-i386-avx-sse-.exp.patch + * gdb-testsuite-fix-fail-in-gdb.tui-basic.exp.patch +- Patches dropped: + * gdb-testsuite-add-checks-to-gdb.arch-i386-sse.exp.patch +- Replace patch: + * gdb-testsuite-Fix-gdb.threads-thread-specific-bp.exp.patch + with (updated version, and patchname now generated by + import-patches.sh): + * gdb-testsuite-fix-gdb.threads-thread-specific-bp.exp.patch +- Maintenance script import-patches.sh: + * Improve argument checking. + * Add usage. + * Use filterdiff to filter out ChangeLog entries. +- Maintenance script qa.sh: + * Fix usage. + * Document todo. + +------------------------------------------------------------------- +Fri Nov 5 23:04:35 UTC 2021 - Tom de Vries + +- Re-enable big endian powerpc, but keep testing disabled. +- Add KFAIL for PR28553. + +------------------------------------------------------------------- +Fri Nov 5 19:15:43 UTC 2021 - Tom de Vries + +- Patch added (move zypper hint test to testsuite): + * gdb-testsuite-add-gdb.suse-zypper-hint.exp.patch + +------------------------------------------------------------------- +Fri Nov 5 15:21:03 UTC 2021 - Tom de Vries + +- Maintenance script qa.sh: + * Add PR28551 KFAIL. + * Add missing quotes for some KFAILs. + * Remove PR28355 KFAIL. + +------------------------------------------------------------------- +Tue Nov 2 13:03:51 UTC 2021 - Tom de Vries + +- Patches added (add back ignore-errors command, dropped in + 11.1 update): + * gdb-cli-add-ignore-errors-command.patch + +------------------------------------------------------------------- +Mon Nov 1 10:04:24 UTC 2021 - Tom de Vries + +- Patches added [swo#28355]: + * gdb-tdep-aarch64-make-gdbserver-register-set-selection-dynamic.patch + +------------------------------------------------------------------- +Thu Oct 28 13:40:28 UTC 2021 - Tom de Vries + +- Mention removed fedora patches: + * gdb-6.3-test-self-20050110.patch + * gdb-bz1219747-attach-kills.patch + * gdb-6.6-buildid-locate-core-as-arg.patch + * gdb-attach-fail-reasons-5of5.patch + * gdb-archer-pie-addons.patch + * gdb-jit-reader-multilib.patch + * gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch + * gdb-archer.patch + * gdb-config.patch + * gdb-6.8-quit-never-aborts.patch +- Mention removed patches: + * gdb-breakpoint-fix-assert-in-jit_event_handler.patch + * gdb-fix-section-matching-in-find_pc_sect_compunit.patch + * gdb-fortran-fix-print-dynamic-array.patch + * gdb-build-hardcode-with-included-regex.patch + * gdb-handle-no-upper-bound-in-value-subscript.patch + * gdb-fix-internal-error-in-process_event_stop_test.patch + * gdb-don-t-return-non-existing-path-in-debuginfod-source-query.patch + * gdb-archer-pie-addons-keep-disabled.patch + * gdb-fix-filename-in-not-in-executable-format-error.patch + * gdb-fix-use-of-invalid-pointer-in-remote-async-inferior-event-handler.patch + * gdb-breakpoints-handle-glibc-with-debuginfo-in-create_exception_master_breakpoint.patch +- Maintenance scripts: + * Add KFAILs in qa.sh. + * Add missing '-a' in gdb.log greps in qa.sh. + * Fix error handling in qa.sh. +- Patches added: + * gdb-testsuite-handle-sigill-in-two-gdb.arch-powerpc-test-cases.patch + * gdb-testsuite-work-around-skip_prologue-problems-in-gdb.threads-process-dies-while-detaching.exp.patch + +------------------------------------------------------------------- +Fri Oct 22 07:03:55 UTC 2021 - Tom de Vries + +- Disable big endian powerpc. +- Maintenance scripts: + * Fix patch filtering in clean.sh. + * Add KFAIL in qa.sh. +- Patches added: + * gdb-testsuite-add-checks-to-gdb.arch-i386-sse.exp.patch + * gdb-testsuite-add-gdb.testsuite-dump-system-info.exp.patch + * gdb-testsuite-add-kfail-in-gdb.threads-fork-plus-threads.exp.patch + * gdb-testsuite-factor-out-dump_info-in-gdb.testsuite-dump-system-info.exp.patch + * gdb-testsuite-fix-fail-in-gdb.threads-fork-and-threads.exp.patch + * gdb-testsuite-fix-gdb.threads-linux-dp.exp.patch + * gdb-testsuite-fix-port-detection-in-gdb.debuginfod-fetch_src_and_symbols.exp.patch + * gdb-testsuite-handle-recursive-internal-problem-in-gdb_internal_error_resync.patch + * gdb-testsuite-handle-runto-fail-in-gdb.mi-mi-var-cp.exp.patch + * gdb-tui-fix-breakpoint-display-functionality.patch + * gdb-testsuite-Fix-gdb.threads-thread-specific-bp.exp.patch +- Patches dropped: + * fix-gdb.threads-linux-dp.exp.patch + +------------------------------------------------------------------- +Wed Oct 20 15:48:40 UTC 2021 - Tom de Vries + +- Added maintenance script: + * qa.sh +- Drop 32bit packages for s390x. + +------------------------------------------------------------------- +Tue Oct 19 08:00:06 UTC 2021 - Tom de Vries + +- Fix SLE-15 s390x: unresolvable, nothing provides + glibc-devel-static-32bit. +- Disable test-case gdb.base/break-interp.exp for SLE-11. + It causes a + "glibc detected *** expect: double free or corruption (out)" in + expect and a subsequent runtest abort. This might be the cause + of the package build failure due to + "Job seems to be stuck here, killed. (after 8hrs of inactivity)" +- Patches added: + * gdb-testsuite-fix-gdb.base-step-over-syscall.exp-with-m32-amd-case.patch + * gdb-testsuite-fix-gdb.ada-big_packed_array.exp-xfail-for-m32.patch + * gdb-testsuite-fix-race-in-gdb.threads-detach-step-over.exp.patch + * fix-gdb.multi-multi-term-settings.exp-race.patch + * gdb-testsuite-update-test-gdb.base-step-over-syscall.exp.patch + +------------------------------------------------------------------- +Mon Oct 18 17:46:06 UTC 2021 - Tom de Vries - 11.1 + +- Rebase to 11.1 release (as in fedora 35 @ 9cd9368): + * Implements SLE-21561. + * GDB now supports general memory tagging functionality if the + underlying architecture supports the proper primitives and hooks. + Currently this is enabled only for AArch64 MTE. + * GDB will now look for the .gdbinit file in a config directory + before looking for ~/.gdbinit. The file is searched for in + the following locations: $XDG_CONFIG_HOME/gdb/gdbinit, + $HOME/.config/gdb/gdbinit, $HOME/.gdbinit. + * GDB will now load and process commands from + ~/.config/gdb/gdbearlyinit or ~/.gdbearlyinit if these files + are present. These files are processed earlier than any of + the other initialization files and can affect parts of GDB's + startup that previously had already been completed before the + initialization files were read, for example styling of the + initial GDB greeting. + * GDB now has two new options "--early-init-command" and + "--early-init-eval-command" with corresponding short options + "-eix" and "-eiex" that allow options (that would normally + appear in a gdbearlyinit file) to be passed on the command + line. + * set startup-quietly on|off + show startup-quietly + When 'on', this causes GDB to act as if "-silent" were passed + on the command line. This command needs to be added to an + early initialization file (e.g. ~/.config/gdb/gdbearlyinit) + in order to affect GDB. + * For RISC-V targets, the target feature + "org.gnu.gdb.riscv.vector" is now understood by GDB, and can + be used to describe the vector registers of a target. + * TUI windows now support mouse actions. The mouse wheel + scrolls the appropriate window. + * Key combinations that do not have a specific action on the + focused window are passed to GDB. For example, you now can + use Ctrl-Left/Ctrl-Right to move between words in the command + window regardless of which window is in focus. Previously + you would need to focus on the command window for such key + combinations to work. + * set python ignore-environment on|off + show python ignore-environment + When 'on', this causes GDB's builtin Python to ignore any + environment variables that would otherwise affect how Python + behaves. This command needs to be added to an early + initialization file (e.g. ~/.config/gdb/gdbearlyinit) in + order to affect GDB. + * set python dont-write-bytecode auto|on|off + show python dont-write-bytecode + When 'on', this causes GDB's builtin Python to not write any + byte-code (.pyc files) to disk. This command needs to be + added to an early initialization file + (e.g. ~/.config/gdb/gdbearlyinit) in order to affect GDB. + When 'off' byte-code will always be written. + When set to 'auto' (the default) Python will check the + PYTHONDONTWRITEBYTECODE environment variable. + * break [PROBE_MODIFIER] [LOCATION] [thread THREADNUM] + [-force-condition] [if CONDITION] + This command would previously refuse setting a breakpoint if + the CONDITION expression is invalid at a location. It now + accepts and defines the breakpoint if there is at least one + location at which the CONDITION is valid. The locations + for which the CONDITION is invalid, are automatically + disabled. If CONDITION is invalid at all of the locations, + setting the breakpoint is still rejected. However, the + '-force-condition' flag can be used in this case for forcing + GDB to define the breakpoint, making all the current + locations automatically disabled. This may be useful if the + user knows the condition will become meaningful at a future + location, e.g. due to a shared library load. +- Update libipt to v2.0.4. Dropped obsoleted patch: + * v1.5-libipt-static.patch +- Obsoleted fedora patches dropped: + * gdb-moribund-utrace-workaround.patch + * gdb-save-restore-file-offset-while-reading-notes-in-core-file.patch + * gdb-vla-intel-fix-print-char-array.patch + * gdb-vla-intel-fortran-strides.patch + * gdb-vla-intel-fortran-vla-strings.patch + * gdb-vla-intel-stringbt-fix.patch + * gdb-vla-intel-tests.patch +- Obsoleted fedora fixup patches dropped: + * fixup-2-gdb-archer-vla-tests.patch + * fixup-2-gdb-rhbz1156192-recursive-dlopen-test.patch + * fixup-3-gdb-archer-vla-tests.patch + * fixup-gdb-6.3-test-pie-20050107.patch + * fixup-gdb-6.3-threaded-watchpoints2-20050225.patch + * fixup-gdb-6.5-sharedlibrary-path.patch + * fixup-gdb-6.8-bz442765-threaded-exec-test.patch + * fixup-gdb-archer-vla-tests.patch + * fixup-gdb-base-gnu-ifunc-strstr-workaround-exp.patch + * fixup-gdb-btrobust.patch + * fixup-gdb-bz634108-solib_address.patch + * fixup-gdb-dts-rhel6-python-compat.patch + * fixup-gdb-gnat-dwarf-crash-3of3.patch + * fixup-gdb-rhbz1156192-recursive-dlopen-test.patch + * fixup-gdb-test-ivy-bridge.patch + * fixup-gdb-vla-intel-fortran-vla-strings.patch + * fixup-gdb-vla-intel-tests.patch +- Obsoleted patches dropped: + * amd64-linux-siginfo-include-order.patch + * gdb-powerpc-remove-512-bytes-region-limit-if-2nd-dawr-is-avaliable.patch + * gdb-support-dw-lle-start-end.patch + * gdb-symtab-fix-infinite-recursion-in-dwarf2_cu-get_builder-again.patch + * gdb-symtab-fix-language-of-frame-without-debug-info.patch + * gdb-symtab-read-cu-base-address-for-enqueued-cu.patch + * gdb-symtab-use-early-continue-in-find_pc_sect_compunit.patch + * gdb-testsuite-catch-condition-evaluation-errors-in-gdb-assert.patch + * gdb-testsuite-detect-gdb-prompt-after-monitor-exit.patch + * gdb-testsuite-disable-selftests-for-factory.patch + * gdb-testsuite-fix-control-flow-in-gdb-reverse-insn-reverse-exp.patch + * gdb-testsuite-fix-failure-in-gdb-base-step-over-no-symbols-exp.patch + * gdb-testsuite-fix-gdb-dlang-watch-loc-exp-on-ppc64.patch + * gdb-testsuite-fix-gdb-reverse-insn-reverse-x86-c-for-m32.patch + * gdb-testsuite-fix-gdb.arch-amd64-stap-three-arg-disp.s.patch + * gdb-testsuite-fix-unset-of-debuginfod_urls-in-default_gdb_init.patch + * gdb-testsuite-fix-xfail-handling-in-gdb.threads-gcore-thread.exp.patch + * gdb-testsuite-gdb-base-morestack-exp-no-clang.patch + * gdb-testsuite-gdb-tui-new-layout-exp-partly-require-tcl86.patch + * gdb-testsuite-handle-sigill-in-gdb-reverse-insn-reverse-exp.patch + * gdb-testsuite-ignore-debuginfod_urls.patch + * gdb-testsuite-prevent-pagination-in-gdb-internalflags.patch + * gdb-threads-fix-lin_thread_get_thread_signals-for-glibc-2.28.patch + * gdb-try-to-load-libthread_db-only-after-reading-all-shared-libraries-when-attaching.patch + * gdb-tui-fix-len_without_escapes-in-tui-disasm.c.patch +- Fedora patches updated: + * gdb-6.3-bz140532-ppc-unwinding-test.patch + * gdb-6.3-bz202689-exec-from-pthread-test.patch + * gdb-6.3-gstack-20050411.patch + * gdb-6.3-inheritancetest-20050726.patch + * gdb-6.3-mapping-zero-inode-test.patch + * gdb-6.3-test-dtorfix-20050121.patch + * gdb-6.3-test-movedir-20050125.patch + * gdb-6.3-threaded-watchpoints2-20050225.patch + * gdb-6.5-bz109921-DW_AT_decl_file-test.patch + * gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch + * gdb-6.5-bz218379-ppc-solib-trampoline-test.patch + * gdb-6.5-bz243845-stale-testing-zombie-test.patch + * gdb-6.5-ia64-libunwind-leak-test.patch + * gdb-6.5-last-address-space-byte-test.patch + * gdb-6.5-readline-long-line-crash-test.patch + * gdb-6.5-section-num-fixup-test.patch + * gdb-6.5-sharedlibrary-path.patch + * gdb-6.6-buildid-locate-rpm-scl.patch + * gdb-6.6-buildid-locate-rpm.patch + * gdb-6.6-buildid-locate-solib-missing-ids.patch + * gdb-6.6-buildid-locate.patch + * gdb-6.6-bz229517-gcore-without-terminal.patch + * gdb-6.6-bz230000-power6-disassembly-test.patch + * gdb-6.6-bz237572-ppc-atomic-sequence-test.patch + * gdb-6.8-bz442765-threaded-exec-test.patch + * gdb-bz601887-dwarf4-rh-test.patch + * gdb-bz634108-solib_address.patch + * gdb-ccache-workaround.patch + * gdb-container-rh-pkg.patch + * gdb-fedora-libncursesw.patch + * gdb-fortran-frame-string.patch + * gdb-glibc-strstr-workaround.patch + * gdb-lineno-makeup-test.patch + * gdb-linux_perf-bundle.patch + * gdb-physname-pr11734-test.patch + * gdb-ppc-power7-test.patch + * gdb-rhbz1156192-recursive-dlopen-test.patch + * gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch + * gdb-rhbz1350436-type-printers-error.patch + * gdb-rhbz1398387-tab-crash-test.patch + * gdb-test-dw2-aranges.patch + * gdb-test-ivy-bridge.patch + * gdb-test-pid0-core.patch +- Patches updated: + * gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch + * gdb-gcore-bash.patch +- Fedora patches added: + * gdb-6.3-attach-see-vdso-test.patch + * gdb-6.3-inferior-notification-20050721.patch + * gdb-6.5-gcore-buffer-limit-test.patch + * gdb-6.5-missed-trap-on-step-test.patch + * gdb-rhbz1976887-field-location-kind.patch + * gdb-rhbz2012976-paper-over-fortran-lex-problems.patch + * gdb-test-for-rhbz1976887.patch +- Fedora fixup patches added: + * fixup-2-gdb-6.6-buildid-locate.patch + * fixup-gdb-glibc-strstr-workaround.patch + * fixup-gdb-linux_perf-bundle.patch + * fixup-gdb-rhbz1325795-framefilters-test.patch + * fixup-gdb-rhbz1553104-s390x-arch12-test.patch +- Patches added: + * fix-gdb.mi-new-ui-mi-sync.exp.patch + * fix-gdb.threads-linux-dp.exp.patch + * gdb-add-index.sh-fix-bashism.patch + * gdb-build-add-cxx_dialect-to-cxx.patch + * gdb-build-make-c-exp.y-work-with-bison-3.8.patch + * gdb-python-finishbreakpoint-update.patch + * gdb-symtab-add-call_site_eq-and-call_site_hash.patch + * gdb-symtab-c-ify-call_site.patch + * gdb-symtab-fix-htab_find_slot-call-in-read_call_site_scope.patch + * gdb-symtab-remove-compunit_call_site_htab.patch + * gdb-symtab-use-unrelocated-addresses-in-call_site.patch + * gdb-testsuite-add-nopie-in-two-test-cases.patch + * gdb-testsuite-fix-fail-in-gdb.base-annota1.exp.patch + * gdb-testsuite-fix-fail-in-gdb.tui-corefile-run.exp.patch + * gdb-testsuite-fix-gdb.base-dcache-flush.exp.patch + * gdb-testsuite-fix-gdb.gdb-selftest.exp.patch + * gdb-testsuite-fix-gdb.python-py-events.exp.patch + * gdb-testsuite-fix-gdb.server-server-kill.exp-with-m32.patch + * gdb-testsuite-fix-gdb.threads-check-libthread-db.exp-with-glibc-2.34.patch + * gdb-testsuite-handle-supports_memtag-in-gdb.base-gdb-caching-proc.exp.patch + * gdb-testsuite-prevent-compilation-fails-with-unix-fpie-pie.patch + * gdb-testsuite-refactor-regexp-in-gdb.base-annota1.exp.patch + * gdb-testsuite-support-fpie-fno-pie-pie-no-pie-in-gdb_compile_rust.patch + * gdb-testsuite-use-compiler-generated-instead-of-gas-generated-stabs.patch +- Fedora patches replaced: + * fixup-gdb-6.6-buildid-locate.patch +- Added maintenance scripts: + * import-patches.sh + * clean.sh + +------------------------------------------------------------------- +Tue Jul 20 13:46:59 UTC 2021 - Andreas Schwab + +- amd64-linux-siginfo-include-order.patch: Adjust include order to avoid + gnulib error + +------------------------------------------------------------------- +Wed Jun 23 11:52:54 UTC 2021 - Andreas Schwab + +- gdb-support-dw-lle-start-end.patch: Support DW_LLE_start_end + (bsc#1187044) + +------------------------------------------------------------------- +Thu Jun 17 11:19:14 UTC 2021 - Tom de Vries + +- Fix Leap 15.3 s390x gdb:testsuite build, by not requiring 32-bit + packages for openSUSE s390x. + +------------------------------------------------------------------- +Thu Jun 17 10:18:44 UTC 2021 - Tom de Vries + +- Fix Leap 15.3 s390x gdb:testsuite build, by not requiring + glibc-devel-static-32bit. + +------------------------------------------------------------------- +Thu Jun 17 09:36:06 UTC 2021 - Tom de Vries + +- Fix Leap 15.3 i586 gdb:testsuite build, by not requiring fpc. + +------------------------------------------------------------------- +Wed Jun 16 10:47:16 UTC 2021 - Tom de Vries + +- Backport updated fix from upstream [bsc#1185638, swo#26327]: + * gdb-symtab-fix-infinite-recursion-in-dwarf2_cu-get_builder-again.patch + +------------------------------------------------------------------- +Fri May 21 13:31:07 UTC 2021 - Tom de Vries + +- Backport fix for assert [bsc#1186040, swo#27889]: + * gdb-breakpoint-fix-assert-in-jit_event_handler.patch + +------------------------------------------------------------------- +Wed May 12 14:12:41 UTC 2021 - Tom de Vries + +- Remove fix due to regressions [bsc#1185638, swo#26327]: + * gdb-symtab-fix-infinite-recursion-in-dwarf2_cu-get_builder.patch + +------------------------------------------------------------------- +Fri May 7 10:43:38 UTC 2021 - Tom de Vries +- Replace tentative fix with upstreamed fix [swo#27681]: + Remove: + * gdb-build-workaround-pcre2_posix-linking-problem.patch + Add: + * gdb-build-hardcode-with-included-regex.patch +- Backport fix from upstream [bsc#1185638, swo#26327]: + * gdb-symtab-fix-infinite-recursion-in-dwarf2_cu-get_builder.patch +- Backport fix from upstream [rh#1931344]: + * gdb-save-restore-file-offset-while-reading-notes-in-core-file.patch + +------------------------------------------------------------------- +Sun May 2 18:24:36 UTC 2021 - Tom de Vries + +- Backport fix for tui assert [swo#27680]: + * gdb-tui-fix-len_without_escapes-in-tui-disasm.c.patch + +------------------------------------------------------------------- +Wed Apr 7 03:51:41 UTC 2021 - Tom de Vries + +- Backport fixes that ignore DEBUGINFOD_URLS during testing: + * gdb-testsuite-ignore-debuginfod_urls.patch + * gdb-testsuite-fix-unset-of-debuginfod_urls-in-default_gdb_init.patch + +------------------------------------------------------------------- +Tue Apr 6 15:15:10 UTC 2021 - Tom de Vries + +- Fix various testsuite fails on Factory using backports: + * gdb-testsuite-fix-gdb.arch-amd64-stap-three-arg-disp.s.patch + * gdb-testsuite-fix-xfail-handling-in-gdb.threads-gcore-thread.exp.patch + * gdb-threads-fix-lin_thread_get_thread_signals-for-glibc-2.28.patch +- Fix libthread_db problem on Factory [swo#27526, boo#1184214]: + * gdb-try-to-load-libthread_db-only-after-reading-all-shared-libraries-when-attaching.patch +- Workaround libncurses pulling in libpcre2_posix: + * gdb-build-workaround-pcre2_posix-linking-problem.patch + +------------------------------------------------------------------- +Thu Feb 11 16:13:14 UTC 2021 - Tom de Vries + +- Replace tentative fix with upstreamed fix [swo#26881]: + Remove: + * gdb-fix-assert-in-process-event-stop-test.patch + Add: + * gdb-fix-internal-error-in-process_event_stop_test.patch + * gdb-breakpoints-handle-glibc-with-debuginfo-in-create_exception_master_breakpoint.patch + +------------------------------------------------------------------- +Thu Feb 11 15:07:12 UTC 2021 - Tom de Vries + +- Fix license [bsc#1180786]. + +------------------------------------------------------------------- +Wed Dec 9 07:56:36 UTC 2020 - Tom de Vries + +- Backport from master [jsc#13656]: + * gdb-powerpc-remove-512-bytes-region-limit-if-2nd-dawr-is-avaliable.patch +- Require 8GB diskspace for x86_64. + +------------------------------------------------------------------- +Mon Nov 30 15:43:58 UTC 2020 - Tom de Vries + +- Patches to be upstreamed: + * gdb-fix-use-of-invalid-pointer-in-remote-async-inferior-event-handler.patch + +------------------------------------------------------------------- +Mon Nov 30 14:46:49 UTC 2020 - Tom de Vries + +- Mention fedora patch fixups added: + * fixup-3-gdb-archer-vla-tests.patch +- Mention patch to be upstreamed added: + * gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch + +------------------------------------------------------------------- +Fri Nov 27 13:54:42 UTC 2020 - Tom de Vries + +- Fedora patch fixups update: + * fixup-2-gdb-rhbz1156192-recursive-dlopen-test.patch +- Fedora patch fixups added: + * fixup-gdb-test-ivy-bridge.patch +- Add xz to BuildRequires for testsuite flavour. +- Add note on mpfr-devel for SLE-11. + +------------------------------------------------------------------- +Thu Nov 26 08:05:44 UTC 2020 - Tom de Vries + +- Backport from master: + * gdb-testsuite-fix-failure-in-gdb-base-step-over-no-symbols-exp.patch +- Patch to be upstreamed: + * gdb-testsuite-fix-control-flow-in-gdb-reverse-insn-reverse-exp.patch + +------------------------------------------------------------------- +Thu Nov 26 00:35:52 UTC 2020 - Tom de Vries + +- Patch updated: + * gdb-testsuite-gdb-tui-new-layout-exp-partly-require-tcl86.patch + +------------------------------------------------------------------- +Wed Nov 25 23:45:19 UTC 2020 - Tom de Vries + +- Patch updated: + * gdb-testsuite-gdb-tui-new-layout-exp-partly-require-tcl86.patch + +------------------------------------------------------------------- +Tue Nov 24 13:10:46 UTC 2020 - Tom de Vries + +- Patch to be upstreamed: + * gdb-testsuite-gdb-base-morestack-exp-no-clang.patch + * gdb-testsuite-handle-sigill-in-gdb-reverse-insn-reverse-exp.patch + * gdb-testsuite-fix-gdb-reverse-insn-reverse-x86-c-for-m32.patch + * gdb-testsuite-gdb-tui-new-layout-exp-partly-require-tcl86.patch + * gdb-tui-enable-work-around-libncurses-segfault.patch +- Backport from master dropped: + * gdb-testsuite-fix-unbalanced-braces-in-gdb-tui-new-layout-exp.patch + +------------------------------------------------------------------- +Wed Nov 18 09:59:52 UTC 2020 - Tom de Vries - 10.1 + +- Fedora patch fixups updated: + * fixup-2-gdb-archer-vla-tests.patch +- Fedora patch fixups added: + * fixup-2-gdb-rhbz1156192-recursive-dlopen-test.patch +- Testsuite patch: + * gdb-testsuite-disable-selftests-for-factory.patch +- Backport from master: + * gdb-symtab-read-cu-base-address-for-enqueued-cu.patch + * gdb-symtab-use-early-continue-in-find_pc_sect_compunit.patch + * gdb-fix-section-matching-in-find_pc_sect_compunit.patch + * gdb-symtab-fix-language-of-frame-without-debug-info.patch +- Patch to be upstreamed: + * gdb-symtab-set-default-dwarf-max-cache-age-1000.patch + +------------------------------------------------------------------- +Thu Nov 12 22:30:53 UTC 2020 - Tom de Vries + +- BuildRequire curl for debuginfod test-case. +- Patch to be upstreamed: + * gdb-don-t-return-non-existing-path-in-debuginfod-source-query.patch + * gdb-fix-assert-in-process-event-stop-test.patch + * gdb-fix-filename-in-not-in-executable-format-error.patch + * gdb-handle-no-upper-bound-in-value-subscript.patch + * gdb-fortran-handle-dw-at-string-length-with-loclistptr.patch +- Testsuite patch: + * gdb-testsuite-fix-gdb-server-ext-run-exp-for-obs.patch +- Fedora patch fixups added: + * fixup-gdb-rhbz1156192-recursive-dlopen-test.patch +- Fedora patch fixups updated: + * fixup-gdb-btrobust.patch + * fixup-2-gdb-archer-vla-tests.patch + +------------------------------------------------------------------- +Thu Nov 12 17:04:42 UTC 2020 - Tom de Vries + +- Add missing patch command for: + * gdb-fortran-fix-print-dynamic-array.patch + +------------------------------------------------------------------- +Thu Nov 12 16:31:58 UTC 2020 - Tom de Vries + +- Fix patch application on SLE-11: + * gdb-testsuite-detect-gdb-prompt-after-monitor-exit.patch + +------------------------------------------------------------------- +Thu Nov 12 07:44:58 UTC 2020 - Tom de Vries + +- Disable xz-devel and binutils-gold for SLE-10. +- More enabling of gdbserver for riscv64. +- Backport from master: + * gdb-testsuite-fix-unbalanced-braces-in-gdb-tui-new-layout-exp.patch + * gdb-testsuite-catch-condition-evaluation-errors-in-gdb-assert.patch + * gdb-testsuite-detect-gdb-prompt-after-monitor-exit.patch + * gdb-testsuite-fix-gdb-dlang-watch-loc-exp-on-ppc64.patch +- Patch to be upstreamed: + * gdb-fortran-fix-print-dynamic-array.patch + +------------------------------------------------------------------- +Wed Nov 11 22:13:49 UTC 2020 - Tom de Vries + +- Enable gdbserver for riscv64. +- Restrict BuildRequires libdebuginfod to Factory and supporting + archs. + +------------------------------------------------------------------- +Tue Nov 10 15:12:24 UTC 2020 - Tom de Vries + +- Rebase to 10.1 release (as in fedora 33 @ 6c8ccd6). + * Debuginfod support. + * Multi-target debugging support. + * Multithreaded symbol loading enabled by default. + * New command set exec-file-mismatch. + * New command tui new-layout. + * Alias command can now specify default args for an alias. +- Update libipt to v2.0.2. +- Fedora-specific patches dropped: + * gdb-6.8-bz466901-backtrace-full-prelinked.patch +- Broken/obsolete fedora patches dropped: + * gdb-bz533176-fortran-omp-step.patch + * gdb-6.5-BEA-testsuite.patch + * gdb-6.7-charsign-test.patch +- Obsoleted fedora patches dropped: + * gdb-6.3-attach-see-vdso-test.patch + * gdb-6.3-inferior-notification-20050721.patch + * gdb-6.5-gcore-buffer-limit-test.patch + * gdb-6.5-missed-trap-on-step-test.patch + * gdb-rhbz1818011-bfd-gcc10-error.patch +- Fedora patches updated: + * gdb-6.3-gstack-20050411.patch + * gdb-6.3-test-self-20050110.patch + * gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch + * gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch + * gdb-6.6-buildid-locate-core-as-arg.patch + * gdb-6.6-buildid-locate-rpm-librpm-workaround.patch + * gdb-6.6-buildid-locate-rpm-scl.patch + * gdb-6.6-buildid-locate-rpm.patch + * gdb-6.6-buildid-locate-solib-missing-ids.patch + * gdb-6.6-buildid-locate.patch + * gdb-6.7-testsuite-stable-results.patch + * gdb-6.8-quit-never-aborts.patch + * gdb-archer-pie-addons-keep-disabled.patch + * gdb-archer-pie-addons.patch + * gdb-archer-vla-tests.patch + * gdb-attach-fail-reasons-5of5.patch + * gdb-bz1219747-attach-kills.patch + * gdb-bz533176-fortran-omp-step.patch + * gdb-container-rh-pkg.patch + * gdb-fedora-libncursesw.patch + * gdb-gnat-dwarf-crash-3of3.patch + * gdb-jit-reader-multilib.patch + * gdb-linux_perf-bundle.patch + * gdb-moribund-utrace-workaround.patch + * gdb-runtest-pie-override.patch + * gdb-vla-intel-fix-print-char-array.patch + * gdb-vla-intel-fortran-strides.patch + * gdb-vla-intel-fortran-vla-strings.patch + * gdb-vla-intel-stringbt-fix.patch + * gdb-vla-intel-tests.patch +- Fedora patches added: + * gdb-config.patch +- Obsoleted patched dropped: + * gdb-testsuite-avoid-pagination-in-attach-32.exp.patch + * gdb-fix-toplevel-types-with-fdebug-types-section.patch + * gdb-fix-range-loop-index-in-find_method.patch + * gdb-fix-python3.9-related-runtime-problems.patch + * gdb-fix-unused-function-error.patch + * gdb-fix-the-thread-pool.c-compilation.patch + * gdb-aarch64-fix-erroneous-use-of-spu-architecture-bfd.patch + * gdb-fix-debug-agent-odr-bool-int.patch + * gdbserver-fix-build-with-make-3.81.patch + * gdb-threads-fix-hang-in-stop_all_threads-after-killing-inferior.patch +- Fedora patch fixups added: + * fixup-gdb-6.3-test-pie-20050107.patch + * fixup-gdb-6.5-sharedlibrary-path.patch + * fixup-gdb-6.6-buildid-locate.patch + * fixup-gdb-6.8-bz442765-threaded-exec-test.patch + * fixup-gdb-archer-vla-tests.patch + * fixup-gdb-base-gnu-ifunc-strstr-workaround-exp.patch + * fixup-gdb-btrobust.patch + * fixup-gdb-bz634108-solib_address.patch + * fixup-gdb-dts-rhel6-python-compat.patch + * fixup-gdb-gnat-dwarf-crash-3of3.patch + * fixup-gdb-vla-intel-fortran-vla-strings.patch + * fixup-gdb-vla-intel-tests.patch + * fixup-gdb-6.3-threaded-watchpoints2-20050225.patch +- Patches renamed: + * gdb-testsuite-fix-perror-in-gdb.opt-fortran-string.exp.patch + to fixup-2-gdb-archer-vla-tests.patch +- Patches updated: + * gdb-testsuite-ada-pie.patch +- Backport from master: + * gdb-testsuite-prevent-pagination-in-gdb-internalflags.patch + +------------------------------------------------------------------- +Mon Sep 7 09:04:30 UTC 2020 - Andreas Schwab + +- Enable CTF support also for riscv64 + +------------------------------------------------------------------- +Tue Aug 11 09:56:29 UTC 2020 - Tom de Vries + +- Restore License/Group. + +------------------------------------------------------------------- +Fri Aug 7 08:10:52 UTC 2020 - Tom de Vries + +- Don't BuildRequire systemtap-sdt-devel for SLE-11. + +------------------------------------------------------------------- +Fri Aug 7 07:39:23 UTC 2020 - Tom de Vries + +- Add testsuite BuildRequire systemtap-sdt-devel. + +------------------------------------------------------------------- +Tue Aug 4 10:57:48 UTC 2020 - Tom de Vries + +- Add BuildRequire babeltrace-devel. On Factory this adds bdeps + babeltrace-devel, libuuid-devel, babeltrace, libglib-2_0-0, and + libgmodule-2_0-0. + +------------------------------------------------------------------- +Wed Jul 29 15:44:22 UTC 2020 - Tom de Vries + +- Fix internal error on aarch64 [swo#26316]. + gdb-aarch64-fix-erroneous-use-of-spu-architecture-bfd.patch + +------------------------------------------------------------------- +Tue Jul 28 11:29:35 UTC 2020 - Tom de Vries + +- Change into multibuild package and add flavour gdb-testsuite. + +------------------------------------------------------------------- +Fri Jul 24 12:39:06 UTC 2020 - Tom de Vries + +- Fix s390 -> s390x typo. + +------------------------------------------------------------------- +Fri Jul 24 12:34:41 UTC 2020 - Tom de Vries + +- Don't BuildRequire binutils-gold for SLE-12/s390. + +------------------------------------------------------------------- +Fri Jul 24 10:23:12 UTC 2020 - Tom de Vries + +- BuildRequire binutils-gold for testsuite + +------------------------------------------------------------------- +Thu Jul 23 15:34:40 UTC 2020 - Tom de Vries + +- Rebase to 9.2 release. + +------------------------------------------------------------------- +Tue Jul 14 14:33:12 UTC 2020 - Tom de Vries + +- Fix SLE-11 build. Gdb 9.1 requires make 3.82, but SLE-11 has + make 3.81: + * gdbserver-fix-build-with-make-3.81.patch + +------------------------------------------------------------------- +Tue Jul 14 08:31:27 UTC 2020 - Tom de Vries + +- Fix patch context: + * gdb-fix-the-thread-pool.c-compilation.patch + +------------------------------------------------------------------- +Mon Jul 13 22:13:07 UTC 2020 - Tom de Vries + +- Fix build error due to missing DIAGNOSTIC_IGNORE_UNUSED_FUNCTION. + * gdb-fix-the-thread-pool.c-compilation.patch + +------------------------------------------------------------------- +Mon Jul 13 15:36:16 UTC 2020 - Tom de Vries + +- Drop ChangeLog part of patch: + * gdb-fix-unused-function-error.patch + +------------------------------------------------------------------- +Mon Jul 13 15:24:53 UTC 2020 - Tom de Vries + +- Fix Werror=unused-function with gcc 4.8 (for Leap 42.3). + * gdb-fix-unused-function-error.patch + +------------------------------------------------------------------- +Mon Jul 13 13:56:50 UTC 2020 - Tom de Vries + +- Require %{suse_version} >= 1500 for --with-system-readline. + +------------------------------------------------------------------- +Mon Jul 13 12:21:04 UTC 2020 - Tom de Vries + +- Rebase to 9.1 release (as in fedora 32 @ 1735910). + * Breakpoints on nested functions and subroutines in Fortran. + * Multithreaded symbol loading, disabled by default. Enable + using 'maint set worker-threads unlimited'. + * Multi-target debugging support. + * New command pipe. + * New command set logging debugredirect [on|off]. + * New fortran commands info modules, info module functions, + info module variables. +- Fedora-specific patches dropped: + * gdb-libexec-add-index.patch + * gdb-6.3-rh-testversion-20041202.patch + * gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch +- Obsoleted fedora patches dropped: + * gdb-6.5-bz216711-clone-is-outermost.patch + * gdb-6.6-scheduler_locking-step-is-default.patch + * gdb-6.8-bz436037-reg-no-longer-active.patch + * gdb-bz541866-rwatch-before-run.patch + * gdb-bz568248-oom-is-error.patch + * gdb-follow-child-stale-parent.patch + * gdb-readline62-ask-more-rh.patch + * gdb-rhbz1371380-gcore-elf-headers.patch + * gdb-rhbz1553086-binutils-warning-loadable-section-outside-elf.patch + * gdb-rhbz1704406-disable-style-log-output-1of3.patch + * gdb-rhbz1704406-disable-style-log-output-2of3.patch + * gdb-rhbz1704406-disable-style-log-output-3of3.patch + * gdb-rhbz1708192-parse_macro_definition-crash.patch + * gdb-rhbz1723564-gdb-crash-PYTHONMALLOC-debug.patch + * gdb-rhbz795424-bitpos-20of25.patch + * gdb-rhbz795424-bitpos-21of25.patch + * gdb-rhbz795424-bitpos-22of25.patch + * gdb-rhbz795424-bitpos-23of25.patch + * gdb-rhbz795424-bitpos-25of25-test.patch + * gdb-rhbz795424-bitpos-25of25.patch + * gdb-rhbz795424-bitpos-arrayview.patch + * gdb-rhbz795424-bitpos-lazyvalue.patch + * gdb-testsuite-readline63-sigint.patch +- Fedora patches added: + * gdb-rhbz1818011-bfd-gcc10-error.patch +- Obsoleted patched dropped: + * gdb-fix-s390-build.diff + * gdb-fix-riscv-tdep.patch + * gdb-testsuite-add-missing-initial-prompt-read-in-multidictionary.exp.patch + * gdb-testsuite-pie-no-pie.patch + * gdb-testsuite-read1-fixes.patch + * gdb-testsuite-i386-pkru-exp.patch + * gdb-s390-handle-arch13.diff + * gdb-fix-heap-use-after-free-in-typename-concat.patch + * gdb-dwarf-reader-reject-sections-with-invalid-sizes.patch + * gdb-0001-remove-alloca-0-calls.patch + * gdb-arch13-1.diff + * gdb-arch13-2.diff + * gdb-arch13-3.diff + * bfd-change-num_group-to-unsigned-int.patch + * gdb-fix-incorrect-use-of-is-operator-for-comparison-in-python-lib-gdb-command-prompt.py.patch + * gdb-symtab-prefer-var-def-over-decl.patch + * gdb-only-force-interp_console-ui_out-for-breakpoint-commands-in-mi-mode.patch + * gdb-testsuite-8.3-kfail-xfail-unsupported.patch +- Backport from master: + * gdb-fix-debug-agent-odr-bool-int.patch + * gdb-fix-python3.9-related-runtime-problems.patch + +------------------------------------------------------------------- +Wed May 6 03:46:31 UTC 2020 - Tom de Vries + +- Fix .debug_types problems [swo#24480, swo#25889, bsc#1168394]. + - gdb-fix-range-loop-index-in-find_method.patch + - gdb-fix-toplevel-types-with-fdebug-types-section.patch + +------------------------------------------------------------------- +Mon Apr 20 14:29:12 UTC 2020 - Tom de Vries + +- Fix python 3.8 warning [bsc#1169495]. + * gdb-fix-incorrect-use-of-is-operator-for-comparison-in-python-lib-gdb-command-prompt.py.patch + +------------------------------------------------------------------- +Tue Apr 14 07:40:12 UTC 2020 - Tom de Vries + +- Fix build with gcc 10 [bsc#1169368, swo#25717]. + * bfd-change-num_group-to-unsigned-int.patch + +------------------------------------------------------------------- +Tue Feb 4 19:56:55 UTC 2020 - Tom de Vries + +- Fix hang after SIGKILL [swo#25478]. + * gdb-threads-fix-hang-in-stop_all_threads-after-killing-inferior.patch + +------------------------------------------------------------------- +Fri Jan 17 15:43:46 UTC 2020 - matz@suse.com + +- Add support for official name of s390 arch13: z15. + Add descriptions for arch13 instructions. Adds + gdb-arch13-1.diff, gdb-arch13-2.diff and gdb-arch13-3.diff. + [jsc#SLE-7903] + +------------------------------------------------------------------- +Fri Dec 6 14:20:21 UTC 2019 - Tom de Vries + +- Fix build with gcc 10 [bsc#1158539, swo#24653]. + * gdb-0001-remove-alloca-0-calls.patch + +------------------------------------------------------------------- +Mon Nov 11 08:57:18 UTC 2019 - Ludwig Nussel + +- make fpc optional (boo#1156284) as fpc requires itself for + bootstrapping. + +------------------------------------------------------------------- +Wed Nov 6 21:18:46 UTC 2019 - Tom de Vries + +- Fix for bsc#1146475 [bsc#1146475, swo#24971 ] + * gdb-symtab-prefer-var-def-over-decl.patch +- Fix for bsc#1146167 [bsc#1146167, swo#24956] + * gdb-only-force-interp_console-ui_out-for-breakpoint-commands-in-mi-mode.patch + +------------------------------------------------------------------- +Tue Oct 29 09:32:42 UTC 2019 - Tom de Vries + +- Backport 2nd part of fix for swo#23657. + [bsc#1142772, swo#23657, CVE-2019-1010180] + * gdb-dwarf-reader-reject-sections-with-invalid-sizes.patch + +------------------------------------------------------------------- +Mon Oct 14 17:52:55 UTC 2019 - matz@suse.com + +- Add gdb-s390-handle-arch13.diff to handle most new s390 arch13 + instructions. [fate#327369, jsc#ECO-368] + +------------------------------------------------------------------- +Mon Sep 30 10:34:54 UTC 2019 - Tom de Vries + +- Add gdb-testsuite-8.3-kfail-xfail-unsupported.patch + +------------------------------------------------------------------- +Thu Sep 26 16:51:17 UTC 2019 - Tom de Vries + +- Drop ChangeLog part of patch: + * gdb-rhbz1708192-parse_macro_definition-crash.patch + * gdb-rhbz1704406-disable-style-log-output-1of3.patch + * gdb-rhbz1704406-disable-style-log-output-2of3.patch + * gdb-rhbz1704406-disable-style-log-output-3of3.patch + * gdb-rhbz1723564-gdb-crash-PYTHONMALLOC-debug.patch + * gdb-rhbz1553086-binutils-warning-loadable-section-outside-elf.patch +- Update to gdb-8.3.1. + * Drop "Testsuite: Ensure pie is disabled on some tests" part of + gdb-testsuite-pie-no-pie.patch + * Drop patches included upstream: + - gdb-7.10-swo18929.patch + - gdb-handle-vfork-in-thread-with-follow-fork-mode-child.patch + - gdb-x86_64-i386-syscall-restart-master.patch + - gdb-suppress-sigttou-when-handling-errors.patch + - gdb-fix-breakpoints-on-file-reloads-for-pie-binaries.patch + - gdb-symtab-fix-symbol-loading-performance-regression.patch +- Fix macro in comment warning + +------------------------------------------------------------------- +Wed Sep 25 14:41:32 UTC 2019 - Tom de Vries + +- Upgrade libipt from v2.0 to v2.0.1. + * Use -DBUILD_SHARED_LIBS=OFF to build libipt.a, and drop part + of v1.5-libipt-static.patch that consequentially has become + unnecessary. + +------------------------------------------------------------------- +Tue Sep 24 08:31:04 UTC 2019 - Tom de Vries + +- Sync with f30, merging 1e222a3..8bf40c6. + * gdb-rhbz1708192-parse_macro_definition-crash.patch + * gdb-rhbz1704406-disable-style-log-output-1of3.patch + * gdb-rhbz1704406-disable-style-log-output-2of3.patch + * gdb-rhbz1704406-disable-style-log-output-3of3.patch + * gdb-rhbz1723564-gdb-crash-PYTHONMALLOC-debug.patch + * gdb-rhbz1553086-binutils-warning-loadable-section-outside-elf.patch + +------------------------------------------------------------------- +Sun Sep 22 05:54:09 UTC 2019 - Tom de Vries + +- Use ldd /usr/bin/rpm instead of ls /usr/%{_lib}/ to find librpm + +------------------------------------------------------------------- +Sat Sep 14 05:45:30 UTC 2019 - Michel Normand + +- Add _constraints for PowerPC need more than 3.5GB disk space + to avoid build failure + +------------------------------------------------------------------- +Tue Sep 10 15:45:17 UTC 2019 - matz@suse.com + +- Disable use of valgrind on old s390 (31bit) distros. + +------------------------------------------------------------------- +Fri Aug 23 16:00:18 UTC 2019 - Tom de Vries + +- Enable librpm for version > librpm.so.3 [bsc#1145692]: + * Allow any librpm.so.x + * Fix unused variables in HAVE_LIBRPM code in + gdb-6.6-buildid-locate-rpm-suse.patch + * Add %build test to check for "zypper install " + message +- Implements jsc#ECO-368, the 2019 toolchain module update + +------------------------------------------------------------------- +Tue Aug 6 21:36:49 UTC 2019 - Tom de Vries + +- Master backport: + * gdb-fix-breakpoints-on-file-reloads-for-pie-binaries.patch +- Master backports testsuite: + * gdb-testsuite-i386-pkru-exp.patch + * gdb-testsuite-read1-fixes.patch + * gdb-testsuite-pie-no-pie.patch + * gdb-testsuite-add-missing-initial-prompt-read-in-multidictionary.exp.patch +- Work around bsc#1115034: + * gdb-testsuite-ada-pie.patch +- Fixes for fedora patches: + * gdb-testsuite-fix-perror-in-gdb.opt-fortran-string.exp.patch + * gdb-testsuite-avoid-pagination-in-attach-32.exp.patch + +------------------------------------------------------------------- +Thu Jul 25 21:46:56 UTC 2019 - Stefan Brüns + +- Remove some conditionals for SLE-10 (build is disabled/unresolvable). +- BuildRequire makeinfo instead of full texinfo (requiring texlive) + where available (SLE >= 12). + +------------------------------------------------------------------- +Mon Jul 22 16:58:16 UTC 2019 - Tom de Vries + +- Add Wno-error=odr to work around swo#24835 +- Add BuildRequires xz-devel + +------------------------------------------------------------------- +Wed Jul 3 11:38:05 UTC 2019 - Tom de Vries + +- Add BuildRequires valgrind for make check + +------------------------------------------------------------------- +Wed Jul 3 11:02:06 UTC 2019 - Tom de Vries + +- Move BuildRequires gcc-go and fpc to %{with testsuite} portion + +------------------------------------------------------------------- +Wed Jul 3 10:53:05 UTC 2019 - Tom de Vries + +- Copy %ada_arch from gcc9 and use it to fix 'unresolvable: nothing + provides gcc-ada' for openSUSE_Leap_42.3_Ports/SLE-12 ppc64le. + +------------------------------------------------------------------- +Wed Jul 3 08:37:30 UTC 2019 - Tom de Vries + +- Drop ppc64le for fpc + +------------------------------------------------------------------- +Wed Jul 3 08:27:11 UTC 2019 - Tom de Vries + +- Add missing %endif + +------------------------------------------------------------------- +Wed Jul 3 08:15:33 UTC 2019 - Tom de Vries + +- Add BuildRequire fpc for make check + +------------------------------------------------------------------- +Wed Jul 3 06:47:49 UTC 2019 - Tom de Vries + +- Add comment explaining why guile support has been disabled for + newer distro versions. + +------------------------------------------------------------------- +Tue Jul 2 17:46:53 UTC 2019 - Tom de Vries + +- Add BuildRequire gcc-go to get gccgo command for make check + +------------------------------------------------------------------- +Tue Jul 2 13:48:51 UTC 2019 - Tom de Vries + +- Copy gdbinit from fedora master @ 25caf28. Add + gdbinit.without-python, and use it for --without=python. + +------------------------------------------------------------------- +Mon Jul 1 06:28:27 UTC 2019 - Tom de Vries + +- Remove unused code: gdbtui support + +------------------------------------------------------------------- +Mon Jun 24 07:00:28 UTC 2019 - Tom de Vries + +- Add comments to "patches to upstream" specifying when they can be + dropped. + +------------------------------------------------------------------- +Thu Jun 20 15:19:35 UTC 2019 - Tom de Vries + +- Remove -Wno-implicit-fallthrough, -Wno-error=cast-function-type + and -Wno-error=stringop-truncation + +------------------------------------------------------------------- +Wed Jun 19 06:54:23 UTC 2019 - Tom de Vries + +- Remove gdb-fix-buf-overflow.diff, which is a workaround for + swo#24698, which has been fixed since gdb 7.12. + +------------------------------------------------------------------- +Fri Jun 14 11:39:56 UTC 2019 - Tom de Vries + +- Fix rpmlint macro-in-comment errors + +------------------------------------------------------------------- +Fri Jun 14 11:27:41 UTC 2019 - Tom de Vries + +- Fix rpmlint error "deprecated-grep ['egrep']" . + +------------------------------------------------------------------- +Fri Jun 14 11:22:54 UTC 2019 - Tom de Vries + +- gdb-gcore-bash.patch: Fix rpmlint error env-script-interpreter by + replacing "/usr/bin/env bash" with "/bin/bash" in gcore. + +------------------------------------------------------------------- +Thu Jun 13 17:51:04 UTC 2019 - Tom de Vries + +- Rewrite gdbserver.1 workaround for riscv64 to avoid + %define _unpackaged_files_terminate_build 0 + +------------------------------------------------------------------- +Wed Jun 5 09:53:09 UTC 2019 - Andreas Schwab + +- gdb-suppress-sigttou-when-handling-errors.patch: Suppress SIGTTOU when + handling errors +- Enable ada tests on ppc64le and riscv64 +- Enable multitarget build on riscv64 +- Add ia64 and riscv64 to target_list +- Enable -Werror on riscv64 and aarch64 +- Don't remove %{buildroot} + +------------------------------------------------------------------- +Wed May 22 16:01:13 UTC 2019 - Tom de Vries + +- Remove gdb-gcc9-fix-build-with-latest-GCC-9.0-tree.patch and + gdb-gcc9-warning-on-elf32-arm.c-elf32_arm_final_link.patch, which are + already present in 8.3. + +------------------------------------------------------------------- +Wed May 22 08:44:01 UTC 2019 - Martin LiÅ¡ka + +- Add gdb-gcc9-fix-build-with-latest-GCC-9.0-tree.patch and + gdb-gcc9-warning-on-elf32-arm.c-elf32_arm_final_link.patch + in order to fix build with GCC9. + +------------------------------------------------------------------- +Tue May 21 13:32:17 UTC 2019 - Tom de Vries + +- Replace fedora patch gdb-x86_64-i386-syscall-restart.patch with + master backport gdb-x86_64-i386-syscall-restart-master.patch + +------------------------------------------------------------------- +Fri May 17 16:04:43 UTC 2019 - Tom de Vries + +- Work around riscv64 build error: gdbserver.1 is installed, but not + packaged + +------------------------------------------------------------------- +Thu May 16 15:12:24 UTC 2019 - Tom de Vries + +- Don't expect gdbserver for riscv64 + +------------------------------------------------------------------- +Thu May 16 13:00:08 UTC 2019 - Tom de Vries + +- Add gdb-fix-riscv-tdep.patch to fix RISC-V build breaker + +------------------------------------------------------------------- +Thu May 16 10:42:34 UTC 2019 - Tom de Vries + +- Rebase to 8.3 release (as in fedora 30 @ 1e222a3). + * DWARF index cache: GDB can now automatically save indices of DWARF + symbols on disk to speed up further loading of the same binaries. + * Ada task switching is now supported on aarch64-elf targets when + debugging a program using the Ravenscar Profile. + * Terminal styling is now available for the CLI and the TUI. + * Removed support for old demangling styles arm, edg, gnu, hp and + lucid. + * Support for new native configuration RISC-V GNU/Linux (riscv*-*-linux*). +- Obsoleted fedora patches dropped: + * gdb-6.3-ppc64syscall-20040622.patch + * gdb-6.3-ppc64displaysymbol-20041124.patch + * gdb-6.3-readnever-20050907.patch + * gdb-6.5-bz203661-emit-relocs.patch + * gdb-6.8-sparc64-silence-memcpy-check.patch + * gdb-6.8-watchpoint-conditionals-test.patch + * gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch + * gdb-python-gil.patch + * gdb-rhbz881849-ipv6-1of3.patch + * gdb-rhbz881849-ipv6-2of3.patch + * gdb-rhbz881849-ipv6-3of3.patch + * gdb-rhbz1187581-power8-regs-1of7.patch + * gdb-rhbz1187581-power8-regs-2of7.patch + * gdb-rhbz1187581-power8-regs-3of7.patch + * gdb-rhbz1187581-power8-regs-4of7.patch + * gdb-rhbz1187581-power8-regs-5of7.patch + * gdb-rhbz1187581-power8-regs-6of7.patch + * gdb-rhbz1187581-power8-regs-7of7.patch + * gdb-rhbz1491128-batch-mode-exit-status-1of2.patch + * gdb-rhbz1491128-batch-mode-exit-status-2of2.patch + * gdb-use-pulongest-aarch64-linux-tdep.patch + * gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-1of5.patch + * gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-2of5.patch + * gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-3of5.patch + * gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-4of5.patch + * gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-5of5.patch +- Fedora patches added: + * gdb-rhbz795424-bitpos-arrayview.patch + * gdb-rhbz1371380-gcore-elf-headers.patch +- Obsoleted patched dropped: + * gdb-fix-crash-when-reading-core.patch + * power8-registers.diff + * gdb-fix-multidictionary.exp-for-gdb-8.2.patch +- Backport from master: + * gdb-handle-vfork-in-thread-with-follow-fork-mode-child.patch + [swo#gdb/24454] +- Added patches proposed for master: + * gdb-fix-heap-use-after-free-in-typename-concat.patch + [swo#24094] + * gdb-symtab-fix-symbol-loading-performance-regression.patch + [swo#24545] + +------------------------------------------------------------------- +Wed May 15 07:34:51 UTC 2019 - Tom de Vries + +- Add BuildRequires mpfr-devel + +------------------------------------------------------------------- +Thu Jan 24 10:13:33 UTC 2019 - tdevries@suse.com + +- Backport upstream fix for assertion failure + `SYMBOL_LANGUAGE (sym) == DICT_LANGUAGE (dict)->la_language' + [swo#23712, rh#1560010] + patches: + gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-1of5.patch + gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-2of5.patch + gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-3of5.patch + gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-4of5.patch + gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-5of5.patch + * Add patches from fedora 29 @ 4513f72 + * Add gdb-fix-multidictionary.exp-for-gdb-8.2.patch to fix + multidictionary.exp test-case + +------------------------------------------------------------------- +Thu Dec 6 14:49:34 UTC 2018 - matz@suse.com + +- Add power8-registers.diff for implementing access to + more POWER8 registers. [fate#326120, fate#325178] + +------------------------------------------------------------------- +Mon Nov 12 13:26:01 UTC 2018 - tdevries@suse.com + +- Run tests with -fno-PIE/-no-pie and -fPIE/-pie. + +------------------------------------------------------------------- +Wed Nov 7 15:04:28 UTC 2018 - tdevries@suse.com + +- Fix crash when reading core [bsc #1109013] + * Add gdb-fix-crash-when-reading-core.patch + https://sourceware.org/ml/gdb-cvs/2018-11/msg00022.html + +------------------------------------------------------------------- +Tue Sep 11 15:01:59 UTC 2018 - matz@suse.com + +- Rebase to 8.2 release (as in fedora 29 @ c720d998): + * Contains fix for bnc#1081527, CVE-2018-7208. + * 'symbol-file' and 'add-symbol-file' accept -o to add relative + offset to all sections + * pager accepts 'c' response to disable it for rest of command + * accept _Alignof and alignof in C resp. C++ expressions + * new target riscv*-*-elf + * python API extensions: gdb.Type.align, gdb.execute deals + with multi-line gdb commands, gdb.convenience_variable and + gdb.set_convenience_variable to access convenience variables, + * aarch64: properly support hardware watchpoints on unaligned + addresses (needs kernel >= 4.10) +- Add gdb-fix-s390-build.diff for a Wformat error on s390. +- Support access to new POWER8 registers [fate#325178, fate#326120] + Add patches gdb-rhbz1187581-power8-regs-1of7.patch, + gdb-rhbz1187581-power8-regs-2of7.patch, + gdb-rhbz1187581-power8-regs-3of7.patch, + gdb-rhbz1187581-power8-regs-4of7.patch, + gdb-rhbz1187581-power8-regs-5of7.patch, + gdb-rhbz1187581-power8-regs-6of7.patch, + gdb-rhbz1187581-power8-regs-7of7.patch . +- Support ipv6 for gdbserver connections: + Add patches gdb-rhbz881849-ipv6-1of3.patch, + gdb-rhbz881849-ipv6-2of3.patch, + gdb-rhbz881849-ipv6-3of3.patch . +- Update to intel processor trace library 2.0 (from 1.6.1): + Add v2.0.tar.gz, remove v1.6.1.tar.gz + Remove obsolete v1.6.1-implicit-fallthrough.patch . +- Remove obsolete patches: + gdb-fix-python37-breakage.patch, + gdb-pahole-python2.patch . +- Added patches from Fedora: + gdb-rhbz1491128-batch-mode-exit-status-1of2.patch, + gdb-rhbz1491128-batch-mode-exit-status-2of2.patch, + gdb-rhbz1553104-s390x-arch12-test.patch, + gdb-use-pulongest-aarch64-linux-tdep.patch . +- Removed obsolete patches from Fedora: + gdb-6.6-bz235197-fork-detach-info.patch, + gdb-6.8-attach-signalled-detach-stopped.patch, + gdb-gdb-add-index-script.patch, + gdb-ppc64-stwux-tautological-compare.patch, + gdb-rhbz1540559-gdbaddindex-glibcdebug-regression.patch, + gdb-stale-frame_info.patch . +- Most other patches rebased. + +------------------------------------------------------------------- +Fri Aug 10 08:58:06 UTC 2018 - tchvatal@suse.com + +- Apply patch from fedora to build with python3.7: + * gdb-fix-python37-breakage.patch + +------------------------------------------------------------------- +Tue Mar 27 14:01:27 UTC 2018 - matz@suse.com + +- Add some -Wno-error flags for gcc-8 compatibility. + +------------------------------------------------------------------- +Fri Mar 9 16:27:10 UTC 2018 - matz@suse.com + +- Rebase to 8.1 release: + * Contains fix for bnc#1068950, CVE-2017-16829. + * ptype/o prints offsets and sizes of members (like pahole) + * tab-completion improved: quoting function names is not generally + necessary anymore, completion offers for breakpoint don't include + data symbol + * enable/disable breakpoints now accept ranges: 'disable 1.3-5' + * new commands: + - set/show cwd: working directory of debuggee + - set/show compile-gcc: program to use for 'compile' command + - starti: start program and stop at first instruction + - TUI single-key commands: 'i' for stepi and 'o' for nexti + * --readnever option disables any reading of debug info (for dumping) + * s390: guarded storage register access for z14 + * gcore option -a dumps all memory mapping + * C++ breakpoints: 'b foo' will now set a breakpoint on all functions + and methods named 'foo' no matter the scope. Use -qualified if you + don't want that + * python scripting: new events gdb.new_inferior, gdb.inferior_deleted + and gdb.new_thread; new command rbreak (breakpoint accepting regexps) + * gdbserver can be passed environment parameters to remote debuggee +- Added patches from Fedora: + gdb-ppc64-stwux-tautological-compare.patch + gdb-rhbz1540559-gdbaddindex-glibcdebug-regression.patch + gdb-vla-intel-fix-print-char-array.patch +- Removed unused gdb-libstdc++-v3-python-7.1.1-20170526.tar.bz2 +- Removed obsolete upstream patches: + gdb-s390x-1b63490.patch + gdb-s390x-289e23a.patch + gdb-s390x-8fe09d7.patch + gdb-s390x-96235dc.patch + gdb-s390x-ad33963.patch +- Removed obsolete Fedora patches: + gdb-6.3-rh-dummykfail-20041202.patch + gdb-6.6-threads-static-test.patch + gdb-add-index-chmod.patch + gdb-glibc-vdso-workaround.patch + gdb-rhbz1420304-s390x-01of35.patch + gdb-rhbz1420304-s390x-02of35.patch + gdb-rhbz1420304-s390x-03of35.patch + gdb-rhbz1420304-s390x-04of35.patch + gdb-rhbz1420304-s390x-05of35.patch + gdb-rhbz1420304-s390x-06of35.patch + gdb-rhbz1420304-s390x-07of35.patch + gdb-rhbz1420304-s390x-08of35.patch + gdb-rhbz1420304-s390x-09of35.patch + gdb-rhbz1420304-s390x-10of35.patch + gdb-rhbz1420304-s390x-11of35.patch + gdb-rhbz1420304-s390x-12of35.patch + gdb-rhbz1420304-s390x-13of35.patch + gdb-rhbz1420304-s390x-14of35.patch + gdb-rhbz1420304-s390x-15of35.patch + gdb-rhbz1420304-s390x-16of35.patch + gdb-rhbz1420304-s390x-17of35.patch + gdb-rhbz1420304-s390x-18of35.patch + gdb-rhbz1420304-s390x-19of35.patch + gdb-rhbz1420304-s390x-20of35.patch + gdb-rhbz1420304-s390x-21of35.patch + gdb-rhbz1420304-s390x-22of35.patch + gdb-rhbz1420304-s390x-23of35.patch + gdb-rhbz1420304-s390x-24of35.patch + gdb-rhbz1420304-s390x-25of35.patch + gdb-rhbz1420304-s390x-26of35.patch + gdb-rhbz1420304-s390x-27of35.patch + gdb-rhbz1420304-s390x-28of35.patch + gdb-rhbz1420304-s390x-29of35.patch + gdb-rhbz1420304-s390x-30of35.patch + gdb-rhbz1420304-s390x-31of35.patch + gdb-rhbz1420304-s390x-32of35.patch + gdb-rhbz1420304-s390x-33of35.patch + gdb-rhbz1420304-s390x-34of35.patch + gdb-rhbz1420304-s390x-35of35.patch + gdb-tls-1of2.patch + gdb-tls-2of2.patch + gdb-upstream.patch + +------------------------------------------------------------------- +Wed Nov 15 08:54:04 UTC 2017 - schwab@suse.de + +- Support --without=testsuite and disable testsuite for qemu-linux-user + builds + +------------------------------------------------------------------- +Wed Oct 25 12:14:54 UTC 2017 - jmatejek@suse.com + +- switch to Python 3 for Tumbleweed 1320 and up + +------------------------------------------------------------------- +Mon Oct 9 12:43:07 UTC 2017 - matz@suse.com + +- Remove %clean section. + +------------------------------------------------------------------- +Wed Oct 4 11:20:39 UTC 2017 - matz@suse.com + +- Link gdb against a bundled libipt (processor trace + library) on x86_64 and i686 for improved tracing support + on Intel CPUs. [bnc#985550] + Adds v1.6.1.tar.gz and patches + v1.5-libipt-static.patch and v1.6.1-implicit-fallthrough.patch. + +------------------------------------------------------------------- +Mon Oct 2 14:49:04 UTC 2017 - matz@suse.com + +- Rebase to 8.0.1 release (fixing PR21886, PR22046) +- Updated libstdc++ pretty printers to +- Replace gdb-libstdc++-v3-python-6.3.1-20170212.tar.bz2 with + gdb-libstdc++-v3-python-7.1.1-20170526.tar.bz2 . +- Add patches for s390x z14 feates [fate #321514, fate #322272] + gdb-s390x-1b63490.patch + gdb-s390x-289e23a.patch + gdb-s390x-8fe09d7.patch + gdb-s390x-96235dc.patch + gdb-s390x-ad33963.patch +- Adjust some patches: + gdb-ppc-power7-test.patch + gdb-rhbz795424-bitpos-20of25.patch + gdb-rhbz795424-bitpos-21of25.patch + gdb-vla-intel-fortran-vla-strings.patch +- Add some patches from Fedora: + gdb-rhbz1420304-s390x-01of35.patch + gdb-rhbz1420304-s390x-02of35.patch + gdb-rhbz1420304-s390x-03of35.patch + gdb-rhbz1420304-s390x-04of35.patch + gdb-rhbz1420304-s390x-05of35.patch + gdb-rhbz1420304-s390x-06of35.patch + gdb-rhbz1420304-s390x-07of35.patch + gdb-rhbz1420304-s390x-08of35.patch + gdb-rhbz1420304-s390x-09of35.patch + gdb-rhbz1420304-s390x-10of35.patch + gdb-rhbz1420304-s390x-11of35.patch + gdb-rhbz1420304-s390x-12of35.patch + gdb-rhbz1420304-s390x-13of35.patch + gdb-rhbz1420304-s390x-14of35.patch + gdb-rhbz1420304-s390x-15of35.patch + gdb-rhbz1420304-s390x-16of35.patch + gdb-rhbz1420304-s390x-17of35.patch + gdb-rhbz1420304-s390x-18of35.patch + gdb-rhbz1420304-s390x-19of35.patch + gdb-rhbz1420304-s390x-20of35.patch + gdb-rhbz1420304-s390x-21of35.patch + gdb-rhbz1420304-s390x-22of35.patch + gdb-rhbz1420304-s390x-23of35.patch + gdb-rhbz1420304-s390x-24of35.patch + gdb-rhbz1420304-s390x-25of35.patch + gdb-rhbz1420304-s390x-26of35.patch + gdb-rhbz1420304-s390x-27of35.patch + gdb-rhbz1420304-s390x-28of35.patch + gdb-rhbz1420304-s390x-29of35.patch + gdb-rhbz1420304-s390x-30of35.patch + gdb-rhbz1420304-s390x-31of35.patch + gdb-rhbz1420304-s390x-32of35.patch + gdb-rhbz1420304-s390x-33of35.patch + gdb-rhbz1420304-s390x-34of35.patch + gdb-rhbz1420304-s390x-35of35.patch + gdb-upstream.patch + +------------------------------------------------------------------- +Wed Sep 13 14:09:26 UTC 2017 - matz@suse.com + +- Disable guile extensions for new distros, the gdb support + is incompatible with guile 2.2. + +------------------------------------------------------------------- +Tue Jun 6 14:37:05 UTC 2017 - matz@suse.com + +- Rebase to gdb 8.0 release: [fate #319573] + * support for DWARF5 (except its .debug_names) + * support C++11 rvalue references + * support PKU register (memory protection keys on future Intel CPUs) + * python scripting: + - start, stop and access running btrace + - rvalue references in gdb.Type + * record/replay x86_64 rdrand and rdseed + * removed support for GCJ compiled java programs + * user commands accept more than 10 arguments + * "eval" expands user-defined command arguments + * new options: + set/show disassembler-options (on arm, ppc s390) +- Removed obsoleted patches: + gdb-release-werror.patch + +------------------------------------------------------------------- +Thu Apr 27 14:39:44 UTC 2017 - matz@suse.com + +- Rebase to gdb 7.99.90 (prerelease of gdb 8) [fate #319573] +- Updated libstdc++ pretty printers to + gdb-libstdc++-v3-python-6.3.1-20170212.tar.bz2. +- Added patches from fedora: + gdb-release-werror.patch + gdb-rhbz1398387-tab-crash-test.patch +- Removed obsoleted patches: + gdb-6.7-bz426600-DW_TAG_interface_type-test.patch + gdb-bison-old.patch + gdb-testsuite-casts.patch + gdb-testsuite-m-static.patch + gdb-upstream.patch + gdb-testsuite-morestack-gold.patch + gdb-fix-bnc-994537.diff + gdb-libiberty-demangler-fuzz.diff + +------------------------------------------------------------------- +Mon Apr 3 12:48:42 UTC 2017 - rguenther@suse.com + +- Fix rpm condition to allow build on SLE10. +- Do not require glibc-devel-static-32bit on SLE12 which is not available + there. + +------------------------------------------------------------------- +Wed Feb 15 15:55:11 UTC 2017 - matz@suse.com + +- Update to gdb 7.12.1 + * negative repeat count for x examines backwards + * fortran: support structs/arrays with dynamically types fields + * support MPX bound checking + * support for the Rust language + * 'catch syscall' now can catch groups of related syscalls + * New (sub)commands: + - skip {-file,-gfile,-function,-rfunction}: generic skip + mechanism + - maint {selftest,info line-table} + - new-ui: create new user interface for GUI clients + * (fast) tracepoints on s390x and ppc64le added to gdbserver + * New target Andes NDS32 +- Add rpmlint exception for historic libinproctrace place +- Remove obsolete patches: + gdb-aarch64-v81-hwbreakpoints.diff + gdb-bare-DW_TAG_lexical_block-1of2.patch + gdb-bare-DW_TAG_lexical_block-2of2.patch + gdb-fortran-stride-intel-1of6.patch + gdb-fortran-stride-intel-2of6.patch + gdb-fortran-stride-intel-3of6.patch + gdb-fortran-stride-intel-4of6.patch + gdb-fortran-stride-intel-5of6.patch + gdb-fortran-stride-intel-6of6-nokfail.patch + gdb-fortran-stride-intel-6of6.patch + gdb-testsuite-dw2-undefined-ret-addr.patch + gdb-vla-intel-04of23-fix.patch + gdb-vla-intel-logical-not.patch + gdb-vla-intel.patch +- Add patches from Fedora package: + gdb-6.7-testsuite-stable-results.patch + gdb-add-index-chmod.patch + gdb-bison-old.patch + gdb-container-rh-pkg.patch + gdb-libexec-add-index.patch + gdb-linux_perf-bundle.patch + gdb-physname-pr11734-test.patch + gdb-physname-pr12273-test.patch + gdb-rhbz1007614-memleak-infpy_read_memory-test.patch + gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch + gdb-rhbz1149205-catch-syscall-after-fork-test.patch + gdb-rhbz1156192-recursive-dlopen-test.patch + gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch + gdb-rhbz1350436-type-printers-error.patch + gdb-test-ivy-bridge.patch + gdb-testsuite-casts.patch + gdb-testsuite-m-static.patch + gdb-testsuite-morestack-gold.patch + gdb-tls-1of2.patch + gdb-tls-2of2.patch + gdb-upstream.patch + gdb-vla-intel-fortran-strides.patch + gdb-vla-intel-fortran-vla-strings.patch + gdb-vla-intel-tests.patch + +------------------------------------------------------------------- +Mon Jan 9 15:37:41 UTC 2017 - matz@suse.com + +- Disable 32bit testing on openSUSE s390x. + +------------------------------------------------------------------- +Fri Dec 16 09:55:50 UTC 2016 - mliska@suse.cz + +- Make dependency of gcc-java conditional. + +------------------------------------------------------------------- +Sat Dec 3 10:27:31 UTC 2016 - schwab@suse.de + +- Enable ada testing on aarch64 for tumbleweed + +------------------------------------------------------------------- +Mon Nov 21 11:17:58 UTC 2016 - schwab@suse.de + +- BuildRequire glibc-devel-static for 12.1 or later, and + glibc-devel-static-32bit if biarch + +------------------------------------------------------------------- +Thu Aug 25 14:29:44 UTC 2016 - matz@suse.com + +- Add gdb-fix-bnc-994537.diff for ppc64le, fixing + two testcases. [bnc#994537] +- Add gdb-libiberty-demangler-fuzz.diff for fixing infinite + recursion in demangler. [bnc#987637] + +------------------------------------------------------------------- +Mon Aug 8 15:34:57 UTC 2016 - matz@suse.com + +- Amend gdb-glibc-vdso-workaround.patch to ignore further + vdso filenames on ppc64 and s390x. [bnc#944105] + +------------------------------------------------------------------- +Wed Aug 3 14:38:49 UTC 2016 - matz@suse.com + +- Add gdb-aarch64-v81-hwbreakpoints.diff for detecting + debug capabilities on ARMv8.1/8.2. [bnc#990697] + +------------------------------------------------------------------- +Mon Jun 20 16:36:04 UTC 2016 - matz@suse.com + +- Rebase to gdb 7.11.1: minor bug fixes. +- Remove gdb-gcc6-Wparentheses-warning.patch (applied upstream). +- Add some patches from Fedora F24: + gdb-bare-DW_TAG_lexical_block-1of2.patch + gdb-bare-DW_TAG_lexical_block-2of2.patch + gdb-bz1219747-attach-kills.patch + gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch + gdb-rhbz1325795-framefilters-test.patch + gdb-testsuite-dw2-undefined-ret-addr.patch + +------------------------------------------------------------------- +Tue May 24 10:49:47 UTC 2016 - martin.liska@suse.com + +- Add gdb-gcc6-Wparentheses-warning.patch to fix Werrors reported by GCC6. + +------------------------------------------------------------------- +Mon Apr 25 07:23:34 UTC 2016 - rguenther@suse.com + + [diverging changelog entry from SLE tree vs devel:gcc tree: + +- Add gdb-7.9-bnc976404.patch to fix thread support on s390x. [bnc #976404] + [bnc #970589] +- Add gdb-7.9-swo18929.patch to fix crash printing values. [bnc#971556] + ] +- Removed gdb-7.9-bnc976404.patch when updating to devel:gcc tree. +- Replaced gdb-7.9-swo18929.patch with gdb-7.10-swo18929.patch as well. + +------------------------------------------------------------------- +Thu Apr 7 09:56:22 UTC 2016 - normand@linux.vnet.ibm.com + +- update gdb-orphanripper.c from last fedora changes of 2013 + http://pkgs.fedoraproject.org/cgit/rpms/gdb.git/log/gdb-orphanripper.c + may be solution to transient build hung on Rings:1 ppc64le + tracked by bug boo#974419 + +------------------------------------------------------------------- +Mon Mar 21 09:02:11 UTC 2016 - rguenther@suse.com + +- Add gdb-7.10-swo18929.patch to fix crash printing values. [bnc#971556] + [swo#18929] + +------------------------------------------------------------------- +Mon Feb 29 18:50:39 UTC 2016 - matz@suse.de + +- Rebase to gdb version 7.11 as of version in Fedora 24: + * Per-inferior thread numbers. + * Breakpoint "explicit locations" (via CLI and GDB/MI). + * New convenience variables ($_gthread, $_inferior). + * Record btrace now supports non-stop mode. + * Various improvements on AArch64 GNU/Linux: + - Multi-architecture debugging support. + - displaced stepping. + - tracepoint support added in GDBserver. + * In Ada, the overloads selection menu provides the parameter + types and return types for the matching overloaded subprograms. + * Various remote protocol improvements, including several + new packets which can be used to support features such as + follow-exec-mode, exec catchpoints, syscall catchpoints, etc. + * Some minor improvements in the Python API for extending GDB. +- Added local patch gdb-fix-buf-overflow.diff. +- Added new patches from Fedora: + gdb-fedora-libncursesw.patch + gdb-fortran-stride-intel-1of6.patch + gdb-fortran-stride-intel-2of6.patch + gdb-fortran-stride-intel-3of6.patch + gdb-fortran-stride-intel-4of6.patch + gdb-fortran-stride-intel-5of6.patch + gdb-fortran-stride-intel-6of6-nokfail.patch + gdb-fortran-stride-intel-6of6.patch + gdb-opcodes-clflushopt-test.patch + gdb-testsuite-readline63-sigint.patch +- Removed obsolete patches: + gdb-6.3-bz231832-obstack-2gb.patch + gdb-probes-based-interface-robust-1of2.patch + gdb-probes-based-interface-robust-2of2.patch + gdb-rhbz1260558-ppc64le-skip_trampoline_code.patch + gdb-rhbz1270564-invalid-dwarf-regno.patch + gdb-rhel5-compat.patch +- Really disable problematic testcases. + +------------------------------------------------------------------- +Mon Jan 18 14:49:12 UTC 2016 - matz@suse.de + +- Disable guile support for SLE10. + +------------------------------------------------------------------- +Thu Jan 14 16:46:43 UTC 2016 - matz@suse.de + +- Rebase to gdb version 7.10.1 as of version in Fedora 23: + * reverse debugging on aarch64 + * new commands or subcommands: + - info os cpu, set/show serial parity, info dll + - maint print symbol-cache/symbol-cache-statistics, + maint flush-symbol-cache + - record btrace bts, record bts + - compile print + - show/set mpx bound + - tui enable/disable + - record btrace pt, record pt + - maint info btrace, + maint btrace packet-history/clear-packet-history/clear + * s390 support for vector ABI + * "set sysroot" improvements related to remote targets + * better support for debugging containerized programs + (without "set sysroot") + * HISTSIZE environment variable is replaced by GDBHISTSIZE + * python scripting: + - it's possible to write frame unwinders + - several new methods in Objfile, Type and Value classes + - gdb can auto-load scripts contained in special sections + named '.debug_gdb_scripts'. + * extensions for the MI interface, new remote packet types +- Removed obsolete patches: + 0001-S390-Add-target-descriptions-for-vector-register-set.patch + 0001-S390-Fix-compiler-invocation-with-compile-command.patch + 0001-S390-Support-new-vector-register-sections.patch + 0002-S390-Add-vector-register-support-to-gdb.patch + 0003-S390-Add-vector-register-support-to-gdbserver.patch + 0004-S390-Vector-register-test-case.patch + 0005-S390-Name-invisible-registers-with-the-empty-string-.patch + gdb-6.5-bz190810-gdbserver-arch-advice.patch + gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch + gdb-6.8-bz457187-largefile-test.patch + gdb-enable-count-crash.patch + gdb-libstdc++-v3-python-r155978.tar.bz2 + gdb-no-dg-extract-results-py.patch + gdb-python3-py_hash_t-32bit.patch + gdb-python3-testsuite.patch + gdb-s390-reorder-arch.diff + gdb-upstream.patch +- Added new patches from Fedora: + gdb-pahole-python2.patch + gdb-probes-based-interface-robust-1of2.patch + gdb-probes-based-interface-robust-2of2.patch + gdb-rhbz1260558-ppc64le-skip_trampoline_code.patch + gdb-rhbz1270564-invalid-dwarf-regno.patch + +------------------------------------------------------------------- +Fri Aug 14 13:39:13 UTC 2015 - matz@suse.de + +- Add missing patches from binutils for z13 support. [bnc #936050] + +------------------------------------------------------------------- +Fri Jul 10 13:49:28 UTC 2015 - matz@suse.de + +- Rebase to gdb version 7.9.1: + fixes PR python/18299, python/18285. +- Add gdb-s390-reorder-arch.diff [bnc #936050] +- Added patches for fate#318039, s390 z13 support: + 0001-S390-Fix-compiler-invocation-with-compile-command.patch + 0001-S390-Support-new-vector-register-sections.patch + 0001-S390-Add-target-descriptions-for-vector-register-set.patch + 0002-S390-Add-vector-register-support-to-gdb.patch + 0003-S390-Add-vector-register-support-to-gdbserver.patch + 0004-S390-Vector-register-test-case.patch + 0005-S390-Name-invisible-registers-with-the-empty-string-.patch +- Remove now obsolete SLE12-only patches: + gdb-7.7-bnc896586.patch, gdb-7.7-bnc895831.patch, + gdb-7.7-bnc891040-1.patch, gdb-7.7-bnc891040-2.patch, + gdb-7.7-bnc891040-3.patch, gdb-7.7-bnc891040-4.patch, + gdb-7.7-bnc891040-5.patch + +------------------------------------------------------------------- +Thu Jul 2 13:26:29 UTC 2015 - rguenther@suse.com + +- Remove auto-loading non-existent /etc/gdbinit.d/gdb-heap.py + from /etc/gdbinit + +------------------------------------------------------------------- +Mon Jun 29 07:27:44 UTC 2015 - schwab@suse.de + +- Add guile-devel to enable Scheme scripting support +- Run ada tests also on ppc64 and s390 + +------------------------------------------------------------------- +Tue Mar 3 11:42:10 UTC 2015 - schwab@suse.de + +- Build multi-target also on aarch64 + +------------------------------------------------------------------- +Fri Feb 27 11:10:19 UTC 2015 - rguenther@suse.com + +- Strip date and runtimes from gdb-testsuite contents. + +------------------------------------------------------------------- +Wed Feb 25 13:08:27 UTC 2015 - rguenther@suse.com + +- Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9. + The GDB 7.8 features are: + * Python Scripting + - You can now access frame registers from Python scripts. + - New attribute 'producer' for gdb.Symtab objects. + * New Python-based convenience functions: + - $_caller_is(name [, number_of_frames]) + - $_caller_matches(regexp [, number_of_frames]) + - $_any_caller_is(name [, number_of_frames]) + - $_any_caller_matches(regexp [, number_of_frames]) + * New commands + - queue-signal signal-name-or-number + Queue a signal to be delivered to the thread when it is resumed. + * On resume, GDB now always passes the signal the program had stopped + for to the thread the signal was sent to, even if the user changed + threads before resuming. Previously GDB would often (but not + always) deliver the signal to the thread that happens to be current + at resume time. + * Conversely, the "signal" command now consistently delivers the + requested signal to the current thread. GDB now asks for + confirmation if the program had stopped for a signal and the user + switched threads meanwhile. + * "breakpoint always-inserted" modes "off" and "auto" merged. + Now, when 'breakpoint always-inserted mode' is set to "off", GDB + won't remove breakpoints from the target until all threads stop, + even in non-stop mode. The "auto" mode has been removed, and "off" + is now the default mode. + * MI changes + - The -list-thread-groups command outputs an exit-code field for + inferiors that have exited. +- removed (upstream) gdb-async-stopped-on-pid-arg-1of2.patch, + gdb-async-stopped-on-pid-arg-testsuite.patch, + gdb-python-completer-1of2.patch, gdb-python-completer-2of2.patch + and gdb-readline-6.3.5.patch +- added gdb-jit-reader-multilib.patch, gdb-no-dg-extract-results-py.patch, + gdb-python-gil.patch, gdb-python3-py_hash_t-32bit.patch, + gdb-python3-testsuite.patch and gdb-vla-intel-logical-not.patch + +------------------------------------------------------------------- +Mon Dec 15 07:33:31 UTC 2014 - cshorler@googlemail.com + +- Update for GDB 7.8.1 + * removed (already in upstream): + gdb-babeltrace-configure.patch + gdb-async-stopped-on-pid-arg-2of2.patch + * amended (partially in upstream): + gdb-archer.patch + gdb-attach-fail-reasons-5of5.patch + gdb-async-stopped-on-pid-arg-1of2.patch + gdb-async-stopped-on-pid-arg-testsuite.patch + +------------------------------------------------------------------- +Fri Oct 10 10:01:27 UTC 2014 - hrvoje.senjan@gmail.com + +- Added gdb-async-stopped-on-pid-arg-1of2.patch, + gdb-async-stopped-on-pid-arg-2of2.patch and + gdb-async-stopped-on-pid-arg-testsuite.patch to resolve + https://sourceware.org/bugzilla/show_bug.cgi?id=17347 + +------------------------------------------------------------------- +Wed Aug 13 07:54:35 UTC 2014 - rguenther@suse.com + +- Enable running the testsuite and store results in a gdb-testresults + package. +- Add gdb-rpmlintrc to filter errors about the buildroot mentioned + in testresult logs. + +------------------------------------------------------------------- +Fri Aug 8 12:22:24 UTC 2014 - rguenther@suse.com + +- Use patchlist.pl to merge with gdb-7.8-16.fc22, a rebase to FSF GDB 7.8. + The GDB 7.8 features are: + * Guile scripting support. + * Python scripting enhancements. + * New commands: + ** guile + ** guile-repl + ** info auto-load guile-scripts [REGEXP] + * New options: + ** maint ada set ignore-descriptive-types (on|off) + ** maint set target-async (on|off) + ** set|show auto-load guile-scripts (on|off) + ** set|show auto-connect-native-target + ** set|show guile print-stack (none|message|full) + ** set|show mi-async (on|off) + ** set|show print symbol-loading (off|brief|full) + ** set|show record btrace replay-memory-access (read-only|read-write) + * Remote Protocol: + ** The qXfer:btrace:read packet supports a new annex 'delta'. + * GDB/MI: + ** A new option "-gdb-set mi-async" replaces "-gdb-set target-async". + * New target configurations: + ** PowerPC64 GNU/Linux little-endian + * btrace enhancements: + ** The btrace record target now supports the 'record goto' command. + ** The btrace record target supports limited reverse execution and + replay. + * ISO C99 variable length automatic arrays support. + * It is no longer required to "set target-async on" in order to use + background execution commands (e.g., "c&", "s&", etc.). + * "catch syscall" now implemented on s390*-linux* targets. + * The "compare-sections" command now works on all targets. + * The "target native" command now connects to the native target, and + can be used to launch native programs, even if "set + auto-connect-native-target" is set to off. + * More robust backtraces. [bnc#891040] +- Obsoletes patch gdb-7.7-bnc877566.patch +- Obsoletes patch gdb-fix-s390-build.patch +- Obsoletes patch gdb-ppc64le.patch +- Drop gdb-ia64-tdep.patch, disable building the IA64 target +- Modifies gdb-6.3-test-pie-20050107.patch, + gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch, + gdb-6.6-buildid-locate-core-as-arg.patch, + gdb-6.6-buildid-locate-rpm.patch, gdb-6.6-buildid-locate.patch, + gdb-6.6-scheduler_locking-step-is-default.patch, + gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch, + gdb-6.8-attach-signalled-detach-stopped.patch, + gdb-6.8-quit-never-aborts.patch, + gdb-archer-pie-addons-keep-disabled.patch, gdb-archer-pie-addons.patch, + gdb-archer.patch, gdb-attach-fail-reasons-5of5.patch, + gdb-glibc-strstr-workaround.patch, gdb-rhbz795424-bitpos-20of25.patch, + gdb-rhbz795424-bitpos-21of25.patch, gdb-rhbz795424-bitpos-22of25.patch, + gdb-rhbz795424-bitpos-23of25.patch, gdb-rhbz795424-bitpos-25of25.patch, + gdb-upstream.patch +- Adds gdb-archer-vla-tests.patch, gdb-bz533176-fortran-omp-step.patch, + gdb-bz541866-rwatch-before-run.patch + gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch, + gdb-babeltrace-configure.patch, gdb-btrobust.patch, + gdb-dts-rhel6-python-compat.patch, gdb-fortran-frame-string.patch, + gdb-gnat-dwarf-crash-3of3.patch, gdb-python-completer-1of2.patch, + gdb-python-completer-2of2.patch, gdb-readline-6.3.5.patch, + gdb-vla-intel-04of23-fix.patch, gdb-vla-intel-stringbt-fix.patch, + gdb-vla-intel.patch +- Removes gdb-rhel5-gcc44.patch, gdb-6.6-bfd-vdso8k.patch, + gdb-testsuite-nohostid.patch, gdb-python-stacksmash.patch + +------------------------------------------------------------------- +Mon Jul 15 07:42:50 UTC 2014 - rguenther@suse.com + (was: Mon Sep 15 07:42:50 UTC 2014 - rguenther@suse.com) + +- Backport fix for gdb internal-error on register info on PPC64LE. + Addds patch gdb-7.7-bnc896586.patch. [bnc#896586] + +------------------------------------------------------------------- +Wed Jul 10 07:41:20 UTC 2014 - rguenther@suse.com + (was: Wed Sep 10 07:41:20 UTC 2014 - rguenther@suse.com) + +- Backport fix for gdbserver PPC64LE byteorder issue. [bnc#895831] + Adds patch gdb-7.7-bnc895831.patch. + +------------------------------------------------------------------- +Tue Jul 8 08:13:11 UTC 2014 - rguenther@suse.com + + (was: Tue Aug 12 08:13:11 UTC 2014 - rguenther@suse.com) + +- Backport all frame-related changes from gdb 7.8. Adds patches + gdb-7.7-bnc891040-1.patch, gdb-7.7-bnc891040-2.patch, + gdb-7.7-bnc891040-3.patch, gdb-7.7-bnc891040-4.patch, + gdb-7.7-bnc891040-5.patch [bnc#891040] + +------------------------------------------------------------------- +Thu Jun 26 14:00:26 UTC 2014 - rguenther@suse.com + +- Add baselibs.conf to sources. + +------------------------------------------------------------------- +Thu Jun 26 08:59:49 UTC 2014 - rguenther@suse.com + +- For _with_testsuite require gcc-fortran, not gcc-gfortran. + [bnc#884399] + +------------------------------------------------------------------- +Wed May 14 07:43:54 UTC 2014 - rguenther@suse.com + +- Fix debugging of threaded 31bit inferiors on s390x + (gdb-7.7-bnc877566.patch). [bnc#877566] +- Add patchlist.pl and patchname_get.sh as sources. + +------------------------------------------------------------------- +Wed Feb 12 16:24:38 UTC 2014 - matz@suse.de + +- Fix build on s390 (gdb-fix-s390-build.patch). + +------------------------------------------------------------------- +Mon Feb 10 17:19:07 UTC 2014 - matz@suse.de + +- Use patchlist.pl to merge with gdb-Fedora at + e86a0cc13a5d91ba95242690237bb77511500897. +- Don't apply patches gdb-rhel5-gcc44.patch, + gdb-6.6-buildid-locate-rpm-scl.patch, + gdb-readline62-ask-more-rh.patch, + gdb-6.8-attach-signalled-detach-stopped.patch, + gdb-6.8-quit-never-aborts.patch, + gdb-rhel5-compat.patch; retained to have same structure as fedoras + package. +- Add gdb-testsuite-nohostid.patch (from fedora). +- Remove gdb-fix-attach-signalled-detach-stopped.patch again + (as base not applied), gdb-ppc-ptrace.diff (not applied since some time). + +------------------------------------------------------------------- +Sun Feb 9 15:44:04 UTC 2014 - burnus@net-b.de + +- Merge from fedoras gdb-7.7-1.fc21, a rebase to FSF GDB 7.7. + The 7.7 features are: + * For C++, the 'typeid' operator has been added and + exception catchpoints can be filtered by type. + * Python scripting has been extended + * New commands and new command options + * New convenice variables/functions + * Some GDB/MI improvements + * Remote protocal improvments + * SystemTap SDT probes support AArch64 GNU/Linux + * Support for Fission DWP file format version 2 + * 'tsave' command supports CTF (Common Trace Format) + * New script 'gcore' +- Remove now obsolete gdb-aarch64-hw-break.patch +- Remove merged bits from gdb-ppc64le.patch +- Rediff gdb-6.6-buildid-locate-rpm-suse.patch +- Add gdb-fix-attach-signalled-detach-stopped.patch + +------------------------------------------------------------------- +Mon Dec 9 14:16:53 UTC 2013 - uweigand@de.ibm.com + +- gdb-ppc64le.patch: add support for powerpc64le-linux + +------------------------------------------------------------------- +Fri Nov 15 12:08:19 UTC 2013 - rguenther@suse.com + +- Allow librpm3 to be used + +------------------------------------------------------------------- +Thu Sep 12 16:04:25 UTC 2013 - schwab@suse.de + +- gdb-aarch64-hw-break.patch: apply last change also to gdbserver + +------------------------------------------------------------------- +Mon Aug 12 15:30:32 UTC 2013 - schwab@suse.de + +- gdb-aarch64-hw-break.patch: fix setting hardware debug registers after + fork + +------------------------------------------------------------------- +Wed Aug 7 13:27:17 UTC 2013 - matz@suse.com + +- Merge from fedoras gdb-7.6.50-20130731-cvs, of what will become 7.7 + eventually. This includes 7.6, which gave: + * new native configurations (e.g. ARM AArch64 GNU/Linux) + * new targets (e.g. ARM AArch64, Lynx 178 PowerPC, x86_64/Cygwin) + * support for the "mini debuginfo" section, .gnu_debugdata + * the C++ ABI now defaults to the GNU v3 ABI + * more Python scripting improvements + * some GDB/MI improvements + * new configure options, new commands, and options + * new remote packets + * a new "target record-btrace" has been added while the + "target record" command has been renamed to "target record-full" +- gdb-ia64-tdep.patch: build fixes +- gdb-ppc-ptrace.diff: Remove patch, not needed on new kernels + +------------------------------------------------------------------- +Tue Jul 2 12:34:27 UTC 2013 - schwab@suse.de + +- Enable multi-target support +- gdb-ia64-tdep.patch: build fixes +- Use --build when configuring +- Don't remove %buildroot in %install +- Set pkgversion and bugurl + +------------------------------------------------------------------- +Sun Mar 17 05:16:06 UTC 2013 - matz@suse.com + +- Update to 7.5.50, mostly for aarch64. + +------------------------------------------------------------------- +Mon Dec 3 14:29:15 UTC 2012 - matz@suse.com + +- Merge from gdb-7.5.1-30.fc18.src.rpm. + + 7.5.1 gives: + * An "Attempt to dereference a generic pointer" errors (-var-create). + * Backtrace problems on x32 (PR backtrace/14646). + * next/step/finish problems on x32 (PR gdb/14647). + * A "malformed linespec error: unexpected keyword, [...]" error + (PR breakpoints/14643). + * GDB crash while stepping through powerpc (32bits) code. + * A failed assertion in linux_ptrace_test_ret_to_nx. + * A "!frame_id_inlined_p (frame_id)" failed assertion. + * A "No more reverse-execution history." error during reverse + "next" execution (PR 14548). + * Incomplete command descriptions in "apropos" output. + * PR gdb/14494 (a GDB crash difficult to characterize). + + 7.5 gives: + * Go language support. + * New targets (x32 ABI, microMIPS, Renesas RL78, HP OpenVMS ia64). + * More Python scripting improvements. + * SDT (Static Defined Tracing) probes support with SystemTap probes. + * GDBserver improvements (stdio connections, target-side evaluation + of breakpoint conditions, remote protocol improvements). + * Other miscellaneous improvements (ability to stop when a shared + library is loaded/unloaded, dynamic printf, etc). + * Reverse debugging on ARM. + +------------------------------------------------------------------- +Tue Jun 19 13:58:08 UTC 2012 - rguenther@suse.com + +- Do not provide a custom (safe) auto-load dir. + +------------------------------------------------------------------- +Tue Jun 12 13:00:14 UTC 2012 - rguenther@suse.com + +- Merge from gdb-7.4.50.20120603-3.fc18.src.rpm. + + * Wed Jun 6 2012 Jan Kratochvil - 7.4.50.20120603-3.fc18 + - Disable -lmcheck in the development builds. + - Fix assertion on some files as glibc-2.15.90-8.fc18 (Doug Evans). + + * Sun Jun 3 2012 Jan Kratochvil - 7.4.50.20120603-2.fc18 + - Fix Release. + - Make yum --enablerepo compatible with at least mock-1.1.21-1.fc16 Rawhide cfg. + + * Sun Jun 3 2012 Jan Kratochvil - 7.4.50.20120602-1.fc18 + - Rebase to FSF GDB 7.4.50.20120602. + - [testsuite] BuildRequire gcc-go. + - Drop printing 2D C++ vectors as matrices which no longer worked (BZ 562763). + - Fix dejagnu-1.5-4.fc17 compatibility for Go (for BZ 635651). + - Use librpm.so.3 for rpm-4.10.0 in Fedora 18. + - Revert recent breakage of UNIX objfiles order for symbols lookup. + + * Sat Jun 2 2012 Jan Kratochvil - 7.4.50.20120120-48.fc17 + - [ppc] Fix hardware watchpoints on PowerPC (BZ 827600, Edjunior Machado). + + * Mon May 28 2012 Jan Kratochvil - 7.4.50.20120120-47.fc17 + - Workaround PR libc/14166 for inferior calls of strstr. + + * Mon May 14 2012 Jan Kratochvil - 7.4.50.20120120-46.fc17 + - [RHEL5] Workaround doc build race. + + * Mon May 14 2012 Jan Kratochvil - 7.4.50.20120120-45.fc17 + - Rename "set auto-load" patchset variable $ddir to $datadir. + + * Wed May 9 2012 Jan Kratochvil - 7.4.50.20120120-44.fc17 + - Fix in "set auto-load" patchset for SCL scripts inheritance (BZ 815910). + + * Wed Apr 25 2012 Jan Kratochvil - 7.4.50.20120120-43.fc17 + - [RHEL5] Workaround kernel for detaching SIGSTOPped processes (BZ 809382). + + * Tue Apr 24 2012 Jan Kratochvil - 7.4.50.20120120-42.fc17 + - Update "set auto-load" patchset and the --with-auto-load-safe-path setting. + - [RHEL] Disable gdb-add-index even on RHEL-6 as RHEL-6.0 had too old elfutils. + + * Wed Apr 18 2012 Jan Kratochvil - 7.4.50.20120120-41.fc17 + - [RHEL] Fix --with-auto-load-safe-path systems prior to /usr move. + + * Wed Apr 18 2012 Jan Kratochvil - 7.4.50.20120120-40.fc17 + - Security fix for loading untrusted inferiors, see "set auto-load" (BZ 756117). + + * Fri Apr 13 2012 Jan Kratochvil - 7.4.50.20120120-39.fc17 + - [RHEL7] Fix/remove readline-devel BuildRequires redundant distro suffic .fc17. + + * Wed Apr 4 2012 Jan Kratochvil - 7.4.50.20120120-38.fc17 + - Workaround crashes from stale frame_info pointer (BZ 804256). + + * Wed Apr 4 2012 Jan Kratochvil - 7.4.50.20120120-37.fc17 + - testsuite: Fix break-interp.exp expections for updated glibc (BZ 752834). + + * Wed Apr 4 2012 Jan Kratochvil - 7.4.50.20120120-36.fc17 + - [RHEL5,RHEL6] Reintroduce fix attaching to stopped processes. + + * Fri Mar 30 2012 Jan Kratochvil - 7.4.50.20120120-35.fc17 + - Fix performance regressions with .gdb_index (Tom Tromey, BZ 805274). + + * Fri Mar 30 2012 Jan Kratochvil - 7.4.50.20120120-34.fc17 + - Fixup %{_datadir}/gdb timestamps for multilib conflicts on RHELs. + + * Mon Mar 26 2012 Jan Kratochvil - 7.4.50.20120120-33.fc17 + - [vla] Fix regression on no type for subrange from IBM XLF Fortran (BZ 806920). + + * Sat Mar 17 2012 Jan Kratochvil - 7.4.50.20120120-32.fc17 + - Fix loading of core files without build-ids but with build-ids in executables. + + * Fri Mar 9 2012 Jan Kratochvil - 7.4.50.20120120-31.fc17 + - Fix an implied regression by the inferior calls fix below (BZ 799531). + + * Fri Mar 9 2012 Jan Kratochvil - 7.4.50.20120120-30.fc17 + - Fix SELinux deny_ptrace .spec build rules (BZ 786878). + + * Tue Mar 6 2012 Jan Kratochvil - 7.4.50.20120120-29.fc17 + - Fix inferior calls, particularly uncaught thrown exceptions (BZ 799531). + - Fix DWARF DIEs CU vs. section relative offsets (Joel Brobecker, me). + + * Tue Mar 6 2012 Jan Kratochvil - 7.4.50.20120120-28.fc17 + - Print reasons for failed attach/spawn incl. SELinux deny_ptrace (BZ 786878). + + * Sun Mar 4 2012 Jan Kratochvil - 7.4.50.20120120-27.fc17 + - [rhel5] Fix up the previous commit (BZ 799318). + + * Sun Mar 4 2012 Jan Kratochvil - 7.4.50.20120120-26.fc17 + - [rhel5] Fix up the previous commit (BZ 799318). + + * Sun Mar 4 2012 Jan Kratochvil - 7.4.50.20120120-25.fc17 + - [rhel5] Workaround rpmbuild to make the doc subpkg noarch again (BZ 799318). + + * Fri Mar 2 2012 Jan Kratochvil - 7.4.50.20120120-24.fc17 + - [vla] Fix crash for dynamic.exp with gcc-gfortran-4.1.2-51.el5.x86_64. + - Reintroduce RHEL-5 glibc workaround for bt-clone-stop.exp. + - testsuite: Update/fix rh634108-solib_address.exp for the upstreamed API. + + * Wed Feb 29 2012 Jan Kratochvil - 7.4.50.20120120-23.fc17 + - Add kernel vDSO workaround (`no loadable ...') on RHEL-5 (kernel BZ 765875). + - Fix skipping of prologues on RHEL-5 gcc-4.1 -O2 -g code (BZ 797889). + - Fix breakpoint warning during 'next' over exit() (Tom Tromey, BZ 797892). + + * Tue Feb 28 2012 Jan Kratochvil - 7.4.50.20120120-22.fc17 + - testsuite: Fix gdb.base/macscp.exp ccache workaround in SCL mode. + - Adjust the RHEL/F version string automatically (BZ 797651, BZ 797646). + - Provide gdbtui for RHEL-5 and RHEL-6 as it is removed upstream (BZ 797664). + + * Fri Feb 24 2012 Jan Kratochvil - 7.4.50.20120120-21.fc17 + - testsuite: Do not use gcc44/gfortran44 on RHEL-5 if in SCL mode. + + * Wed Feb 22 2012 Jan Kratochvil - 7.4.50.20120120-20.fc17 + - Fix libinproctrace.so build on RHEL-5 i386 (disable it on RHEL-5). + + * Wed Feb 22 2012 Jan Kratochvil - 7.4.50.20120120-19.fc17 + - Implement SCL (scl-utils-build) macros. + + * Tue Feb 21 2012 Jan Kratochvil - 7.4.50.20120120-18.fc17 + - Fix debuginfo gdb-gdb.py build without redhat-rpm-config and on RHEL-5. + - Provide precompiled variants of gdb-gdb.py. + + * Mon Feb 13 2012 Jan Kratochvil - 7.4.50.20120120-17.fc17 + - gstack: Turn off --readnever (suggested by Oliver Henshaw). + + * Fri Feb 10 2012 Jan Kratochvil - 7.4.50.20120120-16.fc17 + - [RHELs] Drop simulation of legacy behavior - new GDB should behave as new GDB. + + * Fri Feb 10 2012 Jan Kratochvil - 7.4.50.20120120-15.fc17 + - Simplify %%setup .spec rule. + + * Fri Feb 10 2012 Jan Kratochvil - 7.4.50.20120120-14.fc17 + - Drop --with upstream .spec rules. + + * Fri Feb 10 2012 Jan Kratochvil - 7.4.50.20120120-13.fc17 + - Drop --with debug .spec rules. + + * Thu Feb 9 2012 Jan Kratochvil - 7.4.50.20120120-12.fc17 + - Improve performance for C++ symbols expansion (Tom Tromey, BZ 787487). + - Install also gdb-gdb.py pretty printers. + + * Thu Feb 9 2012 Jan Kratochvil - 7.4.50.20120120-11.fc17 + - Fix possible NULL crash in find_charset_names (Tom Tromey, BZ 786091). + - [ppc*] Fix build failure due to GCC aliasing warning (BZ 786504). + +------------------------------------------------------------------- +Tue Jun 12 07:41:22 UTC 2012 - cfarrell@suse.com + +- license update: GPL-3.0+ and GPL-3.0-with-GCC-exception and LGPL-2.1+ and + LGPL-3.0+ + SPDX format + +------------------------------------------------------------------- +Wed May 9 05:13:38 UTC 2012 - coolo@suse.com + +- Fix the minimum to get it through factory-auto + +------------------------------------------------------------------- +Tue Apr 3 14:08:43 UTC 2012 - rguenther@suse.com + +- Fixup missed debuginfo handling SUSE specifics. + +------------------------------------------------------------------- +Thu Jan 26 09:42:11 UTC 2012 - rguenther@suse.com + +- Merge from gdb-7.4.50.20120120-10.fc17.src.rpm. + + * Sat Jan 21 2012 Jan Kratochvil - 7.4.50.20120120-10.fc17 + - Rebase to FSF GDB 7.4.50.20120120. + - Drop the g77 .spec provisioning as it has been fixed in FSF GDB. + + * Thu Jan 19 2012 Jan Kratochvil - 7.4.50.20120103-9.fc17 + - Enable smaller %{_bindir}/gdb in future by no longer using -rdynamic. + - Make --enablerepo to use '*-debug*' for RHEL compatibility (BZ 781571). + - On older RHELs make readline bundled again (BZ 701131). + - Fix build compatibility with RHEL-5 due to false noarch build. + + * Wed Jan 11 2012 Jan Kratochvil - 7.4.50.20120103-8.fc17 + - Disable unexpected GDB directories relocatability. + + * Wed Jan 11 2012 Jan Kratochvil - 7.4.50.20120103-7.fc17 + - Fix BuildRequires for RHEL compatibility (BZ 701131). + + * Wed Jan 11 2012 Jan Kratochvil - 7.4.50.20120103-6.fc17 + - Provide %%snap timestamp for: Provides: bundled(librarypackage) + - Replace %%define by %%global. + - Replace Java in Summary with Fortran (only GCC-compiled Java is supported). + - Unbundle readline-6.2 with a workaround of skipped "ask" (BZ 701131). + - Work around readline-6.2 incompatibility not asking for --more-- (BZ 701131). + + * Sat Jan 7 2012 Jan Kratochvil - 7.4.50.20120103-5.fc17 + - Mark %{_sysconfdir}/gdbinit as %%config(noreplace). + - Add appropriate: Provides: bundled(librarypackage). + - Remove excessive explicit Requires: librarypackage. + + * Thu Jan 5 2012 Jan Kratochvil - 7.4.50.20120103-4.fc17 + - Fix linking on non-x86* (such as s390*) after libgdb.a removal. + + * Wed Jan 4 2012 Jan Kratochvil - 7.4.50.20120103-3.fc17 + - Reinclude gdb-dlopen-stap-probe.patch (missing in Fedora glibc - BZ 752476). + + * Tue Jan 3 2012 Jan Kratochvil - 7.4.50.20120103-2.fc17 + - Fix SystemTap support regression on i686 (Sergio Durigan Junior). + + * Tue Jan 3 2012 Jan Kratochvil - 7.4.50.20120103-1.fc17 + - Rebase to FSF GDB 7.4.50.20120103. + + * Mon Nov 28 2011 Jan Kratochvil - 7.3.50.20110722-11.fc17 + - No longer build bundled libstdc++ pretty printers on RHELs >= 7. + + * Sat Nov 5 2011 Sergio Durigan Junior - 7.3.50.20110722-10.fc16 + - Backport fix for crash in cp_scan_for_anonymous_namespace + (Aleksandar Ristovski, BZ 750341). + + * Fri Oct 14 2011 Jan Kratochvil - 7.3.50.20110722-9.fc16 + - Backport `info os processes' crash fix - for Eclipse (Pedro Alves, BZ 746294). + + * Tue Oct 11 2011 Jan Kratochvil - 7.3.50.20110722-8.fc16 + - Fix PIE testsuite run; new lib/future.exp hack and use -fPIC instead of -fPIE. + + * Mon Sep 26 2011 Jan Kratochvil - 7.3.50.20110722-7.fc16 + - [vla] Fix VLA arrays displayed in `bt full' (BZ 738482). + - Fix DW_OP_GNU_implicit_pointer for DWARF32 v3+ on 64-bit arches. + - Fix internal error on some optimized-out values. + + * Tue Aug 16 2011 Jan Kratochvil - 7.3.50.20110722-6.fc16 + - Python command/function auto-loading (Phil Muldoon, BZ 730976). + - Work around PR libc/13097 "linux-vdso.so.1" warning message. + - [TUI] Fix stepi on stripped code. + - Add BuildRequires: systemtap-sdt-devel for archer-sergiodj-stap-patch-split. + + * Wed Aug 10 2011 Jan Kratochvil - 7.3.50.20110722-5.fc16 + - Fix dlopen of libpthread.so, patched glibc required (Gary Benson, BZ 669432). + + * Tue Aug 9 2011 Jan Kratochvil - 7.3.50.20110722-4.fc16 + - Improve GDB performance on inferior dlopen calls (Gary Benson, BZ 698001). + - [python] Fix crash when pretty printer fails (Phil Muldoon, BZ 712715). + - Fix crash on invalid C++ mangled names (BZ 729283). + + * Fri Jul 29 2011 Jan Kratochvil - 7.3.50.20110722-3.fc16 + - Fix regression from VLA merge affecting -O0 -g watchpoints. + + * Fri Jul 29 2011 Jan Kratochvil - 7.3.50.20110722-2.fc16 + - Include gcc -g3 .debug_macro implementation by Tom Tromey. + + * Sat Jul 23 2011 Jan Kratochvil - 7.3.50.20110722-1.fc16 + - Rebase to FSF GDB 7.3.50.20110722. + - Improve gcc-4.6 stdarg false prologue end workaround (GDB PR 12435 + GCC PR 47471). + +------------------------------------------------------------------- +Wed Oct 12 12:09:41 UTC 2011 - rguenther@suse.com + +- Add patch to use old ptrace interface on powerpc to fix watchpoint + issues. [bnc#718313] + +------------------------------------------------------------------- +Thu Aug 4 10:28:50 UTC 2011 - rguenther@novell.com + +- Merge from gdb-7.3-41.fc15.src.rpm. [fate#310741] + + * Tue Jul 26 2011 Jan Kratochvil - 7.3-41.fc15 + - Rebase to the final FSF GDB 7.3 release. + - Improve gcc-4.6 stdarg false prologue end workaround (GDB PR 12435 + GCC PR 47471). + + * Sun Jul 3 2011 Jan Kratochvil - 7.2.90.20110703-40.fc15 + - Rebase to FSF GDB 7.2.90.20110703 (which is a 7.3 pre-release). + - Adjust the `print errno' patch due to the DW_AT_linkage_name following again. + + * Fri Jun 24 2011 Jan Kratochvil - 7.2.90.20110525-39.fc15 + - Fix install-info for the gdb-doc subpackage (BZ 715228). + +------------------------------------------------------------------- +Thu Jun 16 09:18:33 UTC 2011 - rguenther@novell.com + +- Merge from gdb-7.2.90.20110525-38.fc15.src.rpm. [fate#310741] + + * Wed May 25 2011 Jan Kratochvil - 7.2.90.20110525-38.fc15 + - Rebase to FSF GDB 7.2.90.20110525 (which is a 7.3 pre-release). + - [stap] Fix double free (Sergio Durigan Junior). + + * Tue May 3 2011 Jan Kratochvil - 7.2.90.20110429-37.fc15 + - Search also for . files in /usr/lib/debug/.build-id (BZ 641377). + +------------------------------------------------------------------- +Wed May 18 11:01:03 UTC 2011 - rguenther@novell.com + +- Merge from gdb-7.2.90.20110429-36.fc15.src.rpm. + + * Mon May 2 2011 Jan Kratochvil - 7.2.90.20110429-36.fc15 + - Bundle readline-6.2 with a workaround of skipped "ask" (BZ 701131). + - Use --without-system-readline, disable Requires and BuildRequires of readline. + - Drop gdb-6.5-readline-long-line-crash.patch and gdb-readline-6.0-signal.patch. + + * Fri Apr 29 2011 Jan Kratochvil - 7.2.90.20110429-35.fc15 + - Rebase to FSF GDB 7.2.90.20110429 (which is a 7.3 pre-release). + - Fix -O2 -g breakpoints internal error + prologue skipping (BZ 612253). + - Fix case insensitive symbols for Fortran by iFort (BZ 645773). + - Fix physname-related CU expansion issue for C++ (PR 12708). + - Fix Python access to inlined frames (BZ 694824). + + * Mon Apr 11 2011 Jan Kratochvil - 7.2.90.20110411-34.fc15 + - Rebase to FSF GDB 7.2.90.20110411 (which is a 7.3 pre-release). + - Include the proper fix for anonymous struct typedefs (Tom Tromey, BZ 672230). + + * Wed Mar 30 2011 Fabio M. Di Nitto - 7.2.50.20110328-33.fc15 + - Cleanup spec file to add sparc|sparcv9|sparc64. + - Add sparc specific workarounds to toolchain badness: + - disable mmap in bdf/ via --without-mmap configure option. + - add patch to not build mmap support on sparc for gdb/. + - gdb code is NOT at fault, but we need a working gdb while we sort out + the toolchain and rebuild all packages. this workaround is NOT for upstream. + + * Tue Mar 29 2011 Jan Kratochvil - 7.2.50.20110328-32.fc15 + - Fix occasional crash on `print errno' with no -pthread and no -g3 (BZ 690908). + +------------------------------------------------------------------- +Thu Apr 14 12:50:20 UTC 2011 - rguenther@novell.com + +- Merge from gdb-7.2.50.20110328-31.fc15.src.rpm. + + * Mon Mar 28 2011 Jan Kratochvil - 7.2.50.20110328-31.fc15 + - Rebase to FSF GDB 7.2.50.20110328 (which is a 7.3 pre-release). + - Bundle %%{libstdcxxpython}.tar.bz2 unconditionally - for rebulds on RHELs. + + * Sun Mar 20 2011 Jan Kratochvil - 7.2.50.20110320-30.fc15 + - Fix threading internal error on corrupted memory (BZ 677654). + - Fix i386 rwatch+awatch before run (BZ 688788, on top of BZ 541866). + + * Sun Mar 20 2011 Jan Kratochvil - 7.2.50.20110320-29.fc15 + - Rebase to FSF GDB 7.2.50.20110320 (which is a 7.3 pre-release). + - Merge archer-sergiodj-stap, the SystemTap probes breakpoints feature. + - [stap] Fix -O2 warnings. + - Fix Ada support crash on uninitialized gdbarch. + + * Sat Mar 5 2011 Jan Kratochvil - 7.2.50.20110305-28.fc15 + - Rebase to FSF GDB 7.2.50.20110305 (which is a 7.3 pre-release). + + * Fri Feb 25 2011 Jan Kratochvil - 7.2.50.20110222-27.fc15 + - Include doc also in the PDF form; new BuildRequires: texinfo-tex. + + * Wed Feb 23 2011 Jan Kratochvil - 7.2.50.20110222-26.fc15 + - Rebase to FSF GDB 7.2.50.20110222 (which is a 7.3 pre-release). + - Fix attach/core-load of {,un}prelinked i386 libs (bugreport by Michal Toman). + + * Mon Feb 21 2011 Jan Kratochvil - 7.2.50.20110218-25.fc15 + - Drop %%{_datadir}/gdb/syscalls/* for unsupported arches. + + * Fri Feb 18 2011 Jan Kratochvil - 7.2.50.20110218-24.fc15 + - Rebase to FSF GDB 7.2.50.20110218 (which is a 7.3 pre-release). + - [vla] Fox Fortran vector slices for allocated arrays (for BZ 609782). + + * Tue Feb 15 2011 Jan Kratochvil - 7.2.50.20110213-23.fc15 + - Move the GFDL License to gdb-doc. + + * Tue Feb 15 2011 Jan Kratochvil - 7.2.50.20110213-22.fc15 + - Fix gdb-doc Group to be Documentation, also provide it as noarch. + + * Tue Feb 15 2011 Jan Kratochvil - 7.2.50.20110213-21.fc15 + - Drop non-user (gdbint) and obsolete (stabs) documentation. + - Install also HTML files besides the INFO file. + - Create new subpackage gdb-doc for both INFO and HTML files. + + * Sun Feb 13 2011 Jan Kratochvil - 7.2.50.20110213-20.fc15 + - Rebase to FSF GDB 7.2.50.20110213 (which is a 7.3 pre-release). + - Fix occasionall unfound source lines (affecting at least glibc debugging). + - Fix const/volatile qualifiers of C++ types (PR c++/12328). + - Be backward compatible for --rebuild with <=fc14 librpm.so.1. + +- Revert documentation split. + +------------------------------------------------------------------- +Thu Mar 3 12:42:45 UTC 2011 - rguenther@novell.com + +- Merge from gdb-7.2.50.20110206-19.fc15.src.rpm. + + * Tue Feb 08 2011 Fedora Release Engineering - 7.2.50.20110206-19 + - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + + * Sun Feb 6 2011 Jan Kratochvil - 7.2.50.20110206-18.fc15 + - Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). + + * Sun Feb 6 2011 Jan Kratochvil - 7.2.50.20110206-17.fc15 + - Rebase to FSF GDB 7.2.50.20110206 (which is a 7.3 pre-release). + + * Thu Jan 27 2011 Jan Kratochvil - 7.2.50.20110125-16.fc15 + - Fix Python new-backtrace command (BZ 672235, Phil Muldoon). + + * Wed Jan 26 2011 Jan Kratochvil - 7.2.50.20110125-15.fc15 + - Temporary fix of F15 gcc-4.6 child DIEs of DW_TAG_typedef (BZ 672230). + - Workaround gcc-4.6 stdarg false prologue end (GDB PR 12435 + GCC PR 47471). + + * Tue Jan 25 2011 Jan Kratochvil - 7.2.50.20110125-14.fc15 + - Rebase to FSF GDB 7.2.50.20110125 (which is a 7.3 pre-release). + - Fix discontiguous address ranges in .gdb_index - v3->v4 (BZ 672281). + - Fix DWARF-3+ DW_AT_accessibility default assumption for F15 gcc-4.6. + + * Thu Jan 20 2011 Jan Kratochvil - 7.2.50.20110117-13.fc15 + - Use librpm.so.2 for rpm-4.9.0 in Fedora 15. + + * Mon Jan 17 2011 Jan Kratochvil - 7.2.50.20110117-12.fc15 + - Use %%{?dist} for sanity checking tools compliance (suggested by Petr Muller). + + * Mon Jan 17 2011 Jan Kratochvil - 7.2.50.20110117-11.fc15 + - Rebase to FSF GDB 7.2.50.20110117 (which is a 7.3 pre-release). + - Fix callback-mode readline-6.0 regression for CTRL-C (for RHEL-6.0). + - Fix occasional NULL dereference of the readline-6.0 workaround (BZ 575516). + + * Sat Jan 15 2011 Jan Kratochvil - 7.2.50.20110107-10.fc15 + - [delayed-symfile] Test a backtrace regression on CFIs without DIE (BZ 614604). + - [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp. + - [archer-keiths-expr-cumulative+upstream] Import C++ testcases. + - testsuite: Fix gdb-test-expr-cumulative-archer.patch compatibility. + + * Fri Jan 7 2011 Jan Kratochvil - 7.2.50.20110107-9.fc15 + - Remove --with-pythondir as no longer valid. + - Provide %{_bindir}gdb-add-index even on RHEL-5. + - Provide again libstdc++ pretty printers for any RHEL. + + * Fri Jan 7 2011 Jan Kratochvil - 7.2.50.20110107-8.fc15 + - Rebase to FSF GDB 7.2.50.20110107 (which is a 7.3 pre-release). + - Import archer-tromey-python (BZ 666177, branch update by Phil Muldoon). + + * Tue Jan 4 2011 Jan Kratochvil - 7.2.50.20110104-7.fc15 + - Rebase to FSF GDB 7.2.50.20110104 (which is a 7.3 pre-release). + - New testcase py-prettyprint.exp:print hint_error (for BZ 611569, BZ 629236). + - New test gdb.arch/x86_64-pid0-core.exp for kernel PID 0 cores (BZ 611435). + + * Sat Jan 1 2011 Jan Kratochvil - 7.2.50.20101231-6.fc15 + - Fix --with-system-readline doc build upstream regression. + + * Sat Jan 1 2011 Jan Kratochvil - 7.2.50.20101231-5.fc15 + - Rebase to FSF GDB 7.2.50.20101231 (which is a 7.3 pre-release). + - Remove gdb-6.3-bt-past-zero-20051201.patch, gdb-archer-ada.patch and + gdb-6.3-framepczero-20040927.patch already removed from .spec before. + - Remove gdb-6.5-dwarf-stack-overflow.patch, upstreamed (Tom Tromey). + - Remove gdb-6.6-bz225783-gdb-debuginfo-paths.patch, upstreamed (Tom Tromey). + - Remove gdb-6.6-readline-system.patch, reimplemented upstream (Tom Tromey). + - Remove gdb-bz642879-elfread-sigint-stale.patch, upstreamed (Jan Kratochvil). + - Remove gdb-next-over-throw.patch, upstreamed (Tom Tromey). + + * Mon Dec 27 2010 Jan Kratochvil - 7.2.50.20101117-4.fc15 + - Provide stub %%{_sysconfdir}/gdbinit (BZ 651232). + + * Mon Dec 27 2010 Jan Kratochvil - 7.2.50.20101117-3.fc15 + - Fix ppc* compilation of PRPSINFO in the core files (BZ 662995, for BZ 254229). + - Fix (disable) non-x86* compilation of libinproctrace.so (for BZ 662995). + + * Thu Nov 18 2010 Jan Kratochvil - 7.2.50.20101117-2.fc15 + - Drop gdb-6.8-glibc-headers-compat.patch: GNU/Linux irrelevant (Tom Tromey). + - Drop gdb-6.3-terminal-fix-20050214.patch: The bug is not reproducible. + - Drop gdb-6.7-kernel-headers-compat.patch: kernel-headers seem to be fixed. + - Drop gdb-archer-ada.patch: No longer needed for Ada (Keith Seitz). + - New PR backtrace/12237, drop gdb-6.3-framepczero-20040927.patch + gdb-6.3-bt-past-zero-20051201.patch as they already had no effect. + - Drop gdb-6.8-gcc35998-ada-memory-trash.patch as a different fix is upstream. + - Drop gdb-6.3-inheritance-20050324.patch: the call is redundent (Tom Tromey). + - Drop gdb-6.3-large-core-20051206.patch: obsoleted by MAX_COPY_BYTES. + + * Thu Nov 18 2010 Jan Kratochvil - 7.2.50.20101117-1.fc15 + - Rebase to FSF GDB 7.2.50.20101117 (which is a 7.3 pre-release). + + * Sun Nov 7 2010 Jan Kratochvil - 7.2-25.fc14 + - iFort compat. - case insensitive DWARF not in lowercase (BZ 645773). + + * Thu Oct 14 2010 Jan Kratochvil - 7.2-24.fc14 + - Add gdb.spec comments on the *.patch files upstream merge status. + + * Thu Oct 14 2010 Jan Kratochvil - 7.2-23.fc14 + - Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879). + - Fix crash on CTRL-C while reading an ELF symbol file (BZ 642879). + + * Tue Oct 12 2010 Jan Kratochvil - 7.2-22.fc14 + - testsuite: Provide missing lib/gdb-python.exp (for BZ 639089). + + * Tue Oct 12 2010 Jan Kratochvil - 7.2-21.fc14 + - Fix python stale error state, also fix its save/restore (BZ 639089). + - Fix inferior exec of new PIE x86_64 (BZ 638979). + + * Tue Oct 12 2010 Jan Kratochvil - 7.2-20.fc14 + - Fixup Release for 20.fc14. + + * Tue Oct 12 2010 Jan Kratochvil - 7.2-19.fc14 + - Use .gdb_index v3 to fix excessive resources rqmnts (BZ 640634, Tom Tromey). + + * Wed Oct 6 2010 Jan Kratochvil - 7.2-18.fc14 + - Fix false warning: non-absolute filename: (BZ 640648). + + * Thu Sep 30 2010 Jan Kratochvil - 7.2-17.fc14 + - New Conflicts: elfutils < 0.149 due to the .gdb_index .debug support. + +------------------------------------------------------------------- +Mon Dec 6 13:53:30 UTC 2010 - rguenther@novell.com + +- On SLE10 package libinproctrace in the main gdb package. + +------------------------------------------------------------------- +Wed Oct 13 10:52:15 UTC 2010 - rguenther@novell.com + +- Merge from gdb-7.2-16.fc14.src.rpm. + +------------------------------------------------------------------- +Mon Sep 13 10:42:49 UTC 2010 - rguenther@novell.com + +- Change python-base from recommends to requires, gdb no longer + works without some basic python modules. [bnc#638858] + +------------------------------------------------------------------- +Mon Sep 6 09:45:11 UTC 2010 - rguenther@novell.com + +- Merge from gdb-7.2-1.fc14.src.rpm. + +------------------------------------------------------------------- +Wed Aug 25 11:04:38 UTC 2010 - rguenther@novell.com + +- Backport fix for gcore not handling GNU_RELRO sections. [bnc#596646] + +------------------------------------------------------------------- +Wed Aug 25 10:53:50 UTC 2010 - rguenther@novell.com + +- Merge from gdb-7.1-33.fc13.src.rpm. + +------------------------------------------------------------------- +Fri Aug 6 12:25:13 UTC 2010 - rguenther@novell.com + +- Backport fix for setting of VSX registers. [bnc#626970] + +------------------------------------------------------------------- +Thu Aug 5 11:24:00 UTC 2010 - rguenther@novell.com + +- Merge from gdb-7.1-30.fc13.src.rpm. + +------------------------------------------------------------------- +Thu Aug 5 11:18:33 UTC 2010 - rguenther@novell.com + +- For SLE10 do not build a separate gdbserver package. + +------------------------------------------------------------------- +Thu Jul 22 09:54:36 UTC 2010 - rguenther@novell.com + +- Merge from gdb-7.1-29.fc13.src.rpm. + +------------------------------------------------------------------- +Tue Jun 1 11:46:20 UTC 2010 - rguenther@novell.com + +- Fix build on hppa fix. + +------------------------------------------------------------------- +Tue Jun 1 10:57:30 UTC 2010 - bg@novell.com + +- Fix build on hppa. + +------------------------------------------------------------------- +Fri May 21 12:17:19 UTC 2010 - rguenther@novell.com + +- Merge from gdb-7.1-20.fc13.src.rpm. + +------------------------------------------------------------------- +Thu Apr 22 19:13:48 UTC 2010 - aj@suse.de + +- Add upstream change to fix build with -Werror + +------------------------------------------------------------------- +Thu Apr 15 14:22:36 CEST 2010 - rguenther@novell.com + +- Merge from gdb-7.1-12.fc13.src.rpm. +- Re-write history to match SLE11 SP1 changelog + * Drop some more strange RHEL stuff. + * Fix build for SLE10. + +------------------------------------------------------------------- +Mon Mar 15 11:21:05 CET 2010 - rguenther@novell.com + +- Fix info documentation registering. [bnc#588278] + +------------------------------------------------------------------- +Thu Feb 11 13:43:11 CET 2010 - kukuk@suse.de + +- Re-Add baselibs.conf + +------------------------------------------------------------------- +Thu Oct 22 17:03:30 CEST 2009 - rguenther@suse.de + +- Merge from gdb-7.0-2.fc12.src.rpm. [fate#304116] + [bnc#488132] [bnc#498749] + +------------------------------------------------------------------- +Mon Oct 19 12:48:43 CEST 2009 - rguenther@suse.de + +- Recommend python-base. + +------------------------------------------------------------------- +Mon Oct 12 10:22:38 CEST 2009 - rguenther@suse.de + +- Fix python dependency. + +------------------------------------------------------------------- +Wed Oct 7 15:11:51 UTC 2009 - crrodriguez@opensuse.org + +- fix info files (un)installation. + +------------------------------------------------------------------- +Mon Oct 5 14:23:33 CEST 2009 - rguenther@suse.de + +- Merge from gdb-6.8.91.20090930-2.fc12.src.rpm. + +------------------------------------------------------------------- +Thu Sep 24 11:40:44 CEST 2009 - rguenther@suse.de + +- Merge from gdb-6.8.91.20090921-1.fc12.src.rpm. + +------------------------------------------------------------------- +Mon Sep 14 14:29:20 CEST 2009 - rguenther@suse.de + +- Merge from gdb-6.8.50.20090910-1.fc12.src.rpm. + +------------------------------------------------------------------- +Mon Aug 24 17:30:30 CEST 2009 - rguenther@suse.de + +- Fix gdb-6.3-ia64-sigtramp-frame-20050708.patch patch to allow + ia64 to build again. + +------------------------------------------------------------------- +Mon Aug 24 14:07:52 CEST 2009 - rguenther@suse.de + +- Merge from gdb-6.8.50.20090818-4.fc12.src.rpm. + +------------------------------------------------------------------- +Mon Aug 17 14:04:46 CEST 2009 - rguenther@suse.de + +- Merge from gdb-6.8.50.20090811-2.fc12.src.rpm. + +------------------------------------------------------------------- +Tue Aug 11 17:32:38 CEST 2009 - rguenther@suse.de + +- Remove no longer applied patches. + +------------------------------------------------------------------- +Thu Aug 6 12:29:19 CEST 2009 - rguenther@suse.de + +- Fixup the merge. + +------------------------------------------------------------------- +Thu Aug 6 12:11:40 CEST 2009 - rguenther@suse.de + +- Merge from gdb-6.8.50.20090803-2.fc12.src.rpm. + +------------------------------------------------------------------- +Tue Jul 28 13:44:45 CEST 2009 - rguenther@suse.de + +- Fix crash during debuginfo reading. + +------------------------------------------------------------------- +Wed Jul 8 13:22:36 CEST 2009 - rguenther@suse.de + +- Drop fixes done upstream. + +------------------------------------------------------------------- +Wed Jun 17 16:43:08 CEST 2009 - matz@suse.de + +- Apply fix for backtraces without unwind info again. [#390722] +- Disable gdb-6.5-bz218379-ppc-solib-trampoline-fix.patch, it's not + necessary anymore and breaks the above. + +------------------------------------------------------------------- +Wed May 27 18:07:26 CEST 2009 - rguenther@suse.de + +- Merge FC11 update 23. + - Fix crashes due to (missing) varobj revalidation, for VLA (for brc#377541). + - Archer update to the snapshot: e2812eadef2c15baeccd003e11fdf3fbc0b90dc2 + - Archer backport: 58dcda94ac5d6398f47382505e9d3d9d866d79bf + + f3de7bbd655337fe6705aeaafcc970deff3dd5d5 + - Implement Fortran modules namespaces (brc#466118). + +------------------------------------------------------------------- +Mon May 18 10:42:26 CEST 2009 - rguenther@suse.de + +- Add patch to fix handling of string DW_AT_const_values. [bnc#329420] +- Verified + * Fix printing of 'inf'. [bnc#466266] + * Stepping through templates. [bnc#414230] + * gcore script. [fate#303462] + +------------------------------------------------------------------- +Thu May 14 15:26:42 CEST 2009 - rguenther@suse.de + +- Change reported version to mention SUSE instead of Fedora. +- Fix handling of bogus global namespace DIEs from GCC 4.1. [bnc#329420] +- Fix Power7 DFP detection. [bnc#492331] + +------------------------------------------------------------------- +Thu May 7 15:00:14 CEST 2009 - rguenther@suse.de + +- Fix build for SLE10. [fate#305977] +- Adjust missing debug packages suggested install command. + +------------------------------------------------------------------- +Wed Apr 29 15:11:15 CEST 2009 - rguenther@suse.de + +- Adjust package name and release to not contain macros. + +------------------------------------------------------------------- +Mon Apr 27 16:18:02 CEST 2009 - rguenther@suse.de + +- Disable rpm support for locating debug info packages. + +------------------------------------------------------------------- +Mon Apr 27 13:33:06 CEST 2009 - rguenther@suse.de + +- Switch to Fedora 11 source RPM. + * includes partially merge from Archer. [bnc#329420, bnc#497141, + bnc#492782] + +------------------------------------------------------------------- +Tue Mar 10 11:14:25 CET 2009 - rguenther@suse.de + +- Add VLA support patch from Fedora to fix possible + dwarf_expr_frame_base NULL checking regression. +- Fix readline incompatibility. + +------------------------------------------------------------------- +Mon Mar 2 11:42:03 CET 2009 - rguenther@suse.de + +- Integrate support for transparently debugging inline functions. + +------------------------------------------------------------------- +Mon Feb 16 11:40:00 CET 2009 - schwab@suse.de + +- Update to head to trunk. + +------------------------------------------------------------------- +Tue Feb 3 16:18:13 CET 2009 - schwab@suse.de + +- Fix merge error. + +------------------------------------------------------------------- +Thu Jan 22 17:17:14 CET 2009 - schwab@suse.de + +- Add updates for Cell combined debugger. + +------------------------------------------------------------------- +Tue Jan 20 15:45:56 CET 2009 - schwab@suse.de + +- Do not call get_frame_arch for NULL frame pointers. +- Remove deprecated_safe_get_selected_frame call from read_var_value. + +------------------------------------------------------------------- +Fri Jan 16 15:30:23 CET 2009 - bwalle@suse.de + +- Recommend Python for GDB to prevent strange error messages to + be presented to the user in the default case. + +------------------------------------------------------------------- +Wed Dec 10 12:34:56 CET 2008 - olh@suse.de + +- use Obsoletes: -XXbit only for ppc64 to help solver during distupgrade + (bnc#437293) + +------------------------------------------------------------------- +Thu Nov 20 16:33:45 CET 2008 - schwab@suse.de + +- Update to head of trunk. +- Don't lose running state of the inferior. +- Fix dangling pointers after following fork. + +------------------------------------------------------------------- +Sun Nov 9 19:18:33 CET 2008 - schwab@suse.de + +- Update .debug_line parser patch. + +------------------------------------------------------------------- +Mon Nov 3 19:21:09 CET 2008 - schwab@suse.de + +- Update to head of trunk. +- Fix auxv decoding. + +------------------------------------------------------------------- +Mon Nov 3 12:51:52 CET 2008 - schwab@suse.de + +- Revert broken change from jblunck. + +------------------------------------------------------------------- +Thu Oct 30 12:34:56 CET 2008 - olh@suse.de + +- obsolete old -XXbit packages (bnc#437293) + +------------------------------------------------------------------- +Tue Oct 28 12:43:31 CET 2008 - jblunck@suse.de + +- Fix segfault when reading line number program (bnc #439457). + +------------------------------------------------------------------- +Mon Oct 27 16:05:13 CET 2008 - schwab@suse.de + +- Complain about invalid line number program. + +------------------------------------------------------------------- +Tue Oct 7 15:00:24 CEST 2008 - schwab@suse.de + +- Fix crash. + +------------------------------------------------------------------- +Wed Sep 24 14:23:01 CEST 2008 - schwab@suse.de + +- Update to head of trunk. +- Add POWER7 support. +- Add gcore. +- Add spu-elf to list of targets. + +------------------------------------------------------------------- +Fri Sep 12 11:36:50 CEST 2008 - schwab@suse.de + +- Update to head of trunk. +- Add Cell combined debugger patch. + +------------------------------------------------------------------- +Thu Sep 4 11:30:34 CEST 2008 - schwab@suse.de + +- Update to head of trunk. + +------------------------------------------------------------------- +Fri Aug 15 17:58:02 CEST 2008 - schwab@suse.de + +- Update to head of trunk. + +------------------------------------------------------------------- +Fri Aug 8 15:30:07 CEST 2008 - schwab@suse.de + +- Update to head of trunk. +- Enable multi-target support. + +------------------------------------------------------------------- +Fri Jul 18 13:18:33 CEST 2008 - schwab@suse.de + +- Update to head of trunk. + +------------------------------------------------------------------- +Mon Jul 7 13:42:05 CEST 2008 - schwab@suse.de + +- Update to head of trunk. + +------------------------------------------------------------------- +Wed Jun 18 16:47:02 CEST 2008 - schwab@suse.de + +- Update to head of trunk. + +------------------------------------------------------------------- +Fri May 23 11:29:13 CEST 2008 - matz@suse.de + +- Try harder to provide backtraces without debuginfo on i386. [bnc #390722] + +------------------------------------------------------------------- +Wed May 21 10:39:41 CEST 2008 - schwab@suse.de + +- Fix assertion failure. + +------------------------------------------------------------------- +Fri May 9 14:05:00 CEST 2008 - schwab@suse.de + +- Split off gdbserver. +- Fix watchpoints. + +------------------------------------------------------------------- +Thu Apr 10 12:54:45 CEST 2008 - ro@suse.de + +- added baselibs.conf file to build xxbit packages + for multilib support + +------------------------------------------------------------------- +Fri Mar 28 10:55:28 CET 2008 - schwab@suse.de + +- Update to gdb 6.8. + * New native configurations + NetBSD/hppa hppa*-*netbsd* + Xtensa GNU/Linux xtensa*-*-linux* + * New targets + NetBSD/hppa hppa*-*-netbsd* + Xtensa GNU/Lunux xtensa*-*-linux* + * Change in command line behavior -- corefiles vs. process ids. + When the '-p NUMBER' or '--pid NUMBER' options are used, and + attaching to process NUMBER fails, GDB no longer attempts to open a + core file named NUMBER. Attaching to a program using the -c option + is no longer supported. Instead, use the '-p' or '--pid' options. + * GDB can now be built as a native debugger for debugging Windows x86 + (mingw32) Portable Executable (PE) programs. + * Pending breakpoints no longer change their number when their address + is resolved. + * GDB now supports breakpoints with multiple locations, + including breakpoints on C++ constructors, inside C++ templates, + and in inlined functions. + * GDB's ability to debug optimized code has been improved. GDB more + accurately identifies function bodies and lexical blocks that occupy + more than one contiguous range of addresses. + * Target descriptions can now describe registers for PowerPC. + * The GDB remote stub, gdbserver, now supports the AltiVec and SPE + registers on PowerPC targets. + * The GDB remote stub, gdbserver, now supports thread debugging on GNU/Linux + targets even when the libthread_db library is not available. + * The GDB remote stub, gdbserver, now supports the new file transfer + commands (remote put, remote get, and remote delete). + * The GDB remote stub, gdbserver, now supports run and attach in + extended-remote mode. + * hppa*64*-*-hpux11* target broken + The debugger is unable to start a program and fails with the following + error: "Error trying to get information about dynamic linker". + The gdb-6.7 release is also affected. + * GDB now supports the --enable-targets= configure option to allow + building a single GDB executable that supports multiple remote + target architectures. + * GDB now supports debugging C and C++ programs which use the + Decimal Floating Point extension. In addition, the PowerPC target + now has a set of pseudo-registers to inspect decimal float values + stored in two consecutive float registers. + * The -break-insert MI command can optionally create pending + breakpoints now. + * Improved support for debugging Ada + Many improvements to the Ada language support have been made. These + include: + - Better support for Ada2005 interface types + - Improved handling of arrays and slices in general + - Better support for Taft-amendment types + - The '{type} ADDRESS' expression is now allowed on the left hand-side + of an assignment + - Improved command completion in Ada + - Several bug fixes + * New commands + set print frame-arguments (all|scalars|none) + show print frame-arguments + The value of this variable can be changed to control which argument + values should be printed by the debugger when displaying a frame. + remote put + remote get + remote delete + Transfer files to and from a remote target, and delete remote files. + * New MI commands + -target-file-put + -target-file-get + -target-file-delete + Transfer files to and from a remote target, and delete remote files. + * New remote packets + vFile:open: + vFile:close: + vFile:pread: + vFile:pwrite: + vFile:unlink: + Open, close, read, write, and delete files on the remote system. + * GDB on GNU/Linux and HP/UX can now debug through "exec" of a new + process. + vAttach + Attach to an existing process on the remote system, in extended-remote + mode. + vRun + Run a new process on the remote system, in extended-remote mode. + +------------------------------------------------------------------- +Wed Mar 5 15:38:06 CET 2008 - schwab@suse.de + +- Update to head of gdb_6_8-branch. + +------------------------------------------------------------------- +Thu Feb 14 13:41:54 CET 2008 - schwab@suse.de + +- Update to head of trunk. + +------------------------------------------------------------------- +Thu Jan 31 15:34:47 CET 2008 - schwab@suse.de + +- Update to head of trunk. + +------------------------------------------------------------------- +Thu Jan 10 11:57:13 CET 2008 - schwab@suse.de + +- Update to head of trunk. + +------------------------------------------------------------------- +Mon Nov 12 14:47:26 CET 2007 - schwab@suse.de + +- Update to gdb 6.7.1. + * hppa*64*-*-hpux11* target broken + The debugger is unable to start a program and fails with the following + error: "Error trying to get information about dynamic linker". + The gdb-6.7 release is also affected. + +------------------------------------------------------------------- +Fri Oct 19 15:02:27 CEST 2007 - olh@suse.de + +- allow build with old distributions, libexpat-devel is new in 10.3 + +------------------------------------------------------------------- +Thu Oct 11 18:52:04 CEST 2007 - schwab@suse.de + +- Update to gdb 6.7. + * Resolved 101 resource leaks, null pointer dereferences, etc. in gdb, + bfd, libiberty and opcodes, as revealed by static analysis donated by + Coverity, Inc. (http://scan.coverity.com). + * When looking up multiply-defined global symbols, GDB will now prefer the + symbol definition in the current shared library if it was built using the + -Bsymbolic linker option. + * When the Text User Interface (TUI) is not configured, GDB will now + recognize the -tui command-line option and print a message that the TUI + is not supported. + * The GDB remote stub, gdbserver, now has lower overhead for high + frequency signals (e.g. SIGALRM) via the QPassSignals packet. + * GDB for MIPS targets now autodetects whether a remote target provides + 32-bit or 64-bit register values. + * Support for C++ member pointers has been improved. + * GDB now understands XML target descriptions, which specify the + target's overall architecture. GDB can read a description from + a local file or over the remote serial protocol. + * Vectors of single-byte data use a new integer type which is not + automatically displayed as character or string data. + * The /s format now works with the print command. It displays + arrays of single-byte integers and pointers to single-byte integers + as strings. + * Target descriptions can now describe target-specific registers, + for architectures which have implemented the support (currently + only ARM, M68K, and MIPS). + * GDB and the GDB remote stub, gdbserver, now support the XScale + iWMMXt coprocessor. + * The GDB remote stub, gdbserver, has been updated to support + ARM Windows CE (mingw32ce) debugging, and GDB Windows CE support + has been rewritten to use the standard GDB remote protocol. + * GDB can now step into C++ functions which are called through thunks. + * GDB for the Cell/B.E. SPU now supports overlay debugging. + * The GDB remote protocol "qOffsets" packet can now honor ELF segment + layout. It also supports a TextSeg= and DataSeg= response when only + segment base addresses (rather than offsets) are available. + * The /i format now outputs any trailing branch delay slot instructions + immediately following the last instruction within the count specified. + * The GDB remote protocol "T" stop reply packet now supports a + "library" response. Combined with the new "qXfer:libraries:read" + packet, this response allows GDB to debug shared libraries on targets + where the operating system manages the list of loaded libraries (e.g. + Windows and SymbianOS). + * The GDB remote stub, gdbserver, now supports dynamic link libraries + (DLLs) on Windows and Windows CE targets. + * GDB now supports a faster verification that a .debug file matches its binary + according to its build-id signature, if the signature is present. + * New commands + set remoteflow + show remoteflow + Enable or disable hardware flow control (RTS/CTS) on the serial port + when debugging using remote targets. + set mem inaccessible-by-default + show mem inaccessible-by-default + If the target supplies a memory map, for instance via the remote + protocol's "qXfer:memory-map:read" packet, setting this variable + prevents GDB from accessing memory outside the memory map. This + is useful for targets with memory mapped registers or which react + badly to accesses of unmapped address space. + set breakpoint auto-hw + show breakpoint auto-hw + If the target supplies a memory map, for instance via the remote + protocol's "qXfer:memory-map:read" packet, setting this variable + lets GDB use hardware breakpoints automatically for memory regions + where it can not use software breakpoints. This covers both the + "break" command and internal breakpoints used for other commands + including "next" and "finish". + catch exception + catch exception unhandled + Stop the program execution when Ada exceptions are raised. + catch assert + Stop the program execution when an Ada assertion failed. + set sysroot + show sysroot + Set an alternate system root for target files. This is a more + general version of "set solib-absolute-prefix", which is now + an alias to "set sysroot". + info spu + Provide extended SPU facility status information. This set of + commands is available only when debugging the Cell/B.E. SPU + architecture. + * New native configurations + OpenBSD/sh sh*-*openbsd* + set tdesc filename + unset tdesc filename + show tdesc filename + Use the specified local file as an XML target description, and do + not query the target for its built-in description. + * New targets + OpenBSD/sh sh*-*-openbsd* + MIPS64 GNU/Linux (gdbserver) mips64-linux-gnu + Toshiba Media Processor mep-elf + * New remote packets + QPassSignals: + Ignore the specified signals; pass them directly to the debugged program + without stopping other threads or reporting them to GDB. + qXfer:features:read: + Read an XML target description from the target, which describes its + features. + qXfer:spu:read: + qXfer:spu:write: + Read or write contents of an spufs file on the target system. These + packets are available only on the Cell/B.E. SPU architecture. + qXfer:libraries:read: + Report the loaded shared libraries. Combined with new "T" packet + response, this packet allows GDB to debug shared libraries on + targets where the operating system manages the list of loaded + libraries (e.g. Windows and SymbianOS). + * Removed targets + Support for these obsolete configurations has been removed. + alpha*-*-osf1* + alpha*-*-osf2* + d10v-*-* + hppa*-*-hiux* + i[34567]86-ncr-* + i[34567]86-*-dgux* + i[34567]86-*-lynxos* + i[34567]86-*-netware* + i[34567]86-*-sco3.2v5* + i[34567]86-*-sco3.2v4* + i[34567]86-*-sco* + i[34567]86-*-sysv4.2* + i[34567]86-*-sysv4* + i[34567]86-*-sysv5* + i[34567]86-*-unixware2* + i[34567]86-*-unixware* + i[34567]86-*-sysv* + i[34567]86-*-isc* + m68*-cisco*-* + m68*-tandem-* + mips*-*-pe + rs6000-*-lynxos* + sh*-*-pe + * Other removed features + target abug + target cpu32bug + target est + target rom68k + Various m68k-only ROM monitors. + target hms + target e7000 + target sh3 + target sh3e + Various Renesas ROM monitors and debugging interfaces for SH and + H8/300. + target ocd + Support for a Macraigor serial interface to on-chip debugging. + GDB does not directly support the newer parallel or USB + interfaces. + DWARF 1 support + A debug information format. The predecessor to DWARF 2 and + DWARF 3, which are still supported. + Support for the HP aCC compiler on HP-UX/PA-RISC + SOM-encapsulated symbolic debugging information, automatic + invocation of pxdb, and the aCC custom C++ ABI. This does not + affect HP-UX for Itanium or GCC for HP-UX/PA-RISC. Code compiled + with aCC can still be debugged on an assembly level. + MIPS ".pdr" sections + A MIPS-specific format used to describe stack frame layout + in debugging information. + Scheme support + GDB could work with an older version of Guile to debug + the interpreter and Scheme programs running in it. + set mips stack-arg-size + set mips saved-gpreg-size + Use "set mips abi" to control parameter passing for MIPS. + +------------------------------------------------------------------- +Mon Oct 1 15:44:07 CEST 2007 - schwab@suse.de + +- Update to head of gdb_6_7-branch. + +------------------------------------------------------------------- +Mon Sep 24 11:33:32 CEST 2007 - schwab@suse.de + +- Fix internal error [#309928]. + +------------------------------------------------------------------- +Thu Jul 26 12:41:05 CEST 2007 - schwab@suse.de + +- Update to head of trunk. + +------------------------------------------------------------------- +Fri Jul 13 11:46:27 CEST 2007 - schwab@suse.de + +- Update to head of trunk. + +------------------------------------------------------------------- +Sun Jun 24 18:52:47 CEST 2007 - schwab@suse.de + +- Fix annotations for commands prompt. + +------------------------------------------------------------------- +Thu Jun 21 12:37:56 CEST 2007 - schwab@suse.de + +- Update to head of trunk. + +------------------------------------------------------------------- +Fri Jun 8 17:15:17 CEST 2007 - schwab@suse.de + +- Update to head of trunk. + +------------------------------------------------------------------- +Fri May 11 15:22:37 CEST 2007 - schwab@suse.de + +- Update to head of trunk. + +------------------------------------------------------------------- +Fri Apr 13 15:43:47 CEST 2007 - schwab@suse.de + +- Avoid crash on object with no text section [#176306]. + +------------------------------------------------------------------- +Wed Apr 11 17:16:45 CEST 2007 - schwab@suse.de + +- Handle non-threaded processes in gstack [#262694]. + +------------------------------------------------------------------- +Sun Apr 1 21:32:33 CEST 2007 - schwab@suse.de + +- Properly decode CR register number. + +------------------------------------------------------------------- +Thu Mar 29 13:45:08 CEST 2007 - schwab@suse.de + +- Update solib-extract-address patch. + +------------------------------------------------------------------- +Tue Mar 20 13:41:02 CET 2007 - schwab@suse.de + +- Update single stepping patch again [#154486]. + +------------------------------------------------------------------- +Fri Mar 16 13:39:50 CET 2007 - schwab@suse.de + +- Update single stepping patch [#154486]. + +------------------------------------------------------------------- +Thu Mar 15 18:22:31 CET 2007 - schwab@suse.de + +- Fix altivec vector return location [#250004]. + +------------------------------------------------------------------- +Mon Mar 12 18:07:07 CET 2007 - schwab@suse.de + +- Update ppc DWARF patch to also handle broken debug info from old + compilers. + +------------------------------------------------------------------- +Thu Mar 8 15:04:28 CET 2007 - schwab@suse.de + +- Deal with stepping over sequence of atomic insns [#154486]. + +------------------------------------------------------------------- +Wed Mar 7 14:05:16 CET 2007 - schwab@suse.de + +- Improve last change. + +------------------------------------------------------------------- +Tue Mar 6 18:47:10 CET 2007 - schwab@suse.de + +- Better handling of ppc64 function descriptor symbols. + +------------------------------------------------------------------- +Mon Mar 5 22:06:00 CET 2007 - schwab@suse.de + +- Remove obsolete patch. +- Fix show endian. + +------------------------------------------------------------------- +Thu Jan 11 18:29:13 CET 2007 - schwab@suse.de + +- Fix unchecked use of PC_REGNUM. + +------------------------------------------------------------------- +Wed Dec 20 12:37:40 CET 2006 - schwab@suse.de + +- Update to gdb 6.6. + * New targets + Xtensa xtensa-elf + Cell Broadband Engine SPU spu-elf + * GDB can now be configured as a cross-debugger targeting native Windows + (mingw32) or Cygwin. It can communicate with a remote debugging stub + running on a Windows system over TCP/IP to debug Windows programs. + * The GDB remote stub, gdbserver, has been updated to support Windows and + Cygwin debugging. Both single-threaded and multi-threaded programs are + supported. + * The "set trust-readonly-sections" command works again. This command was + broken in GDB 6.3, 6.4, and 6.5. + * Support for GNU/Linux Thread Local Storage (TLS, per-thread variables) no + longer requires symbolic debug information (e.g. DWARF-2). + * New commands + set substitute-path + unset substitute-path + show substitute-path + Manage a list of substitution rules that GDB uses to rewrite the name + of the directories where the sources are located. This can be useful + for instance when the sources were moved to a different location + between compilation and debugging. + set trace-commands + show trace-commands + Print each CLI command as it is executed. Each command is prefixed with + a number of `+' symbols representing the nesting depth. + The source command now has a `-v' option to enable the same feature. + * REMOVED features + The ARM Demon monitor support (RDP protocol, "target rdp"). + Kernel Object Display, an embedded debugging feature which only worked with + an obsolete version of Cisco IOS. + The 'set download-write-size' and 'show download-write-size' commands. + * New remote packets + qSupported: + Tell a stub about GDB client features, and request remote target features. + The first feature implemented is PacketSize, which allows the target to + specify the size of packets it can handle - to minimize the number of + packets required and improve performance when connected to a remote + target. + qXfer:auxv:read: + Fetch an OS auxilliary vector from the remote stub. This packet is a + more efficient replacement for qPart:auxv:read. + * Removed remote packets + qPart:auxv:read: + This packet has been replaced by qXfer:auxv:read. Only GDB 6.4 and 6.5 + used it, and only gdbserver implemented it. + +------------------------------------------------------------------- +Sat Dec 2 21:38:33 CET 2006 - schwab@suse.de + +- Update to gdb 6.5.90. + +------------------------------------------------------------------- +Sat Oct 28 00:25:25 CEST 2006 - schwab@suse.de + +- Rename detach-fork to detach fork. + +------------------------------------------------------------------- +Tue Oct 24 13:35:52 CEST 2006 - schwab@suse.de + +- Better fix for function descriptor handling on ppc64. + +------------------------------------------------------------------- +Fri Aug 25 13:40:31 CEST 2006 - schwab@suse.de + +- Minimal support for .gnu.hash. + +------------------------------------------------------------------- +Thu Aug 24 14:18:29 CEST 2006 - schwab@suse.de + +- Fix off-by-one in add_symbol_file_command [#200831]. + +------------------------------------------------------------------- +Fri Aug 11 14:45:43 CEST 2006 - schwab@suse.de + +- Correctly extend addresses read from link map. + +------------------------------------------------------------------- +Sun Jul 16 23:22:08 CEST 2006 - schwab@suse.de + +- Fix function decriptor handing on ppc64. + +------------------------------------------------------------------- +Wed Jun 21 10:16:16 CEST 2006 - schwab@suse.de + +- Update to final gdb 6.5. + +------------------------------------------------------------------- +Sat Jun 3 10:04:56 CEST 2006 - schwab@suse.de + +- Update to gdb 6.5 RC 1. + +------------------------------------------------------------------- +Wed May 31 14:41:40 CEST 2006 - schwab@suse.de + +- Set long double size to 16 [#180103]. + +------------------------------------------------------------------- +Mon May 22 14:53:53 CEST 2006 - schwab@suse.de + +- Update to gdb 6.4.90 snapshot 20060522. + +------------------------------------------------------------------- +Sun Apr 23 16:05:38 CEST 2006 - schwab@suse.de + +- Add patch to avoid losing compilation directory. +- Fix a parallel build problem. + +------------------------------------------------------------------- +Tue Apr 4 21:48:43 CEST 2006 - schwab@suse.de + +- Relocate PIEs. + +------------------------------------------------------------------- +Mon Mar 27 00:47:48 CEST 2006 - schwab@suse.de + +- Handle .eh_frame register encoding that is different from .dwarf_frame. +- Remove obsolete patch. + +------------------------------------------------------------------- +Wed Jan 25 21:30:16 CET 2006 - mls@suse.de + +- converted neededforbuild to BuildRequires + +------------------------------------------------------------------- +Mon Jan 23 12:01:15 CET 2006 - schwab@suse.de + +- Add fix for PIC prologue analyzer on powerpc. + +------------------------------------------------------------------- +Wed Dec 14 01:11:46 CET 2005 - schwab@suse.de + +- Add fix for observer notify queue after attach. + +------------------------------------------------------------------- +Fri Dec 2 15:13:15 CET 2005 - schwab@suse.de + +- Update to gdb 6.4. + +------------------------------------------------------------------- +Tue Nov 22 13:11:03 CET 2005 - schwab@suse.de + +- Update to gdb 6.3.90. + +------------------------------------------------------------------- +Fri Nov 4 01:06:09 CET 2005 - schwab@suse.de + +- Update to gdb-6.3.50 snapshot 20051103. + +------------------------------------------------------------------- +Mon Oct 3 14:47:06 CEST 2005 - schwab@suse.de + +- Update to gdb 6.3.50 snapshot 20051003. + +------------------------------------------------------------------- +Mon Sep 19 19:06:04 CEST 2005 - schwab@suse.de + +- Fix warnings. + +------------------------------------------------------------------- +Sun Aug 21 15:04:46 CEST 2005 - schwab@suse.de + +- Add DWARF CFI unwinder on ppc. + +------------------------------------------------------------------- +Mon Jun 20 23:33:40 CEST 2005 - schwab@suse.de + +- Require libunwind-devel on ia64. + +------------------------------------------------------------------- +Thu Jun 9 15:51:37 CEST 2005 - schwab@suse.de + +- Add patch for ia64 vDSO support and unwinding through signals and + syscalls [#60766]. + +------------------------------------------------------------------- +Mon Apr 11 20:35:27 CEST 2005 - schwab@suse.de + +- Fix backtrace through vsyscall [#63483]. + +------------------------------------------------------------------- +Mon Apr 11 01:13:30 CEST 2005 - schwab@suse.de + +- Add patch to fix bugs in rs6000/powerpc register set functions. +- Fix a testsuite bug. + +------------------------------------------------------------------- +Sun Mar 6 17:52:14 CET 2005 - schwab@suse.de + +- Add patch to suppress fork attach/detach messages. + +------------------------------------------------------------------- +Wed Mar 2 17:41:41 CET 2005 - schwab@suse.de + +- Add patch to fix following vfork from a secondary thread. + +------------------------------------------------------------------- +Mon Feb 28 15:26:00 CET 2005 - schwab@suse.de + +- Don't ignore DW_TAG_member [#66406]. + +------------------------------------------------------------------- +Tue Feb 1 17:02:10 CET 2005 - schwab@suse.de + +- Find separate debug symbol files in /usr/lib/debug by default. + +------------------------------------------------------------------- +Thu Jan 27 17:13:46 CET 2005 - schwab@suse.de + +- Add patch to handle back-to-back and nested signals. + +------------------------------------------------------------------- +Thu Jan 27 13:21:20 CET 2005 - schwab@suse.de + +- Add patch to implement reggroups for ppc. + +------------------------------------------------------------------- +Wed Jan 26 11:14:23 CET 2005 - schwab@suse.de + +- Add patch to implement PPC GNU/Linux sigtramp frame code. + +------------------------------------------------------------------- +Wed Jan 12 14:26:25 CET 2005 - schwab@suse.de + +- Don't error out when encountering an unavailable value. + +------------------------------------------------------------------- +Fri Dec 3 15:33:47 CET 2004 - schwab@suse.de + +- Downgrade errors to warnings during backtrace [#48484]. +- Undocument --readnever since it may not be supported by future releases. +- Fix patches from last change. + +------------------------------------------------------------------- +Fri Dec 3 14:05:13 CET 2004 - kukuk@suse.de + +- Add --readnever option as workaround for [#48485] + +------------------------------------------------------------------- +Sun Nov 14 21:47:53 CET 2004 - schwab@suse.de + +- Add libunwind-devel to neededforbuild. + +------------------------------------------------------------------- +Sat Nov 13 15:59:26 CET 2004 - schwab@suse.de + +- Fix missing dependencies. + +------------------------------------------------------------------- +Wed Nov 10 11:56:32 CET 2004 - schwab@suse.de + +- Version 6.2.91 renamed to 6.3. + +------------------------------------------------------------------- +Tue Nov 9 00:57:31 CET 2004 - schwab@suse.de + +- Update to gdb 6.2.91 (6.3 release candidate). + +------------------------------------------------------------------- +Mon Nov 8 15:34:08 CET 2004 - schwab@suse.de + +- Revert last change. +- Fix typo. + +------------------------------------------------------------------- +Mon Nov 8 15:04:27 CET 2004 - uli@suse.de + +- fixed to build on s390* + +------------------------------------------------------------------- +Mon Oct 25 14:51:07 CEST 2004 - schwab@suse.de + +- Fix building gdbserver on x86-64. + +------------------------------------------------------------------- +Mon Oct 25 11:43:37 CEST 2004 - schwab@suse.de + +- Update to gdb 6.2.90. +- Use libunwind on ia64. + +------------------------------------------------------------------- +Thu Sep 9 10:13:11 CEST 2004 - schwab@suse.de + +- Update to gdb 6.2.1. + +------------------------------------------------------------------- +Wed Aug 25 16:00:27 CEST 2004 - schwab@suse.de + +- Fix deadlock in child_wait [#42796]. + +------------------------------------------------------------------- +Tue Aug 24 16:43:36 CEST 2004 - schwab@suse.de + +- Import latest changes from 6.2 branch. + +------------------------------------------------------------------- +Fri Jul 30 15:23:17 CEST 2004 - schwab@suse.de + +- Update to gdb 6.2. + +------------------------------------------------------------------- +Thu Jul 29 15:53:51 CEST 2004 - schwab@suse.de + +- Update to gdb 6.1.92. + +------------------------------------------------------------------- +Mon Jul 26 21:08:42 CEST 2004 - schwab@suse.de + +- Fix handling of relative filenames in DWARF2 .debug_line. + +------------------------------------------------------------------- +Mon Jul 19 13:01:27 CEST 2004 - schwab@suse.de + +- Update to gdb 6.1.91. + +------------------------------------------------------------------- +Thu Jun 24 14:26:28 CEST 2004 - schwab@suse.de + +- Better handling of dying threads. + +------------------------------------------------------------------- +Fri Jun 18 23:57:13 CEST 2004 - schwab@suse.de + +- Update to gdb 6.1.1. + +------------------------------------------------------------------- +Tue May 25 17:14:03 CEST 2004 - schwab@suse.de + +- Fix handling of short lived threads [#40841]. + +------------------------------------------------------------------- +Sat May 1 15:07:32 CEST 2004 - schwab@suse.de + +- Restore removed hunk. + +------------------------------------------------------------------- +Fri Apr 30 21:31:35 CEST 2004 - meissner@suse.de + +- applied 3 patches to fix problems on ppc64. #39394 + +------------------------------------------------------------------- +Sat Apr 17 15:55:23 CEST 2004 - schwab@suse.de + +- Pacify autobuild. + +------------------------------------------------------------------- +Mon Apr 5 11:40:31 CEST 2004 - schwab@suse.de + +- Version 6.0.92 has been renamed to 6.1. + +------------------------------------------------------------------- +Sat Apr 3 20:34:55 CEST 2004 - schwab@suse.de + +- Update to gdb 6.0.92 (6.1 release candidate). + +------------------------------------------------------------------- +Tue Mar 30 16:50:40 CEST 2004 - schwab@suse.de + +- Fix invalid use of va_list. + +------------------------------------------------------------------- +Mon Mar 29 23:29:09 CEST 2004 - schwab@suse.de + +- Update to gdb 6.0.91. + +------------------------------------------------------------------- +Mon Mar 29 15:40:16 CEST 2004 - schwab@suse.de + +- Update to current CVS. + +------------------------------------------------------------------- +Fri Mar 19 11:59:48 CET 2004 - schwab@suse.de + +- Fix last change: don't disable testsuite. + +------------------------------------------------------------------- +Wed Mar 17 10:00:43 CET 2004 - mludvig@suse.cz + +- Added opcodes for VIA PadLock instructions. + +------------------------------------------------------------------- +Tue Mar 2 14:28:18 CET 2004 - schwab@suse.de + +- Update to gdb 6.0.90. +- Run testsuite. + +------------------------------------------------------------------- +Thu Jan 8 18:37:10 CET 2004 - schwab@suse.de + +- Fix gate area range. + +------------------------------------------------------------------- +Wed Dec 10 18:16:55 CET 2003 - schwab@suse.de + +- Support DW_TAG_subrange_type. +- Backport recent ia64 improvements from mainline. + +------------------------------------------------------------------- +Tue Oct 21 14:36:49 CEST 2003 - mludvig@ + +- Add support for debugging both i386 and amd64 apps by a single + amd64 GDB binary. + +------------------------------------------------------------------- +Mon Oct 20 16:44:00 CEST 2003 - mludvig@suse.cz + +- Correctly interpret symbol tables for debugging kernel modules + (gdb6-symtab-minimal.diff) +- Fixed support for GCC variable tracking (gdb6-vartrack.diff) +- Fixed support for Fortran arrays (gdb6-fortranarray.diff) + +------------------------------------------------------------------- +Tue Oct 7 14:50:24 CEST 2003 - schwab@suse.de + +- Hack to build on sparc. + +------------------------------------------------------------------- +Mon Oct 6 22:33:00 CEST 2003 - schwab@suse.de + +- Update to gdb 6.0. + +------------------------------------------------------------------- +Fri Oct 3 10:48:16 CEST 2003 - kukuk@suse.de + +- Remove unused tetex from neededforbuild + +------------------------------------------------------------------- +Mon Sep 29 12:00:35 CEST 2003 - schwab@suse.de + +- Update to gdb 5.3.93 pre-release. + +------------------------------------------------------------------- +Wed Sep 17 18:39:07 CEST 2003 - schwab@suse.de + +- Remove debugging hooks. + +------------------------------------------------------------------- +Wed Sep 17 17:50:23 CEST 2003 - schwab@suse.de + +- Ignore more insns during i386 prologue decoding [#30288]. +- Fix hash table mixup in bfd_simple interface. + +------------------------------------------------------------------- +Tue Sep 16 14:50:44 CEST 2003 - schwab@suse.de + +- Update to gdb 5.3.92 pre-release. + * Fixes bug 31033. + +------------------------------------------------------------------- +Wed Sep 3 17:56:43 CEST 2003 - schwab@suse.de + +- Update to gdb 5.3.91 pre-release. + +------------------------------------------------------------------- +Tue Aug 19 14:09:44 CEST 2003 - schwab@suse.de + +- Update to gdb 5.3.90 2003-08-19 cvs snapshot. + +------------------------------------------------------------------- +Mon Jun 23 13:16:24 CEST 2003 - kukuk@suse.de + +- Fix compiling on SPARC + +------------------------------------------------------------------- +Tue Jun 10 15:54:25 CEST 2003 - schwab@suse.de + +- Don't package mmalloc.info, since libmmalloc isn't included either. + +------------------------------------------------------------------- +Thu May 15 12:09:51 CEST 2003 - schwab@suse.de + +- Remove unwanted files. + +------------------------------------------------------------------- +Thu Apr 24 12:20:23 CEST 2003 - ro@suse.de + +- fix install_info --delete call and move from preun to postun + +------------------------------------------------------------------- +Fri Apr 11 10:14:30 CEST 2003 - mludvig@suse.cz + +- Fix read_2u() function in dwarf2cfi.c + +------------------------------------------------------------------- +Thu Apr 10 18:09:43 CEST 2003 - mludvig@suse.cz + +- Add 'info cfi
' command. +- Fix off-by-4 bug in the CFI parser. + +------------------------------------------------------------------- +Mon Apr 7 13:11:34 CEST 2003 - schwab@suse.de + +- Only delete info entries when removing last version. + +------------------------------------------------------------------- +Thu Mar 27 17:01:30 CET 2003 - schwab@suse.de + +- Fix specfile. + +------------------------------------------------------------------- +Thu Mar 6 15:46:52 CET 2003 - aj@suse.de + +- Fix neededforbuild. + +------------------------------------------------------------------- +Wed Feb 26 17:35:10 CET 2003 - mludvig@suse.cz + +- Added loclist support +- Fixed eh_frame parsing problems +- Updated for proposed x86-64 ABI change + +------------------------------------------------------------------- +Thu Feb 6 17:48:35 CET 2003 - schwab@suse.de + +- Use %install_info. + +------------------------------------------------------------------- +Tue Feb 4 20:22:27 CET 2003 - schwab@suse.de + +- Enable TUI. + +------------------------------------------------------------------- +Sun Jan 26 20:39:57 CET 2003 - olh@suse.de + +- add inital native ppc64 support + +------------------------------------------------------------------- +Thu Jan 09 13:51:58 CET 2003 - mludvig@suse.cz + +- Fixed compilation problem with last gdb-asmbtrace.diff. + No new feature. + +------------------------------------------------------------------- +Tue Jan 07 17:41:49 CET 2003 - mludvig@suse.cz + +- Several Dwarf2 and x86-64 specific changes + * Added ability to do backtrace from some functions + without debug info (patch gdb-asmbtrace.diff) + * Fixed crash on re-run of a debugged program. + * Added some more verbosity to dwarf2cfi engine. + +------------------------------------------------------------------- +Thu Dec 12 15:03:36 CET 2002 - schwab@suse.de + +- Update to gdb 5.3. + * GNU/Linux shared library multi-threaded performance improved. + * ``gdbserver'' now supports multi-threaded applications on some targets + * GDB now supports C/C++ preprocessor macros. + +------------------------------------------------------------------- +Fri Oct 11 11:44:53 CEST 2002 - aj@suse.de + +- Handle gcc code generated by gcc -f-elimante-dwarf2-dups -g. + +------------------------------------------------------------------- +Thu Sep 26 12:13:23 CEST 2002 - schwab@suse.de + +- Avoid installing libbfd, libopcodes, libiberty and libmmalloc [#20199]. + +------------------------------------------------------------------- +Wed Sep 18 17:15:11 CEST 2002 - sf@suse.de + +- added patch from mludvig to remove framepointer on x86_64 + +------------------------------------------------------------------- +Wed Sep 4 10:34:56 CEST 2002 - kukuk@suse.de + +- Add Patch for reading SPARC core files + +------------------------------------------------------------------- +Tue Sep 3 14:01:05 CEST 2002 - schwab@suse.de + +- Remove tetex from neededforbuild. + +------------------------------------------------------------------- +Wed Jul 24 10:51:03 CEST 2002 - schwab@suse.de + +- Update to gdb 5.2.1. + +------------------------------------------------------------------- +Thu Jul 18 12:26:11 CEST 2002 - mludvig@suse.de + +- Fix PLT recognisation. + +------------------------------------------------------------------- +Mon Jul 8 15:19:58 CEST 2002 - schwab@suse.de + +- Add fix for memory leak. + +------------------------------------------------------------------- +Tue Jul 2 16:05:09 CEST 2002 - mludvig@suse.cz + +- removed my previous patches +- added a huge one suse-521-x8664.diff + +------------------------------------------------------------------- +Thu Jun 6 12:38:48 CEST 2002 - sf@suse.de + +- added fpregset.diff (from mludvig@suse.de) +- added dwarf2cfi.diff (from mludvig@suse.de) + +------------------------------------------------------------------- +Wed May 15 12:05:22 CEST 2002 - sf@suse.de + +- added some dwarf2-patches for x86_64 + (from mludvig@suse.de) + +------------------------------------------------------------------- +Thu May 9 19:03:27 CEST 2002 - schwab@suse.de + +- Fix breakpoints on MLX bundle. + +------------------------------------------------------------------- +Mon May 6 17:57:10 CEST 2002 - schwab@suse.de + +- Sparc doesn't have gdbserver either. + +------------------------------------------------------------------- +Sun May 5 15:57:22 CEST 2002 - schwab@suse.de + +- Update to gdb 5.2. +- Gdbserver now available for all but alpha. + +------------------------------------------------------------------- +Fri Jan 25 11:10:12 CET 2002 - schwab@suse.de + +- Update to gdb 5.1.1. + +------------------------------------------------------------------- +Thu Nov 22 15:22:51 CET 2001 - schwab@suse.de + +- Update to gdb 5.1. +- Build and install gdbserver on i386 and ia64. + +------------------------------------------------------------------- +Sat Aug 18 22:59:47 CEST 2001 - schwab@suse.de + +- Update to gdb snapthot 20010316. + +------------------------------------------------------------------- +Fri May 18 15:40:30 CEST 2001 - schwab@suse.de + +- Include ia64 warning patches (from nadvornik@suse.cz). + +------------------------------------------------------------------- +Thu Apr 12 15:15:53 CEST 2001 - schwab@suse.de + +- Remove declaration of tilde_expand, now in readline header. + +------------------------------------------------------------------- +Sun Apr 1 01:12:02 CEST 2001 - schwab@suse.de + +- Fix hardware watchpoints on ia64. + +------------------------------------------------------------------- +Fri Mar 30 14:45:15 CEST 2001 - schwab@suse.de + +- Fix crash on info architecture (#6865). + +------------------------------------------------------------------- +Wed Mar 28 10:57:09 CEST 2001 - schwab@suse.de + +- Use installed readline library. + +------------------------------------------------------------------- +Tue Mar 6 18:25:45 CET 2001 - schwab@suse.de + +- Remove some ia64 hacks. + +------------------------------------------------------------------- +Tue Dec 12 18:22:12 CET 2000 - schwab@suse.de + +- Improve handling of breakpoints in shared libraries. + +------------------------------------------------------------------- +Fri Nov 17 11:25:57 CET 2000 - kukuk@suse.de + +- Update to working gdb snapshot + +------------------------------------------------------------------- +Wed Sep 27 12:56:18 CEST 2000 - fober@suse.de + +- s390: added s390-sigregs-SuSE.patch + +------------------------------------------------------------------- +Thu Sep 14 14:38:38 CEST 2000 - fober@suse.de + +- s390: incorporate new ibm patches for gdb 5.0 + +------------------------------------------------------------------- +Wed Sep 6 17:20:46 CEST 2000 - fober@suse.de + +- s390: incorporate ibm patches for gdb 5.0 + +------------------------------------------------------------------- +Fri Jun 30 16:37:17 CEST 2000 - kukuk@suse.de + +- Add gdb-5.0 + +------------------------------------------------------------------- +Tue Apr 4 12:43:40 MEST 2000 - bk@suse.de + +- s390 team added s390 support + +------------------------------------------------------------------- +Tue Mar 21 17:33:22 CET 2000 - schwab@suse.de + +- Fix core dump reading (#2586). + +------------------------------------------------------------------- +Fri Feb 4 14:14:20 CET 2000 - kukuk@suse.de + +- Add patches for PPC +- Move /usr/info -> /usr/share/info + +------------------------------------------------------------------- +Mon Dec 6 16:52:58 MET 1999 - kukuk@suse.de + +- Remove gdb 4.17 +- Add gdb 4.18 fixes for SPARC + +------------------------------------------------------------------- +Mon Sep 13 17:23:57 CEST 1999 - bs@suse.de + +- ran old prepare_spec on spec file to switch to new prepare_spec. + +------------------------------------------------------------------- +Fri Sep 3 12:00:15 MEST 1999 - kukuk@suse.de + +- Use RPM values for CFLAGS and configure + +------------------------------------------------------------------- +Tue Aug 24 17:05:53 MEST 1999 - uli@suse.de + +- added -fsigned-char to CFLAGS (PPC) + +------------------------------------------------------------------- +Mon Aug 23 18:14:32 MEST 1999 - kukuk@suse.de + +- Add gdb 4.18 thread patch from RH + +------------------------------------------------------------------- +Mon Jul 19 09:54:42 MEST 1999 - florian@suse.de + +- add gdb-4.17.0.12 as /usr/bin/gdb-4.17 + +------------------------------------------------------------------- +Wed Jul 7 17:16:59 MEST 1999 - kukuk@suse.de + +- update to 4.18 using diff from jurix + +------------------------------------------------------------------- +Mon Feb 22 23:39:42 MET 1999 - ro@suse.de + +- update to 4.17.0.11 using diff from jurix + +------------------------------------------------------------------- +Thu Jan 21 14:05:35 MET 1999 - ro@suse.de + +- update to 4.17.0.8 + +------------------------------------------------------------------- +Thu Oct 1 16:55:44 MEST 1998 - ro@suse.de + +- update to 4.17.0.4 using jurix-diff + +------------------------------------------------------------------- +Tue Sep 15 11:18:43 MEST 1998 - ro@suse.de + +- hacked for GLIBC: include sys/ucontext and sys/ptrace where needed +- catch strup redeclarations +- cleaned up patch-sequence + +---------------------------------------------------------------------- +Wed Oct 29 00:00:08 MET 1997 - florian@suse.de + +- fix in libc to correctly support core-files + +- add bug-fix to read symbols from dynamic symbol tables + +- apply all patches from debian gdb-4.16-11 + + +---------------------------------------------------------------------- +Tue Oct 22 15:43:38 MET DST 1996 - florian@suse.de + + +Neue Version 4.16. + +gdb kompiliert nur mit libc 5.4.7 richtig. Mit 5.2.18 kann gdb +keine core-files lesen. +Ich waere dafuer, einfach das Binary von libc 5.4.7 zu benutzen. +Wird schon funktionieren... diff --git a/gdb.spec b/gdb.spec new file mode 100644 index 0000000..5aaa3a0 --- /dev/null +++ b/gdb.spec @@ -0,0 +1,1459 @@ +# +# spec file +# +# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2012 RedHat +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define flavor @BUILD_FLAVOR@%{nil} + +%bcond_with ringdisabled +%bcond_with for_chroot + +%if "%flavor" == "testsuite" +%if %{with ringdisabled} +ExclusiveArch: do_not_build +%endif +%if 0%{?qemu_user_space_build} +# In a qemu_user_space_build ptrace is not supported, so we can't test gdb. +ExclusiveArch: do_not_build +%endif + +# Disable big-endian ppc testing. +ExcludeArch: ppc ppc64 + +%define build_main 0 +%define build_testsuite 1 +%else +%define build_main 1 +%define build_testsuite 0 +%endif + +%if %{build_testsuite} +%define debug_package %{nil} +%endif + +%if %{build_main} +%define name_suffix %{nil} +%else +%if %{build_testsuite} +%define name_suffix -testresults +%else +%define name_suffix -%{flavor} +%endif +%endif + +%bcond_without fpc + +%if %{build_main} +Summary: A GNU source-level debugger for C, C++, Fortran and other languages +License: GPL-3.0-only WITH GCC-exception-3.1 AND GPL-3.0-or-later AND LGPL-2.1-or-later AND LGPL-3.0-or-later +Group: Development/Languages/C and C++ +%endif +%if %{build_testsuite} +Summary: GDB testsuite results +License: SUSE-Public-Domain +Group: Development/Languages/C and C++ +%endif +Name: gdb%{name_suffix} + +Version: 14.2 +Release: 0 + +# 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. + +BuildRoot: %{_tmppath}/%{name}-%{version}-build +# Do not provide URL for snapshots as the file lasts there only for 2 days. +# ftp://sourceware.org/pub/gdb/releases/gdb-%%{version}.tar.gz +Source: gdb-%{version}.tar.bz2 +URL: http://gnu.org/software/gdb/ + +%if "%{scl}" == "devtoolset-1.1" +Obsoletes: devtoolset-1.0-%{pkg_name} +%endif + +# For our convenience +%global gdb_src gdb-%{version} +%global gdb_build build-%{_target_platform} +%global gdb_docdir %{_docdir}/gdb-doc + +%global have_inproctrace 0 +%ifarch %{ix86} x86_64 +%global have_inproctrace 1 +%endif # %%{ix86} x86_64 + +# Choose python version +%if 0%{?suse_version} >= 1200 +%define python python3 +%else +# Skip for SLE-11 due to lack of python3. +%define _without_python 1 +%endif + +# GDB patches have the format `gdb--bz-.patch'. +# They should be created using patch level 1: diff -up ./gdb (or gdb-6.3/gdb). + +#= +#push=Should be pushed upstream. +#maybepush=Should be pushed upstream unless it got obsoleted there. +#fedora=Should stay as a Fedora patch. +#ia64=Drop after RHEL-5 rebases and rebuilds are no longer meaningful. +#fedoratest=Keep it in Fedora only as a regression test safety. +#+ppc=Specific for ppc32/ppc64/ppc* +#+work=Requires some nontrivial work. + +# Cleanup any leftover testsuite processes as it may stuck mock(1) builds. +#=push +Source2: gdb-orphanripper.c + +# Man page for gstack(1). +#=push +Source3: gdb-gstack.man + +# /etc/gdbinit (from Debian but with Fedora compliant location). +#=fedora +Source4: gdbinit +Source5: gdbinit.without-python + +# libipt: Intel Processor Trace Decoder Library +%global libipt_version 2.0.5 +Source7: v%{libipt_version}.tar.gz + +# Infrastructure to sync patches from the Fedora rpm +Source10: patchlist.pl +Source11: patchname_get.sh +Source12: baselibs.conf +Source13: gdb-rpmlintrc + +# Infrastructure to maintain package. +Source14: clean.sh +Source15: import-patches.sh +Source16: qa.sh +Source17: qa-local.sh +Source18: qa-remote.sh +Source19: README.qa +Source20: import-fedora.sh + +%if %{build_testsuite} +NoSource: 0 +NoSource: 2 +NoSource: 3 +NoSource: 4 +NoSource: 5 +NoSource: 7 +NoSource: 10 +NoSource: 11 +NoSource: 12 +NoSource: 13 +NoSource: 14 +NoSource: 15 +NoSource: 16 +NoSource: 17 +NoSource: 18 +NoSource: 19 +NoSource: 20 +%endif + +# Fedora import from branch f38, commit 82cc8e0. + +#Fedora Packages begin +Patch2: gdb-6.3-gstack-20050411.patch +Patch3: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +Patch4: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch +Patch5: gdb-6.6-bz229517-gcore-without-terminal.patch +Patch6: gdb-6.6-testsuite-timeouts.patch +Patch7: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch +Patch8: gdb-6.3-attach-see-vdso-test.patch +Patch9: gdb-6.5-bz243845-stale-testing-zombie-test.patch +Patch10: gdb-6.6-buildid-locate.patch +Patch11: gdb-6.6-buildid-locate-solib-missing-ids.patch +Patch12: gdb-6.6-buildid-locate-rpm.patch +Patch14: gdb-6.5-gcore-buffer-limit-test.patch +Patch15: gdb-6.3-mapping-zero-inode-test.patch +Patch16: gdb-6.5-section-num-fixup-test.patch +Patch18: gdb-simultaneous-step-resume-breakpoint-test.patch +Patch19: gdb-core-open-vdso-warning.patch +Patch20: gdb-archer-next-over-throw-cxx-exec.patch +Patch21: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +Patch22: gdb-test-bt-cfi-without-die.patch +Patch23: gdb-bz634108-solib_address.patch +Patch24: gdb-test-dw2-aranges.patch +Patch25: gdb-glibc-strstr-workaround.patch +Patch26: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch27: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +Patch28: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +Patch31: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch32: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch33: gdb-fedora-libncursesw.patch +Patch34: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch36: gdb-linux_perf-bundle.patch +Patch38: gdb-rhbz2232086-refactor-selftest-support.patch +Patch39: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch +Patch40: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch +Patch41: gdb-rhbz-2232086-generate-gdb-index-consistently.patch +Patch42: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch +Patch43: gdb-rhbz2250652-gdbpy_gil.patch +Patch44: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch +Patch45: gdb-ftbs-swapped-calloc-args.patch +Patch46: gdb-rhbz2261580-intrusive_list-assertion-fix.patch +#Fedora Packages end + +# Fedora patches fixup +# These need a number with at least four digits, otherwise patchlist.pl removes +# them when upgrading. + +Patch1000: fixup-gdb-linux_perf-bundle.patch +Patch1003: fixup-gdb-glibc-strstr-workaround.patch +Patch1004: fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch +Patch1005: fixup-gdb-test-bt-cfi-without-die.patch +Patch1007: fixup-gdb-test-dw2-aranges.patch +Patch1008: fixup-gdb-bz634108-solib_address.patch +Patch1009: fixup-gdb-6.3-gstack-20050411.patch +Patch1010: fixup-gdb-6.3-attach-see-vdso-test.patch +Patch1012: fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch +# Fixes up several patches, should be dropped when updating to +# rawhide @ 08bfd0a. +Patch1013: fixup-skip-tests.patch + +# openSUSE specific + +# Hardcodes /bin/bash, given that path is known. +Patch1100: gdb-gcore-bash.patch +# Make gdb emit zypper install hints, rather than debuginfo-install hints. +Patch1101: gdb-6.6-buildid-locate-rpm-suse.patch + +# openSUSE specific -- testsuite + +# Silences ada pie compilation FAILs. Todo: Fix ada pie compilation. +Patch1200: gdb-testsuite-ada-pie.patch +# Tests the zypper install hints. +Patch1203: gdb-testsuite-add-gdb.suse-zypper-hint.exp.patch +# Tests that no branding is leaked from sourcing the fedora package. +Patch1204: gdb-testsuite-add-gdb.suse-debranding.exp.patch + +# Patches to upstream + +# https://sourceware.org/bugzilla/show_bug.cgi?id=25703 +Patch1500: gdb-symtab-set-default-dwarf-max-cache-age-1000.patch +# https://bugzilla.suse.com/show_bug.cgi?id=1179210 +Patch1501: gdb-tui-enable-work-around-libncurses-segfault.patch +# Fixes: gdb.x86_64: W: potential-bashisms /usr/bin/gdb-add-index +Patch1503: gdb-add-index.sh-fix-bashism.patch +# Fixes: +# FAIL: gdb.mi/new-ui-mi-sync.exp: sync-command=run: add-inferior (timeout) +Patch1504: fix-gdb.mi-new-ui-mi-sync.exp.patch +# Fixes: +# FAIL: gdb.base/step-over-syscall.exp: fork: displaced=off: \ +# pc after stepi matches insn addr after syscall +Patch1505: gdb-testsuite-fix-gdb.base-step-over-syscall.exp-with-m32-amd-case.patch + +# Backports from current release branch (GDB 14). + +# + +# Backports from master, available in next release (GDB 15). + +Patch2000: gdb-symtab-work-around-pr-gas-29517.patch +Patch2001: gdb-symtab-add-producer_is_gas.patch +Patch2002: gdb-symtab-work-around-gas-pr28629.patch +Patch2003: gdb-tdep-fix-nr-array-elements-in-ppc64_aggregate_ca.patch +Patch2004: gdb-tui-fix-wmaybe-uninitialized-in-tui_find_disasse.patch +Patch2005: gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch +Patch2006: gdb-testsuite-remove-spurious-in-save_vars.patch +Patch2007: make-pascal_language-print_type-handle-varstring-nul.patch +Patch2008: gdb-symtab-work-around-pr-gas-29517-dwarf2-case.patch +Patch2010: fix-the-gdb.ada-inline-section-gc.exp-test.patch +Patch2011: gdb-testsuite-handle-pac-marker.patch +Patch2012: change-gdb.base-examine-backwards.exp-for-aix.patch +Patch2013: gdb-testsuite-fix-spurious-fails-with-examine-backwa.patch +Patch2014: gdb-testsuite-make-gdb.base-solib-search.exp-more-ro.patch +Patch2015: gdb-testsuite-fix-regexp-in-vgdb_start.patch +Patch2016: powerpc-and-aarch64-fix-reverse-stepping-failure.patch +Patch2017: gdb-tdep-fix-gdb.base-watch-bitfields.exp-on-aarch64.patch +Patch2018: gdb-tdep-fix-gdb.base-watchpoint-unaligned.exp-on-aa.patch +Patch2019: gdb-testsuite-add-pr-gdb-26967-kfail-in-two-more-tes.patch +Patch2020: gdb-testsuite-fix-gdb.base-eh_return.exp.patch +Patch2021: fixup-powerpc-and-aarch64-fix-reverse-stepping-failu.patch +Patch2022: gdb-exp-fix-printing-of-out-of-bounds-struct-members.patch +Patch2023: gdb-fix-heap-use-after-free-in-select_event_lwp.patch +Patch2024: fix-regression-on-aarch64-linux-gdbserver.patch +Patch2025: gdb-testsuite-factor-out-proc-get_portnum.patch +Patch2026: gdb-testsuite-make-portnum-a-persistent-global.patch +Patch2027: gdb-testsuite-factor-out-proc-with_lock.patch +Patch2028: gdb-testsuite-factor-out-proc-lock_dir.patch +Patch2029: gdb-testsuite-move-gpu-parallel.lock-to-cache-dir.patch +Patch2030: gdb-testsuite-use-unique-portnum-in-parallel-testing.patch +Patch2031: gdb-testsuite-use-unique-portnum-in-parallel-testing-check-slash-slash-case.patch +Patch2032: gdb-tdep-fix-reverse-execution-of-ldr-immediate-t4.patch +Patch2033: gdb-exp-fix-cast-handling-for-indirection.patch +Patch2034: gdb-remote-fix-abort-on-remote_close_error.patch +Patch2035: gdb-testsuite-use-find_gnatmake-instead-of-gdb_find_.patch +Patch2036: gdb-testsuite-simplify-gdb.server-server-kill-python.patch +Patch2037: gdb-testsuite-fix-gdbserver-pid-in-gdb.server-server.patch +Patch2038: gdb-testsuite-add-missing-include-in-gdb.base-ctf-pt.patch +Patch2039: gdb-testsuite-fix-gdb.ada-verylong.exp-on-32-bit-tar.patch +Patch2040: gdb-testsuite-add-missing-includes-in-gdb.trace-coll.patch +Patch2041: gdb-testsuite-fix-missing-return-type-in-gdb.linespe.patch +Patch2042: gdb-testsuite-fix-gdb.base-ending-run.exp-on-manjaro.patch +Patch2043: gdb-testsuite-fix-test-case-gdb.threads-attach-stopp.patch +Patch2044: gdb-testsuite-add-missing-include-in-gdb.base-rtld-s.patch +Patch2045: gdb-testsuite-fix-valgrind-tests-on-debian.patch +Patch2046: gdb-testsuite-fix-gdb.server-server-connect.exp-for-.patch +Patch2047: gdb-testsuite-handle-core-without-build-id-in-gdb.ba.patch +Patch2048: gdb-testsuite-fix-gdb.base-list-no-debug.exp-on-debi.patch +Patch2049: gdb-testsuite-reset-errcnt-and-warncnt-in-default_gd.patch +Patch2050: gdb-testsuite-fix-test-in-gdb.python-py-finish-break.patch +Patch2051: gdb-testsuite-further-handle-long-filenames-in-gdb.b.patch +Patch2052: gdb-testsuite-fix-license-text-in-gdb.reverse-map-to.patch +Patch2053: gdb-testsuite-call-ldd-version-in-gdb.testsuite-dump.patch +Patch2054: gdb-testsuite-fix-gdb.mi-mi-dprintf.exp-with-read1.patch +Patch2055: gdb-testsuite-fix-gdb.cp-namespace.exp-with-read1.patch +Patch2056: gdb-testsuite-fix-typo-in-gdb.base-catch-syscall.exp.patch +Patch2057: gdb-testsuite-use-more-progbits-for-arm.patch +Patch2058: gdb-testsuite-fix-gdb.dwarf2-dw2-gas-workaround.exp.patch +Patch2059: gdb-fix-segfault-in-for_each_block-part-1.patch +Patch2060: gdb-fix-segfault-in-for_each_block-part-2.patch +Patch2061: gdb-tui-allow-command-window-of-1-or-2-lines.patch +Patch2062: gdb-tui-fix-resizing-of-terminal-to-1-or-2-lines.patch +Patch2063: gdb-symtab-workaround-pr-gas-31115.patch +Patch2064: gdb-arm-remove-tpidruro-register-from-non-freebsd-ta.patch +Patch2065: gdb-tdep-fix-catching-syscall-execve-exit-for-arm.patch +Patch2066: gdb-arm-fix-epilogue-frame-id.patch +Patch2070: rs6000-unwind-on-each-instruction-fix.patch +Patch2071: gdb-python-make-gdb.unwindinfo.add_saved_register-mo.patch +Patch2072: gdb-arm-remove-thumb-bit-in-arm_adjust_breakpoint_ad.patch +Patch2073: gdb-build-fix-gdbserver-linux-aarch64-low.cc-build.patch +Patch2074: powerpc-fix-test-gdb.ada-finish-large.exp.patch +Patch2075: gdb-python-make-gdb.unwindinfo.add_saved_register-mo-fixup.patch +Patch2076: gdb-exp-redo-cast-handling-for-indirection.patch +Patch2077: s390-provide-ibm-z16-arch14-instruction-descriptions.patch +Patch2078: gdb-s390-add-arch14-record-replay-support.patch +Patch2079: riscv-lrsc.patch + +# Backports from master, not yet available in next release (GDB 16). + +Patch2090: gdb-python-fix-gdb.python-py-disasm.exp-on-arm-linux.patch +Patch2091: gdb-testsuite-fix-gdb.fortran-array-bounds.exp-on-ar.patch +Patch2092: gdb-symtab-return-correct-reader-for-top-level-cu-in.patch +Patch2093: gdb-tdep-s390-add-arch15-record-replay-support.patch +Patch2094: gdb-testsuite-avoid-intermittent-failures-on-a-debug.patch + +# + +# Backport from gdb-patches + +# https://sourceware.org/pipermail/gdb-patches/2021-September/182226.html +Patch2100: gdb-python-finishbreakpoint-update.patch +# https://sourceware.org/pipermail/gdb-patches/2021-October/182444.html +Patch2101: gdb-testsuite-prevent-compilation-fails-with-unix-fpie-pie.patch +# https://sourceware.org/pipermail/gdb-patches/2021-May/178990.html +Patch2102: gdb-cli-add-ignore-errors-command.patch +# https://sourceware.org/pipermail/gdb-patches/2024-May/209469.html +Patch2103: gdb-testsuite-fix-error-in-gdb.server-server-kill-py.patch +# https://sourceware.org/pipermail/gdb-patches/2024-May/209504.html +Patch2104: gdb-testsuite-fix-timeout-in-gdb.tui-resize-2.exp.patch +# https://sourceware.org/pipermail/gdb-patches/2024-June/209736.html +Patch2105: gdb-tdep-fix-gdb.base-watchpoint-running-on-arm-ppc6.patch + +# https://sourceware.org/pipermail/gdb-patches/2023-December/205054.html +Patch2120: gdb-symtab-refactor-condition-in-scan_attributes.patch +Patch2121: gdb-symtab-factor-out-m_die_range_map-usage.patch +Patch2122: gdb-symtab-handle-nullptr-parent-in-parent_map-set_p.patch +Patch2123: gdb-symtab-factor-out-m_deferred_entries-usage.patch +Patch2124: gdb-symtab-resolve-deferred-entries-inter-shard-case.patch +Patch2125: gdb-testsuite-add-gdb.dwarf2-forward-spec-inter-cu.e.patch +Patch2126: gdb-testsuite-add-gdb.dwarf2-backward-spec-inter-cu..patch +Patch2127: gdb-symtab-keep-track-of-processed-dies-in-shard.patch +Patch2128: gdb-symtab-resolve-deferred-entries-intra-shard-case.patch +Patch2129: gdb-symtab-don-t-defer-backward-refs-inter-cu-intra-.patch +Patch2130: gdb-symtab-recurse-into-c-dw_tag_subprogram-dies-for.patch +Patch2131: gdb-symtab-keep-track-of-all-parents-for-cooked-inde.patch +Patch2132: gdb-symtab-fix-dw_tag_inlined_subroutine-entries-in-.patch + +# Debug patches. + +# + +# Other. Needs comment for each patch. + +# + +# End of patches. + +%if 0%{?suse_version} >= 1600 +# Disable ptrace_scope on tumbleweed. +BuildRequires: aaa_base-yama-enable-ptrace +%endif + +BuildRequires: bison +BuildRequires: flex +%if 0%{suse_version} > 1110 +BuildRequires: gcc-c++ +%else +BuildRequires: gcc48 +BuildRequires: gcc48-c++ +%endif +BuildRequires: gettext +BuildRequires: glibc-devel +%if 0%{suse_version} > 1110 && 0%{suse_version} < 1330 +# GDB supports guile 2.0, but not guile 2.2 (swo#21104). Disable guile +# support for newer distro versions in anticipation of a move to guile 2.2. +BuildRequires: guile-devel +%endif +BuildRequires: libexpat-devel +%if 0%{suse_version} >= 1200 +BuildRequires: makeinfo +%else +BuildRequires: texinfo +%endif +BuildRequires: expect + +# Dependency is there for SLE-11, but configure test fails. +BuildRequires: mpfr-devel + +BuildRequires: ncurses-devel +BuildRequires: pkg-config +BuildRequires: readline-devel +BuildRequires: rpm-devel +# SLE-10 doesn't have xz-devel. +%if 0%{suse_version} >= 1110 +BuildRequires: xz-devel +%endif +BuildRequires: zlib-devel + +%if 0%{!?_without_python:1} +%if %{build_testsuite} +BuildRequires: %{python}-base +%else +Requires: %{python}-base +%endif +BuildRequires: %{python}-devel +%endif # 0%{!?_without_python:1} + +%global have_libdebuginfod 0 +# Enable for SLE15-SP4/Leap-15.4, ALP/Factory. +%if 0%{?sle_version} >= 150400 || 0%{?suse_version} >= 1600 +%global have_libdebuginfod 1 +%endif + +%if 0%{have_libdebuginfod} +BuildRequires: libdebuginfod-devel +# Indicate that we prefer libdebuginfod1 over libdebuginfod1-dummy. +BuildRequires: libdebuginfod1 +%endif + +%global have_libipt 0 +%if 0%{suse_version} > 1110 +%ifarch %{ix86} x86_64 +%global have_libipt 1 +BuildRequires: cmake +%endif +%endif + +# BuildArch would break RHEL-5 by overriding arch and not building noarch. +%if 0%{?el5:1} +ExclusiveArch: noarch i386 x86_64 ppc ppc64 ia64 s390 s390x +%endif # 0%{?el5:1} + +%ifarch s390x +%if %{suse_version} > 1500 +BuildRequires: babeltrace-devel +%endif +%endif + +%ifarch i386 x86_64 ppc64 ppc64le aarch64 riscv64 +%if %{suse_version} >= 1500 +BuildRequires: babeltrace-devel +%endif +%endif + +%if 0%{?suse_version} >= 1500 +BuildRequires: libboost_regex-devel +BuildRequires: libsource-highlight-devel +%endif + +%if 0%{?suse_version} >= 1500 +BuildRequires: libzstd-devel +%endif + +%if %{build_testsuite} + +# Copied from gcc9/gcc.spec.in +# Ada currently fails to build on a few platforms, enable it only +# on those that work +%if %{suse_version} >= 1310 +%if %{suse_version} >= 1330 +%define ada_arch %ix86 x86_64 ppc ppc64 ppc64le s390 s390x ia64 aarch64 riscv64 +%else +%define ada_arch %ix86 x86_64 ppc ppc64 s390 ia64 +%endif +%else +%define ada_arch %ix86 x86_64 ppc s390 ia64 +%endif + +# Ensure the devel libraries are installed for both multilib arches. +%global bits_local %{?_isa} +%global bits_other %{?_isa} +%if 0%{!?el5:1} +%ifarch s390x +%global bits_other (%{__isa_name}-32) +%else #!s390x +%ifarch ppc +%global bits_other (%{__isa_name}-64) +%else #!ppc +%ifarch sparc64 ppc64 s390x x86_64 +%global bits_other (%{__isa_name}-32) +%endif #sparc64 ppc64 s390x x86_64 +%endif #!ppc +%endif #!s390x +%endif #!el5 + +BuildRequires: dejagnu +BuildRequires: sharutils +# gcc-objc++ is not covered by the GDB testsuite. + +BuildRequires: gcc-fortran +BuildRequires: gcc-objc +%ifarch %ada_arch +BuildRequires: gcc-ada +%endif + +%define supported_32bit_arch x86_64 ppc64 + +%if 0%{!?disable_32bit:1} +%ifarch %{supported_32bit_arch} + +%if 0%{suse_version} >= 1330 +# Older distros miss this pseudo package, the Ada +# testsuite won't work completely +BuildRequires: gcc-ada-32bit +%endif + +%if 0%{suse_version} > 1110 +BuildRequires: gcc-c++-32bit +%else +# Use system g++ for testing for SLE-11. +BuildRequires: gcc-c++ +%endif + +%if 0%{suse_version} >= 1210 && 0%{suse_version} != 1315 +BuildRequires: glibc-devel-static-32bit +%endif + +%endif # supported_32bit_arch +%endif # !disable_32bit + +%if 0%{suse_version} >= 1210 +BuildRequires: glibc-devel-static +%endif + +%if 0%{?suse_version} > 1500 +# The gccgo command is used by make check for some gdb.go test-cases, so we +# need the gcc-go package. However, the gccgo command was missing from the +# gcc-go package (bsc#1096677), so we only require it for known fixed +# versions. +BuildRequires: gcc-go + +%if 0%{?suse_version} > 1600 +# Fix: unresolvable: +# have choice for libgo.so.23()(64bit) needed by gcc14-go: libgo23 libgo23-gcc14 +# have choice for libgo23 >= 14.2.1+git10750-37.2 needed by gcc14-go: libgo23 libgo23-gcc14 +BuildRequires: libgo23 +%endif +%endif + +%if %{with fpc} && 0%{?is_opensuse} +%ifarch x86_64 aarch64 armv7l +# Tumbleweed and Leap 15.x. +%if 0%{?suse_version} >= 1500 +BuildRequires: fpc +%endif +%ifarch %{ix86} +# Tumbleweed and Leap 15.{0,1,2}. +# fpc seems to be unavailable for Leap 15.{3,4}/i586. +%if 0%{?suse_version} > 1500 || (0%{?sle_version} >= 150000 && 0%{?sle_version} <= 150200) +BuildRequires: fpc +%endif +%endif +%endif +%endif + +%if 0%{?suse_version} >= 1200 +%ifnarch s390 +# s390 (for SLE12) doesn't have valgrind +BuildRequires: valgrind +%endif +%endif + +%if 0%{?suse_version} >= 1200 +BuildRequires: systemtap-sdt-devel +%endif + +%if 0%{have_libdebuginfod} +BuildRequires: curl +BuildRequires: elfutils-debuginfod +# Fix: unresolvable: have choice for debuginfod-client needed by +# elfutils-debuginfod: debuginfod-client debuginfod-dummy-client. +BuildRequires: debuginfod-client +%endif + +# SLE-10 doesn't have xz. +%if 0%{suse_version} >= 1110 +# Missing on SLE-11 +BuildRequires: xz +%endif + +%if 0%{!?_without_python:1} +# Provide python package xml.etree.ElementTree, used by test-case +# gdb.python/py-send-packet.exp. +BuildRequires: %{python}-xml +%endif + +%endif # %%{build_testsuite} + +%ifarch ia64 +BuildRequires: libunwind-devel +Requires: libunwind +%endif + +%if %{build_main} + +%if 0%{!?_without_python:1} +%if 0%{?suse_version} >= 1500 +# For SLE-15 and later, we use source-highlight by default, and +# pygments as fallback. So, suggests rather than recommends is what we want. +# Don't bother older releases with this. +Suggests: %{python}-Pygments +%endif +%endif + +%description +GDB, the GNU debugger, allows you to debug programs written in C, C++, +Java, and other languages, by executing them in a controlled fashion +and printing their data. + +%package -n gdbserver +Summary: A standalone server for GDB (the GNU source-level debugger) +License: GPL-3.0-only WITH GCC-exception-3.1 AND GPL-3.0-or-later AND LGPL-2.1-or-later AND LGPL-3.0-or-later +Group: Development/Tools/Debuggers + +%description -n gdbserver +GDB, the GNU debugger, allows you to debug programs written in C, C++, +Java, and other languages, by executing them in a controlled fashion +and printing their data. + +This package provides a program that allows you to run GDB on a different +machine than the one which is running the program being debugged. + +%package doc +Summary: Documentation for GDB (the GNU source-level debugger) +License: GFDL-1.3-only +Group: Documentation/Other +PreReq: %{install_info_prereq} + +%if "%{scl}" == "devtoolset-1.1" +Obsoletes: devtoolset-1.0-%{pkg_name}-doc +%endif + +%description doc +GDB, the GNU debugger, allows you to debug programs written in C, C++, +Java, and other languages, by executing them in a controlled fashion +and printing their data. + +This package provides INFO, HTML and PDF user manual for GDB. +%endif + +%if %{build_testsuite} +%description +Results from running the GDB testsuite. +%endif + +%prep +%setup -q -n %{gdb_src} + +%if 0%{?rhel:1} && 0%{?rhel} <= 6 +# libstdc++ pretty printers. +tar xjf %{SOURCE5} +%endif # 0%{?rhel:1} && 0%{?rhel} <= 6 + +# Files have `# ' statements breaking VPATH / find-debuginfo.sh . +rm -f gdb/ada-exp.c gdb/ada-lex.c gdb/c-exp.c gdb/cp-name-parser.c gdb/f-exp.c +rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c gdb/go-exp.c + +# *.info* is needlessly split in the distro tar; also it would not get used as +# we build in %%{gdb_build}, just to be sure. +find -name "*.info*"|xargs rm -f + +#Fedora patching start +%patch -P 2 -p1 +%patch -P 3 -p1 +%patch -P 4 -p1 +%patch -P 5 -p1 +%patch -P 6 -p1 +%patch -P 7 -p1 +%patch -P 8 -p1 +%patch -P 9 -p1 +%patch -P 10 -p1 +%patch -P 11 -p1 +%patch -P 12 -p1 +%patch -P 14 -p1 +%patch -P 15 -p1 +%patch -P 16 -p1 +%patch -P 18 -p1 +%patch -P 19 -p1 +%patch -P 20 -p1 +%patch -P 21 -p1 +%patch -P 22 -p1 +%patch -P 23 -p1 +%patch -P 24 -p1 +%patch -P 25 -p1 +%patch -P 26 -p1 +%patch -P 27 -p1 +%patch -P 28 -p1 +%patch -P 31 -p1 +%patch -P 32 -p1 +%patch -P 33 -p1 +%patch -P 34 -p1 +%patch -P 36 -p1 +%patch -P 38 -p1 +%patch -P 39 -p1 +%patch -P 40 -p1 +%patch -P 41 -p1 +%patch -P 42 -p1 +%patch -P 43 -p1 +%patch -P 44 -p1 +%patch -P 45 -p1 +%patch -P 46 -p1 +#Fedora patching end + +%patch -P 1000 -p1 +%patch -P 1003 -p1 +%patch -P 1004 -p1 +%patch -P 1005 -p1 +%patch -P 1007 -p1 +%patch -P 1008 -p1 +%patch -P 1009 -p1 +%patch -P 1010 -p1 +%patch -P 1012 -p1 +%patch -P 1013 -p1 + +%patch -P 1100 -p1 +%patch -P 1101 -p1 + +%patch -P 1200 -p1 +%patch -P 1203 -p1 +%patch -P 1204 -p1 + +%patch -P 1500 -p1 +%patch -P 1501 -p1 +%patch -P 1503 -p1 +%patch -P 1504 -p1 +%patch -P 1505 -p1 + +%patch -P 2000 -p1 +%patch -P 2001 -p1 +%patch -P 2002 -p1 +%patch -P 2003 -p1 +%patch -P 2004 -p1 +%patch -P 2005 -p1 +%patch -P 2006 -p1 +%patch -P 2007 -p1 +%patch -P 2008 -p1 +%patch -P 2010 -p1 +%patch -P 2011 -p1 +%patch -P 2012 -p1 +%patch -P 2013 -p1 +%patch -P 2014 -p1 +%patch -P 2015 -p1 +%patch -P 2016 -p1 +%patch -P 2017 -p1 +%patch -P 2018 -p1 +%patch -P 2019 -p1 +%patch -P 2020 -p1 +%patch -P 2021 -p1 +%patch -P 2022 -p1 +%patch -P 2023 -p1 +%patch -P 2024 -p1 +%patch -P 2025 -p1 +%patch -P 2026 -p1 +%patch -P 2027 -p1 +%patch -P 2028 -p1 +%patch -P 2029 -p1 +%patch -P 2030 -p1 +%patch -P 2031 -p1 +%patch -P 2032 -p1 +%patch -P 2033 -p1 +%patch -P 2034 -p1 +%patch -P 2035 -p1 +%patch -P 2036 -p1 +%patch -P 2037 -p1 +%patch -P 2038 -p1 +%patch -P 2039 -p1 +%patch -P 2040 -p1 +%patch -P 2041 -p1 +%patch -P 2042 -p1 +%patch -P 2043 -p1 +%patch -P 2044 -p1 +%patch -P 2045 -p1 +%patch -P 2046 -p1 +%patch -P 2047 -p1 +%patch -P 2048 -p1 +%patch -P 2049 -p1 +%patch -P 2050 -p1 +%patch -P 2051 -p1 +%patch -P 2052 -p1 +%patch -P 2053 -p1 +%patch -P 2054 -p1 +%patch -P 2055 -p1 +%patch -P 2056 -p1 +%patch -P 2057 -p1 +%patch -P 2058 -p1 +%patch -P 2059 -p1 +%patch -P 2060 -p1 +%patch -P 2061 -p1 +%patch -P 2062 -p1 +%patch -P 2063 -p1 +%patch -P 2064 -p1 +%patch -P 2065 -p1 +%patch -P 2066 -p1 +%patch -P 2070 -p1 +%patch -P 2071 -p1 +%patch -P 2072 -p1 +%patch -P 2073 -p1 +%patch -P 2074 -p1 +%patch -P 2075 -p1 +%patch -P 2076 -p1 +%patch -P 2077 -p1 +%patch -P 2078 -p1 +%patch -P 2079 -p1 + +%patch -P 2090 -p1 +%patch -P 2091 -p1 +%patch -P 2092 -p1 +%patch -P 2093 -p1 +%patch -P 2094 -p1 + +%patch -P 2100 -p1 +%patch -P 2101 -p1 +%patch -P 2102 -p1 +%patch -P 2103 -p1 +%patch -P 2104 -p1 +%patch -P 2105 -p1 + +%patch -P 2120 -p1 +%patch -P 2121 -p1 +%patch -P 2122 -p1 +%patch -P 2123 -p1 +%patch -P 2124 -p1 +%patch -P 2125 -p1 +%patch -P 2126 -p1 +%patch -P 2127 -p1 +%patch -P 2128 -p1 +%patch -P 2129 -p1 +%patch -P 2130 -p1 +%patch -P 2131 -p1 +%patch -P 2132 -p1 + +#unpack libipt +%if 0%{have_libipt} +tar xzf %{SOURCE7} +mv libipt-%{libipt_version} processor-trace-%{libipt_version} +%endif + +find -name "*.orig" | xargs rm -f +! find -name "*.rej" # Should not happen. + +# Remove the info and other generated files added by the FSF release +# process. +rm -f libdecnumber/gstdint.h +rm -f bfd/doc/*.info +rm -f bfd/doc/*.info-* +rm -f gdb/doc/*.info +rm -f gdb/doc/*.info-* + +# Fixes problem building release tarball with --with-system-readline. +# Reported here: +# - https://sourceware.org/pipermail/gdb/2021-July/049552.html +# - https://sourceware.org/bugzilla/show_bug.cgi?id=27808 +rm -f gdb/doc/GDBvn.texi + +%build + +# Identify the build directory with the version of gdb as well as the +# architecture, to allow for mutliple versions to be installed and +# built. +# Initially we're in the %%{gdb_src} directory. + +for fprofile in %{?_with_profile:-fprofile} "" +do + +mkdir %{gdb_build}$fprofile +cd %{gdb_build}$fprofile + +%if 0%{suse_version} > 1110 +CC=gcc +CXX=g++ +%else +CC=gcc-4.8 +CXX=g++-4.8 +%endif +export CC +export CXX +export CFLAGS="$RPM_OPT_FLAGS" + +# Add your -Wno-x/-Wno-error=y options here: +for opt in -Wno-error=odr -Wno-error=enum-int-mismatch; do + # checking for acceptance of -Wno-foo is a bit wieldy: GCC doesn't + # warn about unknown -Wno- flags, _except_ if there are other + # diagnostics as well, so let's force an uninitialized use warning + # and grep for the diagnostic about the -Wno flag: + if ! echo "int foo(void) { int a; return a;} " | \ + $CC -x c -c - -o /dev/null -W ${opt} 2>&1 | \ + grep -E "Wno|no option" >/dev/null; then + CFLAGS="$CFLAGS ${opt}" + fi +done +%if %{have_libipt} +CFLAGS="$CFLAGS -DPERF_ATTR_SIZE_VER5_BUNDLE" +( + mkdir processor-trace-%{libipt_version}-root + mkdir processor-trace-%{libipt_version}-build + cd processor-trace-%{libipt_version}-build + # -DPTUNIT:BOOL=ON has no effect on ctest. + cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DBUILD_SHARED_LIBS=OFF \ + -DPTUNIT:BOOL=OFF \ + -DDEVBUILD:BOOL=ON \ + ../../processor-trace-%{libipt_version} + make VERBOSE=1 %{?_smp_mflags} + ctest -V %{?_smp_mflags} + make install DESTDIR=../processor-trace-%{libipt_version}-root +) +# There is also: --with-libipt-prefix +CFLAGS="$CFLAGS -I$PWD/processor-trace-%{libipt_version}-root%{_includedir}" +LDFLAGS="$LDFLAGS -L$PWD/processor-trace-%{libipt_version}-root%{_libdir}" +%endif + +export CXXFLAGS="$CFLAGS" + +export LIBRPM=$(ldd /bin/rpm \ + | grep librpm.so \ + | awk '{print $3}') +if [ "$LIBRPM" != "" ]; then + [ -f "$LIBRPM" ] +else + export LIBRPM=no +fi + +%ifarch %ix86 ia64 ppc ppc64 ppc64le s390 s390x x86_64 aarch64 riscv64 +%define build_multitarget 1 +%else +%define build_multitarget 0 +%endif + +%define extra_target_list_common i686 powerpc64le s390x x86_64 aarch64 +%if 0%{?is_opensuse} +%define extra_target_list %{extra_target_list_common} powerpc powerpc64 s390 arm m68k ia64 riscv64 +%define have_elf_extra_target_list 1 +%define elf_extra_target_list avr pru spu +%else +%define extra_target_list %{extra_target_list_common} +%define have_elf_extra_target_list 0 +%endif + +%define DIST %(echo '%distribution' | sed 's, /.*,,') + +%if %build_multitarget +EXTRA_TARGETS="%(printf ,%%s-suse-linux %{extra_target_list})" +%if %{have_elf_extra_target_list} +EXTRA_TARGETS="$EXTRA_TARGETS%(printf ,%%s-elf %{elf_extra_target_list})" +%endif +%else +EXTRA_TARGETS= +%endif + +# Reenable enable-werror on tumbleweed when upgrading to 13.1 (bsc#1211052) +../configure \ + --prefix=%{_prefix} \ + --libdir=%{_libdir} \ + --sysconfdir=%{_sysconfdir} \ + --mandir=%{_mandir} \ + --infodir=%{_infodir} \ + --htmldir=%{gdb_docdir} \ + --pdfdir=%{gdb_docdir} \ + --with-system-gdbinit=%{_sysconfdir}/gdbinit \ + --with-gdb-datadir=%{_datadir}/gdb \ + --enable-gdb-build-warnings=,-Wno-unused \ +%ifnarch %{ix86} alpha ia64 ppc s390 s390x x86_64 ppc64 ppc64le sparc sparcv9 sparc64 riscv64 aarch64 + --disable-werror \ +%else +%if %{suse_version} <= 1110 || %{suse_version} > 1500 + --disable-werror \ +%else + --enable-werror \ +%endif +%endif + --with-separate-debug-dir=/usr/lib/debug \ +%if 0%{have_libdebuginfod} + --with-debuginfod=yes \ +%endif + --disable-sim \ + --disable-rpath \ + --with-system-zlib \ +%if %{suse_version} >= 1500 + --with-system-readline \ +%else + --without-system-readline \ +%endif + --with-expat \ +$(: ppc64 host build crashes on ppc variant of libexpat.so ) \ + --without-libexpat-prefix \ + --enable-tui \ +%if 0%{!?_without_python:1} + --with-python=%{_bindir}/%{python} \ +%else + --without-python \ +%endif +%if %{suse_version} >= 1130 + --with-rpm=$LIBRPM \ +%else + --without-rpm \ +%endif +%ifarch ia64 + --with-libunwind-ia64 \ +%else + --without-libunwind \ +%endif +%ifarch sparc sparcv9 sparc64 + --without-mmap \ +%endif + --enable-64-bit-bfd \ +%if %{have_inproctrace} + --enable-inprocess-agent \ +%else + --disable-inprocess-agent \ +%endif +%if %{have_libipt} + --with-intel-pt \ +%else + --without-intel-pt \ +%endif + --with-bugurl=http://bugs.opensuse.org/ \ + --with-pkgversion="GDB; %{DIST}" \ +$(: ia64 is obsolete. ) \ + --enable-obsolete \ + ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ +%ifarch sparc sparcv9 + --build=sparc-%{_vendor}-%{_target_os}%{?_gnu} +%else +$(: It breaks RHEL-5 by %{_target_platform} being noarch-redhat-linux-gnu ) \ +%ifarch noarch + $(:) +%else + --build=%{_target_platform} +%endif +%endif + +if [ -z "%{!?_with_profile:no}" ] +then + # Run all the configure tests being incompatible with $FPROFILE_CFLAGS. + make %{?_smp_mflags} configure-host configure-target + make %{?_smp_mflags} clean + + # Workaround -fprofile-use: + # linux-x86-low.c:2225: Error: symbol `start_i386_goto' is already defined + make %{?_smp_mflags} -C gdb/gdbserver linux-x86-low.o +fi + +# Global CFLAGS would fail on: +# conftest.c:1:1: error: coverage mismatch for function 'main' while reading counter 'arcs' +if [ "$fprofile" = "-fprofile" ] +then + FPROFILE_CFLAGS='-fprofile-generate' +elif [ -z "%{!?_with_profile:no}" ] +then + FPROFILE_CFLAGS='-fprofile-use' + # We cannot use -fprofile-dir as the bare filenames clash. + (cd ../%{gdb_build}-fprofile; + # It was 333 on x86_64. + test $(find -name "*.gcda"|wc -l) -gt 300 + find -name "*.gcda" | while read -r i + do + ln $i ../%{gdb_build}/$i + done + ) +else + FPROFILE_CFLAGS="" +fi + +# Prepare gdb/config.h first. +make %{?_smp_mflags} V=1 CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS" maybe-configure-gdb +perl -i.relocatable -pe 's/^(D\[".*_RELOCATABLE"\]=" )1(")$/${1}0$2/' gdb/config.status + +make %{?_smp_mflags} V=1 CFLAGS="$CFLAGS $FPROFILE_CFLAGS" LDFLAGS="$LDFLAGS $FPROFILE_CFLAGS" + +! grep '_RELOCATABLE.*1' gdb/config.h + +if [ "$fprofile" = "-fprofile" ] +then + cd gdb + cp -p gdb gdb-withindex + PATH="$PWD:$PATH" sh ../../gdb/gdb-add-index $PWD/gdb-withindex + ./gdb -nx -ex q ./gdb-withindex + ./gdb -nx -readnow -ex q ./gdb-withindex + cd .. +fi + +cd .. + +done # fprofile + +cd %{gdb_build} + +#make %{?_smp_mflags} -C gdb/doc {gdb,annotate}{.info,/index.html,.pdf} MAKEHTMLFLAGS=--no-split + +# Copy the /gdb/NEWS file to the directory above it. +cp $RPM_BUILD_DIR/%{gdb_src}/gdb/NEWS $RPM_BUILD_DIR/%{gdb_src} + +%check +# Initially we're in the %%{gdb_src} directory. +cd %{gdb_build} + +%if !%{build_testsuite} +echo ====================TESTSUITE DISABLED========================= +%else +echo ====================TESTING========================= +cd gdb +CC=gcc +CXX=g++ +export CC +export CXX +$CC -o ./orphanripper %{SOURCE2} -Wall -lutil -ggdb2 +# Need to use a single --ignore option, second use overrides first. +# No `%{?_smp_mflags}' here as it may race. +# WARNING: can't generate a core file - core tests suppressed - check ulimit +# "readline-overflow.exp" - Testcase is broken, functionality is OK. +( + # ULIMIT required for `gdb.base/auxv.exp'. + ulimit -H -c + ulimit -c unlimited || : + + # Setup $CHECK as `check//unix/' or `check//unix/-m64' for explicit bitsize. + # Never use two different bitsizes as it fails on ppc64. + echo 'int main (void) { return 0; }' >biarch.c + CHECK="" + for BI in -m64 -m32 -m31 "" + do + # Do not use size-less options if any of the sizes works. + # On ia64 there is no -m64 flag while we must not leave a bare `check' here + # as it would switch over some testing scripts to the backward compatibility + # mode: when `make check' was executed from inside the testsuite/ directory. + if [ -z "$BI" -a -n "$CHECK" ];then + continue + fi + # Do not use $RPM_OPT_FLAGS as the other non-size options will not be used + # in the real run of the testsuite. + if ! $CC $BI -o biarch biarch.c + then + continue + fi + CHECK="$CHECK check//unix/$BI" + done + # Do not try -m64 inferiors for -m32 GDB as it cannot handle inferiors larger + # than itself. + # s390 -m31 still uses the standard ELF32 binary format. + $CC $RPM_OPT_FLAGS -o biarch biarch.c + RPM_SIZE="$(file ./biarch|sed -n 's/^.*: ELF \(32\|64\)-bit .*$/\1/p')" + if [ "$RPM_SIZE" != "64" ] + then + CHECK="$(echo " $CHECK "|sed 's# check//unix/-m64 # #')" + fi + + # Disable some problematic testcases. + # RUNTESTFLAGS='--ignore ...' is not used below as it gets separated by the + # `check//...' target spawn and too much escaping there would be dense. + DISABLE_TESTS= + DISABLE_TESTS="$DISABLE_TESTS gdb.base/bigcore.exp" + DISABLE_TESTS="$DISABLE_TESTS gdb.threads/attach-many-short-lived-threads.exp" + %if 0%{suse_version} == 1110 + DISABLE_TESTS="$DISABLE_TESTS gdb.base/break-interp.exp" + %endif + for test in $DISABLE_TESTS; do + mv -f ../../gdb/testsuite/$test ../../gdb/testsuite/$test-DISABLED || : + done + + # Run all the scheduled testsuite runs also in the PIE mode. + # See also: gdb-runtest-pie-override.exp + if rpm -q gcc-PIE; then + CHECK="$(echo $CHECK | sed 's#check//unix/[^ ]*#& &/-fno-PIE/-no-pie#g')" + else + CHECK="$(echo $CHECK | sed 's#check//unix/[^ ]*#& &/-fPIE/-pie#g')" + fi + +%if %{with for_chroot} + # When we want to chroot into a local osc build and run a test-case, we + # need -M testsuite to add all the buildrequires, but there's no need + # to run the testsuite. Instead, fail %check to make sure %clean doesn't + # remove buildroot. + false +%else + ./orphanripper make %{?_smp_mflags} -k $CHECK || : +%endif +) +for t in sum log +do + for file in testsuite*/gdb.$t + do + suffix="${file#testsuite.unix.}" + suffix="${suffix%/gdb.$t}" + ln $file gdb-%{_target_platform}$suffix.$t || : + done +done +# `tar | bzip2 | uuencode' may have some piping problems in Brew. +#tar cjf gdb-%%{_target_platform}.tar.bz2 gdb-%%{_target_platform}*.{sum,log} +#uuencode gdb-%%{_target_platform}.tar.bz2 gdb-%%{_target_platform}.tar.bz2 +# Strip dates and completion times from the log to make build-compare happy +sed -i -e '/Test Run By abuild on/d' -e 's/completed in [0-9]* seconds//' *.{sum,log} +cd ../.. +echo ====================TESTING END===================== +%endif + +%install +# Initially we're in the %%{gdb_src} directory. +cd %{gdb_build} + +# It would break RHEL-5 by leaving excessive files for the doc subpackage. +%ifnarch noarch + +make %{?_smp_mflags} install DESTDIR=$RPM_BUILD_ROOT + +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d +touch -r %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d + +%if 0%{!?_without_python:1} +sed 's#%%{_sysconfdir}#%{_sysconfdir}#g' <%{SOURCE4} >$RPM_BUILD_ROOT%{_sysconfdir}/gdbinit +touch -r %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit +%else +sed 's#%%{_sysconfdir}#%{_sysconfdir}#g' <%{SOURCE5} >$RPM_BUILD_ROOT%{_sysconfdir}/gdbinit +touch -r %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit +%endif + +for i in `find $RPM_BUILD_ROOT%{_datadir}/gdb/python/gdb -name "*.py"` +do + # Files could be also patched getting the current time. + touch -r $RPM_BUILD_DIR/%{gdb_src}/gdb/version.in $i +done + +%if 0%{?_enable_debug_packages:1} && 0%{!?_without_python:1} +mkdir -p $RPM_BUILD_ROOT/usr/lib/debug%{_bindir} +cp -p $RPM_BUILD_DIR/%{gdb_src}/gdb/gdb-gdb.py $RPM_BUILD_ROOT/usr/lib/debug%{_bindir}/ +for pyo in "" "-O";do + # RHEL-5: AttributeError: 'module' object has no attribute 'compile_file' + %{python} $pyo -c 'import compileall, re, sys; sys.exit (not compileall.compile_dir("'"$RPM_BUILD_ROOT/usr/lib/debug%{_bindir}"'", 1, "'"/usr/lib/debug%{_bindir}"'"))' +done +%endif # 0%{?_enable_debug_packages:1} && 0%{!?_without_python:1} + +mkdir $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load +%if 0%{?rhel:1} && 0%{?rhel} <= 6 +%if 0%{!?_without_python:1} +# Temporarily now: +for LIB in lib lib64;do + LIBPATH="$RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{_root_prefix}/$LIB" + mkdir -p $LIBPATH + # basename is being run only for the native (non-biarch) file. + sed -e 's,@pythondir@,%{_datadir}/gdb/python,' \ + -e 's,@toolexeclibdir@,%{_root_prefix}/'"$LIB," \ + < $RPM_BUILD_DIR/%{gdb_src}/%{libstdcxxpython}/hook.in \ + > $LIBPATH/$(basename %{_root_prefix}/%{_lib}/libstdc++.so.6.*)-gdb.py + # Test the filename 'libstdc++.so.6.*' has matched. + test -f $LIBPATH/libstdc++.so.6.[0-9]*-gdb.py +done +test ! -e $RPM_BUILD_ROOT%{_datadir}/gdb/python/libstdcxx +cp -a $RPM_BUILD_DIR/%{gdb_src}/%{libstdcxxpython}/libstdcxx \ + $RPM_BUILD_ROOT%{_datadir}/gdb/python/libstdcxx +for i in `find $RPM_BUILD_ROOT%{_datadir}/gdb/python -name "*.py"` \ + `find $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{_prefix} -name "*.py"` \ +; do + # Files come from gdb-archer.patch and can be also further patched. + touch -r $RPM_BUILD_DIR/%{gdb_src}/gdb/version.in $i +done +%endif # 0%{!?_without_python:1} +%endif # 0%{?rhel:1} && 0%{?rhel} <= 6 + +# Remove the files that are part of a gdb build but that are owned and +# provided by other packages. +# These are part of binutils + +rm -rf $RPM_BUILD_ROOT%{_datadir}/locale/ +rm -f $RPM_BUILD_ROOT%{_infodir}/bfd* +rm -f $RPM_BUILD_ROOT%{_infodir}/standard* +rm -f $RPM_BUILD_ROOT%{_infodir}/configure* +rm -f $RPM_BUILD_ROOT%{_infodir}/sframe-spec* +rm -rf $RPM_BUILD_ROOT%{_includedir} +rm -rf $RPM_BUILD_ROOT/%{_libdir}/lib{bfd*,opcodes*,iberty*,ctf*,sframe*} + +%if %{build_testsuite} +rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit +rm -rf $RPM_BUILD_ROOT%{_bindir} +rm -rf $RPM_BUILD_ROOT%{_libdir} +rm -rf $RPM_BUILD_ROOT%{_datadir}/gdb +rm -rf $RPM_BUILD_ROOT%{_infodir} +rm -rf $RPM_BUILD_ROOT%{_mandir} +rm -rf $RPM_BUILD_ROOT/usr/src +%endif + +# pstack obsoletion + +%if %{build_main} +cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_mandir}/man1/gstack.1 +%endif +%endif # 0%{!?_with_upstream:1} + +%if %{build_main} +# Packaged GDB is not a cross-target one. +(cd $RPM_BUILD_ROOT%{_datadir}/gdb/syscalls + rm -f mips*.xml +%ifnarch sparc sparcv9 sparc64 + rm -f sparc*.xml +%endif +%ifnarch x86_64 + rm -f amd64-linux.xml +%endif +%ifnarch %{ix86} x86_64 + rm -f i386-linux.xml +%endif +%ifnarch ppc ppc64 + rm -f ppc{,64}-linux.xml +%endif +%ifnarch ppc64le + rm -f ppc64le-linux.xml +%endif +) + +# It would break RHEL-5 by leaving excessive files for the doc subpackage. +%if 0%{?el5:1} +rm -f $RPM_BUILD_ROOT%{_infodir}/annotate.info* +rm -f $RPM_BUILD_ROOT%{_infodir}/gdb.info* +%endif # 0%{?el5:1} +# -j1: There is some race resulting in: +# /usr/bin/texi2dvi: texinfo.tex appears to be broken, quitting. +make -j1 -C gdb/doc install DESTDIR=$RPM_BUILD_ROOT + +# Documentation only for development; keep 'rm's here after "noarch" above. +rm -f $RPM_BUILD_ROOT%{_infodir}/gdbint* +rm -f $RPM_BUILD_ROOT%{_infodir}/stabs* +rm -f $RPM_BUILD_ROOT%{_infodir}/ctf-spec* + +# Delete this too because the dir file will be updated at rpm install time. +# We don't want a gdb specific one overwriting the system wide one. + +rm -f $RPM_BUILD_ROOT%{_infodir}/dir + +%endif + +%post +# This step is part of the installation of the RPM. Not to be confused +# with the 'make install ' of the build (rpmbuild) process. + +# For --excludedocs: +if [ -e %{_infodir}/gdb.info.gz ] +then + %install_info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz + %install_info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz +fi + +%preun +if [ $1 = 0 ] +then + # For --excludedocs: + if [ -e %{_infodir}/gdb.info.gz ] + then + %install_info_delete --delete --info-dir=%{_infodir} %{_infodir}/annotate.info.gz + %install_info_delete --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz + fi +fi + +%if %{build_main} +%files +%defattr(-,root,root) +%doc README NEWS +%if 0%{suse_version} >= 1320 +%license COPYING3 COPYING COPYING.LIB +%else +%doc COPYING3 COPYING COPYING.LIB +%endif +%{_bindir}/gcore +%{_mandir}/*/gcore.1* +%{_bindir}/gdb +%config(noreplace) %{_sysconfdir}/gdbinit +%{_sysconfdir}/gdbinit.d +%{_mandir}/*/gdb.1* +%{_bindir}/gstack +%{_mandir}/*/gstack.1* +%{_bindir}/gdb-add-index +%{_mandir}/*/gdb-add-index.1* +%{_mandir}/*/gdbinit.5* +%{_datadir}/gdb +%{_infodir}/annotate.info* +%{_infodir}/gdb.info* +%endif + +%if %{build_testsuite} +%files +%defattr(-,root,root) +%doc %{gdb_build}/gdb/gdb-*.sum +%doc %{gdb_build}/gdb/gdb-*.log +%endif + +# don't include the files in include, they are part of binutils + +%if %{build_main} +%ifnarch sparcv9 hppa +%files -n gdbserver +%defattr(-,root,root) +%{_bindir}/gdbserver +%{_mandir}/*/gdbserver.1* +%if %{have_inproctrace} +%{_libdir}/libinproctrace.so +%endif # %%{have_inproctrace} +%endif +%endif + +%if %{build_main} +%post doc +# This step is part of the installation of the RPM. Not to be confused +# with the 'make install ' of the build (rpmbuild) process. + +# For --excludedocs: +if [ -e %{_infodir}/gdb.info.gz ] +then + /sbin/install-info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || : + /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || : +fi + +%preun doc +if [ $1 = 0 ] +then + # For --excludedocs: + if [ -e %{_infodir}/gdb.info.gz ] + then + /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || : + /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || : + fi +fi +%endif + +%changelog diff --git a/gdbinit b/gdbinit new file mode 100644 index 0000000..2ed6e59 --- /dev/null +++ b/gdbinit @@ -0,0 +1,8 @@ +# System-wide GDB initialization file. +python +import glob +for f in glob.glob('%{_sysconfdir}/gdbinit.d/*.gdb'): + gdb.execute('source %s' % f) +for f in glob.glob('%{_sysconfdir}/gdbinit.d/*.py'): + gdb.execute('source %s' % f) +end diff --git a/gdbinit.without-python b/gdbinit.without-python new file mode 100644 index 0000000..c70a140 --- /dev/null +++ b/gdbinit.without-python @@ -0,0 +1,5 @@ +# System-wide GDB initialization file. + +# FIXME: Source /etc/gdbinit.d/*.gdb +# Without python support, there's currently no way to do this. See also +# swo#13578 - "source command file globbing". diff --git a/import-fedora.sh b/import-fedora.sh new file mode 100644 index 0000000..abefcac --- /dev/null +++ b/import-fedora.sh @@ -0,0 +1,142 @@ +#!/bin/bash + +# Fedora Packages not copied: +# +skip_patches=( + # Not applicable for openSUSE. + gdb-add-index.patch + gdb-6.3-rh-testversion-20041202.patch + gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch + gdb-6.8-bz466901-backtrace-full-prelinked.patch + gdb-container-rh-pkg.patch + + # Fragile test-case, requires glibc to fail in a certain way. + gdb-rhbz1156192-recursive-dlopen-test.patch + + # Obsolete. + gdb-6.7-ppc-clobbered-registers-O2-test.patch +) + +usage () +{ + echo "usage: $(basename "$0") " +} + +dir="$1" + +if [ ! -f "$dir"/_patch_order ]; then + usage + exit 1 +fi + +mark1="^#Fedora Packages begin" +mark2="^#Fedora Packages end" +mark3="^#Fedora patching start" +mark4="^#Fedora patching end" + +remove_current_patches () +{ + # shellcheck disable=SC2207 + current_patches=($(awk "/$mark1/,/$mark2/{ print }" gdb.spec \ + | grep Patch \ + | awk '{print $2}')) + + for current_patch in "${current_patches[@]}"; do + rm -f "$current_patch" + done +} + +skip () +{ + local p + p="$1" + + for skip_patch in "${skip_patches[@]}"; do + if [ "$p" = "$skip_patch" ]; then + return 0 + fi + done + + return 1 +} + +import_patches () +{ + # Get the parts of gdb.spec that we want to keep unchanged. + awk "NR==1,/$mark1/" gdb.spec \ + > gdb.spec.1 + awk "/$mark2/,/$mark3/" gdb.spec \ + > gdb.spec.3 + awk "/$mark4/,0" gdb.spec \ + > gdb.spec.5 + + # Start generating the parts of gdb.spec that we want to change. + f1=gdb.spec.2 + f2=gdb.spec.4 + rm -f $f1 $f2 + + # Handle each fedora patch. + skipped_patches=() + n=1 + # shellcheck disable=SC2013 + for p in $(cat "$dir"/_patch_order); do + if skip "$p"; then + echo "Skipped: $p" + skipped_patches=("${skipped_patches[@]}" "$p") + + # Keep numbers the same as in fedora package. + n=$((n + 1)) + continue + fi + + cp "$dir"/"$p" . + + printf \ + "%-16s%s\n" "Patch$n:" "$p" \ + >> $f1 + + echo \ + "%patch -P $n -p1" \ + >> $f2 + + n=$((n + 1)) + done + + # Report which patches did not get skipped. + for skip_patch in "${skip_patches[@]}"; do + found=false + for skipped_patch in "${skipped_patches[@]}"; do + if [ "$skip_patch" = "$skipped_patch" ]; then + found=true + break + fi + done + if ! $found; then + echo "Not skipped: $skip_patch" + fi + done + + # Assemble new gdb.spec. + rm -f gdb.spec.new + for n in $(seq 1 5); do + cat gdb.spec."$n" \ + >> gdb.spec.new + done + + # Cleanup. + for n in $(seq 1 5); do + rm -f gdb.spec."$n" + done + + # Update gdb.spec. + mv gdb.spec.new gdb.spec +} + +main () +{ + remove_current_patches + + import_patches +} + +main "$@" diff --git a/import-patches.sh b/import-patches.sh new file mode 100644 index 0000000..a7ffcaa --- /dev/null +++ b/import-patches.sh @@ -0,0 +1,100 @@ +#!/bin/sh + +# Invoke as: +# $ ./import-patches.sh [ --dry-run ] /00*.patch + +usage () +{ + echo "./import-patches.sh [ --dry-run ] +" +} + +dryrun=false +case "$1" in + -dryrun|-dry-run|--dryrun|--dry-run) + dryrun=true + shift + ;; +esac + +n="$1" +shift + +case $n in + "") + echo "Missing argument" + usage + exit 1 + ;; + [0-9][0-9]*) + ;; + *) + echo "Need numeric argument" + usage + exit 1 + ;; +esac + +if [ "$n" = "" ]; then + echo "Missing argument" + usage + exit 1 +fi + +files="$*" + +rm -Rf tmp.patches +mkdir tmp.patches + +tmp= +for f in $files; do + dir=$(dirname "$f") + f=$(basename "$f") + orig_f="$f" + + # Remove numeric prefix. + f=$(echo "$f" \ + | sed 's/^[0-9]*-//') + + # To lowercase. + f=$(echo "$f" \ + | tr '[:upper:]' '[:lower:]') + + # Fix patch.patch. + f=$(echo "$f" \ + | sed 's/\.patch\.patch/.patch/') + + # Copy. + cp "$dir"/"$orig_f" tmp.patches/"$f" + + # Filter out ChangeLog entries. + filterdiff -x "*/ChangeLog" tmp.patches/"$f" > tmp.patches/tmp."$f" + mv tmp.patches/tmp."$f" tmp.patches/"$f" + + tmp="$tmp $f" +done +files="$tmp" + +i=$n +for f in $files; do + printf "Patch%-11s%s\n" "$i:" "$f" + + i=$((i + 1)) +done + +i=$n +for f in $files; do + echo "%patch$i -p1" + + i=$((i + 1)) +done + +if $dryrun; then + exit +fi + +for f in $files; do + mv tmp.patches/"$f" . + osc add "$f" +done + +rmdir tmp.patches diff --git a/make-pascal_language-print_type-handle-varstring-nul.patch b/make-pascal_language-print_type-handle-varstring-nul.patch new file mode 100644 index 0000000..c838c98 --- /dev/null +++ b/make-pascal_language-print_type-handle-varstring-nul.patch @@ -0,0 +1,43 @@ +From f27cc602d85c46b46f5b02d6f584a1d872e098e3 Mon Sep 17 00:00:00 2001 +From: Tom Tromey +Date: Wed, 27 Mar 2024 10:34:46 -0600 +Subject: [PATCH] Make pascal_language::print_type handle varstring==nullptr + +PR gdb/31524 points out a crash when pascal_language::print_type is +called with varstring==nullptr. This crash is a regression arising +from the printf/pager rewrite -- that indirectly removed a NULL check +from gdb's "puts". + +This patch instead fixes the problem by adding a check to print_type. +Passing nullptr here seems to be expected in other places (e.g., there +is a call to type_print like this in expprint.c), and other +implementations of this method (or related helpers) explicitly check +for NULL. + +I didn't write a test case for this because it seemed like overkill +for a Pascal bug that only occurs with -i=mi. However, if you want +one, let me know and I will do it. + +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31524 +Approved-By: John Baldwin +--- + gdb/p-typeprint.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c +index e8542d6845a..68a94a65f64 100644 +--- a/gdb/p-typeprint.c ++++ b/gdb/p-typeprint.c +@@ -55,7 +55,8 @@ pascal_language::print_type (struct type *type, const char *varstring, + type_print_varspec_prefix (type, stream, show, 0, flags); + } + /* first the name */ +- gdb_puts (varstring, stream); ++ if (varstring != nullptr) ++ gdb_puts (varstring, stream); + + if ((varstring != NULL && *varstring != '\0') + && !(code == TYPE_CODE_FUNC +-- +2.35.3 + diff --git a/patchlist.pl b/patchlist.pl new file mode 100644 index 0000000..414a004 --- /dev/null +++ b/patchlist.pl @@ -0,0 +1,74 @@ +#!/usr/bin/perl + +die "need gdb-Fedora directory" unless -d $ARGV[0]; + +my $gdbFedora = $ARGV[0]; +my $dir = `pwd`; +chomp($dir); + +system "rm \$(grep \"^Patch[0-9]\\{1,3\\}:\" gdb.spec | awk '{print \$2}') 2>/dev/null"; +system "rm *.tar.bz2"; +system "cp -p $gdbFedora/*.tar.bz2 ./"; +system "pushd $gdbFedora ; sh $dir/patchname_get.sh -v gdb.spec 2>$dir/test.txt; popd"; +system "grep \"^Patch\" test.txt > test2.txt"; + +my @patchliste = `cat test2.txt`; +my @patchdeklarationen = (); +my @patchstatements = (); +my %seenpatches = (); +my $blockcounter = 0; +my @patchcopy = (); + +foreach my $line (@patchliste) { + chomp($line); + if ($line =~ /\((.*)\)/) { + $patchname = $1; + if (exists $seenpatches{$patchname}){ + my $oldcount = $seenpatches{$patchname}; + push @patchstatements, "%patch$oldcount -p1 -R\n"; + } + else { + $count = $count + 1; + push @patchdeklarationen, "Patch$count: ". (($count < 10) ? " " : (($count < 100) ? " " : "")) ."$patchname\n"; + push @patchstatements, "%patch$count -p1\n"; + $seenpatches{$patchname} = $count; + push @patchcopy, $patchname; + } + } +} + +foreach my $copy (@patchcopy) { + system "cp \"$gdbFedora/$copy\" ./"; +} + +open F, ">gdb.spec.new"; +foreach my $line (`cat gdb.spec`) { + if ($line eq "#Fedora Packages begin\n") { + print F $line; + $blockcounter = 1; + } + elsif ($line eq "#Fedora Packages end\n") { + $blockcounter = 0; + } + elsif($line eq "#Fedora patching start\n") { + print F $line; + $blockcounter = 3; + } + elsif($line eq "#Fedora patching end\n") { + $blockcounter = 0; + } + if ($blockcounter == 0){ + print F $line; + } elsif ($blockcounter == 1) { + print F @patchdeklarationen; + $blockcounter = 2; + } elsif ($blockcounter == 3) { + print F @patchstatements; + $blockcounter = 4; + } +} +close F; + +system "mv gdb.spec.new gdb.spec"; +system "rm test.txt test2.txt"; +system "osc addremove"; diff --git a/patchname_get.sh b/patchname_get.sh new file mode 100644 index 0000000..fe4ff82 --- /dev/null +++ b/patchname_get.sh @@ -0,0 +1,314 @@ +#!/bin/bash + + + +: ${QUILT_DIR=/usr/share/quilt} + + +if ! [ -r $QUILT_DIR/scripts/patchfns ] +then + echo "Cannot read library $QUILT_DIR/scripts/patchfns" >&2 + exit 1 +fi +. $QUILT_DIR/scripts/patchfns +cd ${SUBDIR:-.} + +usage() { + echo "Usage: ${0##*/} [--fuzz=N] specfile" + exit 1 +} + +options=$(getopt -o v --long sourcedir:,fuzz: -n "${0##*/}" -- "$@") || exit + +eval set -- "$options" + +sourcedir= + +while true +do + case "$1" in + -v) + verbose=1 + shift ;; + --sourcedir) + sourcedir=${2%/}/ + shift 2 ;; + --fuzz) + # Only works with rpm 4.6 and later + DEFINE_FUZZ="%define _default_patch_fuzz $2" + shift 2 ;; + --) + shift + break ;; + esac +done + +[ "${sourcedir:0:1}" = / ] || sourcedir=$PWD/$sourcedir + +specfile=$1 +if [ $# -ne 1 -o ! -f "$specfile" ] +then + + usage +fi +if [ "${specfile:0:1}" = / ] +then + specdir=$(dirname "$specfile") + specfile=${specfile##*/} +else + specdir=$PWD +fi + +tmpdir="$(gen_tempfile -d ${VARTMPDIR:-/var/tmp}/${0##*/})" +mkdir -p $tmpdir || exit 1 +add_exit_handler "rm -rf $tmpdir" +mkdir -p $tmpdir/build +mkdir -p $tmpdir/bin + +# Older versions of Suse packages have a symbolic release number, and rpmbuild +# won't like that, so change it to something compliant. +if grep -q '^Release:.*[<>]' "$specdir/$specfile" +then + sed -e '/^Release:/s/[<>]//g' < "$specdir/$specfile" > $tmpdir/"$specfile" + specdir=$tmpdir +fi + +# Redirect file descriptors +# 5 is used in verbose mode, 4 in non-verbose mode, and 2 for both (real errors) +if [ -n "$verbose" ] +then + exec 3>&1 5>&2 4>/dev/null +else + exec 3>&1 4>&2 5>/dev/null +fi + + + +# wrapper script for patch and tar +cat <<-'EOF' > $tmpdir/bin/wrapper + #! /bin/bash + + # find original data file by md5sum + original_file() { + local file=$1 md5sum + + set -- $(md5sum < $file) + md5sum=$1 + while read md5sum_ file_ + do + if [ "$md5sum" = "$md5sum_" ] + then + echo ${file_#\*} + return 0 + fi + done < $tmpdir/md5sums + + # Try harder + if ! [ -e $tmpdir/more-md5sums ] + then + ( cd $RPM_BUILD_DIR + find . -type f \ + | sed -e 's:^.\/::' \ + | xargs md5sum \ + ) > $tmpdir/more-md5sums + fi + + while read md5sum_ file_ + do + if [ "$md5sum" = "$md5sum_" ] + then + echo ${file_#\*} + return 0 + fi + done < $tmpdir/more-md5sums + return 1 + } + + + + + + # Extract a command line option with or without argument + cmdline_option() { + local letter=$1 no_arg=$2 + shift + + while [ $# -ne 0 ] + do + if [ "${1:0:2}" = -$letter ] + then + if [ -z "$no_arg" ] + then + [ "$1" = -$letter ] && set -- "$1$2" + fi + echo $1 + break + fi + shift + done + } + + + strip_option() { + set -- $(cmdline_option p "$@") + [ "$1" != -p1 ] && echo $1 + } + + # Extract the -p option from the command line + strip_option() { + set -- $(cmdline_option p "$@") + [ "$1" != -p1 ] && echo $1 + } + + # Extract the -R option from the command line + reverse_option() { + set -- $(cmdline_option R no_arg "$@") + echo $1 + } + + patch_opt_d() { + local subdir=$(cmdline_option d "$@") + [ -z "$subdir" ] || echo "${subdir:2}" + } + + + + patch_input_file() { + while [ $# -gt 0 ]; do + case "$1" in + -i|--input) + if [ $# -ge 2 ]; then + echo "$2" + return + fi + ;; + -i*) + echo "${1#-i}" + return + ;; + --input=*) + echo "${1#--input=}" + return + ;; + esac + shift + done + return + } + + tar_input_file() { + case "$1" in + *C*f*) + echo "$3" + ;; + *f*) + echo "$2" + ;; + esac + } + + + tar_opt_C() { + case "$1" in + *C*f*) + echo "$2" + return ;; + esac + } + + tmpdir=${RPM_BUILD_DIR%/*} + rm -f $tmpdir/data + case "${0##*/}" in + patch) + inputfile=$(patch_input_file "$@") + ;; + tar) + inputfile=$(tar_input_file "$@") + # For tar, file - means read from stdin + [ "$inputfile" = "-" ] && inputfile= + ;; + esac + if [ -z "$inputfile" ]; then + # put data from stdin into tmpfile + cat > $tmpdir/data + fi + + unpackfile="$(original_file ${inputfile:-$tmpdir/data})" + if [ -n "$unpackfile" ] + then + case "${0##*/}" in + patch) + echo -n p >&4 + subdir=$(patch_opt_d "$@") + if [ -n "$subdir" ] + then + dir=$(cd "$subdir" && echo $PWD) + else + dir=$PWD + fi + dir=${dir/$RPM_BUILD_DIR} + dir=${dir##/} + dir=${dir// /\\ } + echo "${0##*/} ${dir:-.} $unpackfile" \ + $(strip_option "$@") $(reverse_option "$@") >&3 + ;; + tar) + echo -n t >&4 + subdir=$(tar_opt_C "$@") + if [ -n "$subdir" ] + then + dir=$(cd "$subdir" && echo $PWD) + else + dir=$PWD + fi + dir=${dir/$RPM_BUILD_DIR} + dir=${dir##/} + dir=${dir// /\\ } + echo "${0##*/} ${dir:-.} $unpackfile" >&3 + ;; + esac + fi + + PATH=${PATH#*:} + if [ -n "$inputfile" ]; then + ${0##*/} "$@" + else + ${0##*/} "$@" < $tmpdir/data + fi + +EOF + +chmod 755 $tmpdir/bin/wrapper +# If $TMPDIR is mounted with noexec, rpmbuild won't be able to execute +# our wrapper script +if [ ! -x $tmpdir/bin/wrapper ] +then + printf "Cannot execute %s; filesystem mounted with noexec?\n" \ + $tmpdir/bin/wrapper >&2 + printf "Setting %s in ~/.quiltrc may help\n" "VARTMPDIR" >&2 + exit 1 +fi + +ln -s wrapper $tmpdir/bin/patch +ln -s wrapper $tmpdir/bin/tar + +# let rpm do all the dirty specfile stuff ... +echo -n "### rpmbuild: " >&4 + +export PATH="$tmpdir/bin:$PATH" +rpmbuild --eval "%define _sourcedir $sourcedir" \ + --eval "%define _specdir $specdir" \ + --eval "%define _builddir $tmpdir/build" \ + --eval "%define __patch $tmpdir/bin/patch" \ + --eval "%define __tar $tmpdir/bin/tar" \ + --eval "$DEFINE_FUZZ" \ + --nodeps \ + -bp "$specdir/$specfile" < /dev/null >&5 2>&5 +status=$? +echo >&4 +exit $status +### Local Variables: +### mode: shell-script +### End: +# vim:filetype=sh + diff --git a/powerpc-and-aarch64-fix-reverse-stepping-failure.patch b/powerpc-and-aarch64-fix-reverse-stepping-failure.patch new file mode 100644 index 0000000..b1d37b7 --- /dev/null +++ b/powerpc-and-aarch64-fix-reverse-stepping-failure.patch @@ -0,0 +1,478 @@ +From b826313e55938c8cf83b0889e2f6bdf8129bc004 Mon Sep 17 00:00:00 2001 +From: Carl Love +Date: Tue, 2 Jan 2024 17:46:02 -0500 +Subject: [PATCH 07/48] PowerPC and aarch64: Fix reverse stepping failure + +When running GDB's testsuite on aarch64-linux/Ubuntu 20.04 (also spotted on +the ppc backend), there are failures in gdb.reverse/solib-precsave.exp and +gdb.reverse/solib-reverse.exp. + +The failure happens around the following code: + +38 b[1] = shr2(17); /* middle part two */ +40 b[0] = 6; b[1] = 9; /* generic statement, end part two */ +42 shr1 ("message 1\n"); /* shr1 one */ + +Normal execution: + +- step from line 38 will land on line 40. +- step from line 40 will land on line 42. + +Reverse execution: +- step from line 42 will land on line 40. +- step from line 40 will land on line 40. +- step from line 40 will land on line 38. + +The problem here is that line 40 contains two contiguous but distinct +PC ranges in the line table, like so: + +Line 40 - [0x7ec ~ 0x7f4] +Line 40 - [0x7f4 ~ 0x7fc] + +The two distinct ranges are generated because GCC started outputting source +column information, which GDB doesn't take into account at the moment. + +When stepping forward from line 40, we skip both of these ranges and land on +line 42. When stepping backward from line 42, we stop at the start PC of the +second (or first, going backwards) range of line 40. + +Since we've reached ecs->event_thread->control.step_range_start, we stop +stepping backwards. + +The above issues were fixed by introducing a new function that looks for +adjacent PC ranges for the same line, until we notice a line change. Then +we take that as the start PC of the range. The new start PC for the range +is used for the control.step_range_start when setting up a step range. + +The test case gdb.reverse/map-to-same-line.exp is added to test the fix +for the above reverse step issues. + +Patch has been tested on PowerPC, X86 and AArch64 with no regressions. +--- + gdb/infrun.c | 57 +++++++ + gdb/symtab.c | 50 ++++++ + gdb/symtab.h | 17 ++ + gdb/testsuite/gdb.reverse/map-to-same-line.c | 58 +++++++ + .../gdb.reverse/map-to-same-line.exp | 153 ++++++++++++++++++ + 5 files changed, 335 insertions(+) + create mode 100644 gdb/testsuite/gdb.reverse/map-to-same-line.c + create mode 100644 gdb/testsuite/gdb.reverse/map-to-same-line.exp + +diff --git a/gdb/infrun.c b/gdb/infrun.c +index 4730d290442..069ef144a76 100644 +--- a/gdb/infrun.c ++++ b/gdb/infrun.c +@@ -114,6 +114,8 @@ static struct async_event_handler *infrun_async_inferior_event_token; + /* Stores whether infrun_async was previously enabled or disabled. + Starts off as -1, indicating "never enabled/disabled". */ + static int infrun_is_async = -1; ++static CORE_ADDR update_line_range_start (CORE_ADDR pc, ++ struct execution_control_state *ecs); + + /* See infrun.h. */ + +@@ -6886,6 +6888,27 @@ handle_signal_stop (struct execution_control_state *ecs) + process_event_stop_test (ecs); + } + ++/* Return the address for the beginning of the line. */ ++ ++CORE_ADDR ++update_line_range_start (CORE_ADDR pc, struct execution_control_state *ecs) ++{ ++ /* The line table may have multiple entries for the same source code line. ++ Given the PC, check the line table and return the PC that corresponds ++ to the line table entry for the source line that PC is in. */ ++ CORE_ADDR start_line_pc = ecs->event_thread->control.step_range_start; ++ std::optional real_range_start; ++ ++ /* Call find_line_range_start to get the smallest address in the ++ linetable for multiple Line X entries in the line table. */ ++ real_range_start = find_line_range_start (pc); ++ ++ if (real_range_start.has_value ()) ++ start_line_pc = *real_range_start; ++ ++ return start_line_pc; ++} ++ + /* Come here when we've got some debug event / signal we can explain + (IOW, not a random signal), and test whether it should cause a + stop, or whether we should resume the inferior (transparently). +@@ -7687,6 +7710,29 @@ process_event_stop_test (struct execution_control_state *ecs) + + if (stop_pc_sal.is_stmt) + { ++ if (execution_direction == EXEC_REVERSE) ++ { ++ /* We are stepping backwards make sure we have reached the ++ beginning of the line. */ ++ CORE_ADDR stop_pc = ecs->event_thread->stop_pc (); ++ CORE_ADDR start_line_pc ++ = update_line_range_start (stop_pc, ecs); ++ ++ if (stop_pc != start_line_pc) ++ { ++ /* Have not reached the beginning of the source code line. ++ Set a step range. Execution should stop in any function ++ calls we execute back into before reaching the beginning ++ of the line. */ ++ ecs->event_thread->control.step_range_start ++ = start_line_pc; ++ ecs->event_thread->control.step_range_end = stop_pc; ++ set_step_info (ecs->event_thread, frame, stop_pc_sal); ++ keep_going (ecs); ++ return; ++ } ++ } ++ + /* We are at the start of a statement. + + So stop. Note that we don't stop if we step into the middle of a +@@ -7749,6 +7795,17 @@ process_event_stop_test (struct execution_control_state *ecs) + set_step_info (ecs->event_thread, frame, stop_pc_sal); + + infrun_debug_printf ("keep going"); ++ ++ if (execution_direction == EXEC_REVERSE) ++ { ++ CORE_ADDR stop_pc = ecs->event_thread->stop_pc (); ++ ++ /* Make sure the stop_pc is set to the beginning of the line. */ ++ if (stop_pc != ecs->event_thread->control.step_range_start) ++ ecs->event_thread->control.step_range_start ++ = update_line_range_start (stop_pc, ecs); ++ } ++ + keep_going (ecs); + } + +diff --git a/gdb/symtab.c b/gdb/symtab.c +index e9bc7b2c933..ef63ec93c5a 100644 +--- a/gdb/symtab.c ++++ b/gdb/symtab.c +@@ -73,6 +73,7 @@ + #include "gdbsupport/gdb_string_view.h" + #include "gdbsupport/pathstuff.h" + #include "gdbsupport/common-utils.h" ++#include + + /* Forward declarations for local functions. */ + +@@ -3311,6 +3312,55 @@ find_pc_line (CORE_ADDR pc, int notcurrent) + return sal; + } + ++/* Compare two symtab_and_line entries. Return true if both have ++ the same line number and the same symtab pointer. That means we ++ are dealing with two entries from the same line and from the same ++ source file. ++ ++ Return false otherwise. */ ++ ++static bool ++sal_line_symtab_matches_p (const symtab_and_line &sal1, ++ const symtab_and_line &sal2) ++{ ++ return sal1.line == sal2.line && sal1.symtab == sal2.symtab; ++} ++ ++/* See symtah.h. */ ++ ++std::optional ++find_line_range_start (CORE_ADDR pc) ++{ ++ struct symtab_and_line current_sal = find_pc_line (pc, 0); ++ ++ if (current_sal.line == 0) ++ return {}; ++ ++ struct symtab_and_line prev_sal = find_pc_line (current_sal.pc - 1, 0); ++ ++ /* If the previous entry is for a different line, that means we are already ++ at the entry with the start PC for this line. */ ++ if (!sal_line_symtab_matches_p (prev_sal, current_sal)) ++ return current_sal.pc; ++ ++ /* Otherwise, keep looking for entries for the same line but with ++ smaller PC's. */ ++ bool done = false; ++ CORE_ADDR prev_pc; ++ while (!done) ++ { ++ prev_pc = prev_sal.pc; ++ ++ prev_sal = find_pc_line (prev_pc - 1, 0); ++ ++ /* Did we notice a line change? If so, we are done searching. */ ++ if (!sal_line_symtab_matches_p (prev_sal, current_sal)) ++ done = true; ++ } ++ ++ return prev_pc; ++} ++ + /* See symtab.h. */ + + struct symtab * +diff --git a/gdb/symtab.h b/gdb/symtab.h +index 365743384e1..e17d15c595b 100644 +--- a/gdb/symtab.h ++++ b/gdb/symtab.h +@@ -38,6 +38,7 @@ + #include "gdb-demangle.h" + #include "split-name.h" + #include "frame.h" ++#include + + /* Opaque declarations. */ + struct ui_file; +@@ -2362,6 +2363,22 @@ extern struct symtab_and_line find_pc_line (CORE_ADDR, int); + extern struct symtab_and_line find_pc_sect_line (CORE_ADDR, + struct obj_section *, int); + ++/* Given PC, and assuming it is part of a range of addresses that is part of ++ a line, go back through the linetable and find the starting PC of that ++ line. ++ ++ For example, suppose we have 3 PC ranges for line X: ++ ++ Line X - [0x0 - 0x8] ++ Line X - [0x8 - 0x10] ++ Line X - [0x10 - 0x18] ++ ++ If we call the function with PC == 0x14, we want to return 0x0, as that is ++ the starting PC of line X, and the ranges are contiguous. ++*/ ++ ++extern std::optional find_line_range_start (CORE_ADDR pc); ++ + /* Wrapper around find_pc_line to just return the symtab. */ + + extern struct symtab *find_pc_line_symtab (CORE_ADDR); +diff --git a/gdb/testsuite/gdb.reverse/map-to-same-line.c b/gdb/testsuite/gdb.reverse/map-to-same-line.c +new file mode 100644 +index 00000000000..3086e849231 +--- /dev/null ++++ b/gdb/testsuite/gdb.reverse/map-to-same-line.c +@@ -0,0 +1,58 @@ ++/* Copyright 2023 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++/* The purpose of this test is to create a DWARF line table that contains two ++ or more entries for the same line. When stepping (forwards or backwards), ++ GDB should step over the entire line and not just a particular entry in ++ the line table. */ ++ ++int ++main (void) ++{ /* TAG: main prologue */ ++ asm ("main_label: .globl main_label"); ++ int i = 1, j = 2, k; ++ float f1 = 2.0, f2 = 4.1, f3; ++ const char *str_1 = "foo", *str_2 = "bar", *str_3; ++ ++ asm ("line1: .globl line1"); ++ k = i; f3 = f1; str_3 = str_1; /* TAG: line 1 */ ++ ++ asm ("line2: .globl line2"); ++ k = j; f3 = f2; str_3 = str_2; /* TAG: line 2 */ ++ ++ asm ("line3: .globl line3"); ++ k = i; f3 = f1; str_3 = str_1; /* TAG: line 3 */ ++ ++ asm ("line4: .globl line4"); ++ k = j; f3 = f2; str_3 = str_2; /* TAG: line 4 */ ++ ++ asm ("line5: .globl line5"); ++ k = i; f3 = f1; str_3 = str_1; /* TAG: line 5 */ ++ ++ asm ("line6: .globl line6"); ++ k = j; f3 = f2; str_3 = str_2; /* TAG: line 6 */ ++ ++ asm ("line7: .globl line7"); ++ k = i; f3 = f1; str_3 = str_1; /* TAG: line 7 */ ++ ++ asm ("line8: .globl line8"); ++ k = j; f3 = f2; str_3 = str_2; /* TAG: line 8 */ ++ ++ asm ("main_return: .globl main_return"); ++ k = j; f3 = f2; str_3 = str_2; /* TAG: main return */ ++ ++ asm ("end_of_sequence: .globl end_of_sequence"); ++ return 0; /* TAG: main return */ ++} +diff --git a/gdb/testsuite/gdb.reverse/map-to-same-line.exp b/gdb/testsuite/gdb.reverse/map-to-same-line.exp +new file mode 100644 +index 00000000000..63f8c9c76b3 +--- /dev/null ++++ b/gdb/testsuite/gdb.reverse/map-to-same-line.exp +@@ -0,0 +1,153 @@ ++# Copyright 2023 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# When stepping (forwards or backwards), GDB should step over the entire line ++# and not just a particular entry in the line table. This test was added to ++# verify the find_line_range_start function properly sets the step range for a ++# line that consists of multiple statements, i.e. multiple entries in the line ++# table. This test creates a DWARF line table that contains two entries for ++# the same line to do the needed testing. ++ ++# This test can only be run on targets which support DWARF-2 and use gas. ++load_lib dwarf.exp ++require dwarf2_support ++ ++# The DWARF assembler requires the gcc compiler. ++require is_c_compiler_gcc ++ ++# This test suitable only for process that can do reverse execution ++require supports_reverse ++ ++standard_testfile .c .S ++ ++if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { ++ return -1 ++} ++ ++set asm_file [standard_output_file $srcfile2] ++Dwarf::assemble $asm_file { ++ global srcdir subdir srcfile ++ declare_labels integer_label L ++ ++ # Find start address and length of program ++ lassign [function_range main [list ${srcdir}/${subdir}/$srcfile]] \ ++ main_start main_len ++ set main_end "$main_start + $main_len" ++ ++ cu {} { ++ compile_unit { ++ {language @DW_LANG_C} ++ {name map-to-same-line.c} ++ {stmt_list $L DW_FORM_sec_offset} ++ {low_pc 0 addr} ++ } { ++ subprogram { ++ {external 1 flag} ++ {name main} ++ {low_pc $main_start addr} ++ {high_pc $main_len DW_FORM_data4} ++ } ++ } ++ } ++ ++ lines {version 2 default_is_stmt 1} L { ++ include_dir "${srcdir}/${subdir}" ++ file_name "$srcfile" 1 ++ ++ # Generate the line table program with distinct source lines being ++ # mapped to the same line entry. Line 1, 5 and 8 contain 1 statement ++ # each. Line 2 contains 2 statements. Line 3 contains 3 statements. ++ program { ++ DW_LNE_set_address $main_start ++ line [gdb_get_line_number "TAG: main prologue"] ++ DW_LNS_copy ++ DW_LNE_set_address line1 ++ line [gdb_get_line_number "TAG: line 1" ] ++ DW_LNS_copy ++ DW_LNE_set_address line2 ++ line [gdb_get_line_number "TAG: line 2" ] ++ DW_LNS_copy ++ DW_LNE_set_address line3 ++ line [gdb_get_line_number "TAG: line 2" ] ++ DW_LNS_copy ++ DW_LNE_set_address line4 ++ line [gdb_get_line_number "TAG: line 3" ] ++ DW_LNS_copy ++ DW_LNE_set_address line5 ++ line [gdb_get_line_number "TAG: line 3" ] ++ DW_LNS_copy ++ DW_LNE_set_address line6 ++ line [gdb_get_line_number "TAG: line 3" ] ++ DW_LNS_copy ++ DW_LNE_set_address line7 ++ line [gdb_get_line_number "TAG: line 5" ] ++ DW_LNS_copy ++ DW_LNE_set_address line8 ++ line [gdb_get_line_number "TAG: line 8" ] ++ DW_LNS_copy ++ DW_LNE_set_address main_return ++ line [gdb_get_line_number "TAG: main return"] ++ DW_LNS_copy ++ DW_LNE_set_address end_of_sequence ++ DW_LNE_end_sequence ++ } ++ } ++} ++ ++if { [prepare_for_testing "failed to prepare" ${testfile} \ ++ [list $srcfile $asm_file] {nodebug} ] } { ++ return -1 ++} ++ ++if { ![runto_main] } { ++ return ++} ++ ++# Print the line table ++gdb_test_multiple "maint info line-table ${testfile}" "" { ++ -re "\r\n$decimal\[ \t\]+$decimal\[ \t\]+($hex)\[ \t\]+Y\[^\r\n\]*" { ++ lappend is_stmt $expect_out(1,string) ++ exp_continue ++ } ++ -re -wrap "" { ++ } ++} ++ ++# Do the reverse-step and reverse-next tests ++foreach_with_prefix cmd {step next} { ++ gdb_test_no_output "record" "turn on process record, test $cmd" ++ ++ set bp_main_return [gdb_get_line_number "TAG: main return" $srcfile] ++ gdb_breakpoint $srcfile:$bp_main_return ++ gdb_continue_to_breakpoint "run to end of main, reverse-$cmd test" ".*$srcfile:$bp_main_return.*" ++ gdb_test "display \$pc" ".*pc =.*" "display pc, reverse-$cmd test" ++ ++ # At this point, GDB has already recorded the execution up until the return ++ # statement. Reverse and test if GDB transitions between lines in the ++ # expected order. It should reverse-step or reverse-next across lines 8, ++ # 5, 3, 2 and 1. ++ foreach line {8 5 3 2 1} { ++ gdb_test "reverse-$cmd" ".*TAG: line $line.*" "reverse $cmd to line $line" ++ } ++ ++ if {$cmd =="step"} { ++ ## Clean restart, test reverse-next command ++ clean_restart ${testfile} ++ ++ if { ![runto_main] } { ++ return ++ } ++ } ++} +-- +2.35.3 + diff --git a/powerpc-fix-test-gdb.ada-finish-large.exp.patch b/powerpc-fix-test-gdb.ada-finish-large.exp.patch new file mode 100644 index 0000000..ef9899b --- /dev/null +++ b/powerpc-fix-test-gdb.ada-finish-large.exp.patch @@ -0,0 +1,49 @@ +From d95be7a5210b69ad879c86d23efaa2cd7dcda94a Mon Sep 17 00:00:00 2001 +From: Carl Love +Date: Mon, 20 Nov 2023 11:13:22 -0500 +Subject: [PATCH] PowerPC: Fix test gdb.ada/finish-large.exp + +Function Create_large returns a large data structure. On PowerPC, register +r3 contains the address of where the data structure to be returned is to +be stored. However, on exit the ABI does not guarantee that r3 has not +been changed. The GDB finish command prints the return value of the +function at the end of the function. GDB needs to use the +DW_TAG_call_site information to determine the value of r3 on entry to +the function to correctly print the return value at the end of the +function. The test must be compiled with -fvar-tracking for the +DW_TAG_call_site information to be included in the executable file. + +This patch adds the -fvar-tracking option to the compile line if the +option is supported. + +The patch fixes the one regression error for the test on PowerPC. + +The patch has been tested on Power 10 and X86-64 with no regressions. +--- + gdb/testsuite/gdb.ada/finish-large.exp | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.ada/finish-large.exp b/gdb/testsuite/gdb.ada/finish-large.exp +index 5661d132a18..6c8b1b2648d 100644 +--- a/gdb/testsuite/gdb.ada/finish-large.exp ++++ b/gdb/testsuite/gdb.ada/finish-large.exp +@@ -19,7 +19,13 @@ require allow_ada_tests + + standard_ada_testfile p + +-if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != ""} { ++set flags {debug} ++ ++if {[have_fvar_tracking]} { ++ lappend flags "additional_flags=-fvar-tracking" ++} ++ ++if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $flags] != ""} { + return -1 + } + + +base-commit: 0397481ff25b76d43b123f3d51828982ceb92834 +-- +2.35.3 + diff --git a/qa-local.sh b/qa-local.sh new file mode 100644 index 0000000..a41d7ea --- /dev/null +++ b/qa-local.sh @@ -0,0 +1,251 @@ +#!/bin/sh + +set -e + +pwd=$(pwd -P) + +root=$pwd/tmp-qa-local +logs=$root/logs +pkgs=$root/pkgs + +configs=" +openSUSE_Leap_15.6 +openSUSE_Leap_15.5 +openSUSE_Factory +openSUSE_Factory_LegacyX86 +SLE-15 +SLE-12 +SLFO +" + +archs="x86_64 i586" + +version=14.2 + +usage () +{ + echo "usage: $0 <1-4>" + echo "1: Cleanup" + echo "2: List configs" + echo "3: Verify quilt setup" + echo "4: Do local builds without testsuite" + echo "5: Do local builds with testsuite" + echo "6: Verify local testsuite results" +} + +if [ $# -eq 0 ]; then + usage + exit 1 +fi + +n="$1" +shift + +extract () +{ + local package + package="$1" + + rpm2cpio "$package" \ + | cpio -idmv \ + > /dev/null \ + 2>&1 +} + +cleanup () +{ + if [ -d $root ]; then + echo "About to remove dir $root" + echo "Press ^C to abort, enter to continue" + read + fi + rm -Rf $root + mkdir -p $root +} + +acquire_sudo_rights () +{ + # Acquire sudo rights. + sudo --validate + + # Keep sudo rights alive. + while true; do + sleep 100 + sudo --validate --non-interactive + kill -0 "$$" 2>/dev/null || exit + done & +} + +have_combo () +{ + arch="$1" + c="$2" + + if [ "$arch" = "i586" ]; then + case " $c " in + " openSUSE_Factory "|" SLFO ") + # Doesn't have i586. + return 1 + ;; + " SLE-11 "|" SLE-12 "|" SLE-15 ") + # SLE-12 and SLE-15 don't have i586. SLE-11 does, but + # we ignore that for now. + return 1 + ;; + esac + fi + if [ "$arch" = "x86_64" ]; then + case " $c " in + " openSUSE_Factory_LegacyX86 ") + # Doesn't have x86_64. + return 1 + ;; + esac + fi + return 0 +} + +case "$n" in + 1) + cleanup + ;; + + 2) + for arch in $archs; do + for c in $configs; do + if ! have_combo $arch $c; then + continue + fi + echo "$c $arch" + done + done + ;; + + 3) + quilt setup -d $root -v gdb.spec + rm -Rf $root/gdb-* + ;; + + 4) + acquire_sudo_rights + + rm -Rf $logs/$n + mkdir -p $logs/$n + + for arch in $archs; do + for c in $configs; do + if ! have_combo $arch $c; then + continue + fi + if osc build \ + --clean \ + --no-verify \ + --trust-all-projects \ + --no-service \ + $c $arch \ + > $logs/$n/LOG.$c.$arch \ + 2>&1; \ + st=$?; then + true + fi + + if [ $st -eq 0 ]; then + echo PASS: $c $arch + else + echo FAIL: $c $arch + fi + + sudo rm -Rf /var/tmp/build-root/$c-$arch + done + done + ;; + + 5) + acquire_sudo_rights + + rm -Rf $logs/$n + mkdir -p $logs/$n + + for arch in $archs; do + for c in $configs; do + if ! have_combo $arch $c; then + continue + fi + mkdir -p $pkgs/$c.$arch + if osc build \ + --clean \ + --no-verify \ + --trust-all-projects \ + --no-service \ + -k $pkgs/$c.$arch \ + $c $arch \ + -M testsuite \ + > $logs/$n/LOG.$c.$arch \ + 2>&1; \ + st=$?; then + true + fi + if [ $st -eq 0 ]; then + ok=true + else + reason="Build failed" + ok=false + fi + + if $ok; then + rpm=gdb-testresults-$version-0.$arch.rpm + if [ -f $pkgs/$c.$arch/$rpm ]; then + ( + cd $pkgs/$c.$arch + extract gdb-testresults-$version-0.$arch.rpm + ) + mv \ + $pkgs/$c.$arch/usr/share/doc/packages/gdb-testresults \ + $pkgs/gdb-testresults.$c.$arch + rm -Rf $pkgs/$c.$arch + else + ok=false + reason="Couldn't find $rpm" + fi + fi + if $ok; then + echo "PASS: $c $arch" + else + echo "FAIL: $c $arch ($reason)" + fi + + sudo rm -Rf /var/tmp/build-root/$c-$arch + done + done + ;; + + 6) + for arch in $archs; do + for c in $configs; do + if ! have_combo $arch $c; then + continue + fi + echo "CONFIG: $c $arch" + case $c in + openSUSE_Factory|openSUSE_Factory_LegacyX86|SLFO) + bash qa.sh -local -$arch -factory $pkgs/gdb-testresults.$c.$arch + ;; + SLE-12) + bash qa.sh -local -$arch -sle12 $pkgs/gdb-testresults.$c.$arch + ;; + SLE-11) + bash qa.sh -local -$arch -sle11 $pkgs/gdb-testresults.$c.$arch + ;; + *) + bash qa.sh -local -$arch $pkgs/gdb-testresults.$c.$arch + ;; + esac + done + done + ;; + + *) + echo "Don't know how to handle arg: $n" + exit 1 + ;; +esac diff --git a/qa-remote.sh b/qa-remote.sh new file mode 100644 index 0000000..f8c612d --- /dev/null +++ b/qa-remote.sh @@ -0,0 +1,163 @@ +#!/bin/sh + +scriptdir=$(cd $(dirname $0); pwd -P) + +pwd=$(pwd -P) + +root=$pwd/tmp-qa-remote +pkgs=$root/pkgs + +usage () +{ + echo "usage: $0 <1-2>" + echo " $0 <3> <1-5>" + echo "1: Cleanup" + echo "2: Get remote testsuite results" + echo "3: Verify remote testsuite result" +} + +if [ $# -eq 0 ]; then + usage + exit 1 +fi + +n="$1" +shift + +extract () +{ + local package + package="$1" + + rpm2cpio "$package" \ + | cpio -idmv \ + > /dev/null \ + 2>&1 +} + +get_item () +{ + c="$1" + arch="$2" + + if [ -d $root/binaries-testsuite.$c.$arch/gdb-testresults ]; then + echo "Already have $c $arch, skipping" + return + fi + + if [ "$c" = "openSUSE_Leap_15.2" ]; then + # Stale config, skip. + return + fi + + echo "Trying $c $arch" + + local dir + dir=$pkgs/$c.$arch + + if [ ! -d $dir ]; then + mkdir -p $dir + fi + + rpm=$(echo $dir/gdb-testresults-*.*.rpm) + rpm=$(for f in $rpm; do echo $f; done | grep -v nosrc) + rpm=$(basename $rpm) + if [ "$rpm" = "" ] || [ ! -f "$rpm" ]; then + echo "Getting rpms" + osc getbinaries -q -M testsuite -d $dir $c $arch + rpm=$(echo $dir/gdb-testresults-*.rpm) + rpm=$(for f in $rpm; do echo $f; done | grep -v nosrc) + rpm=$(basename $rpm) + echo "Got rpm: $rpm" + else + echo "Already have rpm: $rpm" + fi + + if [ ! -d $pkgs/gdb-testresults.$c.$arch ]; then + ( + echo "Extracting rpm: $rpm" + cd $dir + extract $rpm + ) + else + echo "Already extracted rpm: $rpm" + fi + + if [ -d $dir/usr/share/doc/packages/gdb-testresults ]; then + echo "Renaming" + mkdir $root/binaries-testsuite.$c.$arch + mv \ + $dir/usr/share/doc/packages/gdb-testresults \ + $root/binaries-testsuite.$c.$arch/gdb-testresults + fi + + if [ -d $root/binaries-testsuite.$c.$arch/gdb-testresults ]; then + echo "Cleaning up" + rm -Rf $dir + fi +} + +cleanup () +{ + if [ -d $root ]; then + echo "About to remove dir $root" + echo "Press ^C to abort, enter to continue" + read + fi + rm -Rf $root + mkdir -p $root +} + +report_todo () +{ + c="$1" + arch="$2" + status="$3" + + if [ "$c" = "SLE-10_SDK" ]; then + # Stale config. + return + fi + + if [ "$c" = "SLE-11" ]; then + # No longer supported, gdb requires more recent version of MPFR. + return + fi + + echo -e "Todo: $c\t$arch\t$status" +} + +case "$n" in + 1) + cleanup + ;; + + 2) + osc results -M testsuite \ + | grep succeeded \ + | awk '{print $1, $2}' \ + | while read line; do + get_item $line + done + osc results -M testsuite \ + | grep -v succeeded \ + | awk '{print $1, $2, $4}' \ + | while read line; do + report_todo $line + done + ;; + + 3) + m="$1" + shift + ( + cd $root + bash $scriptdir/qa.sh $m + ) + ;; + + *) + echo "Don't know how to handle arg: $n" + exit 1 + ;; +esac diff --git a/qa.sh b/qa.sh new file mode 100644 index 0000000..1e95056 --- /dev/null +++ b/qa.sh @@ -0,0 +1,1118 @@ +#!/bin/bash + +usage () +{ + echo "usage: $0 <1-5>" + echo " $0 -local [ -sle11 | -sle12 | -factory | -i586 | -x86_64 | -aarch64 | -powerpc64le | -s390 | -s390x ] " + echo + echo "Verify remote results at:" + echo " ./binaries-testsuite.distro.arch/gdb-testresults" + echo "1: gdb.sum: Check for 'FAIL: .* internal error' (all configs)" + echo "2: gdb.sum: Check for 'ERROR:' (all configs)" + echo "3: gdb.log: Check for 'internal-error:' (all configs)" + echo "4: gdb.sum: Check FAIL and ERROR (known clean configs)" + echo "5: gdb.sum: Check gdb.suse PASS (all configs)" + echo + echo "Verify local results at:" + echo " \$dir" + echo "-local: gdb.sum: Check FAIL and ERROR" +} + +if [ $# -eq 0 ]; then + usage + exit 1 +fi + +n="$1" +shift + +have_sle11=false +have_sle12=false +have_factory=false +have_aarch64=false +have_arm=false +have_powerpc64le=false +have_s390=false +have_s390x=false +have_i586=false +have_x86_64=false +if [ "$n" = "-local" ]; then + while [ $# -gt 1 ]; do + case $1 in + -sle11) + have_sle11=true + ;; + -sle12) + have_sle12=true + ;; + -factory) + have_factory=true + ;; + -aarch64) + have_aarch64=true + ;; + -arm) + have_arm=true + ;; + -powerpc64le|-ppc64le) + have_powerpc64le=true + ;; + -s390) + have_s390=true + ;; + -s390x) + have_s390x=true + ;; + -i586) + have_i586=true + ;; + -x86_64) + have_x86_64=true + ;; + *) + echo "Don't know how to handle arg: $1" + usage + exit 1 + ;; + esac + shift 1 + done + dir="$1" + shift +fi + +echo_line () +{ + for n in "$@"; do + echo "$n" + done +} + +join () +{ + local char + char="$1" + shift + + local res + res="" + + local first + first=true + for elem in "$@"; do + if $first; then + first=false + else + res+="$char" + fi + res+="$elem" + done + echo "$res" +} + +report_sum () +{ + local sum + sum="$1" + + echo + echo "$sum:" + + if [ ! -f "$sum" ]; then + echo "MISSING" + return + fi + + if false; then + for i in "${kfail[@]}"; do + echo "K$i" + done + fi + + kfail_re=$(join "|" "${kfail[@]}") + echo FAILs: + grep ^FAIL: "$sum" \ + | grep -E -v "$kfail_re" + echo -n "ERROR COUNT: " + grep -c ^ERROR: "$sum" +} + +kfail=( + + # https://sourceware.org/bugzilla/show_bug.cgi?id=26971 + "FAIL: gdb.arch/amd64-init-x87-values.exp: check_x87_regs_around_init: check post FLD1 value of .fop" + "FAIL: gdb.arch/amd64-init-x87-values.exp: check_x87_regs_around_init: check post FLD1 value of .fioff" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=24845 + "FAIL: gdb.base/step-over-syscall.exp: clone: displaced=off: single step over clone" + "FAIL: gdb.base/step-over-syscall.exp: clone: displaced=off: continue to marker \(clone\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=19436#c1 + "FAIL: gdb.cp/no-dmgl-verbose.exp: setting breakpoint at 'f\(std::string\)'" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=25504 + "FAIL: gdb.threads/process-dies-while-detaching.exp: single-process: continue: .*: continue" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=25503 + "FAIL: gdb.threads/signal-while-stepping-over-bp-other-thread.exp: step \(pattern 3\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=26915 + "FAIL: gdb.threads/schedlock.exp: schedlock=off: .*: other threads ran - unlocked" + "FAIL: gdb.threads/watchthreads-threaded.exp: watchpoint on args\[[1-3]\] hit in thread" + "FAIL: gdb.threads/watchthreads-threaded.exp: watch args\[[1-3]\]" + "FAIL: gdb.threads/watchthreads-threaded.exp: threaded watch loop" + "FAIL: gdb.threads/watchthreads-threaded.exp: combination of threaded watchpoints = 30 \+ initial values" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=28479 + "FAIL: gdb.mi/mi-nonstop.exp: wait for thread exit \(timeout\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=26273 + "FAIL: gdb.threads/gcore-stale-thread.exp: save a corefile" + "FAIL: gdb.threads/gcore-stale-thread.exp: exited thread is current due to non-stop" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=28617 + "FAIL: gdb.base/info-os.exp: get process list \(timeout\)" + "FAIL: gdb.base/info-os.exp: get process list" + "FAIL: gdb.base/info-os.exp: get process groups \(timeout\)" + "FAIL: gdb.base/info-os.exp: get threads \(timeout\)" + "FAIL: gdb.base/info-os.exp: get file descriptors \(timeout\)" + "FAIL: gdb.base/info-os.exp: get internet-domain sockets \(timeout\)" + "FAIL: gdb.base/info-os.exp: get shared-memory regions \(timeout\)" + "FAIL: gdb.base/info-os.exp: get semaphores \(timeout\)" + "FAIL: gdb.base/info-os.exp: get message queues \(timeout\)" + "FAIL: gdb.base/info-os.exp: info os unknown_entry \(timeout\)" + "FAIL: gdb.base/info-os.exp: continue \(timeout\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=26284 + # https://sourceware.org/bugzilla/show_bug.cgi?id=28343 + "FAIL: gdb.threads/detach-step-over.exp: .*internal error" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=26363 + "FAIL: gdb.xml/tdesc-reload.exp: .*internal error" + + # If a test-case fails to compile, it's not a GDB FAIL, ignore. + "FAIL: gdb.ada/.*\.exp: compilation .*\.adb" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=27539 + "FAIL: gdb.cp/typeid.exp: before starting: print &typeid\(i\)" + "FAIL: gdb.cp/typeid.exp: before starting: print &typeid\(i\) == &typeid\(typeof\(i\)\)" + "FAIL: gdb.cp/typeid.exp: before starting: print &typeid\(cp\)" + "FAIL: gdb.cp/typeid.exp: before starting: print &typeid\(cp\) == &typeid\(typeof\(cp\)\)" + "FAIL: gdb.cp/typeid.exp: before starting: print &typeid\(ccp\)" + "FAIL: gdb.cp/typeid.exp: before starting: print &typeid\(ccp\) == &typeid\(typeof\(ccp\)\)" + + # Fails for i586. Appearantly, glibc for i586 doesn't use vdso to do + # syscalls. Fedora test-case. + "FAIL: gdb.base/set-solib-absolute-prefix.exp: backtrace with __kernel_vsyscall" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=28504 + "FAIL: gdb.arch/i386-sse.exp: check contents of data\[2\]" + "FAIL: gdb.arch/i386-sse.exp: check contents of data\[3\]" + "FAIL: gdb.arch/i386-sse.exp: check contents of data\[4\]" + "FAIL: gdb.arch/i386-sse.exp: check contents of data\[5\]" + "FAIL: gdb.arch/i386-sse.exp: check contents of data\[6\]" + "FAIL: gdb.arch/i386-sse.exp: check contents of data\[7\]" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse addps" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse addss" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse addsubpd" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse andpd" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse blendps" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse cmppd" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse cmpps" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse cmpss" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse comisd" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse comiss" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse cvtdq2pd" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse cvtpd2dq" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse cvtpd2ps" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse divpd" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse divsd" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse divss" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse mulps" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse mulss" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse orpd" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse orps" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse pabsw" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse packsswb" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse ucomisd" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse ucomiss" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse unpckhpd" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse unpckhps" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse xorpd" + "FAIL: gdb.reverse/i386-sse-reverse.exp: verify xmm2 after reverse xorps" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29419 + # https://sourceware.org/bugzilla/show_bug.cgi?id=29409 + "FAIL: gdb.opt/inline-small-func.exp: info breakpoints" + "FAIL: gdb.ada/access_tagged_param.exp: continue" + "FAIL: gdb.ada/inline-section-gc.exp: break callee.adb:22" + "FAIL: gdb.ada/ptype_tagged_param.exp: ptype s, with debug info" + "FAIL: gdb.ada/ref_param.exp: frame argument value printed" + "FAIL: gdb.reverse/singlejmp-reverse.exp: next to v = 1" + "FAIL: gdb.reverse/singlejmp-reverse.exp: next to f" + "FAIL: gdb.reverse/singlejmp-reverse.exp: next to nodebug" + "FAIL: gdb.reverse/singlejmp-reverse.exp: next to v = 3" + "FAIL: gdb.reverse/singlejmp-reverse.exp: reverse-step" + "FAIL: gdb.reverse/singlejmp-reverse.exp: reverse-next" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=25038 + "FAIL: gdb.reverse/test_ioctl_TCSETSW.exp: handle TCSETSW" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=26873 + "FAIL: gdb.threads/watchthreads-threaded.exp: threaded watch loop \(GDB internal error\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=28617 + "FAIL: gdb.base/info-os.exp: get file descriptors" + "FAIL: gdb.base/info-os.exp: get internet-domain sockets" + "FAIL: gdb.base/info-os.exp: get message queues" + "FAIL: gdb.base/info-os.exp: get process groups" + "FAIL: gdb.base/info-os.exp: get semaphores" + "FAIL: gdb.base/info-os.exp: get shared-memory regions" + "FAIL: gdb.base/info-os.exp: get threads" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=28478 + "FAIL: gdb.gdb/selftest.exp: backtrace through signal handler" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29781 + "FAIL: gdb.mi/mi-multi-commands.exp: args=.*: look for second command output, command length .* \(timeout\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=27027 + # https://sourceware.org/bugzilla/show_bug.cgi?id=28464 + "FAIL: gdb.ada/mi_var_access.exp: Create varobj \(unexpected output\)" + "FAIL: gdb.ada/mi_var_access.exp: update at stop 2 \(unexpected output\)" + + # Fragile test-case, requires glibc to fail in a certain way, ignore. + "FAIL: gdb.base/gdb-rhbz1156192-recursive-dlopen.exp:" + + # GDB fails to print "Thread $x stopped" message for all threads, but + # subsequent info threads shows all threads stopped, and a previous + # info threads show all threads running. Not harmful. + "FAIL: gdb.threads/interrupt-while-step-over.exp: displaced-stepping=off: iter=[0-9]*: wait for stops \(timeout\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29040 + "FAIL: gdb.threads/next-fork-other-thread.exp:" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31810 + "FAIL: gdb.threads/next-fork-exec-other-thread.exp:" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30521 + "FAIL: gdb.base/printcmds.exp: print {unsigned char\[\]}{0xffffffff}" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30528 + # Fixed in 15. Backportable to 14. + "FAIL: gdb.dwarf2/per-bfd-sharing.exp: couldn't remove files in temporary cache dir" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30480 + "FAIL: gdb.ada/info_auto_lang.exp: language_choice=auto: frame=0, frame_lang=c: info functions proc_in_" + "FAIL: gdb.ada/info_auto_lang.exp: language_choice=auto: frame=1, frame_lang=ada: info functions proc_in_" + "FAIL: gdb.ada/info_auto_lang.exp: language_choice=ada: frame=0, frame_lang=c: info functions proc_in_" + "FAIL: gdb.ada/info_auto_lang.exp: language_choice=ada: frame=1, frame_lang=ada: info functions proc_in_" + "FAIL: gdb.ada/info_auto_lang.exp: language_choice=c: frame=0, frame_lang=c: info functions proc_in_" + "FAIL: gdb.ada/info_auto_lang.exp: language_choice=c: frame=1, frame_lang=ada: info functions proc_in_" + "FAIL: gdb.ada/info_exc.exp: info exceptions task" + "FAIL: gdb.ada/info_exc.exp: info exceptions const.aint" + "FAIL: gdb.ada/mi_exc_info.exp: -info-ada-exceptions task \(unexpected output\)" + "FAIL: gdb.ada/mi_exc_info.exp: -info-ada-exceptions const.aint \(unexpected output\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31440 + "FAIL: gdb.python/py-progspace-events.exp: inferior 1 \(timeout\)" + "FAIL: gdb.python/py-progspace-events.exp: step" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31809 + "FAIL: gdb.threads/attach-slow-waitpid.exp: attach to target \(timeout\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31806 + "FAIL: gdb.debuginfod/fetch_src_and_symbols.exp: local_url: file corefile" + "FAIL: gdb.debuginfod/crc_mismatch.exp: local_debuginfod: debuginfod running, info downloaded, no CRC mismatch" + + # Fixed by commit 17f6581c36a ("gdb/testsuite: another attempt to fix + # gdb.threads/thread-specific-bp.exp"). + "FAIL: gdb.threads/thread-specific-bp.exp: non_stop=on: continue to end \(timeout\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31811 + "FAIL: gdb.threads/threads-after-exec.exp:" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29253 + "FAIL: gdb.server/stop-reply-no-thread.exp: to_disable=threads: continue to main \(timeout\)" + "FAIL: gdb.server/stop-reply-no-thread.exp: to_disable=threads: continue until exit \(timeout\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31831 + "FAIL: gdb.dap/log-message.exp: logging output \(checking body category\)" + + + # https://sourceware.org/bugzilla/show_bug.cgi?id=32121 + "FAIL: gdb.arch/i386-disp-step-self-call.exp: check return address was updated correctly" + "FAIL: gdb.arch/amd64-disp-step-self-call.exp: check return address was updated correctly" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=26867 + "FAIL: gdb.threads/signal-sigtrap.exp: sigtrap thread 1: signal SIGTRAP reaches handler" + "FAIL: gdb.threads/signal-command-handle-nopass.exp: step-over (yes|no): signal SIGUSR1" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=32439 + "FAIL: gdb.base/step-over-syscall.exp: (fork|vfork): displaced=on: check_pc_after_cross_syscall: single step over (fork|vfork) final pc" + +) # kfail + +kfail_sle12=( + + # https://sourceware.org/bugzilla/show_bug.cgi?id=26292 + "FAIL: gdb.base/checkpoint-ns.exp: .* \(timeout\)" + "FAIL: gdb.base/checkpoint.exp: .* \(timeout\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29238 + "FAIL: gdb.cp/ambiguous.exp: all vars: print jv" + "FAIL: gdb.cp/ambiguous.exp: all vars: print jva1" + "FAIL: gdb.cp/ambiguous.exp: all vars: print jva1v" + "FAIL: gdb.cp/ambiguous.exp: all vars: print jva2" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=25059 + "FAIL: gdb.cp/subtypes.exp:" + "FAIL: gdb.base/max-depth-c\+\+.exp:" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29240 + "FAIL: gdb.base/align-c.exp: print _Alignof\(double\)" + "FAIL: gdb.base/align-c.exp: print _Alignof\(long long\)" + "FAIL: gdb.base/align-c.exp: print _Alignof\(unsigned long long\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29241 + "FAIL: gdb.guile/scm-type.exp: lang_cpp: test_range: on flexible array member: guile \(print \(type-range \(field-type \(type-field \(value-type \(value-dereference f\)\) \"items\"\)\)\)\)" + "FAIL: gdb.guile/scm-type.exp: lang_cpp: test_range: on flexible array member: guile \(print \(value-subscript \(value-field \(value-dereference f\) \"items\"\) 0\)\)" + "FAIL: gdb.guile/scm-type.exp: lang_cpp: test_range: on flexible array member: guile \(print \(value-subscript \(value-field \(value-dereference f\) \"items\"\) 1\)\)" + + # Cluster of gcc 4.8 ada FAILs, to be investigated, but not high priority. + "FAIL: gdb.ada/info_locals_renaming.exp: info locals" + "FAIL: gdb.ada/interface.exp: info locals" + "FAIL: gdb.ada/length_cond.exp: cond 1 loc'first > 15" + "FAIL: gdb.ada/length_cond.exp: cond 1 loc'last > 15" + "FAIL: gdb.ada/length_cond.exp: cond 1 loc'length > 15" + "FAIL: gdb.ada/null_overload.exp: print f\(r_access'\(null\)\)" + "FAIL: gdb.ada/str_uninit.exp: print my_str" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29244 + "FAIL: gdb.arch/amd64-disp-step-avx.exp: running to main in runto" + "FAIL: gdb.arch/amd64-init-x87-values.exp: check_x87_regs_around_init: runto: run to main" + "FAIL: gdb.arch/amd64-init-x87-values.exp: check_setting_mxcsr_before_enable: runto: run to main" + "FAIL: gdb.arch/amd64-init-x87-values.exp: check_setting_x87_regs_before_enable: runto: run to main" + "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: frame" + "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: starti prompt" + "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: step back into _start \(the program is no longer running\)" + "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: step back into foo \(the program is no longer running\)" + "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: step into bar \(the program is no longer running\)" + "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: step into foo \(the program is no longer running\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=26967 + "FAIL: gdb.base/longjmp.exp: next over call_longjmp \(2\)" + "FAIL: gdb.base/longjmp.exp: next over longjmp\(1\)" + "FAIL: gdb.base/longjmp.exp: next over patt3" + "FAIL: gdb.base/premature-dummy-frame-removal.exp: p some_func \(\)" + "FAIL: gdb.base/premature-dummy-frame-removal.exp: set debug frame on" + "FAIL: gdb.base/longjmp-until-in-main.exp: until \\\$line, in main" + + # Test-cases that use -static but may turn out to be PIE when using + # unix/-fPIE/-fpie. + # https://sourceware.org/bugzilla/show_bug.cgi?id=29244 + "FAIL: gdb.base/break-entry.exp: runto: run to *" + "FAIL: gdb.base/catch-fork-static.exp: run to fork" + "FAIL: gdb.threads/staticthreads.exp: runto: run to main" + "FAIL: gdb.threads/staticthreads.exp: continue to main's call of sem_post" + "FAIL: gdb.threads/staticthreads.exp: handle SIG32 helps" + "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: step back into _start" + "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: step back into foo" + "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: step into bar" + "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: step into foo" + + # Fails on both i586 and s390x/-m31 for SLE-12-SP3, but does not reproduce + # on s390x/-m31 for SLE-12-SP5 with trunk. + "FAIL: gdb.guile/scm-disasm.exp: disassemble via memory port" + "FAIL: gdb.guile/scm-disasm.exp: memory-port: disassemble" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30180 + "FAIL: gdb.fortran/module.exp: print var_d" + "FAIL: gdb.fortran/module.exp: print var_x value 31" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30531 + "FAIL: gdb.threads/clone-thread_db.exp: continue to clone_fn \(the program exited\)" + "FAIL: gdb.threads/clone-thread_db.exp: continue to end \(the program is no longer running\)" + +) # kfail_sle12 + +kfail_sle11=( + + # FAILs for SLE-11 are not very interesting. This is with on old compiler: + # 4.3.4, and tests are likely to be broken. We're really only interested in + # segmentation faults and internal errors. + "FAIL: " + +) + +kfail_factory=( + + # yama ptrace_scope == 1 + # https://sourceware.org/pipermail/gdb-patches/2024-April/208251.html + "FAIL: .*attach.*" + "FAIL: .*detach.*" + "FAIL: gdb.base/gcore-excessive-memory.exp: verify we can get to main" + "FAIL: gdb.base/gcore-excessive-memory.exp: verify we can get to main" + "FAIL: gdb.base/gcore-excessive-memory.exp: Save the core file" + "FAIL: gdb.base/gcorebg.exp: Core file generated by standard gcore" + "FAIL: gdb.threads/check-libthread-db.exp: automated load-time check: libpthread.so fully initialized: check debug libthread-db output \(pattern 1\)" + + # https://sourceware.org/pipermail/gdb-patches/2021-October/182449.html + "FAIL: gdb.threads/current-lwp-dead.exp: continue to breakpoint: fn_return" + + # Similar error message to the one above, see if fixing that one fixes this. + "FAIL: gdb.threads/clone-new-thread-event.exp: catch SIGUSR1" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=28551 + "FAIL: gdb.go/package.exp: going to first breakpoint \\(GDB internal error\\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=28477 + "FAIL: gdb.base/step-over-syscall.exp: clone: displaced=off: continue to marker \(clone\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=28510 + "FAIL: gdb.debuginfod/fetch_src_and_symbols.exp: local_url: br main" + "FAIL: gdb.debuginfod/fetch_src_and_symbols.exp: local_url: l" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=28667 + "FAIL: gdb.reverse/watch-precsave.exp: watchpoint hit, fourth time \\(GDB internal error\\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29196 + "FAIL: gdb.base/gdb11531.exp: watchpoint variable triggers at next" + "FAIL: gdb.base/gdb11531.exp: watchpoint variable triggers at continue" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29706 + "FAIL: gdb.base/eof-exit.exp: with non-dump terminal: with bracketed-paste-mode on: close GDB with eof \(missed the prompt\)" + + # Looks like a problem with modern debug info, where stepping out of a + # function takes more one step. + "FAIL: gdb.base/rtld-step.exp: finish out of foo 1" + "FAIL: gdb.base/rtld-step.exp: next over baz in bar" + "FAIL: gdb.base/rtld-step.exp: step into foo 2" + "FAIL: gdb.base/rtld-step.exp: next over baz in foo" + "FAIL: gdb.base/rtld-step.exp: step out of foo back into bar" + "FAIL: gdb.base/rtld-step.exp: continue until exit" + "FAIL: gdb.base/rtld-step.exp: next over foo 0" + "FAIL: gdb.base/rtld-step.exp: step into bar" + "FAIL: gdb.base/rtld-step.exp: step into foo 1" + + # Sets breakpoints in gdb build with lto. This is known to be slow, and + # likely to cause timeouts. + gdb.gdb/python-helper.exp + + # Should be fixed by commit fe6356def67 ("PowerPC and aarch64: Fix reverse + # stepping failure"), available in gdb 15. + "FAIL: gdb.reverse/solib-precsave.exp: reverse-step into solib function one" + "FAIL: gdb.reverse/solib-precsave.exp: reverse-step within solib function one" + "FAIL: gdb.reverse/solib-precsave.exp: reverse-step back to main one" + "FAIL: gdb.reverse/solib-precsave.exp: reverse-step into solib function two" + "FAIL: gdb.reverse/solib-precsave.exp: reverse-step within solib function two" + "FAIL: gdb.reverse/solib-precsave.exp: reverse-step back to main two" + "FAIL: gdb.reverse/solib-precsave.exp: run until end part two" + "FAIL: gdb.reverse/solib-precsave.exp: reverse-next over solib function one" + "FAIL: gdb.reverse/solib-precsave.exp: reverse-next over solib function two" + "FAIL: gdb.reverse/solib-reverse.exp: reverse-step into solib function one" + "FAIL: gdb.reverse/solib-reverse.exp: reverse-step within solib function one" + "FAIL: gdb.reverse/solib-reverse.exp: reverse-step back to main one" + "FAIL: gdb.reverse/solib-reverse.exp: reverse-step into solib function two" + "FAIL: gdb.reverse/solib-reverse.exp: reverse-step within solib function two" + "FAIL: gdb.reverse/solib-reverse.exp: reverse-step back to main two" + "FAIL: gdb.reverse/solib-reverse.exp: run until end part two" + "FAIL: gdb.reverse/solib-reverse.exp: reverse-next over solib function one" + "FAIL: gdb.reverse/solib-reverse.exp: reverse-next over solib function two" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31564 + "FAIL: gdb.base/rtld-step.exp: runto: run to main" + +) # kfail_factory + +kfail_aarch64=( + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29405 + "FAIL: gdb.base/step-over-syscall.exp: (fork|vfork): displaced=(on|off): pc after stepi matches insn addr after syscall" + "FAIL: gdb.base/step-over-syscall.exp: (fork|vfork): displaced=(on|off): check_pc_after_cross_syscall: single step over fork final pc" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29423 + "FAIL: gdb.base/watchpoint-unaligned.exp: continue \(timeout\)" + "FAIL: gdb.base/watchpoint-unaligned.exp: size8twice write" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31214 + "FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q\.e: 0->5: continue" + "FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q\.a: 1->0: print expression before" + "FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q\.a: 1->0: continue \(the program exited\)" + "FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q\.e: 5->4: print expression before" + "FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q\.e: 5->4: continue \(the program is no longer running\)" + "FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: q\.e: 5->4: print expression after" + "FAIL: gdb.base/watch-bitfields.exp: -location watch against bitfields: continue until exit \(the program is no longer running\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=28561 + # "[gdb/testsuite] Error due to not reading \r\n at end of mi prompt" + # We match pretty aggressively here. + "FAIL: gdb.mi/.*.exp:" + "FAIL: gdb.python/.*-mi.exp:" + "FAIL: gdb.python/py-mi-.*.exp:" + "FAIL: gdb.ada/mi.*.exp:" + "FAIL: gdb.base/annota.*.exp:" + "FAIL: gdb.dwarf2/dw2-opt-structptr.exp: mi" + "FAIL: gdb.trace/mi-.*.exp:" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31826 + "FAIL: gdb.arch/aarch64-unwind-pc.exp:" + +) # kfail_aarch64 + +kfail_powerpc64le=( + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29792 + "FAIL: gdb.opt/solib-intra-step.exp: second-hit" + + # Known to run into timeouts. + "FAIL: gdb.gdb/python-helper.exp" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30548 + "FAIL: gdb.base/inline-frame-cycle-unwind.exp: cycle at level [0-9]*: backtrace when the unwind is broken at frame [0-9]*" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29815 + "FAIL: gdb.reverse/finish-reverse-bkpt.exp: reverse-finish from void_func trips breakpoint at entry" + "FAIL: gdb.reverse/finish-reverse-bkpt.exp: no spurious proceed after breakpoint stop" + "FAIL: gdb.reverse/next-reverse-bkpt-over-sr.exp: reverse-next over call trips user breakpoint at function entry" + "FAIL: gdb.reverse/next-reverse-bkpt-over-sr.exp: stopped at the right callee call" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29897 + "FAIL: gdb.base/run-control-while-bg-execution.exp: action1=.*: action2=start: start \(GDB internal error\)" + "FAIL: gdb.base/run-control-while-bg-execution.exp: action1=.*: action2=run: run \(GDB internal error\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30021 + "FAIL: gdb.base/unwind-on-each-insn.exp: instruction 6: \\\$fba_value == \\\$main_fba" + "FAIL: gdb.base/unwind-on-each-insn.exp: instruction 6: \[string equal \\\$fid \\\$main_fid\]" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30542 + "FAIL: gdb.base/watch-before-fork.exp: test: continue to catch fork" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30543 + "FAIL: gdb.python/py-send-packet.exp: call python run_auxv_send_packet_test function" + + # Cluster of fails related to hw watchpoint support. + "FAIL: gdb.ada/scoped_watch.exp:" + "FAIL: gdb.ada/task_watch.exp:" + "FAIL: gdb.ada/watch_minus_l.exp:" + "FAIL: gdb.base/watch-before-fork.exp:" + "FAIL: gdb.base/watch-bitfields.exp:" + "FAIL: gdb.base/watch-cond.exp:" + "FAIL: gdb.base/watch-cond-infcall.exp:" + "FAIL: gdb.base/watchpoint-during-step.exp:" + "FAIL: gdb.base/watchpoint.exp:" + "FAIL: gdb.base/watchpoint-hw-attach.exp:" + "FAIL: gdb.base/watchpoint-hw-hit-once.exp:" + "FAIL: gdb.base/watchpoints.exp:" + "FAIL: gdb.base/watchpoint-solib.exp:" + "FAIL: gdb.base/watchpoint-stops-at-right-insn.exp:" + "FAIL: gdb.base/watchpoint-unaligned.exp:" + "FAIL: gdb.base/watch-read.exp:" + "FAIL: gdb.base/watch_thread_num.exp:" + "FAIL: gdb.base/watch-vfork.exp:" + "FAIL: gdb.cp/watch-cp.exp:" + "FAIL: gdb.mi/mi-watch.exp:" + "FAIL: gdb.threads/step-over-trips-on-watchpoint.exp:" + "FAIL: gdb.threads/watchpoint-fork.exp:" + "FAIL: gdb.threads/watchthreads2.exp:" + "FAIL: gdb.threads/wp-replication.exp:" + "FAIL: gdb.base/display.exp:" + "FAIL: gdb.base/recurse.exp:" + "FAIL: gdb.base/gdb11531.exp:" + "FAIL: gdb.base/pr11022.exp:" + "FAIL: gdb.base/value-double-free.exp: continue \(the program exited\)" + "FAIL: gdb.base/value-double-free.exp: print empty\(\)" + "FAIL: gdb.cp/annota2.exp: watch triggered on a.x \(timeout\)" + "FAIL: gdb.cp/annota2.exp: annotate-quit" + "FAIL: gdb.cp/annota3.exp: watch triggered on a.x \(timeout\)" + "FAIL: gdb.cp/annota3.exp: annotate-quit \(pattern 1\)" + "FAIL: gdb.mi/pr11022.exp:" + "FAIL: gdb.python/py-breakpoint.exp: test_watchpoints: Test watchpoint write \(the program exited\)" + "FAIL: gdb.python/py-breakpoint.exp: test_bkpt_internal: Test watchpoint write \(the program exited\)" + "FAIL: gdb.python/py-breakpoint.exp: test_bkpt_eval_funcs: Test watchpoint write \(the program exited\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31004 + "FAIL: gdb.base/run-control-while-bg-execution.exp: action1=.*: action2=run: run" + "FAIL: gdb.base/run-control-while-bg-execution.exp: action1=.*: action2=start: start" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31823 + "FAIL: gdb.base/nodebug.exp: p/c \(int\) array_index\(\"abcdef\",2\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31825 + "FAIL: gdb.base/break-interp.exp: ldprelink=NO: ldsepdebug=NO: binprelink=NO: binsepdebug=NO: binpie=YES: INNER: reach-\(_dl_debug_state|dl_main\)-2: reach" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31827 + "FAIL: gdb.base/gnu_vector.exp: call add_structvecs" + + # GLIBC problem with prctl on ppc64le. Fixed in 2.40. + # https://sourceware.org/bugzilla/show_bug.cgi?id=29770 + # https://bugzilla.suse.com/show_bug.cgi?id=1234665 + "FAIL: gdb.ada/tasks.exp: info threads" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31229 + "FAIL: gdb.linespec/explicit.exp: complete after -qualified -source: cmd complete .b -qualified -source thr." + "FAIL: gdb.linespec/explicit.exp: complete after -qualified -source: tab complete .b -qualified -source thr." + "FAIL: gdb.linespec/explicit.exp: complete after -source: cmd complete .b -source thr." + "FAIL: gdb.linespec/explicit.exp: complete after -source: tab complete .b -source thr." +) + +kfail_powerpc64le_sle12=( + + "FAIL: gdb.guile/scm-breakpoint.exp:.*" + # Cluster of fails related to hw watchpoint support. + "FAIL: gdb.guile/scm-breakpoint.exp: test_bkpt_eval_funcs: test watchpoint write \(the program exited\)" + "FAIL: gdb.guile/scm-breakpoint.exp: test_bkpt_internal: test invisible watchpoint write \(the program exited\)" + "FAIL: gdb.guile/scm-breakpoint.exp: test_watchpoints: test watchpoint write \(the program exited\)" + +) + +kfail_s390x_s390=( + +) + +# Plain s390 or s390x/-m31. +kfail_s390=( + + "${kfail_s390x_s390[@]}" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29841 + "FAIL: gdb.reverse/.*.exp:" + + # Doesn't reproduce with trunk on SLE-12SP5. + "FAIL: gdb.guile/scm-ports.exp: buffered: test byte at sp, before flush" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29867 + "FAIL: gdb.guile/scm-lazy-string.exp: ptr: lazy string length 2 value" + "FAIL: gdb.guile/scm-lazy-string.exp: ptr: lazy string value" + "FAIL: gdb.guile/scm-lazy-string.exp: ptr: print ptr" + "FAIL: gdb.base/sym-file.exp: add-symbol-file sym-file-lib.so addr" + "FAIL: gdb.base/sym-file.exp: continue to breakpoint: gdb_add_symbol_file" + "FAIL: gdb.python/py-lazy-string.exp: ptr: lazy string length 2 value" + "FAIL: gdb.python/py-lazy-string.exp: ptr: lazy string value" + "FAIL: gdb.python/py-lazy-string.exp: ptr: print ptr" + "FAIL: gdb.python/py-nested-maps.exp: headers=on: pretty=off: exp='\*mm': depth=1: p \*mm" + "FAIL: gdb.python/py-nested-maps.exp: headers=on: pretty=off: exp='\*mm': depth=2: p \*mm" + "FAIL: gdb.python/py-nested-maps.exp: headers=on: pretty=off: exp='\*mm': depth=3: p \*mm" + "FAIL: gdb.python/py-nested-maps.exp: headers=on: pretty=off: exp='\*mm': depth=unlimited: p \*mm" + "FAIL: gdb.python/py-nested-maps.exp: pretty=off: exp='\*mm': depth=1: p \*mm" + "FAIL: gdb.python/py-nested-maps.exp: pretty=off: exp='\*mm': depth=2: p \*mm" + "FAIL: gdb.python/py-nested-maps.exp: pretty=off: exp='\*mm': depth=3: p \*mm" + "FAIL: gdb.python/py-nested-maps.exp: pretty=off: exp='\*mm': depth=unlimited: p \*mm" + "FAIL: gdb.python/py-nested-maps.exp: pretty=on: exp='\*mm': depth=1: p \*mm" + "FAIL: gdb.python/py-nested-maps.exp: pretty=on: exp='\*mm': depth=2: p \*mm" + "FAIL: gdb.python/py-nested-maps.exp: pretty=on: exp='\*mm': depth=3: p \*mm" + "FAIL: gdb.python/py-nested-maps.exp: pretty=on: exp='\*mm': depth=unlimited: p \*mm" + "FAIL: gdb.base/info-shared.exp:" + "FAIL: gdb.python/py-strfns.exp: p /d {char\[4\]} arg" + "FAIL: gdb.python/py-strfns.exp: p arg" + +) + +# s390x/-m64. +kfail_s390x=( + + "${kfail_s390x_s390[@]}" + +) + +kfail_i586=( + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30519 + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test default value" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test default value via gdb.parameter" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: {test set to -1}" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test value of -1" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test value of -1 via gdb.parameter" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test set to 1" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test value of 1" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test value of 1 via gdb.parameter" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: {test set to -5}" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test value of -5 via gdb.parameter" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test set to 5" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test value of 5 via gdb.parameter" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: {test set to None}" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test value of None" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test value of None via gdb.parameter" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test set to 0" + "FAIL: gdb.python/py-parameter.exp: test_integer_parameter: kind=PARAM_UINTEGER: test value of 0 via gdb.parameter" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=32407 + "FAIL: gdb.base/valgrind-bt.exp:" + "FAIL: gdb.base/valgrind-disp-step.exp:" + "FAIL: gdb.base/valgrind-infcall-2.exp:" + "FAIL: gdb.base/valgrind-infcall.exp:" +) + +kfail_arm=( + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30537 + "FAIL: gdb.fortran/intrinsics.exp: p cmplx \(4,4,16\) \(GDB internal error\)" + "FAIL: gdb.fortran/intrinsics.exp: ptype cmplx \(4,4,16\) \(GDB internal error\)" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31061 + "FAIL: gdb.base/gdb-sigterm.exp: .*internal error" + +) + +case $n in + 1) + # 'FAIL: .* internal error' in gdb.sum. + # Test fail due to internal error. + # + # Todo: apply kfail_factory/kfail_sle12 only when appropriate. + kfail+=("${kfail_factory[@]}") + kfail+=("${kfail_sle12[@]}") + kfail+=("${kfail_sle11[@]}") + kfail+=("${kfail_s390[@]}") + kfail+=("${kfail_powerpc64le[@]}") + kfail+=("${kfail_arm[@]}") + kfail+=("${kfail_aarch64[@]}") + kfail_re=$(join "|" "${kfail[@]}") + grep "^FAIL:.*internal error" binaries-testsuite*/gdb-testresults/*.sum \ + | grep -E -v "$kfail_re" + ;; + + 2) + # 'ERROR:' in gdb.sum. + # A dejagnu or tcl ERROR, may hide real problems. + # + kfail+=( + # https://sourceware.org/bugzilla/show_bug.cgi?id=28323 + "SLE-12.x86_64.*gdb.ada/mi_dyn_arr.exp" + + # Gdb runs out of virtual memory, we can expect an internal error. + "UNRESOLVED: gdb.base/gcore-excessive-memory.exp: attach" + "UNRESOLVED: gdb.base/gcore-excessive-memory.exp: verify we can get to main" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31001 + "UNRESOLVED: gdb.threads/async.exp: thread 1: current thread is 1" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31648 + "SLE-11.*UNRESOLVED: gdb.ada/tick_length_array_enum_idx.exp: print vars'length" + + # yama ptrace_scope == 1 + # https://sourceware.org/pipermail/gdb-patches/2024-April/208251.html + "(Factory|SLFO).*UNRESOLVED: gdb.base/gstack.exp: spawn gstack" + "(Factory|SLFO).*UNRESOLVED: gdb.multi/multi-term-settings.exp: inf1_how=run: inf2_how=attach: inf2: flush inferior output" + "(Factory|SLFO).*UNRESOLVED: gdb.multi/multi-term-settings.exp: inf1_how=attach: inf2_how=run: inf1: flush inferior output" + "(Factory|SLFO).*UNRESOLVED: gdb.multi/multi-term-settings.exp: inf1_how=attach: inf2_how=attach: inf2: flush inferior output" + "(Factory|SLFO).*UNRESOLVED: gdb.multi/multi-term-settings.exp: inf1_how=attach: inf2_how=run: continue" + "(Factory|SLFO).*UNRESOLVED: gdb.multi/multi-term-settings.exp: inf1_how=attach: inf2_how=run: continue" + "(Factory|SLFO).*UNRESOLVED: gdb.multi/multi-term-settings.exp: inf1_how=run: inf2_how=attach: continue" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31671 + "SLE-11.*UNRESOLVED: gdb.objc/basicclass.exp: call an Objective-C method with no arguments" + ) + + kfail_re=$(join "|" "${kfail[@]}") + grep -A1 "ERROR:.*no longer" binaries-testsuite*/gdb-testresults/*.sum \ + | grep -E -v "ERROR|\--" | grep -E -v "$kfail_re" + ;; + + 3) + # 'internal-error' in gdb.log + # Catch all internal-errors, not just the ones reported by dejagnu. + # + kfail+=( + # https://sourceware.org/bugzilla/show_bug.cgi?id=26284 + "infrun.c:[0-9]*: internal-error: finish_step_over: Assertion \`ecs->event_thread->control.trap_expected' failed." + # https://sourceware.org/bugzilla/show_bug.cgi?id=26363 + ".i586.*i386-linux-nat.c:[0-9]*: internal-error: Got request for bad register number [0-9]*." + + # https://sourceware.org/bugzilla/show_bug.cgi?id=19675 + # PR is fixed in gdb-15. + "linux-nat.c:[0-9]*: internal-error: wait returned unexpected status" + "linux-nat.c:[0-9]*: internal-error: wait returned unexpected PID" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=28553 + "infrun.c:[0-9]*: internal-error: thread .* needs a step-over, but not in step-over queue" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=28604 + "x86-linux-dregs.c:[0-9]*: internal-error: void x86_linux_update_debug_registers\(lwp_info\*\): Assertion \`lwp_is_stopped \(lwp\)' failed." + + # https://sourceware.org/bugzilla/show_bug.cgi?id=28667 + "record-full.c:[0-9]*: internal-error: ptid_t record_full_wait_1\(target_ops\*, ptid_t, target_waitstatus\*, target_wait_flags\): Assertion \`\(options & TARGET_WNOHANG\) != 0' failed." + + # https://sourceware.org/bugzilla/show_bug.cgi?id=26873 + "infrun.c:[0-9]*: internal-error: resume_1: Assertion \`!\(thread_has_single_step_breakpoints_set \(tp\) && step\)' failed." + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29783 + "frame.c:[0-9]*: internal-error: get_selected_frame: Assertion \`selected_frame != NULL' failed." + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29841 + "regcache.c:[0-9]*: internal-error: raw_read: Assertion \`buf != NULL' failed." + + # https://sourceware.org/bugzilla/show_bug.cgi?id=29897 + "displaced-stepping.c:[0-9]*: internal-error: prepare: Assertion \`buf.current_thread != thread' failed." + + # https://sourceware.org/bugzilla/show_bug.cgi?id=30537 + "f-lang.c:[0-9]*: internal-error: eval_op_f_cmplx: Assertion \`kind_arg->code \(\) == TYPE_CODE_COMPLEX' failed." + + # Test-case gdb.base/gcore-excessive-memory.exp. + "utils.c:[0-9]*: internal-error: virtual memory exhausted: can't allocate [0-9]* bytes." + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31061 + "intrusive_list.h:[0-9]*: internal-error: erase_element: Assertion \`elem_node->prev != INTRUSIVE_LIST_UNLINKED_VALUE' failed\." + + # Assumed to be variant of + # https://sourceware.org/bugzilla/show_bug.cgi?id=32446 + "linux-nat.c:[0-9]*: internal-error: mark_lwp_dead: Assertion .lp->status == 0. failed\." + + ) + + kfail_re=$(join "|" "${kfail[@]}") + grep -a -H internal-error: binaries-testsuite.*/gdb-testresults/*.log \ + | grep -a -v "maint.c:[0-9]" \ + | grep -a -E -v "$kfail_re" + ;; + + 4) + for id in SLE-12 \ + SLE-15 \ + SLFO \ + openSUSE_Leap_15.5 \ + openSUSE_Leap_15.6 \ + openSUSE_Factory; \ + do + for arch in x86_64 \ + i586 \ + aarch64 \ + ppc64le \ + s390x; \ + do + + config=$id.$arch + case $config in + SLE-15.i586|SLE-12.i586|SLFO.i586) + # No such config. + continue + ;; + SLFO.ppc64le|openSUSE_Factory.ppc64le|*.s390x) + # Not cleaned up yet. + continue + ;; + esac + + id2=$id + case $id in + openSUSE_Factory) + case $arch in + s390x) + id2=openSUSE_Factory_zSystems + ;; + ppc64le) + id2=openSUSE_Factory_PPC + ;; + i586) + id2=openSUSE_Factory_LegacyX86 + ;; + armv7l|aarch64) + id2=openSUSE_Factory_ARM + ;; + esac + esac + config=$id2.$arch + + config="$config/gdb-testresults" + + sums=() + case $arch in + x86_64) + case $id in + SLE-12|SLFO) + sums=("$config/gdb-$arch-suse-linux-m64.-fPIE.-pie.sum" + "$config/gdb-$arch-suse-linux-m64.sum" + "$config/gdb-$arch-suse-linux-m32.-fPIE.-pie.sum" + "$config/gdb-$arch-suse-linux-m32.sum") + ;; + *) + sums=("$config/gdb-$arch-suse-linux-m64.-fno-PIE.-no-pie.sum" + "$config/gdb-$arch-suse-linux-m64.sum" + "$config/gdb-$arch-suse-linux-m32.-fno-PIE.-no-pie.sum" + "$config/gdb-$arch-suse-linux-m32.sum") + ;; + esac + ;; + i586) + sums=("$config/gdb-$arch-suse-linux-m32.-fno-PIE.-no-pie.sum" + "$config/gdb-$arch-suse-linux-m32.sum") + ;; + aarch64) + case $id in + SLE-12|SLFO) + sums=("$config/gdb-$arch-suse-linux.-fPIE.-pie.sum" + "$config/gdb-$arch-suse-linux.sum") + ;; + *) + sums=("$config/gdb-$arch-suse-linux.-fno-PIE.-no-pie.sum" + "$config/gdb-$arch-suse-linux.sum") + ;; + esac + ;; + ppc64le|s390x) + case $id in + SLE-12|SLFO) + sums=("$config/gdb-$arch-suse-linux-m64.-fPIE.-pie.sum" + "$config/gdb-$arch-suse-linux-m64.sum") + ;; + *) + sums=("$config/gdb-$arch-suse-linux-m64.-fno-PIE.-no-pie.sum" + "$config/gdb-$arch-suse-linux-m64.sum") + ;; + esac + ;; + *) + echo "Don't know how to handle: $arch" + exit 1 + ;; + esac + + ( + case $arch in + i586) + kfail+=("${kfail_i586[@]}") + ;; + aarch64) + kfail+=("${kfail_aarch64[@]}") + ;; + ppc64le) + kfail+=("${kfail_powerpc64le[@]}") + ;; + *) + ;; + esac + + case $id in + SLE-12) + kfail+=("${kfail_sle12[@]}") + ;; + SLFO|openSUSE_Factory) + kfail+=("${kfail_factory[@]}") + ;; + *) + ;; + esac + + case $id.$arch in + SLE-12.ppc64le) + kfail+=("${kfail_powerpc64le_sle12[@]}") + ;; + esac + + for sum in "${sums[@]}"; do + sum=binaries-testsuite.$sum + report_sum "$sum" + done + ) + done + done + + ( + # Known cleanish config: Factory x86_64. + config=openSUSE_Factory.x86_64/gdb-testresults + sums=("$config/gdb-x86_64-suse-linux-m64.-fno-PIE.-no-pie.sum" + "$config/gdb-x86_64-suse-linux-m64.sum" + "$config/gdb-x86_64-suse-linux-m32.-fno-PIE.-no-pie.sum" + "$config/gdb-x86_64-suse-linux-m32.sum") + + kfail+=("${kfail_factory[@]}") + + for sum in "${sums[@]}"; do + sum=binaries-testsuite.$sum + report_sum "$sum" + done + ) + + ( + # Known clean config: Factory i586. + config=openSUSE_Factory_LegacyX86.i586/gdb-testresults + sums=("$config/gdb-i586-suse-linux-m32.-fno-PIE.-no-pie.sum" + "$config/gdb-i586-suse-linux-m32.sum") + + kfail+=("${kfail_factory[@]}") + kfail+=("${kfail_i586[@]}") + + for sum in "${sums[@]}"; do + sum=binaries-testsuite.$sum + report_sum "$sum" + done + ) + + ;; + + 5) + librpm=$(ls -1 binaries-testsuite*/gdb-testresults/*.sum \ + | grep -v SLE-11) + nolibrpm=$(ls -1 binaries-testsuite*/gdb-testresults/*.sum \ + | grep SLE-11) + if [ "$librpm" != "" ]; then + grep -c "PASS: gdb.suse/zypper-hint.exp: zypper hint printed (librpm)" \ + $librpm \ + | grep -E -v ":1" + fi + if [ "$nolibrpm" != "" ]; then + grep -c "PASS: gdb.suse/zypper-hint.exp: zypper hint printed (no librpm)" \ + $nolibrpm \ + | grep -E -v ":1" + fi + ;; + + -local) + sums=() + for f in "$dir"/*.sum; do + mapfile -t < <(echo_line "$f") + sums+=("${MAPFILE[@]}") + done + + if [ ${#sums[@]} -ne 4 ] && [ ${#sums[@]} -ne 2 ]; then + echo "No summary files to check" + exit 1 + fi + + + if $have_factory; then + kfail+=("${kfail_factory[@]}") + fi + if $have_sle11; then + kfail+=("${kfail_sle11[@]}") + fi + if $have_sle12; then + kfail+=("${kfail_sle12[@]}") + fi + if $have_aarch64; then + kfail+=("${kfail_aarch64[@]}") + fi + if $have_arm; then + kfail+=("${kfail_arm[@]}") + fi + if $have_powerpc64le; then + kfail+=("${kfail_powerpc64le[@]}") + fi + if $have_powerpc64le && $have_sle12; then + kfail+=("${kfail_powerpc64le_sle12[@]}") + fi + if $have_s390; then + kfail+=("${kfail_s390[@]}") + fi + if $have_s390x; then + kfail+=("${kfail_s390x[@]}") + fi + if $have_i586; then + kfail+=("${kfail_i586[@]}") + fi + if $have_x86_64; then + kfail+=("${kfail_x86_64[@]}") + fi + + for sum in "${sums[@]}"; do + report_sum "$sum" + done + ;; + + *) + echo "Don't know how to handle arg: $n" + exit 1 + ;; +esac + +true diff --git a/riscv-lrsc.patch b/riscv-lrsc.patch new file mode 100644 index 0000000..83ea87c --- /dev/null +++ b/riscv-lrsc.patch @@ -0,0 +1,380 @@ +From b273287f4e7f111c1bb667267c6bde4fdd8418c7 Mon Sep 17 00:00:00 2001 +From: Yang Liu +Date: Sun, 14 Jan 2024 01:20:59 +0800 +Subject: [PATCH] gdb: RISC-V: Refine lr/sc sequence support + +Per RISC-V spec, the lr/sc sequence can consist of up to 16 instructions, and we +cannot insert breakpoints in the middle of this sequence. Before this, we only +detected a specific pattern (the most common one). This patch improves this part +and now supports more complex pattern detection. + +Signed-off-by: Yang Liu +Approved-By: Andrew Burgess +Reviewed-by: Palmer Dabbelt +--- + gdb/riscv-tdep.c | 290 ++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 251 insertions(+), 39 deletions(-) + +diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c +index 55d21cc4ac5..9a7cfa35afd 100644 +--- a/gdb/riscv-tdep.c ++++ b/gdb/riscv-tdep.c +@@ -1578,8 +1578,34 @@ class riscv_insn + BLTU, + BGEU, + /* These are needed for stepping over atomic sequences. */ +- LR, +- SC, ++ SLTI, ++ SLTIU, ++ XORI, ++ ORI, ++ ANDI, ++ SLLI, ++ SLLIW, ++ SRLI, ++ SRLIW, ++ SRAI, ++ SRAIW, ++ SUB, ++ SUBW, ++ SLL, ++ SLLW, ++ SLT, ++ SLTU, ++ XOR, ++ SRL, ++ SRLW, ++ SRA, ++ SRAW, ++ OR, ++ AND, ++ LR_W, ++ LR_D, ++ SC_W, ++ SC_D, + /* This instruction is used to do a syscall. */ + ECALL, + +@@ -1768,6 +1794,13 @@ class riscv_insn + m_imm.s = EXTRACT_CBTYPE_IMM (ival); + } + ++ void decode_ca_type_insn (enum opcode opcode, ULONGEST ival) ++ { ++ m_opcode = opcode; ++ m_rs1 = decode_register_index_short (ival, OP_SH_CRS1S); ++ m_rs2 = decode_register_index_short (ival, OP_SH_CRS2S); ++ } ++ + /* Fetch instruction from target memory at ADDR, return the content of + the instruction, and update LEN with the instruction length. */ + static ULONGEST fetch_instruction (struct gdbarch *gdbarch, +@@ -1882,14 +1915,62 @@ riscv_insn::decode (struct gdbarch *gdbarch, CORE_ADDR pc) + decode_b_type_insn (BLTU, ival); + else if (is_bgeu_insn (ival)) + decode_b_type_insn (BGEU, ival); ++ else if (is_slti_insn(ival)) ++ decode_i_type_insn (SLTI, ival); ++ else if (is_sltiu_insn(ival)) ++ decode_i_type_insn (SLTIU, ival); ++ else if (is_xori_insn(ival)) ++ decode_i_type_insn (XORI, ival); ++ else if (is_ori_insn(ival)) ++ decode_i_type_insn (ORI, ival); ++ else if (is_andi_insn(ival)) ++ decode_i_type_insn (ANDI, ival); ++ else if (is_slli_insn(ival)) ++ decode_i_type_insn (SLLI, ival); ++ else if (is_slliw_insn(ival)) ++ decode_i_type_insn (SLLIW, ival); ++ else if (is_srli_insn(ival)) ++ decode_i_type_insn (SRLI, ival); ++ else if (is_srliw_insn(ival)) ++ decode_i_type_insn (SRLIW, ival); ++ else if (is_srai_insn(ival)) ++ decode_i_type_insn (SRAI, ival); ++ else if (is_sraiw_insn(ival)) ++ decode_i_type_insn (SRAIW, ival); ++ else if (is_sub_insn(ival)) ++ decode_r_type_insn (SUB, ival); ++ else if (is_subw_insn(ival)) ++ decode_r_type_insn (SUBW, ival); ++ else if (is_sll_insn(ival)) ++ decode_r_type_insn (SLL, ival); ++ else if (is_sllw_insn(ival)) ++ decode_r_type_insn (SLLW, ival); ++ else if (is_slt_insn(ival)) ++ decode_r_type_insn (SLT, ival); ++ else if (is_sltu_insn(ival)) ++ decode_r_type_insn (SLTU, ival); ++ else if (is_xor_insn(ival)) ++ decode_r_type_insn (XOR, ival); ++ else if (is_srl_insn(ival)) ++ decode_r_type_insn (SRL, ival); ++ else if (is_srlw_insn(ival)) ++ decode_r_type_insn (SRLW, ival); ++ else if (is_sra_insn(ival)) ++ decode_r_type_insn (SRA, ival); ++ else if (is_sraw_insn(ival)) ++ decode_r_type_insn (SRAW, ival); ++ else if (is_or_insn(ival)) ++ decode_r_type_insn (OR, ival); ++ else if (is_and_insn(ival)) ++ decode_r_type_insn (AND, ival); + else if (is_lr_w_insn (ival)) +- decode_r_type_insn (LR, ival); ++ decode_r_type_insn (LR_W, ival); + else if (is_lr_d_insn (ival)) +- decode_r_type_insn (LR, ival); ++ decode_r_type_insn (LR_D, ival); + else if (is_sc_w_insn (ival)) +- decode_r_type_insn (SC, ival); ++ decode_r_type_insn (SC_W, ival); + else if (is_sc_d_insn (ival)) +- decode_r_type_insn (SC, ival); ++ decode_r_type_insn (SC_D, ival); + else if (is_ecall_insn (ival)) + decode_i_type_insn (ECALL, ival); + else if (is_ld_insn (ival)) +@@ -1944,6 +2025,24 @@ riscv_insn::decode (struct gdbarch *gdbarch, CORE_ADDR pc) + m_rd = decode_register_index (ival, OP_SH_CRS1S); + m_imm.s = EXTRACT_CITYPE_LUI_IMM (ival); + } ++ else if (is_c_srli_insn (ival)) ++ decode_cb_type_insn (SRLI, ival); ++ else if (is_c_srai_insn (ival)) ++ decode_cb_type_insn (SRAI, ival); ++ else if (is_c_andi_insn (ival)) ++ decode_cb_type_insn (ANDI, ival); ++ else if (is_c_sub_insn (ival)) ++ decode_ca_type_insn (SUB, ival); ++ else if (is_c_xor_insn (ival)) ++ decode_ca_type_insn (XOR, ival); ++ else if (is_c_or_insn (ival)) ++ decode_ca_type_insn (OR, ival); ++ else if (is_c_and_insn (ival)) ++ decode_ca_type_insn (AND, ival); ++ else if (is_c_subw_insn (ival)) ++ decode_ca_type_insn (SUBW, ival); ++ else if (is_c_addw_insn (ival)) ++ decode_ca_type_insn (ADDW, ival); + else if (is_c_li_insn (ival)) + decode_ci_type_insn (LI, ival); + /* C_SD and C_FSW have the same opcode. C_SD is RV64 and RV128 only, +@@ -4405,51 +4504,164 @@ riscv_next_pc (struct regcache *regcache, CORE_ADDR pc) + return next_pc; + } + ++/* Return true if INSN is not a control transfer instruction and is allowed to ++ appear in the middle of the lr/sc sequence. */ ++ ++static bool ++riscv_insn_is_non_cti_and_allowed_in_atomic_sequence ++ (const struct riscv_insn &insn) ++{ ++ switch (insn.opcode ()) ++ { ++ case riscv_insn::LUI: ++ case riscv_insn::AUIPC: ++ case riscv_insn::ADDI: ++ case riscv_insn::ADDIW: ++ case riscv_insn::SLTI: ++ case riscv_insn::SLTIU: ++ case riscv_insn::XORI: ++ case riscv_insn::ORI: ++ case riscv_insn::ANDI: ++ case riscv_insn::SLLI: ++ case riscv_insn::SLLIW: ++ case riscv_insn::SRLI: ++ case riscv_insn::SRLIW: ++ case riscv_insn::SRAI: ++ case riscv_insn::ADD: ++ case riscv_insn::ADDW: ++ case riscv_insn::SRAIW: ++ case riscv_insn::SUB: ++ case riscv_insn::SUBW: ++ case riscv_insn::SLL: ++ case riscv_insn::SLLW: ++ case riscv_insn::SLT: ++ case riscv_insn::SLTU: ++ case riscv_insn::XOR: ++ case riscv_insn::SRL: ++ case riscv_insn::SRLW: ++ case riscv_insn::SRA: ++ case riscv_insn::SRAW: ++ case riscv_insn::OR: ++ case riscv_insn::AND: ++ return true; ++ } ++ ++ return false; ++} ++ ++/* Return true if INSN is a direct branch instruction. */ ++ ++static bool ++riscv_insn_is_direct_branch (const struct riscv_insn &insn) ++{ ++ switch (insn.opcode ()) ++ { ++ case riscv_insn::BEQ: ++ case riscv_insn::BNE: ++ case riscv_insn::BLT: ++ case riscv_insn::BGE: ++ case riscv_insn::BLTU: ++ case riscv_insn::BGEU: ++ case riscv_insn::JAL: ++ return true; ++ } ++ ++ return false; ++} ++ + /* We can't put a breakpoint in the middle of a lr/sc atomic sequence, so look + for the end of the sequence and put the breakpoint there. */ + +-static bool +-riscv_next_pc_atomic_sequence (struct regcache *regcache, CORE_ADDR pc, +- CORE_ADDR *next_pc) ++static std::vector ++riscv_deal_with_atomic_sequence (struct regcache *regcache, CORE_ADDR pc) + { + struct gdbarch *gdbarch = regcache->arch (); + struct riscv_insn insn; +- CORE_ADDR cur_step_pc = pc; +- CORE_ADDR last_addr = 0; ++ CORE_ADDR cur_step_pc = pc, next_pc; ++ std::vector next_pcs; ++ bool found_valid_atomic_sequence = false; ++ enum riscv_insn::opcode lr_opcode; + + /* First instruction has to be a load reserved. */ + insn.decode (gdbarch, cur_step_pc); +- if (insn.opcode () != riscv_insn::LR) +- return false; +- cur_step_pc = cur_step_pc + insn.length (); ++ lr_opcode = insn.opcode (); ++ if (lr_opcode != riscv_insn::LR_D && lr_opcode != riscv_insn::LR_W) ++ return {}; ++ ++ /* The loop comprises only an LR/SC sequence and code to retry the sequence in ++ the case of failure, and must comprise at most 16 instructions placed ++ sequentially in memory. While our code tries to follow these restrictions, ++ it has the following limitations: ++ ++ (a) We expect the loop to start with an LR and end with a BNE. ++ Apparently this does not cover all cases for a valid sequence. ++ (b) The atomic limitations only apply to the code that is actually ++ executed, so here again it's overly restrictive. ++ (c) The lr/sc are required to be for the same target address, but this ++ information is only known at runtime. Same as (b), in order to check ++ this we will end up needing to simulate the sequence, which is more ++ complicated than what we're doing right now. ++ ++ Also note that we only expect a maximum of (16-2) instructions in the for ++ loop as we have assumed the presence of LR and BNE at the beginning and end ++ respectively. */ ++ for (int insn_count = 0; insn_count < 16 - 2; ++insn_count) ++ { ++ cur_step_pc += insn.length (); ++ insn.decode (gdbarch, cur_step_pc); + +- /* Next instruction should be branch to exit. */ +- insn.decode (gdbarch, cur_step_pc); +- if (insn.opcode () != riscv_insn::BNE) +- return false; +- last_addr = cur_step_pc + insn.imm_signed (); +- cur_step_pc = cur_step_pc + insn.length (); ++ /* The dynamic code executed between lr/sc can only contain instructions ++ from the base I instruction set, excluding loads, stores, backward ++ jumps, taken backward branches, JALR, FENCE, FENCE.I, and SYSTEM ++ instructions. If the C extension is supported, then compressed forms ++ of the aforementioned I instructions are also permitted. */ + +- /* Next instruction should be store conditional. */ +- insn.decode (gdbarch, cur_step_pc); +- if (insn.opcode () != riscv_insn::SC) +- return false; +- cur_step_pc = cur_step_pc + insn.length (); ++ if (riscv_insn_is_non_cti_and_allowed_in_atomic_sequence (insn)) ++ continue; ++ /* Look for a conditional branch instruction, check if it's taken forward ++ or not. */ ++ else if (riscv_insn_is_direct_branch (insn)) ++ { ++ if (insn.imm_signed () > 0) ++ { ++ next_pc = cur_step_pc + insn.imm_signed (); ++ next_pcs.push_back (next_pc); ++ } ++ else ++ break; ++ } ++ /* Look for a paired SC instruction which closes the atomic sequence. */ ++ else if ((insn.opcode () == riscv_insn::SC_D ++ && lr_opcode == riscv_insn::LR_D) ++ || (insn.opcode () == riscv_insn::SC_W ++ && lr_opcode == riscv_insn::LR_W)) ++ found_valid_atomic_sequence = true; ++ else ++ break; ++ } ++ ++ if (!found_valid_atomic_sequence) ++ return {}; + + /* Next instruction should be branch to start. */ + insn.decode (gdbarch, cur_step_pc); + if (insn.opcode () != riscv_insn::BNE) +- return false; ++ return {}; + if (pc != (cur_step_pc + insn.imm_signed ())) +- return false; +- cur_step_pc = cur_step_pc + insn.length (); ++ return {}; ++ cur_step_pc += insn.length (); + +- /* We should now be at the end of the sequence. */ +- if (cur_step_pc != last_addr) +- return false; ++ /* Remove all PCs that jump within the sequence. */ ++ auto matcher = [cur_step_pc] (const CORE_ADDR addr) -> bool ++ { ++ return addr < cur_step_pc; ++ }; ++ auto it = std::remove_if (next_pcs.begin (), next_pcs.end (), matcher); ++ next_pcs.erase (it, next_pcs.end ()); + +- *next_pc = cur_step_pc; +- return true; ++ next_pc = cur_step_pc; ++ next_pcs.push_back (next_pc); ++ return next_pcs; + } + + /* This is called just before we want to resume the inferior, if we want to +@@ -4459,14 +4671,14 @@ riscv_next_pc_atomic_sequence (struct regcache *regcache, CORE_ADDR pc, + std::vector + riscv_software_single_step (struct regcache *regcache) + { +- CORE_ADDR pc, next_pc; +- +- pc = regcache_read_pc (regcache); ++ CORE_ADDR cur_pc = regcache_read_pc (regcache), next_pc; ++ std::vector next_pcs ++ = riscv_deal_with_atomic_sequence (regcache, cur_pc); + +- if (riscv_next_pc_atomic_sequence (regcache, pc, &next_pc)) +- return {next_pc}; ++ if (!next_pcs.empty ()) ++ return next_pcs; + +- next_pc = riscv_next_pc (regcache, pc); ++ next_pc = riscv_next_pc (regcache, cur_pc); + + return {next_pc}; + } +-- +2.48.0 + diff --git a/rs6000-unwind-on-each-instruction-fix.patch b/rs6000-unwind-on-each-instruction-fix.patch new file mode 100644 index 0000000..75d1ff3 --- /dev/null +++ b/rs6000-unwind-on-each-instruction-fix.patch @@ -0,0 +1,97 @@ +From 6d21f33bb8f63d1d9aeda88ca815e442da0dc160 Mon Sep 17 00:00:00 2001 +From: Carl Love +Date: Tue, 23 Jan 2024 17:12:34 -0500 +Subject: [PATCH 1/2] rs6000, unwind-on-each-instruction fix. + +The function rs6000_epilogue_frame_cache assumes the LR and gprs have been +restored. In fact register r31 and the link register, lr, may not have +been restored yet. This patch adds support to store the lr and gpr +register unrolling rules in the cache. The LR and GPR values can now be +unrolled correctly. + +Patch fixes all 10 regresion test failures for the unwind-on-each-insn.exp. +--- + gdb/rs6000-tdep.c | 53 +++++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 47 insertions(+), 6 deletions(-) + +diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c +index 23397d037ae..ecc8766d319 100644 +--- a/gdb/rs6000-tdep.c ++++ b/gdb/rs6000-tdep.c +@@ -3805,6 +3805,8 @@ rs6000_epilogue_frame_cache (frame_info_ptr this_frame, void **this_cache) + struct rs6000_frame_cache *cache; + struct gdbarch *gdbarch = get_frame_arch (this_frame); + ppc_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); ++ struct rs6000_framedata fdata; ++ int wordsize = tdep->wordsize; + + if (*this_cache) + return (struct rs6000_frame_cache *) *this_cache; +@@ -3815,17 +3817,56 @@ rs6000_epilogue_frame_cache (frame_info_ptr this_frame, void **this_cache) + + try + { +- /* At this point the stack looks as if we just entered the +- function, and the return address is stored in LR. */ +- CORE_ADDR sp, lr; ++ /* At this point the stack looks as if we just entered the function. ++ The SP (r1) has been restored but the LR and r31 may not have been ++ restored yet. Need to update the register unrolling information in ++ the cache for the LR and the saved gprs. */ ++ CORE_ADDR sp; ++ CORE_ADDR func = 0, pc = 0; + +- sp = get_frame_register_unsigned (this_frame, gdbarch_sp_regnum (gdbarch)); +- lr = get_frame_register_unsigned (this_frame, tdep->ppc_lr_regnum); ++ func = get_frame_func (this_frame); ++ cache->pc = func; ++ pc = get_frame_pc (this_frame); ++ skip_prologue (gdbarch, func, pc, &fdata); ++ ++ /* SP is in r1 and it has been restored. Get the current value. */ ++ sp = get_frame_register_unsigned (this_frame, ++ gdbarch_sp_regnum (gdbarch)); + + cache->base = sp; + cache->initial_sp = sp; + +- cache->saved_regs[gdbarch_pc_regnum (gdbarch)].set_value (lr); ++ /* Store the unwinding rules for the gpr registers that have not been ++ restored yet, specifically r31. ++ ++ if != -1, fdata.saved_gpr is the smallest number of saved_gpr. ++ All gpr's from saved_gpr to gpr31 are saved (except during the ++ prologue). */ ++ ++ if (fdata.saved_gpr >= 0) ++ { ++ int i; ++ CORE_ADDR gpr_addr = cache->base + fdata.gpr_offset; ++ ++ for(i = fdata.saved_gpr; i < ppc_num_gprs; i++) ++ { ++ if (fdata.gpr_mask & (1U << i)) ++ cache->saved_regs[tdep->ppc_gp0_regnum + i].set_addr (gpr_addr); ++ gpr_addr += wordsize; ++ } ++ } ++ ++ /* Store the lr unwinding rules. */ ++ if (fdata.lr_offset != 0) ++ cache->saved_regs[tdep->ppc_lr_regnum].set_addr (cache->base ++ + fdata.lr_offset); ++ ++ else if (fdata.lr_register != -1) ++ cache->saved_regs[tdep->ppc_lr_regnum].set_realreg (fdata.lr_register); ++ ++ /* The PC is found in the link register. */ ++ cache->saved_regs[gdbarch_pc_regnum (gdbarch)] ++ = cache->saved_regs[tdep->ppc_lr_regnum]; + } + catch (const gdb_exception_error &ex) + { + +base-commit: 800e56a120419b457ebda18c5478ebfea99f9b3a +-- +2.35.3 + diff --git a/s390-provide-ibm-z16-arch14-instruction-descriptions.patch b/s390-provide-ibm-z16-arch14-instruction-descriptions.patch new file mode 100644 index 0000000..e4307e7 --- /dev/null +++ b/s390-provide-ibm-z16-arch14-instruction-descriptions.patch @@ -0,0 +1,103 @@ +From 789e5514da246a792a78ce5f61a6c286f874b03c Mon Sep 17 00:00:00 2001 +From: Jens Remus +Date: Wed, 20 Dec 2023 11:16:38 +0100 +Subject: [PATCH 1/2] s390: Provide IBM z16 (arch14) instruction descriptions + +Provide descriptions for instructions introduced with commit ba2b480f103 +("IBM Z: Implement instruction set extensions"). This complements commit +69341966def ("IBM zSystems: Add support for z16 as CPU name."). Use +instruction names from IBM z/Architecture Principles of Operation [1] as +instruction description. + +[1]: IBM z/Architecture Principles of Operation, SA22-7832-13, IBM z16, + https://publibfp.dhe.ibm.com/epubs/pdf/a227832d.pdf + +opcodes/ + * s390-opc.txt: Add descriptions for IBM z16 (arch14) + instructions. + +Signed-off-by: Jens Remus +Reviewed-by: Andreas Krebbel +--- + opcodes/s390-opc.txt | 66 +++++++++++++++++++++++++------------------- + 1 file changed, 38 insertions(+), 28 deletions(-) + +diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt +index b7efa813e47..b33ee34ea8f 100644 +--- a/opcodes/s390-opc.txt ++++ b/opcodes/s390-opc.txt +@@ -2018,31 +2018,41 @@ e60000000052 vcvbg VRR_RV0UU "vector convert to binary 64 bit" arch13 zarch optp + b93a kdsa RRE_RR "compute digital signature authentication" arch13 zarch + + +-# arch14 instructions +- +-e60000000074 vschp VRR_VVV0U0U " " arch14 zarch +-e60000002074 vschsp VRR_VVV0U0 " " arch14 zarch +-e60000003074 vschdp VRR_VVV0U0 " " arch14 zarch +-e60000004074 vschxp VRR_VVV0U0 " " arch14 zarch +-e6000000007c vscshp VRR_VVV " " arch14 zarch +-e6000000007d vcsph VRR_VVV0U0 " " arch14 zarch +-e60000000051 vclzdp VRR_VV0U2 " " arch14 zarch +-e60000000070 vpkzr VRI_VVV0UU2 " " arch14 zarch +-e60000000072 vsrpr VRI_VVV0UU2 " " arch14 zarch +-e60000000054 vupkzh VRR_VV0U2 " " arch14 zarch +-e6000000005c vupkzl VRR_VV0U2 " " arch14 zarch +- +-b93b nnpa RRE_00 " " arch14 zarch +-e60000000056 vclfnh VRR_VV0UU2 " " arch14 zarch +-e6000000005e vclfnl VRR_VV0UU2 " " arch14 zarch +-e60000000075 vcrnf VRR_VVV0UU " " arch14 zarch +-e6000000005d vcfn VRR_VV0UU2 " " arch14 zarch +-e60000000055 vcnf VRR_VV0UU2 " " arch14 zarch +- +-b98B rdp RRF_RURR2 " " arch14 zarch optparm +- +-eb0000000071 lpswey SIY_RD " " arch14 zarch +-b200 lbear S_RD " " arch14 zarch +-b201 stbear S_RD " " arch14 zarch +- +-b28f qpaci S_RD " " arch14 zarch ++# arch14 (z16) instructions ++ ++# Vector-Packed-Decimal-Enhancement Facility 2 ++ ++e60000000074 vschp VRR_VVV0U0U "decimal scale and convert to hfp" arch14 zarch ++e60000002074 vschsp VRR_VVV0U0 "decimal scale and convert to short hfp" arch14 zarch ++e60000003074 vschdp VRR_VVV0U0 "decimal scale and convert to long hfp" arch14 zarch ++e60000004074 vschxp VRR_VVV0U0 "decimal scale and convert to extended hfp" arch14 zarch ++e6000000007c vscshp VRR_VVV "decimal scale and convert and split to hfp" arch14 zarch ++e6000000007d vcsph VRR_VVV0U0 "vector convert hfp to scaled decimal" arch14 zarch ++e60000000051 vclzdp VRR_VV0U2 "vector count leading zero digits" arch14 zarch ++e60000000070 vpkzr VRI_VVV0UU2 "vector pack zoned register" arch14 zarch ++e60000000072 vsrpr VRI_VVV0UU2 "vector shift and round decimal register" arch14 zarch ++e60000000054 vupkzh VRR_VV0U2 "vector unpack zoned high" arch14 zarch ++e6000000005c vupkzl VRR_VV0U2 "vector unpack zoned low" arch14 zarch ++ ++# Neural-Network-Processing-Assist Facility ++ ++b93b nnpa RRE_00 "neural network processing assist" arch14 zarch ++e60000000056 vclfnh VRR_VV0UU2 "vector fp convert and lengthen from nnp high" arch14 zarch ++e6000000005e vclfnl VRR_VV0UU2 "vector fp convert and lengthen from nnp low" arch14 zarch ++e60000000075 vcrnf VRR_VVV0UU "vector fp convert and round to nnp" arch14 zarch ++e6000000005d vcfn VRR_VV0UU2 "vector fp convert from nnp" arch14 zarch ++e60000000055 vcnf VRR_VV0UU2 "vector fp convert to nnp" arch14 zarch ++ ++# Reset-DAT-Protection Facility ++ ++b98B rdp RRF_RURR2 "reset dat protection" arch14 zarch optparm ++ ++# BEAR-Enhancement Facility ++ ++eb0000000071 lpswey SIY_RD "load PSW extended" arch14 zarch ++b200 lbear S_RD "load bear" arch14 zarch ++b201 stbear S_RD "store bear" arch14 zarch ++ ++# Processor-Activity-Instrumentation Facility ++ ++b28f qpaci S_RD "query processor activity counter information" arch14 zarch + +base-commit: 84b9218d98eb2ac242fe3afc81598206279f7b13 +-- +2.35.3 + diff --git a/v2.0.5.tar.gz b/v2.0.5.tar.gz new file mode 100644 index 0000000..bab6fb3 --- /dev/null +++ b/v2.0.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:95acf499fdf0a0f5ebd07587bb443c702b1fd79f7d869749824234388b9bff80 +size 343369 From e572ca82d0087fd9a8330e9974f1f5788118f25e8fc084d394e9202ccc37880c Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 23 Jan 2025 09:12:33 +0000 Subject: [PATCH 02/34] - Update to fedora rawhide @ e27fd6f. - Patches modified: * gdb-6.6-buildid-locate-rpm.patch * gdb-6.6-buildid-locate.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=407 --- gdb-6.6-buildid-locate-rpm.patch | 2 +- gdb-6.6-buildid-locate.patch | 164 ++----------------------------- gdb.changes | 8 ++ 3 files changed, 17 insertions(+), 157 deletions(-) diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch index b38b945..41ecef7 100644 --- a/gdb-6.6-buildid-locate-rpm.patch +++ b/gdb-6.6-buildid-locate-rpm.patch @@ -1074,7 +1074,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c diff --git a/gdb/symfile.h b/gdb/symfile.h --- a/gdb/symfile.h +++ b/gdb/symfile.h -@@ -367,6 +367,7 @@ extern void generic_load (const char *args, int from_tty); +@@ -366,6 +366,7 @@ extern void generic_load (const char *args, int from_tty); /* build-id support. */ extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr); extern void debug_print_missing (const char *binary, const char *debug); diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index c2d7077..1510ae5 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -33,7 +33,7 @@ diff --git a/bfd/libbfd.h b/bfd/libbfd.h diff --git a/gdb/build-id.c b/gdb/build-id.c --- a/gdb/build-id.c +++ b/gdb/build-id.c -@@ -24,14 +24,72 @@ +@@ -24,9 +24,67 @@ #include "gdbsupport/gdb_vecs.h" #include "symfile.h" #include "objfiles.h" @@ -101,12 +101,6 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c /* See build-id.h. */ - const struct bfd_build_id * --build_id_bfd_get (bfd *abfd) -+build_id_bfd_shdr_get (bfd *abfd) - { - /* Dynamic objfiles such as ones created by JIT reader API - have no underlying bfd structure (that is, objfile->obfd @@ -50,6 +108,348 @@ build_id_bfd_get (bfd *abfd) return NULL; } @@ -456,15 +450,6 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c /* See build-id.h. */ int -@@ -58,7 +458,7 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) - const struct bfd_build_id *found; - int retval = 0; - -- found = build_id_bfd_get (abfd); -+ found = build_id_bfd_shdr_get (abfd); - - if (found == NULL) - warning (_("File \"%s\" has no build-id, file skipped"), @@ -73,63 +473,166 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) return retval; } @@ -704,7 +689,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c if (debug_bfd != NULL) return debug_bfd; } -@@ -190,31 +694,663 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, +@@ -190,30 +694,662 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, return {}; } @@ -1366,14 +1351,12 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c { const struct bfd_build_id *build_id; -- build_id = build_id_bfd_get (objfile->obfd.get ()); + if (build_id_filename_return) + *build_id_filename_return = NULL; + -+ build_id = build_id_bfd_shdr_get (objfile->obfd.get ()); + build_id = build_id_bfd_get (objfile->obfd.get ()); if (build_id != NULL) { - if (separate_debug_file_debug) @@ -222,8 +1358,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile, _("\nLooking for separate debug info (build-id) for " "%s\n"), objfile_name (objfile)); @@ -1423,20 +1406,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c diff --git a/gdb/build-id.h b/gdb/build-id.h --- a/gdb/build-id.h +++ b/gdb/build-id.h -@@ -23,9 +23,10 @@ - #include "gdb_bfd.h" - #include "gdbsupport/rsp-low.h" - --/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */ -+/* Separate debuginfo files have corrupted PHDR but SHDR is correct there. -+ Locate NT_GNU_BUILD_ID from ABFD and return its content. */ - --extern const struct bfd_build_id *build_id_bfd_get (bfd *abfd); -+extern const struct bfd_build_id *build_id_bfd_shdr_get (bfd *abfd); - - /* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value. - Otherwise, issue a warning and return false. */ -@@ -38,14 +39,19 @@ extern int build_id_verify (bfd *abfd, +@@ -38,14 +38,19 @@ extern int build_id_verify (bfd *abfd, can be found, return NULL. */ extern gdb_bfd_ref_ptr build_id_to_debug_bfd (size_t build_id_len, @@ -1458,7 +1428,7 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h /* Find the separate debug file for OBJFILE, by using the build-id associated with OBJFILE's BFD. If successful, returns the file name for the -@@ -58,7 +64,8 @@ extern gdb_bfd_ref_ptr build_id_to_exec_bfd (size_t build_id_len, +@@ -58,7 +63,8 @@ extern gdb_bfd_ref_ptr build_id_to_exec_bfd (size_t build_id_len, will be printed. */ extern std::string find_separate_debug_file_by_buildid @@ -1503,12 +1473,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c /* Issue a message saying we have no core to debug, if FROM_TTY. */ static void -@@ -563,12 +569,14 @@ rename_vmcore_idle_reg_sections (bfd *abfd, inferior *inf) - static void - locate_exec_from_corefile_build_id (bfd *abfd, int from_tty) - { -- const bfd_build_id *build_id = build_id_bfd_get (abfd); -+ const bfd_build_id *build_id = build_id_bfd_shdr_get (abfd); +@@ -567,8 +573,10 @@ locate_exec_from_corefile_build_id (bfd *abfd, int from_tty) if (build_id == nullptr) return; @@ -1548,7 +1513,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo -@@ -22296,6 +22296,27 @@ information files. +@@ -22296,6 +22296,27 @@ @end table @@ -1576,49 +1541,6 @@ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo @cindex @code{.gnu_debuglink} sections @cindex debug link sections A debug link is a special section of the executable file named -diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c ---- a/gdb/dwarf2/index-cache.c -+++ b/gdb/dwarf2/index-cache.c -@@ -96,7 +96,7 @@ index_cache_store_context::index_cache_store_context (const index_cache &ic, - return; - - /* Get build id of objfile. */ -- const bfd_build_id *build_id = build_id_bfd_get (per_bfd->obfd); -+ const bfd_build_id *build_id = build_id_bfd_shdr_get (per_bfd->obfd); - if (build_id == nullptr) - { - index_cache_debug ("objfile %s has no build id", -@@ -111,7 +111,8 @@ index_cache_store_context::index_cache_store_context (const index_cache &ic, - - if (dwz != nullptr) - { -- const bfd_build_id *dwz_build_id = build_id_bfd_get (dwz->dwz_bfd.get ()); -+ const bfd_build_id *dwz_build_id -+ = build_id_bfd_shdr_get (dwz->dwz_bfd.get ()); - - if (dwz_build_id == nullptr) - { -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -3355,7 +3355,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) - { -- const bfd_build_id *build_id = build_id_bfd_get (obj->obfd.get ()); -+ const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd.get ()); - if (build_id == nullptr) - return {}; - -@@ -3368,7 +3368,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) - { -- const bfd_build_id *build_id = build_id_bfd_get (dwz->dwz_bfd.get ()); -+ const bfd_build_id *build_id = build_id_bfd_shdr_get (dwz->dwz_bfd.get ()); - if (build_id == nullptr) - return {}; - diff --git a/gdb/elfread.c b/gdb/elfread.c --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -1634,15 +1556,6 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c if (debugfile.empty ()) debugfile = find_separate_debug_file_by_debuglink (objfile, &warnings); -@@ -1239,7 +1241,7 @@ elf_symfile_read_dwarf2 (struct objfile *objfile, - { - has_dwarf2 = false; - const struct bfd_build_id *build_id -- = build_id_bfd_get (objfile->obfd.get ()); -+ = build_id_bfd_shdr_get (objfile->obfd.get ()); - const char *filename = bfd_get_filename (objfile->obfd.get ()); - - if (build_id != nullptr) @@ -1265,6 +1267,11 @@ elf_symfile_read_dwarf2 (struct objfile *objfile, has_dwarf2 = true; } @@ -1655,27 +1568,6 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c } } /* If all the methods to collect the debuginfo failed, print the -diff --git a/gdb/exec.c b/gdb/exec.c ---- a/gdb/exec.c -+++ b/gdb/exec.c -@@ -237,7 +237,7 @@ validate_exec_file (int from_tty) - current_exec_file = get_exec_file (0); - - const bfd_build_id *exec_file_build_id -- = build_id_bfd_get (current_program_space->exec_bfd ()); -+ = build_id_bfd_shdr_get (current_program_space->exec_bfd ()); - if (exec_file_build_id != nullptr) - { - /* Prepend the target prefix, to force gdb_bfd_open to open the -@@ -250,7 +250,7 @@ validate_exec_file (int from_tty) - if (abfd != nullptr) - { - const bfd_build_id *target_exec_file_build_id -- = build_id_bfd_get (abfd.get ()); -+ = build_id_bfd_shdr_get (abfd.get ()); - - if (target_exec_file_build_id != nullptr) - { diff --git a/gdb/objfiles.h b/gdb/objfiles.h --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -1690,27 +1582,6 @@ diff --git a/gdb/objfiles.h b/gdb/objfiles.h /* A deleter for objfile. */ struct objfile_deleter -diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c ---- a/gdb/python/py-objfile.c -+++ b/gdb/python/py-objfile.c -@@ -158,7 +158,7 @@ objfpy_get_build_id (PyObject *self, void *closure) - - try - { -- build_id = build_id_bfd_get (objfile->obfd.get ()); -+ build_id = build_id_bfd_shdr_get (objfile->obfd.get ()); - } - catch (const gdb_exception &except) - { -@@ -629,7 +629,7 @@ gdbpy_lookup_objfile (PyObject *self, PyObject *args, PyObject *kw) - if (obfd == nullptr) - return 0; - -- const bfd_build_id *obfd_build_id = build_id_bfd_get (obfd); -+ const bfd_build_id *obfd_build_id = build_id_bfd_shdr_get (obfd); - if (obfd_build_id == nullptr) - return 0; - diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -1777,29 +1648,10 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c /* If this entry has no name, or its name matches the name for the main executable, don't include it in the list. */ -diff --git a/gdb/source.c b/gdb/source.c ---- a/gdb/source.c -+++ b/gdb/source.c -@@ -1167,7 +1167,7 @@ open_source_file (struct symtab *s) - } - - const struct bfd_build_id *build_id -- = build_id_bfd_get (ofp->obfd.get ()); -+ = build_id_bfd_shdr_get (ofp->obfd.get ()); - - /* Query debuginfod for the source file. */ - if (build_id != nullptr && !srcpath.empty ()) diff --git a/gdb/symfile.h b/gdb/symfile.h --- a/gdb/symfile.h +++ b/gdb/symfile.h -@@ -357,12 +357,18 @@ bool expand_symtabs_matching - void map_symbol_filenames (gdb::function_view fun, - bool need_fullname); - -+ - /* Target-agnostic function to load the sections of an executable into memory. - - ARGS should be in the form "EXECUTABLE [OFFSET]", where OFFSET is an +@@ -363,6 +363,11 @@ void map_symbol_filenames (gdb::function_view fun, optional offset to apply to each section. */ extern void generic_load (const char *args, int from_tty); diff --git a/gdb.changes b/gdb.changes index fd5e6ba..af3458a 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Jan 23 09:07:47 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ e27fd6f. +- Patches modified: + * gdb-6.6-buildid-locate-rpm.patch + * gdb-6.6-buildid-locate.patch + ------------------------------------------------------------------- Thu Jan 23 08:11:26 UTC 2025 - Tom de Vries From bb279386a76bc3972bbf08cc133c41b416a7698e8a44aa1e19a683f800467e9d Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 23 Jan 2025 09:59:00 +0000 Subject: [PATCH 03/34] - Update to fedora rawhide @ f379362. - Patches modified: * gdb-6.6-buildid-locate.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=408 --- gdb-6.6-buildid-locate.patch | 24 ------------------------ gdb.changes | 7 +++++++ 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index 1510ae5..f581103 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -6,30 +6,6 @@ Subject: gdb-6.6-buildid-locate.patch ;; New locating of the matching binaries from the pure core file (build-id). ;;=push+jan -diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h ---- a/bfd/libbfd-in.h -+++ b/bfd/libbfd-in.h -@@ -110,7 +110,7 @@ static inline char * - bfd_strdup (const char *str) - { - size_t len = strlen (str) + 1; -- char *buf = bfd_malloc (len); -+ char *buf = (char *) bfd_malloc (len); - if (buf != NULL) - memcpy (buf, str, len); - return buf; -diff --git a/bfd/libbfd.h b/bfd/libbfd.h ---- a/bfd/libbfd.h -+++ b/bfd/libbfd.h -@@ -116,7 +116,7 @@ static inline char * - bfd_strdup (const char *str) - { - size_t len = strlen (str) + 1; -- char *buf = bfd_malloc (len); -+ char *buf = (char *) bfd_malloc (len); - if (buf != NULL) - memcpy (buf, str, len); - return buf; diff --git a/gdb/build-id.c b/gdb/build-id.c --- a/gdb/build-id.c +++ b/gdb/build-id.c diff --git a/gdb.changes b/gdb.changes index af3458a..2f4f6f1 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jan 23 09:14:28 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ f379362. +- Patches modified: + * gdb-6.6-buildid-locate.patch + ------------------------------------------------------------------- Thu Jan 23 09:07:47 UTC 2025 - Tom de Vries From 8aea3c9b982512d383f95d0c10e915f2fca7cc0262be35c6f6aaa0f2da0790cc Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 23 Jan 2025 14:31:06 +0000 Subject: [PATCH 04/34] - Update to fedora rawhide @ 08bfd0a. - Patches dropped: * fixup-gdb-6.3-gstack-20050411.patch * fixup-skip-tests.patch * gdb-6.6-buildid-locate-rpm-librpm-workaround.patch * gdb-6.6-buildid-locate-rpm.patch - Patches added: * gdb-add-missing-debug-ext-lang-hook.patch * gdb-add-missing-debug-info-python-hook.patch * gdb-add-rpm-suggestion-script.patch * gdb-do-not-import-py-curses-ascii-module.patch * gdb-handle-no-python-gdb-module.patch * gdb-merge-debug-symbol-lookup.patch * gdb-python-avoid-depending-on-the-curses-library.patch * gdb-refactor-find-and-add-separate-symbol-file.patch * gdb-reformat-missing-debug-py-file.patch * gdb-remove-path-in-test-name.patch * gdb-remove-use-of-py-isascii * gdb-sync-coffread-with-elfread.patch - Patches updated: * fixup-gdb-bz634108-solib_address.patch * gdb-6.3-gstack-20050411.patch * gdb-6.6-buildid-locate-rpm-suse.patch * gdb-6.6-buildid-locate-solib-missing-ids.patch * gdb-6.6-buildid-locate.patch * gdb-archer-next-over-throw-cxx-exec.patch * gdb-bz634108-solib_address.patch * gdb-fedora-libncursesw.patch * gdb-glibc-strstr-workaround.patch * gdb-rhbz1007614-memleak-infpy_read_memory-test.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=409 --- fixup-gdb-6.3-gstack-20050411.patch | 25 - fixup-gdb-bz634108-solib_address.patch | 20 +- fixup-skip-tests.patch | 101 -- gdb-6.3-gstack-20050411.patch | 2 +- ...buildid-locate-rpm-librpm-workaround.patch | 19 - gdb-6.6-buildid-locate-rpm-suse.patch | 154 +- gdb-6.6-buildid-locate-rpm.patch | 1084 ------------ ...6.6-buildid-locate-solib-missing-ids.patch | 9 +- gdb-6.6-buildid-locate.patch | 607 +------ gdb-add-missing-debug-ext-lang-hook.patch | 314 ++++ gdb-add-missing-debug-info-python-hook.patch | 1556 +++++++++++++++++ gdb-add-rpm-suggestion-script.patch | 157 ++ gdb-archer-next-over-throw-cxx-exec.patch | 2 +- gdb-bz634108-solib_address.patch | 9 +- ...do-not-import-py-curses-ascii-module.patch | 64 + gdb-fedora-libncursesw.patch | 274 +-- gdb-glibc-strstr-workaround.patch | 6 +- gdb-handle-no-python-gdb-module.patch | 30 + gdb-merge-debug-symbol-lookup.patch | 265 +++ ...void-depending-on-the-curses-library.patch | 92 + ...or-find-and-add-separate-symbol-file.patch | 190 ++ gdb-reformat-missing-debug-py-file.patch | 38 + gdb-remove-path-in-test-name.patch | 29 + gdb-remove-use-of-py-isascii | 46 + ...07614-memleak-infpy_read_memory-test.patch | 14 +- gdb-sync-coffread-with-elfread.patch | 47 + gdb.changes | 34 + gdb.spec | 112 +- 28 files changed, 3015 insertions(+), 2285 deletions(-) delete mode 100644 fixup-gdb-6.3-gstack-20050411.patch delete mode 100644 fixup-skip-tests.patch delete mode 100644 gdb-6.6-buildid-locate-rpm-librpm-workaround.patch delete mode 100644 gdb-6.6-buildid-locate-rpm.patch create mode 100644 gdb-add-missing-debug-ext-lang-hook.patch create mode 100644 gdb-add-missing-debug-info-python-hook.patch create mode 100644 gdb-add-rpm-suggestion-script.patch create mode 100644 gdb-do-not-import-py-curses-ascii-module.patch create mode 100644 gdb-handle-no-python-gdb-module.patch create mode 100644 gdb-merge-debug-symbol-lookup.patch create mode 100644 gdb-python-avoid-depending-on-the-curses-library.patch create mode 100644 gdb-refactor-find-and-add-separate-symbol-file.patch create mode 100644 gdb-reformat-missing-debug-py-file.patch create mode 100644 gdb-remove-path-in-test-name.patch create mode 100644 gdb-remove-use-of-py-isascii create mode 100644 gdb-sync-coffread-with-elfread.patch diff --git a/fixup-gdb-6.3-gstack-20050411.patch b/fixup-gdb-6.3-gstack-20050411.patch deleted file mode 100644 index 427b668..0000000 --- a/fixup-gdb-6.3-gstack-20050411.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 8c0ae8c3c6fa34f046131f76871db13bc392a440 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Tue, 13 Jun 2023 14:56:55 +0200 -Subject: [PATCH 4/6] fixup gdb-6.3-gstack-20050411.patch - ---- - gdb/testsuite/gdb.base/gstack.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.base/gstack.exp b/gdb/testsuite/gdb.base/gstack.exp -index 089407ec04a..a5dacd582ff 100644 ---- a/gdb/testsuite/gdb.base/gstack.exp -+++ b/gdb/testsuite/gdb.base/gstack.exp -@@ -52,7 +52,7 @@ gdb_expect { - # exiting the function. Still we could retry the gstack command if we fail. - - set test "spawn gstack" --set command "sh -c GDB=$GDB\\ GDBARGS=-data-directory\\\\\\ $BUILD_DATA_DIRECTORY\\ sh\\ ${srcdir}/../gstack.sh\\ $pid\\;echo\\ GSTACK-END" -+set command "sh -c GDB=$GDB\\ GDBARGS=-data-directory\\\\\\ $GDB_DATA_DIRECTORY\\ sh\\ ${srcdir}/../gstack.sh\\ $pid\\;echo\\ GSTACK-END" - set res [remote_spawn host $command]; - if { $res < 0 || $res == "" } { - perror "Spawning $command failed." --- -2.35.3 - diff --git a/fixup-gdb-bz634108-solib_address.patch b/fixup-gdb-bz634108-solib_address.patch index a18ae59..8e397f2 100644 --- a/fixup-gdb-bz634108-solib_address.patch +++ b/fixup-gdb-bz634108-solib_address.patch @@ -1,22 +1,10 @@ -From 023314feb400836eb377a5bc9151850fcdd81b11 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Tue, 6 Jun 2023 09:43:36 +0200 -Subject: [PATCH 3/4] Fixup gdb-bz634108-solib_address.patch - ---- - gdb/testsuite/gdb.python/rh634108-solib_address.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - diff --git a/gdb/testsuite/gdb.python/rh634108-solib_address.exp b/gdb/testsuite/gdb.python/rh634108-solib_address.exp -index 99e6aaba831..ebf00babc34 100644 +index 9bc31992613..078b69c5a6a 100644 --- a/gdb/testsuite/gdb.python/rh634108-solib_address.exp +++ b/gdb/testsuite/gdb.python/rh634108-solib_address.exp -@@ -21,4 +21,4 @@ gdb_start - # Skip all tests if Python scripting is not enabled. - if { [skip_python_tests] } { continue } +@@ -22,4 +22,4 @@ require allow_python_tests + gdb_exit + gdb_start -gdb_test "python print (gdb.solib_name(-1))" "None" "gdb.solib_name exists" +gdb_test "python print (gdb.solib_name(0))" "None" "gdb.solib_name exists" --- -2.35.3 - diff --git a/fixup-skip-tests.patch b/fixup-skip-tests.patch deleted file mode 100644 index 550d1d0..0000000 --- a/fixup-skip-tests.patch +++ /dev/null @@ -1,101 +0,0 @@ -From c1da0d6449415cc1fe6f863526735e4325b0b3ac Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Wed, 1 May 2024 12:43:41 +0200 -Subject: [PATCH 1/2] fixup-skip-tests - ---- - gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp | 4 +--- - gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp | 4 +--- - gdb/testsuite/gdb.cp/cxxexec.exp | 2 +- - .../py-gdb-rhbz1007614-memleak-infpy_read_memory.exp | 4 ++-- - gdb/testsuite/gdb.python/rh634108-solib_address.exp | 6 +++--- - 5 files changed, 8 insertions(+), 12 deletions(-) - -diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp -index 0c46489f315..5879319f27c 100644 ---- a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp -+++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp -@@ -13,9 +13,7 @@ - # You should have received a copy of the GNU General Public License - # along with this program. If not, see . - --if {[skip_shlib_tests]} { -- return 0 --} -+require allow_shlib_tests - - set testfile "gcore-buildid-exec-but-not-solib" - set srcmainfile ${testfile}-main.c -diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp -index 052bd84d420..73a9bb64903 100644 ---- a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp -+++ b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp -@@ -17,9 +17,7 @@ - # invalid IFUNC DW_AT_linkage_name: memmove strstr time - # http://sourceware.org/bugzilla/show_bug.cgi?id=14166 - --if {[skip_shlib_tests]} { -- return 0 --} -+require allow_shlib_tests - - set testfile "gnu-ifunc-strstr-workaround" - set executable ${testfile} -diff --git a/gdb/testsuite/gdb.cp/cxxexec.exp b/gdb/testsuite/gdb.cp/cxxexec.exp -index 77c85587407..089a679a1a9 100644 ---- a/gdb/testsuite/gdb.cp/cxxexec.exp -+++ b/gdb/testsuite/gdb.cp/cxxexec.exp -@@ -13,7 +13,7 @@ - # You should have received a copy of the GNU General Public License - # along with this program. If not, see . - --if { [skip_cplus_tests] } { continue } -+require allow_cplus_tests - - set testfile cxxexec - if { [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.cc {c++ debug}] } { -diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp -index 2e6786d499a..d2693cfef1d 100644 ---- a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp -+++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp -@@ -13,6 +13,8 @@ - # You should have received a copy of the GNU General Public License - # along with this program. If not, see . - -+require allow_python_tests -+ - set testfile py-gdb-rhbz1007614-memleak-infpy_read_memory - set srcfile ${testfile}.c - set binfile [standard_output_file ${testfile}] -@@ -21,8 +23,6 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { - return -1 - } - --if { [skip_python_tests] } { continue } -- - set pid_of_gdb [exp_pid -i [board_info host fileid]] - - proc memory_v_pages_get {} { -diff --git a/gdb/testsuite/gdb.python/rh634108-solib_address.exp b/gdb/testsuite/gdb.python/rh634108-solib_address.exp -index ebf00babc34..2d950b79951 100644 ---- a/gdb/testsuite/gdb.python/rh634108-solib_address.exp -+++ b/gdb/testsuite/gdb.python/rh634108-solib_address.exp -@@ -15,10 +15,10 @@ - - # https://bugzilla.redhat.com/show_bug.cgi?id=634108 - -+# Skip all tests if Python scripting is not enabled. -+require allow_python_tests -+ - gdb_exit - gdb_start - --# Skip all tests if Python scripting is not enabled. --if { [skip_python_tests] } { continue } -- - gdb_test "python print (gdb.solib_name(0))" "None" "gdb.solib_name exists" - -base-commit: 50ee7556c2430effed45ca542852f36368336dce --- -2.35.3 - diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch index c2e49ec..1925d2a 100644 --- a/gdb-6.3-gstack-20050411.patch +++ b/gdb-6.3-gstack-20050411.patch @@ -226,7 +226,7 @@ new file mode 100644 +# exiting the function. Still we could retry the gstack command if we fail. + +set test "spawn gstack" -+set command "sh -c GDB=$GDB\\ GDBARGS=-data-directory\\\\\\ $BUILD_DATA_DIRECTORY\\ sh\\ ${srcdir}/../gstack.sh\\ $pid\\;echo\\ GSTACK-END" ++set command "sh -c GDB=$GDB\\ GDBARGS=-data-directory\\\\\\ $GDB_DATA_DIRECTORY\\ sh\\ ${srcdir}/../gstack.sh\\ $pid\\;echo\\ GSTACK-END" +set res [remote_spawn host $command]; +if { $res < 0 || $res == "" } { + perror "Spawning $command failed." diff --git a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch deleted file mode 100644 index 52bf236..0000000 --- a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +++ /dev/null @@ -1,19 +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-6.6-buildid-locate-rpm-librpm-workaround.patch - -;; Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879). -;;=push+jan - -diff --git a/gdb/proc-service.list b/gdb/proc-service.list ---- a/gdb/proc-service.list -+++ b/gdb/proc-service.list -@@ -37,4 +37,7 @@ - ps_pstop; - ps_ptread; - ps_ptwrite; -+ -+ /* gdb-6.6-buildid-locate-rpm.patch */ -+ rpmsqEnable; - }; diff --git a/gdb-6.6-buildid-locate-rpm-suse.patch b/gdb-6.6-buildid-locate-rpm-suse.patch index 5b9cf7f..fdf7a7f 100644 --- a/gdb-6.6-buildid-locate-rpm-suse.patch +++ b/gdb-6.6-buildid-locate-rpm-suse.patch @@ -1,123 +1,43 @@ -diff --git a/gdb/build-id.c b/gdb/build-id.c -index 059a72fc050..58d73e70bad 100644 ---- a/gdb/build-id.c -+++ b/gdb/build-id.c -@@ -863,10 +863,8 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) - #endif - { - Header h; -- char *debuginfo, **slot, *s, *s2; -+ char *debuginfo, **slot; - errmsg_t err; -- size_t srcrpmlen = sizeof (".src.rpm") - 1; -- size_t debuginfolen = sizeof ("-debuginfo") - 1; - rpmdbMatchIterator mi_debuginfo; +diff --git a/gdb/python/lib/gdb/command/rpm-suggestions.py b/gdb/python/lib/gdb/command/rpm-suggestions.py +index 293b1638617..463684c1462 100644 +--- a/gdb/python/lib/gdb/command/rpm-suggestions.py ++++ b/gdb/python/lib/gdb/command/rpm-suggestions.py +@@ -28,6 +28,8 @@ __missing_rpms = {} + # the prompt is shown. + __suggest_rpms = {} - h = rpmdbNextIterator_p (mi); -@@ -875,7 +873,9 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) ++__package_to_debug_package = {} ++ - /* Verify the debuginfo file is not already installed. */ + # Lookup RPMs that might provide the debug information for FILENAME, + # which is a string containing the path to an object file GDB could +@@ -43,6 +45,7 @@ def find_suggestions(filename): + for h in mi: + # Build the debuginfo package name. + obj = h.format("%{name}-debuginfo-%{version}-%{release}.%{arch}") ++ debug_rpm_name = str(obj) -- debuginfo = headerFormat_p (h, "%{sourcerpm}-debuginfo.%{arch}", -+ /* The allocated memory gets utilized below for MISSING_RPM_HASH. */ -+ debuginfo = headerFormat_p (h, -+ "%{name}-debuginfo-%{version}-%{release}.%{arch}", - &err); - if (!debuginfo) - { -@@ -883,60 +883,19 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) - err); - continue; - } -- /* s = `.src.rpm-debuginfo.%{arch}' */ -- s = strrchr (debuginfo, '-') - srcrpmlen; -- s2 = NULL; -- if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0) -- { -- /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */ -- s2 = (char *) memrchr (debuginfo, '-', s - debuginfo); -- } -- if (s2) -- { -- /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */ -- s2 = (char *) memrchr (debuginfo, '-', s2 - debuginfo); -- } -- if (!s2) -- { -- warning (_("Error querying the rpm file `%s': %s"), filename, -- debuginfo); -- xfree (debuginfo); -- continue; -- } -- /* s = `.src.rpm-debuginfo.%{arch}' */ -- /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */ -- memmove (s2 + debuginfolen, s2, s - s2); -- memcpy (s2, "-debuginfo", debuginfolen); -- /* s = `XXXX.%{arch}' */ -- /* strlen ("XXXX") == srcrpmlen + debuginfolen */ -- /* s2 = `-debuginfo-%{version}-%{release}XX.%{arch}' */ -- /* strlen ("XX") == srcrpmlen */ -- memmove (s + debuginfolen, s + srcrpmlen + debuginfolen, -- strlen (s + srcrpmlen + debuginfolen) + 1); -- /* s = `-debuginfo-%{version}-%{release}.%{arch}' */ + # Check to see if the package is installed. + mi2 = ts.dbMatch(rpm.RPMDBI_LABEL, str(obj)) +@@ -52,6 +55,7 @@ def find_suggestions(filename): + # Now build the name of the package FILENAME came from. + obj = h.format("%{name}-%{version}-%{release}.%{arch}") + rpm_name = str(obj) ++ __package_to_debug_package[rpm_name] = debug_rpm_name + if not rpm_name in __missing_rpms: + __suggest_rpms[rpm_name] = True + __missing_rpms[rpm_name] = True +@@ -83,10 +87,12 @@ class RPMSuggestionHandler(gdb.missing_debug.MissingDebugHandler): + # suggests this to the user. + def before_prompt(): + global __suggest_rpms ++ global __package_to_debug_package -+ /* Verify the debuginfo file is not already installed. */ - /* RPMDBI_PACKAGES requires keylen == sizeof (int). */ - /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */ - mi_debuginfo = rpmtsInitIterator_p (ts, (rpmDbiTagVal) RPMDBI_LABEL, debuginfo, 0); -- xfree (debuginfo); - if (mi_debuginfo) - { -+ xfree (debuginfo); - rpmdbFreeIterator_p (mi_debuginfo); - count = 0; - break; - } + if len(__suggest_rpms) > 0: + for p in __suggest_rpms.keys(): +- print("Missing debuginfo, try: dnf debuginfo-install " + p) ++ dp = __package_to_debug_package[p] ++ print("Missing separate debuginfos, use: zypper install " + dp) + __suggest_rpms = {} -- /* The allocated memory gets utilized below for MISSING_RPM_HASH. */ -- debuginfo = headerFormat_p (h, -- "%{name}-%{version}-%{release}.%{arch}", -- &err); -- if (!debuginfo) -- { -- warning (_("Error querying the rpm file `%s': %s"), filename, -- err); -- continue; -- } -- - /* Base package name for `debuginfo-install'. We do not use the - `yum' command directly as the line - yum --enablerepo='*debug*' install NAME-debuginfo.ARCH -@@ -1085,10 +1044,7 @@ missing_rpm_list_print (void) - missing_rpm_list_entries = 0; - gdb_printf (_("Missing separate debuginfos, use: %s"), --#ifdef DNF_DEBUGINFO_INSTALL -- "dnf " --#endif -- "debuginfo-install"); -+ "zypper install"); - for (const char *el : array) - { - gdb_printf (" %s", el); -@@ -1296,14 +1252,15 @@ debug_print_missing (const char *binary, const char *debug) - _("Missing separate debuginfo for %s.\n"), binary); - if (debug != NULL) - { -+#ifdef HAVE_LIBRPM - if (access (debug, F_OK) == 0) { -- gdb_printf (gdb_stdlog, _("Try: %s %s\n"), --#ifdef DNF_DEBUGINFO_INSTALL -- "dnf" - #else -- "yum" -+ if (1) { - #endif -- " --enablerepo='*debug*' install", debug); -+ const char *p = strrchr (debug, '/'); -+ gdb_printf (gdb_stdlog, _("Try: %s%.2s%.38s\"\n"), -+ "zypper install -C \"debuginfo(build-id)=", -+ p - 2, p + 1); - } else - gdb_printf (gdb_stdlog, _("The debuginfo package for this file is probably broken.\n")); - } diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch deleted file mode 100644 index 41ecef7..0000000 --- a/gdb-6.6-buildid-locate-rpm.patch +++ /dev/null @@ -1,1084 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Kevin Buettner -Date: Wed, 22 Feb 2023 22:30:40 -0700 -Subject: gdb-6.6-buildid-locate-rpm.patch - -;;=push+jan - -diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4 ---- a/gdb/aclocal.m4 -+++ b/gdb/aclocal.m4 -@@ -11,7 +11,223 @@ - # even the implied warranty of MERCHANTABILITY or FITNESS FOR A - # PARTICULAR PURPOSE. - -+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -+# serial 1 (pkg-config-0.24) -+# -+# Copyright © 2004 Scott James Remnant . -+# -+# 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. -+# -+# As a special exception to the GNU General Public License, if you -+# distribute this file as part of a program that contains a -+# configuration script generated by Autoconf, you may include it under -+# the same distribution terms that you use for the rest of that program. -+ -+# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -+# ---------------------------------- -+AC_DEFUN([PKG_PROG_PKG_CONFIG], -+[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) -+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) -+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) -+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) -+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) -+ -+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then -+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) -+fi -+if test -n "$PKG_CONFIG"; then -+ _pkg_min_version=m4_default([$1], [0.9.0]) -+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) -+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then -+ AC_MSG_RESULT([yes]) -+ else -+ AC_MSG_RESULT([no]) -+ PKG_CONFIG="" -+ fi -+fi[]dnl -+])# PKG_PROG_PKG_CONFIG -+ -+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -+# -+# Check to see whether a particular set of modules exists. Similar -+# to PKG_CHECK_MODULES(), but does not set variables or print errors. -+# -+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -+# only at the first occurence in configure.ac, so if the first place -+# it's called might be skipped (such as if it is within an "if", you -+# have to call PKG_CHECK_EXISTS manually -+# -------------------------------------------------------------- -+AC_DEFUN([PKG_CHECK_EXISTS], -+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -+if test -n "$PKG_CONFIG" && \ -+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then -+ m4_default([$2], [:]) -+m4_ifvaln([$3], [else -+ $3])dnl -+fi]) -+ -+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -+# --------------------------------------------- -+m4_define([_PKG_CONFIG], -+[if test -n "$$1"; then -+ pkg_cv_[]$1="$$1" -+ elif test -n "$PKG_CONFIG"; then -+ PKG_CHECK_EXISTS([$3], -+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` -+ test "x$?" != "x0" && pkg_failed=yes ], -+ [pkg_failed=yes]) -+ else -+ pkg_failed=untried -+fi[]dnl -+])# _PKG_CONFIG -+ -+# _PKG_SHORT_ERRORS_SUPPORTED -+# ----------------------------- -+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -+[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then -+ _pkg_short_errors_supported=yes -+else -+ _pkg_short_errors_supported=no -+fi[]dnl -+])# _PKG_SHORT_ERRORS_SUPPORTED -+ -+ -+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -+# [ACTION-IF-NOT-FOUND]) -+# -+# -+# Note that if there is a possibility the first call to -+# PKG_CHECK_MODULES might not happen, you should be sure to include an -+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -+# -+# -+# -------------------------------------------------------------- -+AC_DEFUN([PKG_CHECK_MODULES], -+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl -+ -+pkg_failed=no -+AC_MSG_CHECKING([for $1]) -+ -+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -+_PKG_CONFIG([$1][_LIBS], [libs], [$2]) -+ -+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -+and $1[]_LIBS to avoid the need to call pkg-config. -+See the pkg-config man page for more details.]) -+ -+if test $pkg_failed = yes; then -+ AC_MSG_RESULT([no]) -+ _PKG_SHORT_ERRORS_SUPPORTED -+ if test $_pkg_short_errors_supported = yes; then -+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` -+ else -+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` -+ fi -+ # Put the nasty error message in config.log where it belongs -+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD -+ -+ m4_default([$4], [AC_MSG_ERROR( -+[Package requirements ($2) were not met: -+ -+$$1_PKG_ERRORS -+ -+Consider adjusting the PKG_CONFIG_PATH environment variable if you -+installed software in a non-standard prefix. -+ -+_PKG_TEXT])[]dnl -+ ]) -+elif test $pkg_failed = untried; then -+ AC_MSG_RESULT([no]) -+ m4_default([$4], [AC_MSG_FAILURE( -+[The pkg-config script could not be found or is too old. Make sure it -+is in your PATH or set the PKG_CONFIG environment variable to the full -+path to pkg-config. -+ -+_PKG_TEXT -+ -+To get pkg-config, see .])[]dnl -+ ]) -+else -+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS -+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS -+ AC_MSG_RESULT([yes]) -+ $3 -+fi[]dnl -+])# PKG_CHECK_MODULES -+ -+ -+# PKG_INSTALLDIR(DIRECTORY) -+# ------------------------- -+# Substitutes the variable pkgconfigdir as the location where a module -+# should install pkg-config .pc files. By default the directory is -+# $libdir/pkgconfig, but the default can be changed by passing -+# DIRECTORY. The user can override through the --with-pkgconfigdir -+# parameter. -+AC_DEFUN([PKG_INSTALLDIR], -+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) -+m4_pushdef([pkg_description], -+ [pkg-config installation directory @<:@]pkg_default[@:>@]) -+AC_ARG_WITH([pkgconfigdir], -+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, -+ [with_pkgconfigdir=]pkg_default) -+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) -+m4_popdef([pkg_default]) -+m4_popdef([pkg_description]) -+]) dnl PKG_INSTALLDIR -+ -+ -+# PKG_NOARCH_INSTALLDIR(DIRECTORY) -+# ------------------------- -+# Substitutes the variable noarch_pkgconfigdir as the location where a -+# module should install arch-independent pkg-config .pc files. By -+# default the directory is $datadir/pkgconfig, but the default can be -+# changed by passing DIRECTORY. The user can override through the -+# --with-noarch-pkgconfigdir parameter. -+AC_DEFUN([PKG_NOARCH_INSTALLDIR], -+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) -+m4_pushdef([pkg_description], -+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) -+AC_ARG_WITH([noarch-pkgconfigdir], -+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, -+ [with_noarch_pkgconfigdir=]pkg_default) -+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) -+m4_popdef([pkg_default]) -+m4_popdef([pkg_description]) -+]) dnl PKG_NOARCH_INSTALLDIR -+ -+ -+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, -+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -+# ------------------------------------------- -+# Retrieves the value of the pkg-config variable for the given module. -+AC_DEFUN([PKG_CHECK_VAR], -+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl -+ -+_PKG_CONFIG([$1], [variable="][$3]["], [$2]) -+AS_VAR_COPY([$1], [pkg_cv_][$1]) -+ -+AS_VAR_IF([$1], [""], [$5], [$4])dnl -+])# PKG_CHECK_VAR -+ - m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -+ - # AM_AUX_DIR_EXPAND -*- Autoconf -*- - - # Copyright (C) 2001-2017 Free Software Foundation, Inc. -diff --git a/gdb/build-id.c b/gdb/build-id.c ---- a/gdb/build-id.c -+++ b/gdb/build-id.c -@@ -780,10 +780,10 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) - static rpmts (*rpmtsCreate_p) (void); - extern rpmts rpmtsFree(rpmts ts); - static rpmts (*rpmtsFree_p) (rpmts ts); -- extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, -+ extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, - const void * keyp, size_t keylen); - static rpmdbMatchIterator (*rpmtsInitIterator_p) (const rpmts ts, -- rpmTag rpmtag, -+ rpmDbiTagVal rpmtag, - const void *keyp, - size_t keylen); - #else /* !DLOPEN_LIBRPM */ -@@ -838,7 +838,7 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) - && (rpmdbNextIterator_p = (Header (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbNextIterator")) - && (rpmtsCreate_p = (rpmts (*) (void)) dlsym (h, "rpmtsCreate")) - && (rpmtsFree_p = (rpmts (*) (rpmts ts)) dlsym (h, "rpmtsFree")) -- && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator")))) -+ && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmDbiTagVal rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator")))) - { - warning (_("Opened library \"%s\" is incompatible (%s), " - "missing debuginfos notifications will not be displayed"), -@@ -926,7 +926,7 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) - - /* RPMDBI_PACKAGES requires keylen == sizeof (int). */ - /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */ -- mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0); -+ mi_debuginfo = rpmtsInitIterator_p (ts, (rpmDbiTagVal) RPMDBI_LABEL, debuginfo, 0); - xfree (debuginfo); - if (mi_debuginfo) - { -diff --git a/gdb/config.in b/gdb/config.in ---- a/gdb/config.in -+++ b/gdb/config.in -@@ -42,6 +42,9 @@ - /* Handle .ctf type-info sections */ - #undef ENABLE_LIBCTF - -+/* librpm version specific library name to dlopen. */ -+#undef DLOPEN_LIBRPM -+ - /* Define to 1 if translation of program messages to the user's native - language is requested. */ - #undef ENABLE_NLS -@@ -265,6 +268,9 @@ - /* Define to 1 if you have the `m' library (-lm). */ - #undef HAVE_LIBM - -+/* Define if librpm library is being used. */ -+#undef HAVE_LIBRPM -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_LIBUNWIND_IA64_H - -diff --git a/gdb/configure b/gdb/configure ---- a/gdb/configure -+++ b/gdb/configure -@@ -778,6 +778,11 @@ AMD_DBGAPI_CFLAGS - ENABLE_BFD_64_BIT_FALSE - ENABLE_BFD_64_BIT_TRUE - subdirs -+RPM_LIBS -+RPM_CFLAGS -+PKG_CONFIG_LIBDIR -+PKG_CONFIG_PATH -+PKG_CONFIG - GDB_DATADIR - DEBUGDIR - MAKEINFO_EXTRA_FLAGS -@@ -911,6 +916,7 @@ with_gdb_datadir - with_relocated_sources - with_auto_load_dir - with_auto_load_safe_path -+with_rpm - enable_targets - enable_64_bit_bfd - with_amd_dbgapi -@@ -988,6 +994,8 @@ AMD_DBGAPI_CFLAGS - AMD_DBGAPI_LIBS - DEBUGINFOD_CFLAGS - DEBUGINFOD_LIBS -+RPM_CFLAGS -+RPM_LIBS - YACC - YFLAGS - ZSTD_CFLAGS -@@ -1679,6 +1687,8 @@ Optional Packages: - --with-amd-dbgapi support for the amd-dbgapi target (yes / no / auto) - --with-debuginfod Enable debuginfo lookups with debuginfod - (auto/yes/no) -+ --with-rpm query rpm database for missing debuginfos (yes/no, -+ def. auto=librpm.so) - --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets - --with-curses use the curses library instead of the termcap - library -@@ -1759,6 +1769,8 @@ Some influential environment variables: - C compiler flags for DEBUGINFOD, overriding pkg-config - DEBUGINFOD_LIBS - linker flags for DEBUGINFOD, overriding pkg-config -+ RPM_CFLAGS C compiler flags for RPM, overriding pkg-config -+ RPM_LIBS linker flags for RPM, overriding pkg-config - YACC The `Yet Another Compiler Compiler' implementation to use. - Defaults to the first program found out of: `bison -y', `byacc', - `yacc'. -@@ -18039,6 +18051,495 @@ _ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5 - $as_echo "$with_auto_load_safe_path" >&6; } - -+# Integration with rpm library to support missing debuginfo suggestions. -+# --without-rpm: Disable any rpm support. -+# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime. -+# Even with runtime missing `libname.so' GDB will still other run correctly. -+# Missing `libname.so' during ./configure will abort the configuration. -+# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific -+# minor version first such as `librpm-4.6.so' as minor version differences -+# mean API+ABI incompatibility. If the specific match versioned library name -+# could not be found still open dynamically at least `librpm.so'. -+# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try -+# to find librpm for compilation-time linking by pkg-config. GDB binary will -+# be probably linked with the version specific library (as `librpm-4.6.so'). -+# Failure to find librpm by pkg-config will abort the configuration. -+# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config -+# cannot find librpm use to the rpmless compilation (like `--without-rpm'). -+ -+ -+# Check whether --with-rpm was given. -+if test "${with_rpm+set}" = set; then : -+ withval=$with_rpm; -+else -+ with_rpm="auto" -+fi -+ -+ -+ -+ -+if test "x$with_rpm" != "xno"; then -+ if test "x$with_rpm" = "xyes"; then -+ LIBRPM="librpm.so" -+ RPM_REQUIRE=true -+ DLOPEN_REQUIRE=false -+ elif test "x$with_rpm" = "xauto"; then -+ LIBRPM="librpm.so" -+ RPM_REQUIRE=false -+ DLOPEN_REQUIRE=false -+ else -+ LIBRPM="$with_rpm" -+ RPM_REQUIRE=true -+ DLOPEN_REQUIRE=true -+ fi -+ LIBRPM_STRING='"'"$LIBRPM"'"' -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking specific librpm version" >&5 -+$as_echo_n "checking specific librpm version... " >&6; } -+ HAVE_DLOPEN_LIBRPM=false -+ save_LIBS="$LIBS" -+ LIBS="$LIBS -ldl" -+ if test "$cross_compiling" = yes; then : -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -+as_fn_error "cannot run test program while cross compiling -+See \`config.log' for more details." "$LINENO" 5; } -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#include -+#include -+#include -+ -+int -+main () -+{ -+ -+ void *h; -+ const char *const *rpmverp; -+ FILE *f; -+ -+ f = fopen ("conftest.out", "w"); -+ if (!f) -+ { -+ fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out", -+ strerror (errno)); -+ return 1; -+ } -+ h = dlopen ($LIBRPM_STRING, RTLD_LAZY); -+ if (!h) -+ { -+ fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ()); -+ return 1; -+ } -+ rpmverp = dlsym (h, "RPMVERSION"); -+ if (!rpmverp) -+ { -+ fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ()); -+ return 1; -+ } -+ fprintf (stderr, "RPMVERSION is: \""); -+ fprintf (stderr, "%s\"\n", *rpmverp); -+ -+ /* Try to find the specific librpm version only for "librpm.so" as we do -+ not know how to assemble the version string otherwise. */ -+ -+ if (strcmp ("librpm.so", $LIBRPM_STRING) != 0) -+ { -+ fprintf (f, "%s\n", $LIBRPM_STRING); -+ return 0; -+ } -+ else -+ { -+ char *h2_name; -+ void *h2; -+ int major, minor; -+ -+ if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2) -+ { -+ fprintf (stderr, "Unable to parse RPMVERSION.\n"); -+ fprintf (f, "%s\n", $LIBRPM_STRING); -+ return 0; -+ } -+ /* Avoid the square brackets by malloc. */ -+ h2_name = malloc (64); -+ sprintf (h2_name, "librpm-%d.%d.so", major, minor); -+ h2 = dlopen (h2_name, RTLD_LAZY); -+ if (!h2) -+ { -+ fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ()); -+ fprintf (f, "%s\n", $LIBRPM_STRING); -+ return 0; -+ } -+ if (h2 != h) -+ { -+ fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n", -+ $LIBRPM_STRING, h2_name); -+ fprintf (f, "%s\n", $LIBRPM_STRING); -+ return 0; -+ } -+ /* Found the valid .so name with a specific version. */ -+ fprintf (f, "%s\n", h2_name); -+ return 0; -+ } -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ -+ DLOPEN_LIBRPM="`cat conftest.out`" -+ if test "x$DLOPEN_LIBRPM" != "x"; then -+ HAVE_DLOPEN_LIBRPM=true -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLOPEN_LIBRPM" >&5 -+$as_echo "$DLOPEN_LIBRPM" >&6; } -+ fi -+ -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+ rm -f conftest.out -+ -+ -+ -+ if $HAVE_DLOPEN_LIBRPM; then -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5 -+$as_echo_n "checking rpm library API compatibility... " >&6; } -+ # The compilation requires -Werror to verify anything. -+ save_CFLAGS="$CFLAGS" -+ CFLAGS="$CFLAGS -Werror" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Duplicate here the declarations to verify they match "elfread.c". */ -+#include -+#include -+#include -+#include -+extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg); -+extern int rpmReadConfigFiles(const char * file, const char * target); -+extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi); -+extern Header rpmdbNextIterator(rpmdbMatchIterator mi); -+extern rpmts rpmtsCreate(void); -+extern rpmts rpmtsFree(rpmts ts); -+extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, -+ const void * keyp, size_t keylen); -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ -+ LIBRPM_COMPAT=true -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+else -+ -+ LIBRPM_COMPAT=false -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ CFLAGS="$save_CFLAGS" -+ -+ if ! $LIBRPM_COMPAT; then -+ HAVE_DLOPEN_LIBRPM=false -+ fi -+ fi -+ -+ if $HAVE_DLOPEN_LIBRPM; then -+ DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"' -+ -+cat >>confdefs.h <<_ACEOF -+#define DLOPEN_LIBRPM $DLOPEN_LIBRPM_STRING -+_ACEOF -+ -+ -+$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h -+ -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ LIBS="$save_LIBS" -+ if $DLOPEN_REQUIRE; then -+ as_fn_error "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5 -+ fi -+ -+ -+ -+ -+ -+ -+ -+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then -+ if test -n "$ac_tool_prefix"; then -+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : -+ $as_echo_n "(cached) " >&6 -+else -+ case $PKG_CONFIG in -+ [\\/]* | ?:[\\/]*) -+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. -+ ;; -+ *) -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+ ;; -+esac -+fi -+PKG_CONFIG=$ac_cv_path_PKG_CONFIG -+if test -n "$PKG_CONFIG"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -+$as_echo "$PKG_CONFIG" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+fi -+if test -z "$ac_cv_path_PKG_CONFIG"; then -+ ac_pt_PKG_CONFIG=$PKG_CONFIG -+ # Extract the first word of "pkg-config", so it can be a program name with args. -+set dummy pkg-config; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : -+ $as_echo_n "(cached) " >&6 -+else -+ case $ac_pt_PKG_CONFIG in -+ [\\/]* | ?:[\\/]*) -+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. -+ ;; -+ *) -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+ ;; -+esac -+fi -+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -+if test -n "$ac_pt_PKG_CONFIG"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -+$as_echo "$ac_pt_PKG_CONFIG" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ if test "x$ac_pt_PKG_CONFIG" = x; then -+ PKG_CONFIG="" -+ else -+ case $cross_compiling:$ac_tool_warned in -+yes:) -+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -+ac_tool_warned=yes ;; -+esac -+ PKG_CONFIG=$ac_pt_PKG_CONFIG -+ fi -+else -+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -+fi -+ -+fi -+if test -n "$PKG_CONFIG"; then -+ _pkg_min_version=0.9.0 -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } -+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ PKG_CONFIG="" -+ fi -+fi -+ -+pkg_failed=no -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM" >&5 -+$as_echo_n "checking for RPM... " >&6; } -+ -+if test -n "$RPM_CFLAGS"; then -+ pkg_cv_RPM_CFLAGS="$RPM_CFLAGS" -+ elif test -n "$PKG_CONFIG"; then -+ if test -n "$PKG_CONFIG" && \ -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5 -+ ($PKG_CONFIG --exists --print-errors "rpm") 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; then -+ pkg_cv_RPM_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null` -+ test "x$?" != "x0" && pkg_failed=yes -+else -+ pkg_failed=yes -+fi -+ else -+ pkg_failed=untried -+fi -+if test -n "$RPM_LIBS"; then -+ pkg_cv_RPM_LIBS="$RPM_LIBS" -+ elif test -n "$PKG_CONFIG"; then -+ if test -n "$PKG_CONFIG" && \ -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"rpm\""; } >&5 -+ ($PKG_CONFIG --exists --print-errors "rpm") 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; then -+ pkg_cv_RPM_LIBS=`$PKG_CONFIG --libs "rpm" 2>/dev/null` -+ test "x$?" != "x0" && pkg_failed=yes -+else -+ pkg_failed=yes -+fi -+ else -+ pkg_failed=untried -+fi -+ -+ -+ -+if test $pkg_failed = yes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ -+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then -+ _pkg_short_errors_supported=yes -+else -+ _pkg_short_errors_supported=no -+fi -+ if test $_pkg_short_errors_supported = yes; then -+ RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "rpm" 2>&1` -+ else -+ RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "rpm" 2>&1` -+ fi -+ # Put the nasty error message in config.log where it belongs -+ echo "$RPM_PKG_ERRORS" >&5 -+ -+ HAVE_LIBRPM=false -+elif test $pkg_failed = untried; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ HAVE_LIBRPM=false -+else -+ RPM_CFLAGS=$pkg_cv_RPM_CFLAGS -+ RPM_LIBS=$pkg_cv_RPM_LIBS -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+ HAVE_LIBRPM=true -+fi -+ -+ if $HAVE_LIBRPM; then -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking rpm library API compatibility" >&5 -+$as_echo_n "checking rpm library API compatibility... " >&6; } -+ # The compilation requires -Werror to verify anything. -+ save_CFLAGS="$CFLAGS" -+ CFLAGS="$CFLAGS -Werror" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Duplicate here the declarations to verify they match "elfread.c". */ -+#include -+#include -+#include -+#include -+extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg); -+extern int rpmReadConfigFiles(const char * file, const char * target); -+extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi); -+extern Header rpmdbNextIterator(rpmdbMatchIterator mi); -+extern rpmts rpmtsCreate(void); -+extern rpmts rpmtsFree(rpmts ts); -+extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, -+ const void * keyp, size_t keylen); -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ -+ LIBRPM_COMPAT=true -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+ -+else -+ -+ LIBRPM_COMPAT=false -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ CFLAGS="$save_CFLAGS" -+ -+ if ! $LIBRPM_COMPAT; then -+ HAVE_LIBRPM=false -+ RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB" -+ fi -+ fi -+ -+ if $HAVE_LIBRPM; then -+ -+$as_echo "#define HAVE_LIBRPM 1" >>confdefs.h -+ -+ CFLAGS="$CFLAGS $RPM_CFLAGS" -+ LIBS="$LIBS $RPM_LIBS" -+ else -+ if $RPM_REQUIRE; then -+ as_fn_error "$RPM_PKG_ERRORS" "$LINENO" 5 -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $RPM_PKG_ERRORS" >&5 -+$as_echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;} -+ fi -+ fi -+ fi -+fi -+ - - - subdirs="$subdirs testsuite" -diff --git a/gdb/configure.ac b/gdb/configure.ac ---- a/gdb/configure.ac -+++ b/gdb/configure.ac -@@ -173,6 +173,200 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir, - [Directories safe to hold auto-loaded files.]) - AC_MSG_RESULT([$with_auto_load_safe_path]) - -+# Integration with rpm library to support missing debuginfo suggestions. -+# --without-rpm: Disable any rpm support. -+# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime. -+# Even with runtime missing `libname.so' GDB will still other run correctly. -+# Missing `libname.so' during ./configure will abort the configuration. -+# --with-rpm=librpm.so: Like `--with-rpm=libname.so' but try to find specific -+# minor version first such as `librpm-4.6.so' as minor version differences -+# mean API+ABI incompatibility. If the specific match versioned library name -+# could not be found still open dynamically at least `librpm.so'. -+# --with-rpm: Like `--with-rpm=librpm.so' but if any of its detection fails try -+# to find librpm for compilation-time linking by pkg-config. GDB binary will -+# be probably linked with the version specific library (as `librpm-4.6.so'). -+# Failure to find librpm by pkg-config will abort the configuration. -+# (default) --with-rpm=auto: Like `--with-rpm=librpm.so' but if even pkg-config -+# cannot find librpm use to the rpmless compilation (like `--without-rpm'). -+ -+AC_ARG_WITH([rpm], -+ [AS_HELP_STRING([--with-rpm], -+ [query rpm database for missing debuginfos (yes/no, def. auto=librpm.so)])], [], [with_rpm="auto"]) -+ -+m4_pattern_allow([^AC_MSG_ERROR$]) -+m4_pattern_allow([^AC_MSG_WARN$]) -+if test "x$with_rpm" != "xno"; then -+ if test "x$with_rpm" = "xyes"; then -+ LIBRPM="librpm.so" -+ RPM_REQUIRE=true -+ DLOPEN_REQUIRE=false -+ elif test "x$with_rpm" = "xauto"; then -+ LIBRPM="librpm.so" -+ RPM_REQUIRE=false -+ DLOPEN_REQUIRE=false -+ else -+ LIBRPM="$with_rpm" -+ RPM_REQUIRE=true -+ DLOPEN_REQUIRE=true -+ fi -+ LIBRPM_STRING='"'"$LIBRPM"'"' -+ -+ AC_MSG_CHECKING([specific librpm version]) -+ HAVE_DLOPEN_LIBRPM=false -+ save_LIBS="$LIBS" -+ LIBS="$LIBS -ldl" -+ AC_RUN_IFELSE(AC_LANG_PROGRAM([[ -+#include -+#include -+#include -+#include -+ ]], [[ -+ void *h; -+ const char *const *rpmverp; -+ FILE *f; -+ -+ f = fopen ("conftest.out", "w"); -+ if (!f) -+ { -+ fprintf (stderr, "Cannot write \"%s\": %s\n", "conftest.out", -+ strerror (errno)); -+ return 1; -+ } -+ h = dlopen ($LIBRPM_STRING, RTLD_LAZY); -+ if (!h) -+ { -+ fprintf (stderr, "dlopen (\"%s\"): %s\n", $LIBRPM_STRING, dlerror ()); -+ return 1; -+ } -+ rpmverp = dlsym (h, "RPMVERSION"); -+ if (!rpmverp) -+ { -+ fprintf (stderr, "dlsym (\"RPMVERSION\"): %s\n", dlerror ()); -+ return 1; -+ } -+ fprintf (stderr, "RPMVERSION is: \""); -+ fprintf (stderr, "%s\"\n", *rpmverp); -+ -+ /* Try to find the specific librpm version only for "librpm.so" as we do -+ not know how to assemble the version string otherwise. */ -+ -+ if (strcmp ("librpm.so", $LIBRPM_STRING) != 0) -+ { -+ fprintf (f, "%s\n", $LIBRPM_STRING); -+ return 0; -+ } -+ else -+ { -+ char *h2_name; -+ void *h2; -+ int major, minor; -+ -+ if (sscanf (*rpmverp, "%d.%d", &major, &minor) != 2) -+ { -+ fprintf (stderr, "Unable to parse RPMVERSION.\n"); -+ fprintf (f, "%s\n", $LIBRPM_STRING); -+ return 0; -+ } -+ /* Avoid the square brackets by malloc. */ -+ h2_name = malloc (64); -+ sprintf (h2_name, "librpm-%d.%d.so", major, minor); -+ h2 = dlopen (h2_name, RTLD_LAZY); -+ if (!h2) -+ { -+ fprintf (stderr, "dlopen (\"%s\"): %s\n", h2_name, dlerror ()); -+ fprintf (f, "%s\n", $LIBRPM_STRING); -+ return 0; -+ } -+ if (h2 != h) -+ { -+ fprintf (stderr, "dlopen of \"%s\" and \"%s\" are different.\n", -+ $LIBRPM_STRING, h2_name); -+ fprintf (f, "%s\n", $LIBRPM_STRING); -+ return 0; -+ } -+ /* Found the valid .so name with a specific version. */ -+ fprintf (f, "%s\n", h2_name); -+ return 0; -+ } -+ ]]), [ -+ DLOPEN_LIBRPM="`cat conftest.out`" -+ if test "x$DLOPEN_LIBRPM" != "x"; then -+ HAVE_DLOPEN_LIBRPM=true -+ AC_MSG_RESULT($DLOPEN_LIBRPM) -+ fi -+ ]) -+ rm -f conftest.out -+ -+ m4_define([CHECK_LIBRPM_COMPAT], [ -+ AC_MSG_CHECKING([rpm library API compatibility]) -+ # The compilation requires -Werror to verify anything. -+ save_CFLAGS="$CFLAGS" -+ CFLAGS="$CFLAGS -Werror" -+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[ -+/* Duplicate here the declarations to verify they match "elfread.c". */ -+#include -+#include -+#include -+#include -+extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg); -+extern int rpmReadConfigFiles(const char * file, const char * target); -+extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi); -+extern Header rpmdbNextIterator(rpmdbMatchIterator mi); -+extern rpmts rpmtsCreate(void); -+extern rpmts rpmtsFree(rpmts ts); -+extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, -+ const void * keyp, size_t keylen); -+ ]]), [ -+ LIBRPM_COMPAT=true -+ AC_MSG_RESULT(yes) -+ ], [ -+ LIBRPM_COMPAT=false -+ AC_MSG_RESULT(no) -+ ]) -+ CFLAGS="$save_CFLAGS" -+ ]) -+ -+ if $HAVE_DLOPEN_LIBRPM; then -+ CHECK_LIBRPM_COMPAT -+ if ! $LIBRPM_COMPAT; then -+ HAVE_DLOPEN_LIBRPM=false -+ fi -+ fi -+ -+ if $HAVE_DLOPEN_LIBRPM; then -+ DLOPEN_LIBRPM_STRING='"'"$DLOPEN_LIBRPM"'"' -+ AC_DEFINE_UNQUOTED(DLOPEN_LIBRPM, $DLOPEN_LIBRPM_STRING, [librpm version specific library name to dlopen.]) -+ AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.]) -+ else -+ AC_MSG_RESULT(no) -+ LIBS="$save_LIBS" -+ if $DLOPEN_REQUIRE; then -+ AC_MSG_ERROR([Specific name $LIBRPM was requested but it could not be opened.]) -+ fi -+ PKG_CHECK_MODULES(RPM, rpm, [HAVE_LIBRPM=true], [HAVE_LIBRPM=false]) -+ -+ if $HAVE_LIBRPM; then -+ CHECK_LIBRPM_COMPAT -+ if ! $LIBRPM_COMPAT; then -+ HAVE_LIBRPM=false -+ RPM_PKG_ERRORS="Found $LIBRPM API is incompatibile with this GDB" -+ fi -+ fi -+ -+ if $HAVE_LIBRPM; then -+ AC_DEFINE(HAVE_LIBRPM, 1, [Define if librpm library is being used.]) -+ CFLAGS="$CFLAGS $RPM_CFLAGS" -+ LIBS="$LIBS $RPM_LIBS" -+ else -+ if $RPM_REQUIRE; then -+ AC_MSG_ERROR($RPM_PKG_ERRORS) -+ else -+ AC_MSG_WARN($RPM_PKG_ERRORS) -+ fi -+ fi -+ fi -+fi -+ - AC_CONFIG_SUBDIRS(testsuite) - - # Check whether to support alternative target configurations -diff --git a/gdb/event-top.c b/gdb/event-top.c ---- a/gdb/event-top.c -+++ b/gdb/event-top.c -@@ -43,6 +43,7 @@ - #include "async-event.h" - #include "bt-utils.h" - #include "pager.h" -+#include "symfile.h" - - /* readline include files. */ - #include "readline/readline.h" -@@ -404,6 +405,8 @@ display_gdb_prompt (const char *new_prompt) - /* Reset the nesting depth used when trace-commands is set. */ - reset_command_nest_depth (); - -+ debug_flush_missing (); -+ - /* Do not call the python hook on an explicit prompt change as - passed to this function, as this forms a secondary/local prompt, - IE, displayed but not set. */ -@@ -788,7 +791,10 @@ command_line_handler (gdb::unique_xmalloc_ptr &&rl) - command_handler (cmd); - - if (ui->prompt_state != PROMPTED) -- display_gdb_prompt (0); -+ { -+ debug_flush_missing (); -+ display_gdb_prompt (0); -+ } - } - } - -diff --git a/gdb/symfile.h b/gdb/symfile.h ---- a/gdb/symfile.h -+++ b/gdb/symfile.h -@@ -366,6 +366,7 @@ extern void generic_load (const char *args, int from_tty); - /* build-id support. */ - extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr); - extern void debug_print_missing (const char *binary, const char *debug); -+extern void debug_flush_missing (void); - #define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file") - - /* From minidebug.c. */ diff --git a/gdb-6.6-buildid-locate-solib-missing-ids.patch b/gdb-6.6-buildid-locate-solib-missing-ids.patch index f52fbd9..3ccdb9a 100644 --- a/gdb-6.6-buildid-locate-solib-missing-ids.patch +++ b/gdb-6.6-buildid-locate-solib-missing-ids.patch @@ -130,7 +130,7 @@ diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp b/gdb/t new file mode 100644 --- /dev/null +++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp -@@ -0,0 +1,105 @@ +@@ -0,0 +1,104 @@ +# Copyright 2016 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -146,9 +146,7 @@ new file mode 100644 +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + -+if {[skip_shlib_tests]} { -+ return 0 -+} ++require allow_shlib_tests + +set testfile "gcore-buildid-exec-but-not-solib" +set srcmainfile ${testfile}-main.c @@ -226,7 +224,8 @@ new file mode 100644 +remote_exec build "ln -s /lib64 ${debugdir}/" +# /usr is not needed, all the libs are in /lib64: libm.so.6 libc.so.6 ld-linux-x86-64.so.2 + -+gdb_test "set solib-absolute-prefix $debugdir" ++gdb_test_no_output "set solib-absolute-prefix $debugdir" \ ++ "set solib-absolute-prefix" + +gdb_test_no_output "set debug-file-directory $debugdir" "set debug-file-directory" + diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index f581103..cc738e6 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -553,13 +553,13 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + + /* We expect to be silent on the non-existing files. */ + gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename, gnutarget); -+ + +- return {}; + if (debug_bfd == NULL) + { + if (separate_debug_file_debug) + gdb_printf (gdb_stdlog, _(" no, unable to open.\n")); - -- return {}; ++ + continue; + } + @@ -583,6 +583,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c { if (separate_debug_file_debug) - gdb_printf (gdb_stdlog, _(" no, build-id does not match.\n")); +- +- return {}; + gdb_printf (gdb_stdlog, _(" yes!\n")); + } + else @@ -590,8 +592,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + /* If none of the real files is found report as missing file + always the non-.%u-suffixed file. */ + std::string link0 = orig_link; - -- return {}; ++ + /* If the symlink has target request to install the target. + BASE-debuginfo.rpm contains the symlink but BASE.rpm may be missing. + https://bugzilla.redhat.com/show_bug.cgi?id=981154 */ @@ -665,7 +666,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c if (debug_bfd != NULL) return debug_bfd; } -@@ -190,30 +694,662 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, +@@ -190,20 +694,178 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, return {}; } @@ -683,446 +684,6 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + return result; +} + -+void debug_flush_missing (void); -+ -+#ifdef HAVE_LIBRPM -+ -+#include -+#include -+#include -+#include -+#ifdef DLOPEN_LIBRPM -+#include -+#endif -+ -+/* Workarodun https://bugzilla.redhat.com/show_bug.cgi?id=643031 -+ librpm must not exit() an application on SIGINT -+ -+ Enable or disable a signal handler. SIGNUM: signal to enable (or disable -+ if negative). HANDLER: sa_sigaction handler (or NULL to use -+ rpmsqHandler()). Returns: no. of refs, -1 on error. */ -+extern int rpmsqEnable (int signum, /* rpmsqAction_t handler */ void *handler); -+int -+rpmsqEnable (int signum, /* rpmsqAction_t handler */ void *handler) -+{ -+ return 0; -+} -+ -+/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files -+ and avoid their duplicities during a single inferior run. */ -+ -+static struct htab *missing_rpm_hash; -+ -+/* This MISSING_RPM_LIST tracker is used to collect and print as a single line -+ all the rpms right before the nearest GDB prompt. It gets cleared after -+ each such print (it is questionable if we should clear it after the print). -+ */ -+ -+struct missing_rpm -+ { -+ struct missing_rpm *next; -+ char rpm[1]; -+ }; -+static struct missing_rpm *missing_rpm_list; -+static int missing_rpm_list_entries; -+ -+/* Returns the count of newly added rpms. */ -+ -+static int -+#ifndef GDB_INDEX_VERIFY_VENDOR -+missing_rpm_enlist (const char *filename) -+#else -+missing_rpm_enlist_1 (const char *filename, int verify_vendor) -+#endif -+{ -+ static int rpm_init_done = 0; -+ rpmts ts; -+ rpmdbMatchIterator mi; -+ int count = 0; -+ -+#ifdef DLOPEN_LIBRPM -+ /* Duplicate here the declarations to verify they match. The same sanity -+ check is present also in `configure.ac'. */ -+ extern char * headerFormat(Header h, const char * fmt, errmsg_t * errmsg); -+ static char *(*headerFormat_p) (Header h, const char * fmt, errmsg_t *errmsg); -+ extern int rpmReadConfigFiles(const char * file, const char * target); -+ static int (*rpmReadConfigFiles_p) (const char * file, const char * target); -+ extern rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi); -+ static rpmdbMatchIterator (*rpmdbFreeIterator_p) (rpmdbMatchIterator mi); -+ extern Header rpmdbNextIterator(rpmdbMatchIterator mi); -+ static Header (*rpmdbNextIterator_p) (rpmdbMatchIterator mi); -+ extern rpmts rpmtsCreate(void); -+ static rpmts (*rpmtsCreate_p) (void); -+ extern rpmts rpmtsFree(rpmts ts); -+ static rpmts (*rpmtsFree_p) (rpmts ts); -+ extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, -+ const void * keyp, size_t keylen); -+ static rpmdbMatchIterator (*rpmtsInitIterator_p) (const rpmts ts, -+ rpmTag rpmtag, -+ const void *keyp, -+ size_t keylen); -+#else /* !DLOPEN_LIBRPM */ -+# define headerFormat_p headerFormat -+# define rpmReadConfigFiles_p rpmReadConfigFiles -+# define rpmdbFreeIterator_p rpmdbFreeIterator -+# define rpmdbNextIterator_p rpmdbNextIterator -+# define rpmtsCreate_p rpmtsCreate -+# define rpmtsFree_p rpmtsFree -+# define rpmtsInitIterator_p rpmtsInitIterator -+#endif /* !DLOPEN_LIBRPM */ -+ -+ gdb_assert (filename != NULL); -+ -+ if (strcmp (filename, BUILD_ID_MAIN_EXECUTABLE_FILENAME) == 0) -+ return 0; -+ -+ if (is_target_filename (filename)) -+ return 0; -+ -+ if (filename[0] != '/') -+ { -+ warning (_("Ignoring non-absolute filename: <%s>"), filename); -+ return 0; -+ } -+ -+ if (!rpm_init_done) -+ { -+ static int init_tried; -+ -+ /* Already failed the initialization before? */ -+ if (init_tried) -+ return 0; -+ init_tried = 1; -+ -+#ifdef DLOPEN_LIBRPM -+ { -+ void *h; -+ -+ h = dlopen (DLOPEN_LIBRPM, RTLD_LAZY); -+ if (!h) -+ { -+ warning (_("Unable to open \"%s\" (%s), " -+ "missing debuginfos notifications will not be displayed"), -+ DLOPEN_LIBRPM, dlerror ()); -+ return 0; -+ } -+ -+ if (!((headerFormat_p = (char *(*) (Header h, const char * fmt, errmsg_t *errmsg)) dlsym (h, "headerFormat")) -+ && (rpmReadConfigFiles_p = (int (*) (const char * file, const char * target)) dlsym (h, "rpmReadConfigFiles")) -+ && (rpmdbFreeIterator_p = (rpmdbMatchIterator (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbFreeIterator")) -+ && (rpmdbNextIterator_p = (Header (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbNextIterator")) -+ && (rpmtsCreate_p = (rpmts (*) (void)) dlsym (h, "rpmtsCreate")) -+ && (rpmtsFree_p = (rpmts (*) (rpmts ts)) dlsym (h, "rpmtsFree")) -+ && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator")))) -+ { -+ warning (_("Opened library \"%s\" is incompatible (%s), " -+ "missing debuginfos notifications will not be displayed"), -+ DLOPEN_LIBRPM, dlerror ()); -+ if (dlclose (h)) -+ warning (_("Error closing library \"%s\": %s\n"), DLOPEN_LIBRPM, -+ dlerror ()); -+ return 0; -+ } -+ } -+#endif /* DLOPEN_LIBRPM */ -+ -+ if (rpmReadConfigFiles_p (NULL, NULL) != 0) -+ { -+ warning (_("Error reading the rpm configuration files")); -+ return 0; -+ } -+ -+ rpm_init_done = 1; -+ } -+ -+ ts = rpmtsCreate_p (); -+ -+ mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0); -+ if (mi != NULL) -+ { -+#ifndef GDB_INDEX_VERIFY_VENDOR -+ for (;;) -+#else -+ if (!verify_vendor) for (;;) -+#endif -+ { -+ Header h; -+ char *debuginfo, **slot, *s, *s2; -+ errmsg_t err; -+ size_t srcrpmlen = sizeof (".src.rpm") - 1; -+ size_t debuginfolen = sizeof ("-debuginfo") - 1; -+ rpmdbMatchIterator mi_debuginfo; -+ -+ h = rpmdbNextIterator_p (mi); -+ if (h == NULL) -+ break; -+ -+ /* Verify the debuginfo file is not already installed. */ -+ -+ debuginfo = headerFormat_p (h, "%{sourcerpm}-debuginfo.%{arch}", -+ &err); -+ if (!debuginfo) -+ { -+ warning (_("Error querying the rpm file `%s': %s"), filename, -+ err); -+ continue; -+ } -+ /* s = `.src.rpm-debuginfo.%{arch}' */ -+ s = strrchr (debuginfo, '-') - srcrpmlen; -+ s2 = NULL; -+ if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0) -+ { -+ /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */ -+ s2 = (char *) memrchr (debuginfo, '-', s - debuginfo); -+ } -+ if (s2) -+ { -+ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */ -+ s2 = (char *) memrchr (debuginfo, '-', s2 - debuginfo); -+ } -+ if (!s2) -+ { -+ warning (_("Error querying the rpm file `%s': %s"), filename, -+ debuginfo); -+ xfree (debuginfo); -+ continue; -+ } -+ /* s = `.src.rpm-debuginfo.%{arch}' */ -+ /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */ -+ memmove (s2 + debuginfolen, s2, s - s2); -+ memcpy (s2, "-debuginfo", debuginfolen); -+ /* s = `XXXX.%{arch}' */ -+ /* strlen ("XXXX") == srcrpmlen + debuginfolen */ -+ /* s2 = `-debuginfo-%{version}-%{release}XX.%{arch}' */ -+ /* strlen ("XX") == srcrpmlen */ -+ memmove (s + debuginfolen, s + srcrpmlen + debuginfolen, -+ strlen (s + srcrpmlen + debuginfolen) + 1); -+ /* s = `-debuginfo-%{version}-%{release}.%{arch}' */ -+ -+ /* RPMDBI_PACKAGES requires keylen == sizeof (int). */ -+ /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */ -+ mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0); -+ xfree (debuginfo); -+ if (mi_debuginfo) -+ { -+ rpmdbFreeIterator_p (mi_debuginfo); -+ count = 0; -+ break; -+ } -+ -+ /* The allocated memory gets utilized below for MISSING_RPM_HASH. */ -+ debuginfo = headerFormat_p (h, -+ "%{name}-%{version}-%{release}.%{arch}", -+ &err); -+ if (!debuginfo) -+ { -+ warning (_("Error querying the rpm file `%s': %s"), filename, -+ err); -+ continue; -+ } -+ -+ /* Base package name for `debuginfo-install'. We do not use the -+ `yum' command directly as the line -+ yum --enablerepo='*debug*' install NAME-debuginfo.ARCH -+ would be more complicated than just: -+ debuginfo-install NAME-VERSION-RELEASE.ARCH -+ Do not supply the rpm base name (derived from .src.rpm name) as -+ debuginfo-install is unable to install the debuginfo package if -+ the base name PKG binary rpm is not installed while for example -+ PKG-libs would be installed (RH Bug 467901). -+ FUTURE: After multiple debuginfo versions simultaneously installed -+ get supported the support for the VERSION-RELEASE tags handling -+ may need an update. */ -+ -+ if (missing_rpm_hash == NULL) -+ { -+ /* DEL_F is passed NULL as MISSING_RPM_LIST's HTAB_DELETE -+ should not deallocate the entries. */ -+ -+ missing_rpm_hash = htab_create_alloc (64, htab_hash_string, -+ (int (*) (const void *, const void *)) streq, -+ NULL, xcalloc, xfree); -+ } -+ slot = (char **) htab_find_slot (missing_rpm_hash, debuginfo, INSERT); -+ /* XCALLOC never returns NULL. */ -+ gdb_assert (slot != NULL); -+ if (*slot == NULL) -+ { -+ struct missing_rpm *missing_rpm; -+ -+ *slot = debuginfo; -+ -+ missing_rpm = (struct missing_rpm *) xmalloc (sizeof (*missing_rpm) + strlen (debuginfo)); -+ strcpy (missing_rpm->rpm, debuginfo); -+ missing_rpm->next = missing_rpm_list; -+ missing_rpm_list = missing_rpm; -+ missing_rpm_list_entries++; -+ } -+ else -+ xfree (debuginfo); -+ count++; -+ } -+#ifdef GDB_INDEX_VERIFY_VENDOR -+ else /* verify_vendor */ -+ { -+ int vendor_pass = 0, vendor_fail = 0; -+ -+ for (;;) -+ { -+ Header h; -+ errmsg_t err; -+ char *vendor; -+ -+ h = rpmdbNextIterator_p (mi); -+ if (h == NULL) -+ break; -+ -+ vendor = headerFormat_p (h, "%{vendor}", &err); -+ if (!vendor) -+ { -+ warning (_("Error querying the rpm file `%s': %s"), filename, -+ err); -+ continue; -+ } -+ if (strcmp (vendor, "Red Hat, Inc.") == 0) -+ vendor_pass = 1; -+ else -+ vendor_fail = 1; -+ xfree (vendor); -+ } -+ count = vendor_pass != 0 && vendor_fail == 0; -+ } -+#endif -+ -+ rpmdbFreeIterator_p (mi); -+ } -+ -+ rpmtsFree_p (ts); -+ -+ return count; -+} -+ -+#ifdef GDB_INDEX_VERIFY_VENDOR -+missing_rpm_enlist (const char *filename) -+{ -+ return missing_rpm_enlist_1 (filename, 0); -+} -+ -+extern int rpm_verify_vendor (const char *filename); -+int -+rpm_verify_vendor (const char *filename) -+{ -+ return missing_rpm_enlist_1 (filename, 1); -+} -+#endif -+ -+static bool -+missing_rpm_list_compar (const char *ap, const char *bp) -+{ -+ return strcoll (ap, bp) < 0; -+} -+ -+/* It returns a NULL-terminated array of strings needing to be FREEd. It may -+ also return only NULL. */ -+ -+static void -+missing_rpm_list_print (void) -+{ -+ struct missing_rpm *list_iter; -+ -+ if (missing_rpm_list_entries == 0) -+ return; -+ -+ std::vector array (missing_rpm_list_entries); -+ size_t idx = 0; -+ -+ for (list_iter = missing_rpm_list; list_iter != NULL; -+ list_iter = list_iter->next) -+ { -+ array[idx++] = list_iter->rpm; -+ } -+ gdb_assert (idx == missing_rpm_list_entries); -+ -+ std::sort (array.begin (), array.end (), missing_rpm_list_compar); -+ -+ /* We zero out the number of missing RPMs here because of a nasty -+ bug (see RHBZ 1801974). -+ -+ When we call 'puts_unfiltered' below, if pagination is on and if -+ the number of missing RPMs is big enough to trigger pagination, -+ we will end up in an infinite recursion. The call chain looks -+ like this: -+ -+ missing_rpm_list_print -> puts_unfiltered -> fputs_maybe_filtered -+ -> prompt_for_continue -> display_gdb_prompt -> -+ debug_flush_missing -> missing_rpm_list_print ... -+ -+ For this reason, we make sure MISSING_RPM_LIST_ENTRIES is zero -+ *before* calling any print function. -+ -+ Note: kevinb/2023-02-22: The code below used to call -+ puts_unfiltered() and printf_unfiltered(), but calls to these -+ functions have been replaced by calls to gdb_printf(). The call -+ chain shown above (probably) used to be the case at one time and -+ hopefully something similar is still the case now that -+ gdb_printf() is being used instead. */ -+ missing_rpm_list_entries = 0; -+ -+ gdb_printf (_("Missing separate debuginfos, use: %s"), -+#ifdef DNF_DEBUGINFO_INSTALL -+ "dnf " -+#endif -+ "debuginfo-install"); -+ for (const char *el : array) -+ { -+ gdb_printf (" %s", el); -+ } -+ gdb_printf ("\n"); -+ -+ while (missing_rpm_list != NULL) -+ { -+ list_iter = missing_rpm_list; -+ missing_rpm_list = list_iter->next; -+ xfree (list_iter); -+ } -+} -+ -+static void -+missing_rpm_change (void) -+{ -+ debug_flush_missing (); -+ -+ gdb_assert (missing_rpm_list == NULL); -+ if (missing_rpm_hash != NULL) -+ { -+ htab_delete (missing_rpm_hash); -+ missing_rpm_hash = NULL; -+ } -+} -+ -+enum missing_exec -+ { -+ /* Init state. EXEC_BFD also still could be NULL. */ -+ MISSING_EXEC_NOT_TRIED, -+ /* We saw a non-NULL EXEC_BFD but RPM has no info about it. */ -+ MISSING_EXEC_NOT_FOUND, -+ /* We found EXEC_BFD by RPM and we either have its symbols (either embedded -+ or separate) or the main executable's RPM is now contained in -+ MISSING_RPM_HASH. */ -+ MISSING_EXEC_ENLISTED -+ }; -+static enum missing_exec missing_exec = MISSING_EXEC_NOT_TRIED; -+ -+#endif /* HAVE_LIBRPM */ -+ -+void -+debug_flush_missing (void) -+{ -+#ifdef HAVE_LIBRPM -+ missing_rpm_list_print (); -+#endif -+} -+ +/* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages + yum --enablerepo='*debug*' install ... + avoidance. */ @@ -1178,17 +739,11 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + /* All their memory came just from missing_filepair_OBSTACK. */ + missing_filepair_hash = NULL; + } -+#ifdef HAVE_LIBRPM -+ missing_exec = MISSING_EXEC_NOT_TRIED; -+#endif +} + +static void +debug_print_executable_changed (struct program_space *pspace, bool reload_p) +{ -+#ifdef HAVE_LIBRPM -+ missing_rpm_change (); -+#endif + missing_filepair_change (); +} + @@ -1255,55 +810,30 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + + *slot = missing_filepair; + -+#ifdef HAVE_LIBRPM -+ if (missing_exec == MISSING_EXEC_NOT_TRIED) ++ /* We do not collect and flush these messages as each such message ++ already requires its own separate lines. */ ++ ++ gdb_printf (gdb_stdlog, ++ _("Missing separate debuginfo for %s.\n"), binary); ++ if (debug != NULL) + { -+ const char *execfilename = get_exec_file (0); -+ -+ if (execfilename != NULL) -+ { -+ if (missing_rpm_enlist (execfilename) == 0) -+ missing_exec = MISSING_EXEC_NOT_FOUND; -+ else -+ missing_exec = MISSING_EXEC_ENLISTED; -+ } -+ } -+ if (missing_exec != MISSING_EXEC_ENLISTED) -+ if ((binary[0] == 0 || missing_rpm_enlist (binary) == 0) -+ && (debug == NULL || missing_rpm_enlist (debug) == 0)) -+#endif /* HAVE_LIBRPM */ -+ { -+ /* We do not collect and flush these messages as each such message -+ already requires its own separate lines. */ -+ -+ gdb_printf (gdb_stdlog, -+ _("Missing separate debuginfo for %s.\n"), binary); -+ if (debug != NULL) -+ { -+ if (access (debug, F_OK) == 0) { -+ gdb_printf (gdb_stdlog, _("Try: %s %s\n"), ++ gdb_printf (gdb_stdlog, _("Try: %s %s\n"), +#ifdef DNF_DEBUGINFO_INSTALL -+ "dnf" ++ "dnf" +#else -+ "yum" ++ "yum" +#endif -+ " --enablerepo='*debug*' install", debug); -+ } else -+ gdb_printf (gdb_stdlog, _("The debuginfo package for this file is probably broken.\n")); -+ } -+ } ++ " --enablerepo='*debug*' install", debug); ++ } +} + /* See build-id.h. */ gdb_bfd_ref_ptr --build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id) -+build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id, -+ char **link_return) + build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id) { - return build_id_to_bfd_suffix (build_id_len, build_id, ".debug"); -+ return build_id_to_bfd_suffix (build_id_len, build_id, ".debug", -+ link_return); ++ return build_id_to_bfd_suffix (build_id_len, build_id, ".debug", nullptr); } /* See build-id.h. */ @@ -1318,45 +848,15 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c } /* See build-id.h. */ +@@ -224,6 +886,7 @@ find_separate_debug_file_by_buildid (struct objfile *objfile, - std::string - find_separate_debug_file_by_buildid (struct objfile *objfile, -- deferred_warnings *warnings) -+ deferred_warnings *warnings, -+ gdb::unique_xmalloc_ptr *build_id_filename_return) - { - const struct bfd_build_id *build_id; - -+ if (build_id_filename_return) -+ *build_id_filename_return = NULL; -+ - build_id = build_id_bfd_get (objfile->obfd.get ()); - if (build_id != NULL) - { -@@ -222,8 +1358,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile, - _("\nLooking for separate debug info (build-id) for " - "%s\n"), objfile_name (objfile)); - -+ char *build_id_filename_cstr = NULL; gdb_bfd_ref_ptr abfd (build_id_to_debug_bfd (build_id->size, -- build_id->data)); -+ build_id->data, -+ (!build_id_filename_return ? NULL : &build_id_filename_cstr))); -+ if (build_id_filename_return) -+ { -+ if (!build_id_filename_cstr) -+ gdb_assert (!*build_id_filename_return); -+ else -+ { -+ *build_id_filename_return = gdb::unique_xmalloc_ptr (build_id_filename_cstr); -+ build_id_filename_cstr = NULL; -+ } -+ } + build_id->data)); + /* Prevent looping on a stripped .debug file. */ if (abfd != NULL && filename_cmp (bfd_get_filename (abfd.get ()), -@@ -243,3 +1392,22 @@ find_separate_debug_file_by_buildid (struct objfile *objfile, +@@ -243,3 +906,22 @@ find_separate_debug_file_by_buildid (struct objfile *objfile, return std::string (); } @@ -1382,17 +882,13 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c diff --git a/gdb/build-id.h b/gdb/build-id.h --- a/gdb/build-id.h +++ b/gdb/build-id.h -@@ -38,14 +38,19 @@ extern int build_id_verify (bfd *abfd, - can be found, return NULL. */ - +@@ -40,12 +40,16 @@ extern int build_id_verify (bfd *abfd, extern gdb_bfd_ref_ptr build_id_to_debug_bfd (size_t build_id_len, -- const bfd_byte *build_id); -+ const bfd_byte *build_id, -+ char **link_return = NULL); -+ + const bfd_byte *build_id); + +extern char *build_id_to_filename (const struct bfd_build_id *build_id, + char **link_return); - ++ /* Find and open a BFD for an executable file given a build-id. If no BFD can be found, return NULL. The returned reference to the BFD must be released by the caller. */ @@ -1404,28 +900,6 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h /* Find the separate debug file for OBJFILE, by using the build-id associated with OBJFILE's BFD. If successful, returns the file name for the -@@ -58,7 +63,8 @@ extern gdb_bfd_ref_ptr build_id_to_exec_bfd (size_t build_id_len, - will be printed. */ - - extern std::string find_separate_debug_file_by_buildid -- (struct objfile *objfile, deferred_warnings *warnings); -+ (struct objfile *objfile, deferred_warnings *warnings, -+ gdb::unique_xmalloc_ptr *build_id_filename_return); - - /* Return an hex-string representation of BUILD_ID. */ - -diff --git a/gdb/coffread.c b/gdb/coffread.c ---- a/gdb/coffread.c -+++ b/gdb/coffread.c -@@ -729,7 +729,7 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) - { - deferred_warnings warnings; - std::string debugfile -- = find_separate_debug_file_by_buildid (objfile, &warnings); -+ = find_separate_debug_file_by_buildid (objfile, &warnings, NULL); - - if (debugfile.empty ()) - debugfile diff --git a/gdb/corelow.c b/gdb/corelow.c --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -1517,33 +991,6 @@ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo @cindex @code{.gnu_debuglink} sections @cindex debug link sections A debug link is a special section of the executable file named -diff --git a/gdb/elfread.c b/gdb/elfread.c ---- a/gdb/elfread.c -+++ b/gdb/elfread.c -@@ -1220,8 +1220,10 @@ elf_symfile_read_dwarf2 (struct objfile *objfile, - { - deferred_warnings warnings; - -+ gdb::unique_xmalloc_ptr build_id_filename; - std::string debugfile -- = find_separate_debug_file_by_buildid (objfile, &warnings); -+ = find_separate_debug_file_by_buildid (objfile, &warnings, -+ &build_id_filename); - - if (debugfile.empty ()) - debugfile = find_separate_debug_file_by_debuglink (objfile, &warnings); -@@ -1265,6 +1267,11 @@ elf_symfile_read_dwarf2 (struct objfile *objfile, - has_dwarf2 = true; - } - } -+ /* Check if any separate debug info has been extracted out. */ -+ else if (bfd_get_section_by_name (objfile->obfd.get (), -+ ".gnu_debuglink") -+ != NULL) -+ debug_print_missing (objfile_name (objfile), build_id_filename.get ()); - } - } - /* If all the methods to collect the debuginfo failed, print the diff --git a/gdb/objfiles.h b/gdb/objfiles.h --- a/gdb/objfiles.h +++ b/gdb/objfiles.h diff --git a/gdb-add-missing-debug-ext-lang-hook.patch b/gdb-add-missing-debug-ext-lang-hook.patch new file mode 100644 index 0000000..e4020c1 --- /dev/null +++ b/gdb-add-missing-debug-ext-lang-hook.patch @@ -0,0 +1,314 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Fri, 13 Oct 2023 16:48:36 +0100 +Subject: gdb-add-missing-debug-ext-lang-hook.patch + +;; Backport upstream commit 661d98a3331. + +gdb: add an extension language hook for missing debug info + +This commit adds a new extension_language_ops hook which allows an +extension to handle the case where GDB can't find a separate debug +information file for a particular objfile. + +This commit doesn't actually implement the hook for any of GDB's +extension languages, the next commit will do that. This commit just +adds support for the hook to extension-priv.h and extension.[ch], and +then reworks symfile-debug.c to call the hook. + +Right now the hook will always return its default value, which means +GDB should do nothing different. As such, there should be no user +visible changes after this commit. + +I'll give a brief description of what the hook does here so that we +can understand the changes in symfile-debug.c. The next commit adds a +Python implementation for this new hook, and gives a fuller +description of the new functionality. + +Currently, when looking for separate debug information GDB tries three +things, in this order: + + 1. Use the build-id to find the required debug information, + + 2. Check for .gnu_debuglink section and use that to look up the + required debug information, + + 3. Check with debuginfod to see if it can supply the required + information. + +The new extension_language_ops::handle_missing_debuginfo hook is +called if all three steps fail to find any debug information. The +hook has three possible return values: + + a. Nothing, no debug information is found, GDB continues without the + debug information for this objfile. This matches the current + behaviour of GDB, and is the default if nothing is implementing this + new hook, + + b. Install debug information into a location that step #1 or #2 + above would normally check, and then request that GDB repeats steps + #1 and #2 in the hope that GDB will now find the debug information. + If the debug information is still not found then GDB carries on + without the debug information. If the debug information is found + the GDB loads it and carries on, + + c. Return a filename for a file containing the required debug + information. GDB loads the contents of this file and carries on. + +The changes in this commit mostly involve placing the core of +objfile::find_and_add_separate_symbol_file into a loop which allows +for steps #1 and #2 to be repeated. + +We take care to ensure that debuginfod is only queried once, the first +time through. The assumption is that no extension is going to be able +to control the replies from debuginfod, so there's no point making a +second request -- and as these requests go over the network, they +could potentially be slow. + +The warnings that find_and_add_separate_symbol_file collects are +displayed only once assuming that no debug information is found. If +debug information is found, even after the extension has operated, +then the warnings are not shown; remember, these are warnings from GDB +about failure to find any suitable debug information, so it makes +sense to hide these if debug information is found. + +Approved-By: Tom Tromey + +diff --git a/gdb/extension-priv.h b/gdb/extension-priv.h +--- a/gdb/extension-priv.h ++++ b/gdb/extension-priv.h +@@ -279,6 +279,13 @@ struct extension_language_ops + gdb::optional (*print_insn) (struct gdbarch *gdbarch, + CORE_ADDR address, + struct disassemble_info *info); ++ ++ /* Give extension languages a chance to deal with missing debug ++ information. OBJFILE is the file for which GDB was unable to find ++ any debug information. */ ++ ext_lang_missing_debuginfo_result ++ (*handle_missing_debuginfo) (const struct extension_language_defn *, ++ struct objfile *objfile); + }; + + /* State necessary to restore a signal handler to its previous value. */ +diff --git a/gdb/extension.c b/gdb/extension.c +--- a/gdb/extension.c ++++ b/gdb/extension.c +@@ -997,6 +997,25 @@ ext_lang_print_insn (struct gdbarch *gdbarch, CORE_ADDR address, + return {}; + } + ++/* See extension.h. */ ++ ++ext_lang_missing_debuginfo_result ++ext_lang_handle_missing_debuginfo (struct objfile *objfile) ++{ ++ for (const struct extension_language_defn *extlang : extension_languages) ++ { ++ if (extlang->ops == nullptr ++ || extlang->ops->handle_missing_debuginfo == nullptr) ++ continue; ++ ext_lang_missing_debuginfo_result result ++ = extlang->ops->handle_missing_debuginfo (extlang, objfile); ++ if (!result.filename ().empty () || result.try_again ()) ++ return result; ++ } ++ ++ return {}; ++} ++ + /* Called via an observer before gdb prints its prompt. + Iterate over the extension languages giving them a chance to + change the prompt. The first one to change the prompt wins, +diff --git a/gdb/extension.h b/gdb/extension.h +--- a/gdb/extension.h ++++ b/gdb/extension.h +@@ -337,6 +337,68 @@ extern gdb::optional ext_lang_colorize_disasm + extern gdb::optional ext_lang_print_insn + (struct gdbarch *gdbarch, CORE_ADDR address, struct disassemble_info *info); + ++/* When GDB calls into an extension language because an objfile was ++ discovered for which GDB couldn't find any debug information, this ++ structure holds the result that the extension language returns. ++ ++ There are three possible actions that might be returned by an extension; ++ first an extension can return a filename, this is the path to the file ++ containing the required debug information. The second possibility is ++ to return a flag indicating that GDB should check again for the missing ++ debug information, this would imply that the extension has installed ++ the debug information into a location where GDB can be expected to find ++ it. And the third option is for the extension to just return a null ++ result, indication there is nothing the extension can do to provide the ++ missing debug information. */ ++struct ext_lang_missing_debuginfo_result ++{ ++ /* Default result. The extension was unable to provide the missing debug ++ info. */ ++ ext_lang_missing_debuginfo_result () ++ { /* Nothing. */ } ++ ++ /* When TRY_AGAIN is true GDB should try searching again, the extension ++ may have installed the missing debug info into a suitable location. ++ When TRY_AGAIN is false this is equivalent to the default, no ++ argument, constructor. */ ++ ext_lang_missing_debuginfo_result (bool try_again) ++ : m_try_again (try_again) ++ { /* Nothing. */ } ++ ++ /* Look in FILENAME for the missing debug info. */ ++ ext_lang_missing_debuginfo_result (std::string &&filename) ++ : m_filename (std::move (filename)) ++ { /* Nothing. */ } ++ ++ /* The filename where GDB can find the missing debuginfo. This is empty ++ if the extension didn't suggest a file that can be used. */ ++ const std::string & ++ filename () const ++ { ++ return m_filename; ++ } ++ ++ /* Returns true if GDB should look again for the debug information. */ ++ const bool ++ try_again () const ++ { ++ return m_try_again; ++ } ++ ++private: ++ /* The filename where the missing debuginfo can now be found. */ ++ std::string m_filename; ++ ++ /* When true GDB will search again for the debuginfo using its standard ++ techniques. When false GDB will not search again. */ ++ bool m_try_again = false; ++}; ++ ++/* Called when GDB failed to find any debug information for OBJFILE. */ ++ ++extern ext_lang_missing_debuginfo_result ext_lang_handle_missing_debuginfo ++ (struct objfile *objfile); ++ + #if GDB_SELF_TEST + namespace selftests { + extern void (*hook_set_active_ext_lang) (); +diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c +--- a/gdb/symfile-debug.c ++++ b/gdb/symfile-debug.c +@@ -631,38 +631,88 @@ debuginfod_find_and_open_separate_symbol_file (struct objfile * objfile) + bool + objfile::find_and_add_separate_symbol_file (symfile_add_flags symfile_flags) + { +- bool has_dwarf = false; +- +- deferred_warnings warnings; +- +- gdb_bfd_ref_ptr debug_bfd; +- std::string filename; +- +- std::tie (debug_bfd, filename) = simple_find_and_open_separate_symbol_file +- (this, find_separate_debug_file_by_buildid, &warnings); +- +- if (debug_bfd == nullptr) +- std::tie (debug_bfd, filename) +- = simple_find_and_open_separate_symbol_file +- (this, find_separate_debug_file_by_debuglink, &warnings); ++ bool has_dwarf2 = false; ++ ++ /* Usually we only make a single pass when looking for separate debug ++ information. However, it is possible for an extension language hook ++ to request that GDB make a second pass, in which case max_attempts ++ will be updated, and the loop restarted. */ ++ for (unsigned attempt = 0, max_attempts = 1; ++ attempt < max_attempts && !has_dwarf2; ++ ++attempt) ++ { ++ gdb_assert (max_attempts <= 2); ++ ++ deferred_warnings warnings; ++ gdb_bfd_ref_ptr debug_bfd; ++ std::string filename; ++ ++ std::tie (debug_bfd, filename) ++ = simple_find_and_open_separate_symbol_file ++ (this, find_separate_debug_file_by_buildid, &warnings); ++ ++ if (debug_bfd == nullptr) ++ std::tie (debug_bfd, filename) ++ = simple_find_and_open_separate_symbol_file ++ (this, find_separate_debug_file_by_debuglink, &warnings); ++ ++ /* Only try debuginfod on the first attempt. Sure, we could imagine ++ an extension that somehow adds the required debug info to the ++ debuginfod server but, at least for now, we don't support this ++ scenario. Better for the extension to return new debug info ++ directly to GDB. Plus, going to the debuginfod server might be ++ slow, so that's a good argument for only doing this once. */ ++ if (debug_bfd == nullptr && attempt == 0) ++ std::tie (debug_bfd, filename) ++ = debuginfod_find_and_open_separate_symbol_file (this); ++ ++ if (debug_bfd != nullptr) ++ { ++ /* We found a separate debug info symbol file. If this is our ++ first attempt then setting HAS_DWARF2 will cause us to break ++ from the attempt loop. */ ++ symbol_file_add_separate (debug_bfd, filename.c_str (), ++ symfile_flags, this); ++ has_dwarf2 = true; ++ } ++ else if (attempt == 0) ++ { ++ /* Failed to find a separate debug info symbol file. Call out to ++ the extension languages. The user might have registered an ++ extension that can find the debug info for us, or maybe give ++ the user a system specific message that guides them to finding ++ the missing debug info. */ ++ ++ ext_lang_missing_debuginfo_result ext_result ++ = ext_lang_handle_missing_debuginfo (this); ++ if (!ext_result.filename ().empty ()) ++ { ++ /* Extension found a suitable debug file for us. */ ++ debug_bfd ++ = symfile_bfd_open_no_error (ext_result.filename ().c_str ()); + +- if (debug_bfd == nullptr) +- std::tie (debug_bfd, filename) +- = debuginfod_find_and_open_separate_symbol_file (this); ++ if (debug_bfd != nullptr) ++ { ++ symbol_file_add_separate (debug_bfd, ++ ext_result.filename ().c_str (), ++ symfile_flags, this); ++ has_dwarf2 = true; ++ } ++ } ++ else if (ext_result.try_again ()) ++ { ++ max_attempts = 2; ++ continue; ++ } ++ } + +- if (debug_bfd != nullptr) +- { +- symbol_file_add_separate (debug_bfd, filename.c_str (), symfile_flags, +- this); +- has_dwarf = true; ++ /* If we still have not got a separate debug symbol file, then ++ emit any warnings we've collected so far. */ ++ if (!has_dwarf2) ++ warnings.emit (); + } + +- /* If we still have not got a separate debug symbol file, then +- emit any warnings we've collected so far. */ +- if (!has_dwarf) +- warnings.emit (); +- +- return has_dwarf; ++ return has_dwarf2; + } + + diff --git a/gdb-add-missing-debug-info-python-hook.patch b/gdb-add-missing-debug-info-python-hook.patch new file mode 100644 index 0000000..a9b2270 --- /dev/null +++ b/gdb-add-missing-debug-info-python-hook.patch @@ -0,0 +1,1556 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Sun, 15 Oct 2023 22:48:42 +0100 +Subject: gdb-add-missing-debug-info-python-hook.patch + +;; Backport upstream commit 8f6c452b5a4. + +gdb: implement missing debug handler hook for Python + +This commit builds on the previous commit, and implements the +extension_language_ops::handle_missing_debuginfo function for Python. +This hook will give user supplied Python code a chance to help find +missing debug information. + +The implementation of the new hook is pretty minimal within GDB's C++ +code; most of the work is out-sourced to a Python implementation which +is modelled heavily on how GDB's Python frame unwinders are +implemented. + +The following new commands are added as commands implemented in +Python, this is similar to how the Python unwinder commands are +implemented: + + info missing-debug-handlers + enable missing-debug-handler LOCUS HANDLER + disable missing-debug-handler LOCUS HANDLER + +To make use of this extension hook a user will create missing debug +information handler objects, and registers these handlers with GDB. +When GDB encounters an objfile that is missing debug information, each +handler is called in turn until one is able to help. Here is a +minimal handler that does nothing useful: + + import gdb + import gdb.missing_debug + + class MyFirstHandler(gdb.missing_debug.MissingDebugHandler): + def __init__(self): + super().__init__("my_first_handler") + + def __call__(self, objfile): + # This handler does nothing useful. + return None + + gdb.missing_debug.register_handler(None, MyFirstHandler()) + +Returning None from the __call__ method tells GDB that this handler +was unable to find the missing debug information, and GDB should ask +any other registered handlers. + +By extending the __call__ method it is possible for the Python +extension to locate the debug information for objfile and return a +value that tells GDB how to use the information that has been located. + +Possible return values from a handler: + + - None: This means the handler couldn't help. GDB will call other + registered handlers to see if they can help instead. + + - False: The handler has done all it can, but the debug information + for the objfile still couldn't be found. GDB will not call + any other handlers, and will continue without the debug + information for objfile. + + - True: The handler has installed the debug information into a + location where GDB would normally expect to find it. GDB + should look again for the debug information. + + - A string: The handler can return a filename, which is the file + containing the missing debug information. GDB will load + this file. + +When a handler returns True, GDB will look again for the debug +information, but only using the standard built-in build-id and +.gnu_debuglink based lookup strategies. It is not possible for an +extension to trigger another debuginfod lookup; the assumption is that +the debuginfod server is remote, and out of the control of extensions +running within GDB. + +Handlers can be registered globally, or per program space. GDB checks +the handlers for the current program space first, and then all of the +global handles. The first handler that returns a value that is not +None, has "handled" the objfile, at which point GDB continues. + +Reviewed-By: Eli Zaretskii +Approved-By: Tom Tromey + +diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in +--- a/gdb/data-directory/Makefile.in ++++ b/gdb/data-directory/Makefile.in +@@ -73,6 +73,7 @@ PYTHON_FILE_LIST = \ + gdb/FrameDecorator.py \ + gdb/FrameIterator.py \ + gdb/frames.py \ ++ gdb/missing_debug.py \ + gdb/printing.py \ + gdb/prompt.py \ + gdb/styling.py \ +@@ -82,6 +83,7 @@ PYTHON_FILE_LIST = \ + gdb/command/__init__.py \ + gdb/command/explore.py \ + gdb/command/frame_filters.py \ ++ gdb/command/missing_debug.py \ + gdb/command/pretty_printers.py \ + gdb/command/prompt.py \ + gdb/command/type_printers.py \ +diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi +--- a/gdb/doc/python.texi ++++ b/gdb/doc/python.texi +@@ -229,6 +229,7 @@ + * Connections In Python:: Python representation of connections. + * TUI Windows In Python:: Implementing new TUI windows. + * Disassembly In Python:: Instruction Disassembly In Python ++* Missing Debug Info In Python:: Handle missing debug info from Python. + @end menu + + @node Basic Python +@@ -5191,6 +5192,12 @@ + objects. @xref{Frame Filter API}, for more information. + @end defvar + ++@defvar Progspace.missing_debug_handlers ++The @code{missing_debug_handlers} attribute is a list of the missing ++debug handler objects for this program space. @xref{Missing Debug ++Info In Python}, for more information. ++@end defvar ++ + A program space has the following methods: + + @defun Progspace.block_for_pc (pc) +@@ -7770,6 +7777,139 @@ + gdb.disassembler.register_disassembler(NibbleSwapDisassembler()) + @end smallexample + ++@node Missing Debug Info In Python ++@subsubsection Missing Debug Info In Python ++@cindex python, handle missing debug information ++ ++When @value{GDBN} encounters a new objfile (@pxref{Objfiles In ++Python}), e.g.@: the primary executable, or any shared libraries used ++by the inferior, @value{GDBN} will attempt to load the corresponding ++debug information for that objfile. The debug information might be ++found within the objfile itself, or within a separate objfile which ++@value{GDBN} will automatically locate and load. ++ ++Sometimes though, @value{GDBN} might not find any debug information ++for an objfile, in this case the debugging experience will be ++restricted. ++ ++If @value{GDBN} fails to locate any debug information for a particular ++objfile, there is an opportunity for a Python extension to step in. A ++Python extension can potentially locate the missing debug information ++using some platform- or project-specific steps, and inform ++@value{GDBN} of its location. Or a Python extension might provide ++some platform- or project-specific advice to the user about how to ++obtain the missing debug information. ++ ++A missing debug information Python extension consists of a handler ++object which has the @code{name} and @code{enabled} attributes, and ++implements the @code{__call__} method. When @value{GDBN} encounters ++an objfile for which it is unable to find any debug information, it ++invokes the @code{__call__} method. Full details of how handlers are ++written can be found below. ++ ++@subheading The @code{gdb.missing_debug} Module ++ ++@value{GDBN} comes with a @code{gdb.missing_debug} module which ++contains the following class and global function: ++ ++@deftp{class} gdb.missing_debug.MissingDebugHandler ++ ++@code{MissingDebugHandler} is a base class from which user-created ++handlers can derive, though it is not required that handlers derive ++from this class, so long as any user created handler has the ++@code{name} and @code{enabled} attributes, and implements the ++@code{__call__} method. ++ ++@defun MissingDebugHandler.__init__ (name) ++The @var{name} is a string used to reference this missing debug ++handler within some @value{GDBN} commands. Valid names consist of the ++characters @code{[-_a-zA-Z0-9]}, creating a handler with an invalid ++name raises a @code{ValueError} exception. ++@end defun ++ ++@defun MissingDebugHandler.__call__ (objfile) ++Sub-classes must override the @code{__call__} method. The ++@var{objfile} argument will be a @code{gdb.Objfile}, this is the ++objfile for which @value{GDBN} was unable to find any debug ++information. ++ ++The return value from the @code{__call__} method indicates what ++@value{GDBN} should do next. The possible return values are: ++ ++@itemize @bullet ++@item @code{None} ++ ++This indicates that this handler could not help with @var{objfile}, ++@value{GDBN} should call any other registered handlers. ++ ++@item @code{True} ++ ++This indicates that this handler has installed the debug information ++into a location where @value{GDBN} would normally expect to find it ++when looking for separate debug information files (@pxref{Separate ++Debug Files}). @value{GDBN} will repeat the normal lookup process, ++which should now find the separate debug file. ++ ++If @value{GDBN} still doesn't find the separate debug information file ++after this second attempt, then the Python missing debug information ++handlers are not invoked a second time, this prevents a badly behaved ++handler causing @value{GDBN} to get stuck in a loop. @value{GDBN} ++will continue without any debug information for @var{objfile}. ++ ++@item @code{False} ++ ++This indicates that this handler has done everything that it intends ++to do with @var{objfile}, but no separate debug information can be ++found. @value{GDBN} will not call any other registered handlers for ++@var{objfile}. @value{GDBN} will continue without debugging ++information for @var{objfile}. ++ ++@item A string ++ ++The returned string should contain a filename. @value{GDBN} will not ++call any further registered handlers, and will instead load the debug ++information from the file identified by the returned filename. ++@end itemize ++ ++Invoking the @code{__call__} method from this base class will raise a ++@code{NotImplementedError} exception. ++@end defun ++ ++@defvar MissingDebugHandler.name ++A read-only attribute which is a string, the name of this handler ++passed to the @code{__init__} method. ++@end defvar ++ ++@defvar MissingDebugHandler.enabled ++A modifiable attribute containing a boolean; when @code{True}, the ++handler is enabled, and will be used by @value{GDBN}. When ++@code{False}, the handler has been disabled, and will not be used. ++@end defvar ++@end deftp ++ ++@defun gdb.missing_debug.register_handler (locus, handler, replace=@code{False}) ++Register a new missing debug handler with @value{GDBN}. ++ ++@var{handler} is an instance of a sub-class of ++@code{MissingDebugHandler}, or at least an instance of an object that ++has the same attributes and methods as @code{MissingDebugHandler}. ++ ++@var{locus} specifies to which handler list to prepend @var{handler}. ++It can be either a @code{gdb.Progspace} (@pxref{Progspaces In Python}) ++or @code{None}, in which case the handler is registered globally. The ++newly registered @var{handler} will be called before any other handler ++from the same locus. Two handlers in the same locus cannot have the ++same name, an attempt to add a handler with an already existing name ++raises an exception unless @var{replace} is @code{True}, in which case ++the old handler is deleted and the new handler is prepended to the ++selected handler list. ++ ++@value{GDBN} first calls the handlers for the current program space, ++and then the globally registered handlers. As soon as a handler ++returns a value other than @code{None}, no further handlers are called ++for this objfile. ++@end defun ++ + @node Python Auto-loading + @subsection Python Auto-loading + @cindex Python auto-loading +diff --git a/gdb/python/lib/gdb/__init__.py b/gdb/python/lib/gdb/__init__.py +--- a/gdb/python/lib/gdb/__init__.py ++++ b/gdb/python/lib/gdb/__init__.py +@@ -84,6 +84,8 @@ xmethods = [] + frame_filters = {} + # Initial frame unwinders. + frame_unwinders = [] ++# Initial missing debug handlers. ++missing_debug_handlers = [] + + + def _execute_unwinders(pending_frame): +@@ -291,3 +293,42 @@ class Thread(threading.Thread): + # threads. + with blocked_signals(): + super().start() ++ ++ ++def _handle_missing_debuginfo(objfile): ++ """Internal function called from GDB to execute missing debug ++ handlers. ++ ++ Run each of the currently registered, and enabled missing debug ++ handler objects for the current program space and then from the ++ global list. Stop after the first handler that returns a result ++ other than None. ++ ++ Arguments: ++ objfile: A gdb.Objfile for which GDB could not find any debug ++ information. ++ ++ Returns: ++ None: No debug information could be found for objfile. ++ False: A handler has done all it can with objfile, but no ++ debug information could be found. ++ True: Debug information might have been installed by a ++ handler, GDB should check again. ++ A string: This is the filename of a file containing the ++ required debug information. ++ """ ++ pspace = objfile.progspace ++ ++ for handler in pspace.missing_debug_handlers: ++ if handler.enabled: ++ result = handler(objfile) ++ if result is not None: ++ return result ++ ++ for handler in missing_debug_handlers: ++ if handler.enabled: ++ result = handler(objfile) ++ if result is not None: ++ return result ++ ++ return None +diff --git a/gdb/python/lib/gdb/command/missing_debug.py b/gdb/python/lib/gdb/command/missing_debug.py +new file mode 100644 +--- /dev/null ++++ b/gdb/python/lib/gdb/command/missing_debug.py +@@ -0,0 +1,226 @@ ++# Missing debug related commands. ++# ++# Copyright 2023 Free Software Foundation, Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++import gdb ++import re ++ ++ ++def validate_regexp(exp, idstring): ++ """Compile exp into a compiler regular expression object. ++ ++ Arguments: ++ exp: The string to compile into a re.Pattern object. ++ idstring: A string, what exp is a regexp for. ++ ++ Returns: ++ A re.Pattern object representing exp. ++ ++ Raises: ++ SyntaxError: If exp is an invalid regexp. ++ """ ++ try: ++ return re.compile(exp) ++ except SyntaxError: ++ raise SyntaxError("Invalid %s regexp: %s." % (idstring, exp)) ++ ++ ++def parse_missing_debug_command_args(arg): ++ """Internal utility to parse missing debug handler command argv. ++ ++ Arguments: ++ arg: The arguments to the command. The format is: ++ [locus-regexp [name-regexp]] ++ ++ Returns: ++ A 2-tuple of compiled regular expressions. ++ ++ Raises: ++ SyntaxError: an error processing ARG ++ """ ++ argv = gdb.string_to_argv(arg) ++ argc = len(argv) ++ if argc > 2: ++ raise SyntaxError("Too many arguments.") ++ locus_regexp = "" ++ name_regexp = "" ++ if argc >= 1: ++ locus_regexp = argv[0] ++ if argc >= 2: ++ name_regexp = argv[1] ++ return ( ++ validate_regexp(locus_regexp, "locus"), ++ validate_regexp(name_regexp, "handler"), ++ ) ++ ++ ++class InfoMissingDebugHanders(gdb.Command): ++ """GDB command to list missing debug handlers. ++ ++ Usage: info missing-debug-handlers [LOCUS-REGEXP [NAME-REGEXP]] ++ ++ LOCUS-REGEXP is a regular expression matching the location of the ++ handler. If it is omitted, all registered handlers from all ++ loci are listed. A locus can be 'global', 'progspace' to list ++ the handlers from the current progspace, or a regular expression ++ matching filenames of progspaces. ++ ++ NAME-REGEXP is a regular expression to filter missing debug ++ handler names. If this omitted for a specified locus, then all ++ registered handlers in the locus are listed. ++ """ ++ ++ def __init__(self): ++ super().__init__("info missing-debug-handlers", gdb.COMMAND_FILES) ++ ++ def list_handlers(self, title, handlers, name_re): ++ """Lists the missing debug handlers whose name matches regexp. ++ ++ Arguments: ++ title: The line to print before the list. ++ handlers: The list of the missing debug handlers. ++ name_re: handler name filter. ++ """ ++ if not handlers: ++ return ++ print(title) ++ for handler in handlers: ++ if name_re.match(handler.name): ++ print( ++ " %s%s" % (handler.name, "" if handler.enabled else " [disabled]") ++ ) ++ ++ def invoke(self, arg, from_tty): ++ locus_re, name_re = parse_missing_debug_command_args(arg) ++ ++ if locus_re.match("progspace") and locus_re.pattern != "": ++ cp = gdb.current_progspace() ++ self.list_handlers( ++ "Progspace %s:" % cp.filename, cp.missing_debug_handlers, name_re ++ ) ++ ++ for progspace in gdb.progspaces(): ++ filename = progspace.filename or "" ++ if locus_re.match(filename): ++ if filename == "": ++ if progspace == gdb.current_progspace(): ++ msg = "Current Progspace:" ++ else: ++ msg = "Progspace :" ++ else: ++ msg = "Progspace %s:" % filename ++ self.list_handlers( ++ msg, ++ progspace.missing_debug_handlers, ++ name_re, ++ ) ++ ++ # Print global handlers last, as these are invoked last. ++ if locus_re.match("global"): ++ self.list_handlers("Global:", gdb.missing_debug_handlers, name_re) ++ ++ ++def do_enable_handler1(handlers, name_re, flag): ++ """Enable/disable missing debug handlers whose names match given regex. ++ ++ Arguments: ++ handlers: The list of missing debug handlers. ++ name_re: Handler name filter. ++ flag: A boolean indicating if we should enable or disable. ++ ++ Returns: ++ The number of handlers affected. ++ """ ++ total = 0 ++ for handler in handlers: ++ if name_re.match(handler.name) and handler.enabled != flag: ++ handler.enabled = flag ++ total += 1 ++ return total ++ ++ ++def do_enable_handler(arg, flag): ++ """Enable or disable missing debug handlers.""" ++ (locus_re, name_re) = parse_missing_debug_command_args(arg) ++ total = 0 ++ if locus_re.match("global"): ++ total += do_enable_handler1(gdb.missing_debug_handlers, name_re, flag) ++ if locus_re.match("progspace") and locus_re.pattern != "": ++ total += do_enable_handler1( ++ gdb.current_progspace().missing_debug_handlers, name_re, flag ++ ) ++ for progspace in gdb.progspaces(): ++ filename = progspace.filename or "" ++ if locus_re.match(filename): ++ total += do_enable_handler1(progspace.missing_debug_handlers, name_re, flag) ++ print( ++ "%d missing debug handler%s %s" ++ % (total, "" if total == 1 else "s", "enabled" if flag else "disabled") ++ ) ++ ++ ++class EnableMissingDebugHandler(gdb.Command): ++ """GDB command to enable missing debug handlers. ++ ++ Usage: enable missing-debug-handler [LOCUS-REGEXP [NAME-REGEXP]] ++ ++ LOCUS-REGEXP is a regular expression specifying the handlers to ++ enable. It can be 'global', 'progspace' for the current ++ progspace, or the filename for a file associated with a progspace. ++ ++ NAME_REGEXP is a regular expression to filter handler names. If ++ this omitted for a specified locus, then all registered handlers ++ in the locus are affected. ++ """ ++ ++ def __init__(self): ++ super().__init__("enable missing-debug-handler", gdb.COMMAND_FILES) ++ ++ def invoke(self, arg, from_tty): ++ """GDB calls this to perform the command.""" ++ do_enable_handler(arg, True) ++ ++ ++class DisableMissingDebugHandler(gdb.Command): ++ """GDB command to disable missing debug handlers. ++ ++ Usage: disable missing-debug-handler [LOCUS-REGEXP [NAME-REGEXP]] ++ ++ LOCUS-REGEXP is a regular expression specifying the handlers to ++ enable. It can be 'global', 'progspace' for the current ++ progspace, or the filename for a file associated with a progspace. ++ ++ NAME_REGEXP is a regular expression to filter handler names. If ++ this omitted for a specified locus, then all registered handlers ++ in the locus are affected. ++ """ ++ ++ def __init__(self): ++ super().__init__("disable missing-debug-handler", gdb.COMMAND_FILES) ++ ++ def invoke(self, arg, from_tty): ++ """GDB calls this to perform the command.""" ++ do_enable_handler(arg, False) ++ ++ ++def register_missing_debug_handler_commands(): ++ """Installs the missing debug handler commands.""" ++ InfoMissingDebugHanders() ++ EnableMissingDebugHandler() ++ DisableMissingDebugHandler() ++ ++ ++register_missing_debug_handler_commands() +diff --git a/gdb/python/lib/gdb/missing_debug.py b/gdb/python/lib/gdb/missing_debug.py +new file mode 100644 +--- /dev/null ++++ b/gdb/python/lib/gdb/missing_debug.py +@@ -0,0 +1,169 @@ ++# Copyright (C) 2023 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++""" ++MissingDebugHandler base class, and register_handler function. ++""" ++ ++import gdb ++ ++ ++def _validate_name(name): ++ """Validate a missing debug handler name string. ++ ++ If name is valid as a missing debug handler name, then this ++ function does nothing. If name is not valid then an exception is ++ raised. ++ ++ Arguments: ++ name: A string, the name of a missing debug handler. ++ ++ Returns: ++ Nothing. ++ ++ Raises: ++ ValueError: If name is invalid as a missing debug handler ++ name. ++ """ ++ for ch in name: ++ if not ch.isascii() or not (ch.isalnum() or ch in "_-"): ++ raise ValueError("invalid character '%s' in handler name: %s" % (ch, name)) ++ ++ ++class MissingDebugHandler(object): ++ """Base class for missing debug handlers written in Python. ++ ++ A missing debug handler has a single method __call__ along with ++ the read/write attribute enabled, and a read-only attribute name. ++ ++ Attributes: ++ name: Read-only attribute, the name of this handler. ++ enabled: When true this handler is enabled. ++ """ ++ ++ def __init__(self, name): ++ """Constructor. ++ ++ Args: ++ name: An identifying name for this handler. ++ ++ Raises: ++ TypeError: name is not a string. ++ ValueError: name contains invalid characters. ++ """ ++ ++ if not isinstance(name, str): ++ raise TypeError("incorrect type for name: %s" % type(name)) ++ ++ _validate_name(name) ++ ++ self._name = name ++ self._enabled = True ++ ++ @property ++ def name(self): ++ return self._name ++ ++ @property ++ def enabled(self): ++ return self._enabled ++ ++ @enabled.setter ++ def enabled(self, value): ++ if not isinstance(value, bool): ++ raise TypeError("incorrect type for enabled attribute: %s" % type(value)) ++ self._enabled = value ++ ++ def __call__(self, objfile): ++ """GDB handle missing debug information for an objfile. ++ ++ Arguments: ++ objfile: A gdb.Objfile for which GDB could not find any ++ debug information. ++ ++ Returns: ++ True: GDB should try again to locate the debug information ++ for objfile, the handler may have installed the ++ missing information. ++ False: GDB should move on without the debug information ++ for objfile. ++ A string: GDB should load the file at the given path; it ++ contains the debug information for objfile. ++ None: This handler can't help with objfile. GDB should ++ try any other registered handlers. ++ """ ++ raise NotImplementedError("MissingDebugHandler.__call__()") ++ ++ ++def register_handler(locus, handler, replace=False): ++ """Register handler in given locus. ++ ++ The handler is prepended to the locus's missing debug handlers ++ list. The name of handler should be unique (or replace must be ++ True). ++ ++ Arguments: ++ locus: Either a progspace, or None (in which case the unwinder ++ is registered globally). ++ handler: An object of a gdb.MissingDebugHandler subclass. ++ ++ replace: If True, replaces existing handler with the same name ++ within locus. Otherwise, raises RuntimeException if ++ unwinder with the same name already exists. ++ ++ Returns: ++ Nothing. ++ ++ Raises: ++ RuntimeError: The name of handler is not unique. ++ TypeError: Bad locus type. ++ AttributeError: Required attributes of handler are missing. ++ """ ++ ++ if locus is None: ++ if gdb.parameter("verbose"): ++ gdb.write("Registering global %s handler ...\n" % handler.name) ++ locus = gdb ++ elif isinstance(locus, gdb.Progspace): ++ if gdb.parameter("verbose"): ++ gdb.write( ++ "Registering %s handler for %s ...\n" % (handler.name, locus.filename) ++ ) ++ else: ++ raise TypeError("locus should be gdb.Progspace or None") ++ ++ # Some sanity checks on HANDLER. Calling getattr will raise an ++ # exception if the attribute doesn't exist, which is what we want. ++ # These checks are not exhaustive; we don't check the attributes ++ # have the correct types, or the method has the correct signature, ++ # but this should catch some basic mistakes. ++ getattr(handler, "name") ++ getattr(handler, "enabled") ++ call_method = getattr(handler, "__call__") ++ if not callable(call_method): ++ raise AttributeError( ++ "'%s' object's '__call__' attribute is not callable" ++ % type(handler).__name__ ++ ) ++ ++ i = 0 ++ for needle in locus.missing_debug_handlers: ++ if needle.name == handler.name: ++ if replace: ++ del locus.missing_debug_handlers[i] ++ else: ++ raise RuntimeError("Handler %s already exists." % handler.name) ++ i += 1 ++ locus.missing_debug_handlers.insert(0, handler) +diff --git a/gdb/python/py-progspace.c b/gdb/python/py-progspace.c +--- a/gdb/python/py-progspace.c ++++ b/gdb/python/py-progspace.c +@@ -54,6 +54,9 @@ struct pspace_object + + /* The debug method list. */ + PyObject *xmethods; ++ ++ /* The missing debug handler list. */ ++ PyObject *missing_debug_handlers; + }; + + extern PyTypeObject pspace_object_type +@@ -163,6 +166,7 @@ pspy_dealloc (PyObject *self) + Py_XDECREF (ps_self->frame_unwinders); + Py_XDECREF (ps_self->type_printers); + Py_XDECREF (ps_self->xmethods); ++ Py_XDECREF (ps_self->missing_debug_handlers); + Py_TYPE (self)->tp_free (self); + } + +@@ -198,6 +202,10 @@ pspy_initialize (pspace_object *self) + if (self->xmethods == NULL) + return 0; + ++ self->missing_debug_handlers = PyList_New (0); ++ if (self->missing_debug_handlers == nullptr) ++ return 0; ++ + return 1; + } + +@@ -352,6 +360,47 @@ pspy_get_xmethods (PyObject *o, void *ignore) + return self->xmethods; + } + ++/* Return the list of missing debug handlers for this program space. */ ++ ++static PyObject * ++pspy_get_missing_debug_handlers (PyObject *o, void *ignore) ++{ ++ pspace_object *self = (pspace_object *) o; ++ ++ Py_INCREF (self->missing_debug_handlers); ++ return self->missing_debug_handlers; ++} ++ ++/* Set this program space's list of missing debug handlers to HANDLERS. */ ++ ++static int ++pspy_set_missing_debug_handlers (PyObject *o, PyObject *handlers, ++ void *ignore) ++{ ++ pspace_object *self = (pspace_object *) o; ++ ++ if (handlers == nullptr) ++ { ++ PyErr_SetString (PyExc_TypeError, ++ "cannot delete the missing debug handlers list"); ++ return -1; ++ } ++ ++ if (!PyList_Check (handlers)) ++ { ++ PyErr_SetString (PyExc_TypeError, ++ "the missing debug handlers attribute must be a list"); ++ return -1; ++ } ++ ++ /* Take care in case the LHS and RHS are related somehow. */ ++ gdbpy_ref<> tmp (self->missing_debug_handlers); ++ Py_INCREF (handlers); ++ self->missing_debug_handlers = handlers; ++ ++ return 0; ++} ++ + /* Set the 'type_printers' attribute. */ + + static int +@@ -744,6 +793,8 @@ static gdb_PyGetSetDef pspace_getset[] = + "Type printers.", NULL }, + { "xmethods", pspy_get_xmethods, NULL, + "Debug methods.", NULL }, ++ { "missing_debug_handlers", pspy_get_missing_debug_handlers, ++ pspy_set_missing_debug_handlers, "Missing debug handlers.", NULL }, + { NULL } + }; + +diff --git a/gdb/python/python.c b/gdb/python/python.c +--- a/gdb/python/python.c ++++ b/gdb/python/python.c +@@ -124,7 +124,9 @@ static enum ext_lang_rc gdbpy_before_prompt_hook + static gdb::optional gdbpy_colorize + (const std::string &filename, const std::string &contents); + static gdb::optional gdbpy_colorize_disasm +- (const std::string &content, gdbarch *gdbarch); ++(const std::string &content, gdbarch *gdbarch); ++static ext_lang_missing_debuginfo_result gdbpy_handle_missing_debuginfo ++ (const struct extension_language_defn *extlang, struct objfile *objfile); + + /* The interface between gdb proper and loading of python scripts. */ + +@@ -170,6 +172,8 @@ static const struct extension_language_ops python_extension_ops = + gdbpy_colorize_disasm, + + gdbpy_print_insn, ++ ++ gdbpy_handle_missing_debuginfo + }; + + #endif /* HAVE_PYTHON */ +@@ -1661,6 +1665,83 @@ gdbpy_get_current_objfile (PyObject *unused1, PyObject *unused2) + return objfile_to_objfile_object (gdbpy_current_objfile).release (); + } + ++/* Implement the 'handle_missing_debuginfo' hook for Python. GDB has ++ failed to find any debug information for OBJFILE. The extension has a ++ chance to record this, or even install the required debug information. ++ See the description of ext_lang_missing_debuginfo_result in ++ extension-priv.h for details of the return value. */ ++ ++static ext_lang_missing_debuginfo_result ++gdbpy_handle_missing_debuginfo (const struct extension_language_defn *extlang, ++ struct objfile *objfile) ++{ ++ /* Early exit if Python is not initialised. */ ++ if (!gdb_python_initialized) ++ return {}; ++ ++ struct gdbarch *gdbarch = objfile->arch (); ++ ++ gdbpy_enter enter_py (gdbarch); ++ ++ /* Convert OBJFILE into the corresponding Python object. */ ++ gdbpy_ref<> pyo_objfile = objfile_to_objfile_object (objfile); ++ if (pyo_objfile == nullptr) ++ { ++ gdbpy_print_stack (); ++ return {}; ++ } ++ ++ /* Lookup the helper function within the GDB module. */ ++ gdbpy_ref<> pyo_handler ++ (PyObject_GetAttrString (gdb_python_module, "_handle_missing_debuginfo")); ++ if (pyo_handler == nullptr) ++ { ++ gdbpy_print_stack (); ++ return {}; ++ } ++ ++ /* Call the function, passing in the Python objfile object. */ ++ gdbpy_ref<> pyo_execute_ret ++ (PyObject_CallFunctionObjArgs (pyo_handler.get (), pyo_objfile.get (), ++ nullptr)); ++ if (pyo_execute_ret == nullptr) ++ { ++ /* If the handler is cancelled due to a Ctrl-C, then propagate ++ the Ctrl-C as a GDB exception instead of swallowing it. */ ++ gdbpy_print_stack_or_quit (); ++ return {}; ++ } ++ ++ /* Parse the result, and convert it back to the C++ object. */ ++ if (pyo_execute_ret == Py_None) ++ return {}; ++ ++ if (PyBool_Check (pyo_execute_ret.get ())) ++ { ++ bool try_again = PyObject_IsTrue (pyo_execute_ret.get ()); ++ return ext_lang_missing_debuginfo_result (try_again); ++ } ++ ++ if (!gdbpy_is_string (pyo_execute_ret.get ())) ++ { ++ PyErr_SetString (PyExc_ValueError, ++ "return value from _handle_missing_debuginfo should " ++ "be None, a Bool, or a String"); ++ gdbpy_print_stack (); ++ return {}; ++ } ++ ++ gdb::unique_xmalloc_ptr filename ++ = python_string_to_host_string (pyo_execute_ret.get ()); ++ if (filename == nullptr) ++ { ++ gdbpy_print_stack (); ++ return {}; ++ } ++ ++ return ext_lang_missing_debuginfo_result (std::string (filename.get ())); ++} ++ + /* Compute the list of active python type printers and store them in + EXT_PRINTERS->py_type_printers. The product of this function is used by + gdbpy_apply_type_printers, and freed by gdbpy_free_type_printers. +diff --git a/gdb/testsuite/gdb.python/py-missing-debug.c b/gdb/testsuite/gdb.python/py-missing-debug.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.python/py-missing-debug.c +@@ -0,0 +1,22 @@ ++/* This test program is part of GDB, the GNU debugger. ++ ++ Copyright 2023 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++int ++main () ++{ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.python/py-missing-debug.exp b/gdb/testsuite/gdb.python/py-missing-debug.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.python/py-missing-debug.exp +@@ -0,0 +1,473 @@ ++# Copyright (C) 2023 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++load_lib gdb-python.exp ++ ++require allow_python_tests ++ ++standard_testfile ++ ++if {[build_executable "failed to prepare" ${testfile} ${srcfile}]} { ++ return -1 ++} ++ ++# Remove debug information from BINFILE and place it into ++# BINFILE.debug. ++if {[gdb_gnu_strip_debug $binfile]} { ++ unsupported "cannot produce separate debug info files" ++ return -1 ++} ++ ++set remote_python_file \ ++ [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py] ++ ++set debug_filename ${binfile}.debug ++set hidden_filename ${binfile}.hidden ++ ++# Start GDB. ++clean_restart ++ ++# Some initial sanity checks; initially, we can find the debug information ++# (this will use the .gnu_debuglink), then after we move the debug ++# information, reload the executable, now the debug can't be found. ++with_test_prefix "initial checks" { ++ # Load BINFILE, we should find the separate debug information. ++ gdb_file_cmd $binfile ++ gdb_assert {$gdb_file_cmd_debug_info == "debug"} \ ++ "debug info is found" ++ ++ # Rename the debug information file, re-load BINFILE, GDB should fail ++ # to find the debug information ++ remote_exec build "mv $debug_filename $hidden_filename" ++ gdb_file_cmd $binfile ++ gdb_assert {$gdb_file_cmd_debug_info == "nodebug"} \ ++ "debug info no longer found" ++} ++ ++# Load the Python script into GDB. ++gdb_test "source $remote_python_file" "^Success" \ ++ "source python script" ++ ++# Setup the separate debug info directory. This isn't actually needed until ++# some of the later tests, but might as well get this done now. ++set debug_directory [standard_output_file "debug-dir"] ++remote_exec build "mkdir -p $debug_directory" ++gdb_test_no_output "set debug-file-directory $debug_directory" \ ++ "set debug-file-directory" ++ ++# Initially the missing debug handler we install is in a mode where it ++# returns None, indicating that it can't help locate the debug information. ++# Check this works as expected. ++with_test_prefix "handler returning None" { ++ gdb_test_no_output \ ++ "python gdb.missing_debug.register_handler(None, handler_obj)" \ ++ "register the initial handler" ++ ++ gdb_file_cmd $binfile ++ gdb_assert {$gdb_file_cmd_debug_info == "nodebug"} \ ++ "debug info not found" ++ ++ # Check the handler was only called once. ++ gdb_test "python print(handler_obj.call_count)" "^1" \ ++ "check handler was only called once" ++} ++ ++# Now configure the handler to move the debug file back to the ++# .gnu_debuglink location and then return True, this will cause GDB to ++# recheck, at which point it should find the debug info. ++with_test_prefix "handler in gnu_debuglink mode" { ++ gdb_test_no_output "python handler_obj.set_mode(Mode.RETURN_TRUE, \ ++ \"$hidden_filename\", \ ++ \"$debug_filename\")" \ ++ "confirgure handler" ++ gdb_file_cmd $binfile ++ gdb_assert {$gdb_file_cmd_debug_info == "debug"} "debug info found" ++ ++ # Check the handler was only called once. ++ gdb_test "python print(handler_obj.call_count)" "^1" \ ++ "check handler was only called once" ++} ++ ++# Setup a directory structure based on the build-id of BINFILE, but don't ++# move the debug information into place just yet. ++# ++# Instead, configure the handler to move the debug info into the build-id ++# directory. ++# ++# Reload BINFILE, at which point the handler will move the debug info into ++# the build-id directory and return True, GDB will then recheck for the ++# debug information, and should find it. ++with_test_prefix "handler in build-id mode" { ++ # Move the debug file out of the way once more. ++ remote_exec build "mv $debug_filename $hidden_filename" ++ ++ # Create the build-id based directory in which the debug information ++ # will be placed. ++ set build_id_filename \ ++ $debug_directory/[build_id_debug_filename_get $binfile] ++ remote_exec build "mkdir -p [file dirname $build_id_filename]" ++ ++ # Configure the handler to move the debug info into the build-id dir. ++ gdb_test_no_output "python handler_obj.set_mode(Mode.RETURN_TRUE, \ ++ \"$hidden_filename\", \ ++ \"$build_id_filename\")" \ ++ "confirgure handler" ++ ++ # Reload the binary and check the debug information is found. ++ gdb_file_cmd $binfile ++ gdb_assert {$gdb_file_cmd_debug_info == "debug"} "debug info found" ++ ++ # Check the handler was only called once. ++ gdb_test "python print(handler_obj.call_count)" "^1" \ ++ "check handler was only called once" ++} ++ ++# Move the debug information back to a hidden location and configure the ++# handler to return the filename of the hidden debug info location. GDB ++# should immediately use this file as the debug information. ++with_test_prefix "handler returning a string" { ++ remote_exec build "mv $build_id_filename $hidden_filename" ++ ++ # Configure the handler return a filename string. ++ gdb_test_no_output "python handler_obj.set_mode(Mode.RETURN_STRING, \ ++ \"$hidden_filename\")" \ ++ "confirgure handler" ++ ++ # Reload the binary and check the debug information is found. ++ gdb_file_cmd $binfile ++ gdb_assert {$gdb_file_cmd_debug_info == "debug"} "debug info found" ++ ++ # Check the handler was only called once. ++ gdb_test "python print(handler_obj.call_count)" "^1" \ ++ "check handler was only called once" ++} ++ ++# Register another global handler, this one raises an exception. Reload the ++# debug information, the bad handler should be invoked first, which raises ++# an excetption, at which point GDB should skip further Python handlers. ++with_test_prefix "handler raises an exception" { ++ gdb_test_no_output \ ++ "python gdb.missing_debug.register_handler(None, rhandler)" ++ ++ foreach_with_prefix exception_type {gdb.GdbError TypeError} { ++ gdb_test_no_output \ ++ "python rhandler.exception_type = $exception_type" ++ ++ gdb_file_cmd $binfile ++ gdb_assert {$gdb_file_cmd_debug_info == "nodebug"} \ ++ "debug info not found" ++ ++ set re [string_to_regexp \ ++ "Python Exception : message"] ++ gdb_assert {[regexp $re $gdb_file_cmd_msg]} \ ++ "check for exception in file command output" ++ ++ # Our original handler is still registered, but should not have been ++ # called again (as the exception occurs first). ++ gdb_test "python print(handler_obj.call_count)" "^1" \ ++ "check good handler hasn't been called again" ++ } ++} ++ ++gdb_test "info missing-debug-handlers" \ ++ [multi_line \ ++ "Global:" \ ++ " exception_handler" \ ++ " handler"] \ ++ "check both handlers are visible" ++ ++# Re-start GDB. ++clean_restart ++ ++# Load the Python script into GDB. ++gdb_test "source $remote_python_file" "^Success" \ ++ "source python script for bad handler name checks" ++ ++# Attempt to register a missing-debug-handler with NAME. The expectation is ++# that this should fail as NAME contains some invalid characters. ++proc check_bad_name {name} { ++ set name_re [string_to_regexp $name] ++ set re \ ++ [multi_line \ ++ "ValueError: invalid character '.' in handler name: $name_re" \ ++ "Error while executing Python code\\."] ++ ++ gdb_test "python register(\"$name\")" $re \ ++ "check that '$name' is not accepted" ++} ++ ++# We don't attempt to be exhaustive here, just check a few random examples ++# of invalid names. ++check_bad_name "!! Bad Name" ++check_bad_name "Bad Name" ++check_bad_name "(Bad Name)" ++check_bad_name "Bad \[Name\]" ++check_bad_name "Bad,Name" ++check_bad_name "Bad;Name" ++ ++# Check that there are no handlers registered. ++gdb_test_no_output "info missing-debug-handlers" \ ++ "check no handlers are registered" ++ ++# Check we can use the enable/disable commands where there are no handlers ++# registered. ++gdb_test "enable missing-debug-handler foo" \ ++ "^0 missing debug handlers enabled" ++gdb_test "disable missing-debug-handler foo" \ ++ "^0 missing debug handlers disabled" ++ ++# Grab the current program space object, used for registering handler later. ++gdb_test_no_output "python pspace = gdb.selected_inferior().progspace" ++ ++# Now register some handlers. ++foreach hspec {{\"Foo\" None} ++ {\"-bar\" None} ++ {\"baz-\" pspace} ++ {\"abc-def\" pspace}} { ++ lassign $hspec name locus ++ gdb_test "python register($name, $locus)" ++} ++ ++with_test_prefix "all handlers enabled" { ++ gdb_test "info missing-debug-handlers" \ ++ [multi_line \ ++ "Current Progspace:" \ ++ " abc-def" \ ++ " baz-" \ ++ "Global:" \ ++ " -bar" \ ++ " Foo"] ++ ++ gdb_file_cmd $binfile ++ gdb_test "python print(handler_call_log)" \ ++ [string_to_regexp {['abc-def', 'baz-', '-bar', 'Foo']}] ++ gdb_test_no_output "python handler_call_log = \[\]" \ ++ "reset call log" ++} ++ ++with_test_prefix "disable 'baz-'" { ++ gdb_test "disable missing-debug-handler progspace baz-" \ ++ "^1 missing debug handler disabled" ++ ++ gdb_test "info missing-debug-handlers" \ ++ [multi_line \ ++ "Progspace \[^\r\n\]+:" \ ++ " abc-def" \ ++ " baz- \\\[disabled\\\]" \ ++ "Global:" \ ++ " -bar" \ ++ " Foo"] ++ ++ gdb_file_cmd $binfile ++ gdb_test "python print(handler_call_log)" \ ++ [string_to_regexp {['abc-def', '-bar', 'Foo']}] ++ gdb_test_no_output "python handler_call_log = \[\]" \ ++ "reset call log" ++} ++ ++with_test_prefix "disable 'Foo'" { ++ gdb_test "disable missing-debug-handler .* Foo" \ ++ "^1 missing debug handler disabled" ++ ++ gdb_test "info missing-debug-handlers" \ ++ [multi_line \ ++ "Progspace \[^\r\n\]+:" \ ++ " abc-def" \ ++ " baz- \\\[disabled\\\]" \ ++ "Global:" \ ++ " -bar" \ ++ " Foo \\\[disabled\\\]"] ++ ++ gdb_file_cmd $binfile ++ gdb_test "python print(handler_call_log)" \ ++ [string_to_regexp {['abc-def', '-bar']}] ++ gdb_test_no_output "python handler_call_log = \[\]" \ ++ "reset call log" ++} ++ ++with_test_prefix "disable everything" { ++ gdb_test "disable missing-debug-handler .* .*" \ ++ "^2 missing debug handlers disabled" ++ ++ gdb_test "info missing-debug-handlers" \ ++ [multi_line \ ++ "Progspace \[^\r\n\]+:" \ ++ " abc-def \\\[disabled\\\]" \ ++ " baz- \\\[disabled\\\]" \ ++ "Global:" \ ++ " -bar \\\[disabled\\\]" \ ++ " Foo \\\[disabled\\\]"] ++ ++ gdb_file_cmd $binfile ++ gdb_test "python print(handler_call_log)" \ ++ [string_to_regexp {[]}] ++ gdb_test_no_output "python handler_call_log = \[\]" \ ++ "reset call log" ++} ++ ++with_test_prefix "enable 'abc-def'" { ++ set re [string_to_regexp $binfile] ++ ++ gdb_test "enable missing-debug-handler \"$re\" abc-def" \ ++ "^1 missing debug handler enabled" ++ ++ gdb_test "info missing-debug-handlers" \ ++ [multi_line \ ++ "Progspace \[^\r\n\]+:" \ ++ " abc-def" \ ++ " baz- \\\[disabled\\\]" \ ++ "Global:" \ ++ " -bar \\\[disabled\\\]" \ ++ " Foo \\\[disabled\\\]"] ++ ++ gdb_file_cmd $binfile ++ gdb_test "python print(handler_call_log)" \ ++ [string_to_regexp {['abc-def']}] ++ gdb_test_no_output "python handler_call_log = \[\]" \ ++ "reset call log" ++} ++ ++with_test_prefix "enable global handlers" { ++ set re [string_to_regexp $binfile] ++ ++ gdb_test "enable missing-debug-handler global" \ ++ "^2 missing debug handlers enabled" ++ ++ gdb_test "info missing-debug-handlers" \ ++ [multi_line \ ++ "Progspace \[^\r\n\]+:" \ ++ " abc-def" \ ++ " baz- \\\[disabled\\\]" \ ++ "Global:" \ ++ " -bar" \ ++ " Foo"] ++ ++ gdb_file_cmd $binfile ++ gdb_test "python print(handler_call_log)" \ ++ [string_to_regexp {['abc-def', '-bar', 'Foo']}] ++ gdb_test_no_output "python handler_call_log = \[\]" \ ++ "reset call log" ++} ++ ++# Add handler_obj to the global handler list, and configure it to ++# return False. We should call all of the program space specific ++# handlers (which return None), and then call handler_obj from the ++# global list, which returns False, at which point we shouldn't call ++# anyone else. ++with_test_prefix "return False handler in progspace list" { ++ gdb_test "enable missing-debug-handler progspace" \ ++ "^1 missing debug handler enabled" ++ ++ gdb_test_no_output \ ++ "python gdb.missing_debug.register_handler(None, handler_obj)" \ ++ "register the initial handler" ++ ++ gdb_test "info missing-debug-handlers" \ ++ [multi_line \ ++ "Progspace \[^\r\n\]+:" \ ++ " abc-def" \ ++ " baz-" \ ++ "Global:" \ ++ " handler" \ ++ " -bar" \ ++ " Foo"] ++ ++ gdb_test_no_output "python handler_obj.set_mode(Mode.RETURN_FALSE)" \ ++ "confirgure handler" ++ ++ gdb_file_cmd $binfile ++ gdb_test "python print(handler_call_log)" \ ++ [string_to_regexp {['abc-def', 'baz-', 'handler']}] ++ gdb_test_no_output "python handler_call_log = \[\]" \ ++ "reset call log" ++} ++ ++# Now add handler_obj to the current program space's handler list. We ++# use the same handler object here, that's fine. We should only see a ++# call to the first handler object in the call log. ++with_test_prefix "return False handler in global list" { ++ gdb_test_no_output \ ++ "python gdb.missing_debug.register_handler(pspace, handler_obj)" \ ++ "register the initial handler" ++ ++ gdb_test "info missing-debug-handlers" \ ++ [multi_line \ ++ "Progspace \[^\r\n\]+:" \ ++ " handler" \ ++ " abc-def" \ ++ " baz-" \ ++ "Global:" \ ++ " handler" \ ++ " -bar" \ ++ " Foo"] ++ ++ gdb_file_cmd $binfile ++ gdb_test "python print(handler_call_log)" \ ++ [string_to_regexp {['handler']}] ++ gdb_test_no_output "python handler_call_log = \[\]" \ ++ "reset call log" ++} ++ ++with_test_prefix "check handler replacement" { ++ # First, check we can have the same name appear in both program ++ # space and global lists without giving an error. ++ gdb_test_no_output "python register(\"Foo\", pspace)" ++ ++ gdb_test "info missing-debug-handlers" \ ++ [multi_line \ ++ "Progspace \[^\r\n\]+:" \ ++ " Foo" \ ++ " handler" \ ++ " abc-def" \ ++ " baz-" \ ++ "Global:" \ ++ " handler" \ ++ " -bar" \ ++ " Foo"] ++ ++ # Now check that we get an error if we try to add a handler with ++ # the same name. ++ gdb_test "python gdb.missing_debug.register_handler(pspace, log_handler(\"Foo\"))" \ ++ [multi_line \ ++ "RuntimeError: Handler Foo already exists\\." \ ++ "Error while executing Python code\\."] ++ ++ gdb_test "python gdb.missing_debug.register_handler(handler=log_handler(\"Foo\"), locus=pspace)" \ ++ [multi_line \ ++ "RuntimeError: Handler Foo already exists\\." \ ++ "Error while executing Python code\\."] ++ ++ # And now try again, but this time with 'replace=True', we ++ # shouldn't get an error in this case. ++ gdb_test_no_output \ ++ "python gdb.missing_debug.register_handler(pspace, log_handler(\"Foo\"), replace=True)" ++ ++ gdb_test_no_output \ ++ "python gdb.missing_debug.register_handler(handler=log_handler(\"Foo\"), locus=None, replace=True)" ++ ++ # Now disable a handler and check we still need to use 'replace=True'. ++ gdb_test "disable missing-debug-handler progspace Foo" \ ++ "^1 missing debug handler disabled" ++ ++ gdb_test "python gdb.missing_debug.register_handler(pspace, log_handler(\"Foo\"))" \ ++ [multi_line \ ++ "RuntimeError: Handler Foo already exists\\." \ ++ "Error while executing Python code\\."] \ ++ "still get an error when handler is disabled" ++ ++ gdb_test_no_output \ ++ "python gdb.missing_debug.register_handler(pspace, log_handler(\"Foo\"), replace=True)" \ ++ "can replace a disabled handler" ++} +diff --git a/gdb/testsuite/gdb.python/py-missing-debug.py b/gdb/testsuite/gdb.python/py-missing-debug.py +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.python/py-missing-debug.py +@@ -0,0 +1,120 @@ ++# Copyright (C) 2023 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++import gdb ++from gdb.missing_debug import MissingDebugHandler ++from enum import Enum ++import os ++ ++# A global log that is filled in by instances of the LOG_HANDLER class ++# when they are called. ++handler_call_log = [] ++ ++ ++class Mode(Enum): ++ RETURN_NONE = 0 ++ RETURN_TRUE = 1 ++ RETURN_FALSE = 2 ++ RETURN_STRING = 3 ++ ++ ++class handler(MissingDebugHandler): ++ def __init__(self): ++ super().__init__("handler") ++ self._call_count = 0 ++ self._mode = Mode.RETURN_NONE ++ ++ def __call__(self, objfile): ++ global handler_call_log ++ handler_call_log.append(self.name) ++ self._call_count += 1 ++ if self._mode == Mode.RETURN_NONE: ++ return None ++ ++ if self._mode == Mode.RETURN_TRUE: ++ os.rename(self._src, self._dest) ++ return True ++ ++ if self._mode == Mode.RETURN_FALSE: ++ return False ++ ++ if self._mode == Mode.RETURN_STRING: ++ return self._dest ++ ++ assert False ++ ++ @property ++ def call_count(self): ++ """Return a count, the number of calls to __call__ since the last ++ call to set_mode. ++ """ ++ return self._call_count ++ ++ def set_mode(self, mode, *args): ++ self._call_count = 0 ++ self._mode = mode ++ ++ if mode == Mode.RETURN_NONE: ++ assert len(args) == 0 ++ return ++ ++ if mode == Mode.RETURN_TRUE: ++ assert len(args) == 2 ++ self._src = args[0] ++ self._dest = args[1] ++ return ++ ++ if mode == Mode.RETURN_FALSE: ++ assert len(args) == 0 ++ return ++ ++ if mode == Mode.RETURN_STRING: ++ assert len(args) == 1 ++ self._dest = args[0] ++ return ++ ++ assert False ++ ++ ++class exception_handler(MissingDebugHandler): ++ def __init__(self): ++ super().__init__("exception_handler") ++ self.exception_type = None ++ ++ def __call__(self, objfile): ++ global handler_call_log ++ handler_call_log.append(self.name) ++ assert self.exception_type is not None ++ raise self.exception_type("message") ++ ++ ++class log_handler(MissingDebugHandler): ++ def __call__(self, objfile): ++ global handler_call_log ++ handler_call_log.append(self.name) ++ return None ++ ++ ++# A basic helper function, this keeps lines shorter in the TCL script. ++def register(name, locus=None): ++ gdb.missing_debug.register_handler(locus, log_handler(name)) ++ ++ ++# Create instances of the handlers, but don't install any. We install ++# these as needed from the TCL script. ++rhandler = exception_handler() ++handler_obj = handler() ++ ++print("Success") diff --git a/gdb-add-rpm-suggestion-script.patch b/gdb-add-rpm-suggestion-script.patch new file mode 100644 index 0000000..9ee42c2 --- /dev/null +++ b/gdb-add-rpm-suggestion-script.patch @@ -0,0 +1,157 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Thu, 7 Mar 2024 15:14:23 +0000 +Subject: gdb-add-rpm-suggestion-script.patch + +;; Not a backport. Add a new script which hooks into GDB and suggests +;; RPMs to install when GDB finds an objfile with no debug info. + +gdb: add script which will suggest debuginfo RPMs to install + +This script hooks into GDB's missing debug info Python API and +suggests debuginfo RPMs to install. + +diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in +--- a/gdb/data-directory/Makefile.in ++++ b/gdb/data-directory/Makefile.in +@@ -86,6 +86,7 @@ PYTHON_FILE_LIST = \ + gdb/command/missing_debug.py \ + gdb/command/pretty_printers.py \ + gdb/command/prompt.py \ ++ gdb/command/rpm-suggestions.py \ + gdb/command/type_printers.py \ + gdb/command/unwinders.py \ + gdb/command/xmethods.py \ +diff --git a/gdb/python/lib/gdb/command/rpm-suggestions.py b/gdb/python/lib/gdb/command/rpm-suggestions.py +new file mode 100644 +--- /dev/null ++++ b/gdb/python/lib/gdb/command/rpm-suggestions.py +@@ -0,0 +1,111 @@ ++# Copyright 2023 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++import gdb ++import gdb.missing_debug ++import rpm ++ ++# Track all the RPMs suggested during a single debug session so we ++# don't suggest the same RPM twice. This is only cleared when the ++# main executable is changed. ++__missing_rpms = {} ++ ++# Track any missing RPMs that have been discovered since the last time ++# the prompt was displayed. RPMs in here are also present in the ++# __MISSING_RPMS dictionary, but this dictionary is cleared each time ++# the prompt is shown. ++__suggest_rpms = {} ++ ++ ++# Lookup RPMs that might provide the debug information for FILENAME, ++# which is a string containing the path to an object file GDB could ++# not find any debug information for. ++# ++# If a possible RPM is found then this is added to the globals ++# __MISSING_RPMS and __SUGGEST_RPMS, which are used elsewhere in this ++# script. ++def find_suggestions(filename): ++ ts = rpm.TransactionSet() ++ ++ mi = ts.dbMatch(rpm.RPMDBI_BASENAMES, filename) ++ for h in mi: ++ # Build the debuginfo package name. ++ obj = h.format("%{name}-debuginfo-%{version}-%{release}.%{arch}") ++ ++ # Check to see if the package is installed. ++ mi2 = ts.dbMatch(rpm.RPMDBI_LABEL, str(obj)) ++ if len(mi2) > 0: ++ continue ++ ++ # Now build the name of the package FILENAME came from. ++ obj = h.format("%{name}-%{version}-%{release}.%{arch}") ++ rpm_name = str(obj) ++ if not rpm_name in __missing_rpms: ++ __suggest_rpms[rpm_name] = True ++ __missing_rpms[rpm_name] = True ++ ++ ++# A missing debug handler class. Just forwards the name of the ++# objfile for which we are missing debug information to ++# find_suggestions. ++class RPMSuggestionHandler(gdb.missing_debug.MissingDebugHandler): ++ def __init__(self): ++ super().__init__("rpm-suggestions") ++ ++ def __call__(self, objfile): ++ # Traditionally the 'build-id-verbose' parameter is what ++ # controlled all RPM suggestion. Maybe once all the RPM ++ # suggestion is performed via Python extensions then we might ++ # consider renaming this parameter to something else, but for ++ # now, for backward compatibility, I've retained this name. ++ if gdb.parameter("build-id-verbose") > 0: ++ find_suggestions(objfile.filename) ++ return False ++ return None ++ ++ ++# Called before GDB displays its prompt. If the global __SUGGEST_RPMS ++# dictionary is not empty, then this hook prints treats the keys of ++# this dictionary as strings which are the names of RPMs. This hook ++# formats each RPM name into a suggested debuginfo-install command and ++# suggests this to the user. ++def before_prompt(): ++ global __suggest_rpms ++ ++ if len(__suggest_rpms) > 0: ++ for p in __suggest_rpms.keys(): ++ print("Missing debuginfo, try: dnf debuginfo-install " + p) ++ __suggest_rpms = {} ++ ++ ++# Called when the executable within a progrm space is changed. Clear ++# the lists of RPM suggestions. We only clear the previous suggestion ++# list when the executable really changes. If the user simply ++# recompiles the executable, then we don't both clearing this list. ++def executable_changed_handler(event): ++ global __missing_rpms ++ global __suggest_rpms ++ ++ if not event.reload: ++ __missing_rpms = {} ++ __suggest_rpms = {} ++ ++ ++# Attach to the required GDB events. ++gdb.events.executable_changed.connect(executable_changed_handler) ++gdb.events.before_prompt.connect(before_prompt) ++ ++# Register the missing debug handler with GDB. ++gdb.missing_debug.register_handler(None, RPMSuggestionHandler()) +diff --git a/gdb/testsuite/gdb.python/py-missing-debug.py b/gdb/testsuite/gdb.python/py-missing-debug.py +--- a/gdb/testsuite/gdb.python/py-missing-debug.py ++++ b/gdb/testsuite/gdb.python/py-missing-debug.py +@@ -18,6 +18,13 @@ from gdb.missing_debug import MissingDebugHandler + from enum import Enum + import os + ++# This is a RHEL/Fedora work around: There's already a ++# missing-debug-info handler registered for these versions of GDB. ++# Discard the handler now so that the tests will pass (the tests ++# assume no handler is currently registered). ++gdb.missing_debug_handlers = [] ++ ++ + # A global log that is filled in by instances of the LOG_HANDLER class + # when they are called. + handler_call_log = [] diff --git a/gdb-archer-next-over-throw-cxx-exec.patch b/gdb-archer-next-over-throw-cxx-exec.patch index ce3c1aa..510363e 100644 --- a/gdb-archer-next-over-throw-cxx-exec.patch +++ b/gdb-archer-next-over-throw-cxx-exec.patch @@ -59,7 +59,7 @@ new file mode 100644 +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + -+if { [skip_cplus_tests] } { continue } ++require allow_cplus_tests + +set testfile cxxexec +if { [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.cc {c++ debug}] } { diff --git a/gdb-bz634108-solib_address.patch b/gdb-bz634108-solib_address.patch index bc7ef8a..cec3245 100644 --- a/gdb-bz634108-solib_address.patch +++ b/gdb-bz634108-solib_address.patch @@ -14,7 +14,7 @@ diff --git a/gdb/testsuite/gdb.python/rh634108-solib_address.exp b/gdb/testsuite new file mode 100644 --- /dev/null +++ b/gdb/testsuite/gdb.python/rh634108-solib_address.exp -@@ -0,0 +1,24 @@ +@@ -0,0 +1,25 @@ +# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -32,10 +32,11 @@ new file mode 100644 + +# https://bugzilla.redhat.com/show_bug.cgi?id=634108 + ++load_lib gdb-python.exp ++ ++require allow_python_tests ++ +gdb_exit +gdb_start + -+# Skip all tests if Python scripting is not enabled. -+if { [skip_python_tests] } { continue } -+ +gdb_test "python print (gdb.solib_name(-1))" "None" "gdb.solib_name exists" diff --git a/gdb-do-not-import-py-curses-ascii-module.patch b/gdb-do-not-import-py-curses-ascii-module.patch new file mode 100644 index 0000000..bbfbae9 --- /dev/null +++ b/gdb-do-not-import-py-curses-ascii-module.patch @@ -0,0 +1,64 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 22 Nov 2023 19:02:34 +0100 +Subject: gdb-do-not-import-py-curses-ascii-module.patch + +;; Backport upstream commit e8c3dafa5f5. + +[gdb/python] Don't import curses.ascii module unless necessary + +I ran into a failure in test-case gdb.python/py-missing-debug.exp with python +3.6, which was fixed by commit 7db795bc67a ("gdb/python: remove use of +str.isascii()"). + +However, I subsequently ran into a failure with python 3.11: +... +(gdb) PASS: $exp: initial checks: debug info no longer found +source py-missing-debug.py^M +Traceback (most recent call last):^M + File "py-missing-debug.py", line 17, in ^M + from gdb.missing_debug import MissingDebugHandler^M + File "missing_debug.py", line 21, in ^M + from curses.ascii import isascii, isalnum^M + File "/usr/lib64/python3.11/_import_failed/curses.py", line 16, in ^M + raise ImportError(f"""Module '{failed_name}' is not installed.^M +ImportError: Module 'curses' is not installed.^M +Use:^M + sudo zypper install python311-curses^M +to install it.^M +(gdb) FAIL: $exp: source python script +... + +Apparently I have the curses module installed for 3.6, but not 3.11. + +I could just install it, but the test-case worked fine with 3.11 before commit +7db795bc67a. + +Fix this by only using the curses module when necessary, for python <= 3.7. + +Tested on x86_64-linux, with both python 3.6 and 3.11. + +diff --git a/gdb/python/lib/gdb/missing_debug.py b/gdb/python/lib/gdb/missing_debug.py +--- a/gdb/python/lib/gdb/missing_debug.py ++++ b/gdb/python/lib/gdb/missing_debug.py +@@ -18,8 +18,18 @@ MissingDebugHandler base class, and register_handler function. + """ + + import gdb +-from curses.ascii import isascii, isalnum +- ++import sys ++if sys.version_info >= (3, 7): ++ # Functions str.isascii() and str.isalnum are available starting Python ++ # 3.7. ++ def isascii(ch): ++ return ch.isascii() ++ def isalnum(ch): ++ return ch.isalnum() ++else: ++ # Fall back to curses.ascii.isascii() and curses.ascii.isalnum() for ++ # earlier versions. ++ from curses.ascii import isascii, isalnum + + def _validate_name(name): + """Validate a missing debug handler name string. diff --git a/gdb-fedora-libncursesw.patch b/gdb-fedora-libncursesw.patch index 6bf6aa3..99214df 100644 --- a/gdb-fedora-libncursesw.patch +++ b/gdb-fedora-libncursesw.patch @@ -12,269 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1270534 diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -780,9 +780,6 @@ ENABLE_BFD_64_BIT_TRUE - subdirs - RPM_LIBS - RPM_CFLAGS --PKG_CONFIG_LIBDIR --PKG_CONFIG_PATH --PKG_CONFIG - GDB_DATADIR - DEBUGDIR - MAKEINFO_EXTRA_FLAGS -@@ -990,12 +987,12 @@ PKG_CONFIG_PATH - PKG_CONFIG_LIBDIR - MAKEINFO - MAKEINFOFLAGS -+RPM_CFLAGS -+RPM_LIBS - AMD_DBGAPI_CFLAGS - AMD_DBGAPI_LIBS - DEBUGINFOD_CFLAGS - DEBUGINFOD_LIBS --RPM_CFLAGS --RPM_LIBS - YACC - YFLAGS - ZSTD_CFLAGS -@@ -1684,11 +1681,11 @@ Optional Packages: - [--with-auto-load-dir] - --without-auto-load-safe-path - do not restrict auto-loaded files locations -+ --with-rpm query rpm database for missing debuginfos (yes/no, -+ def. auto=librpm.so) - --with-amd-dbgapi support for the amd-dbgapi target (yes / no / auto) - --with-debuginfod Enable debuginfo lookups with debuginfod - (auto/yes/no) -- --with-rpm query rpm database for missing debuginfos (yes/no, -- def. auto=librpm.so) - --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets - --with-curses use the curses library instead of the termcap - library -@@ -1761,6 +1758,8 @@ Some influential environment variables: - MAKEINFO Parent configure detects if it is of sufficient version. - MAKEINFOFLAGS - Parameters for MAKEINFO. -+ RPM_CFLAGS C compiler flags for RPM, overriding pkg-config -+ RPM_LIBS linker flags for RPM, overriding pkg-config - AMD_DBGAPI_CFLAGS - C compiler flags for AMD_DBGAPI, overriding pkg-config - AMD_DBGAPI_LIBS -@@ -1769,8 +1768,6 @@ Some influential environment variables: - C compiler flags for DEBUGINFOD, overriding pkg-config - DEBUGINFOD_LIBS - linker flags for DEBUGINFOD, overriding pkg-config -- RPM_CFLAGS C compiler flags for RPM, overriding pkg-config -- RPM_LIBS linker flags for RPM, overriding pkg-config - YACC The `Yet Another Compiler Compiler' implementation to use. - Defaults to the first program found out of: `bison -y', `byacc', - `yacc'. -@@ -11495,7 +11492,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11486 "configure" -+#line 11495 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -11601,7 +11598,7 @@ else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 11592 "configure" -+#line 11601 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -18102,8 +18099,8 @@ $as_echo_n "checking specific librpm version... " >&6; } - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} --as_fn_error "cannot run test program while cross compiling --See \`config.log' for more details." "$LINENO" 5; } -+as_fn_error $? "cannot run test program while cross compiling -+See \`config.log' for more details" "$LINENO" 5; } - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ -@@ -18275,132 +18272,12 @@ $as_echo "#define HAVE_LIBRPM 1" >>confdefs.h - $as_echo "no" >&6; } - LIBS="$save_LIBS" - if $DLOPEN_REQUIRE; then -- as_fn_error "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5 -+ as_fn_error $? "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5 - fi - -- -- -- -- -- -- --if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then -- if test -n "$ac_tool_prefix"; then -- # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. --set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 --$as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : -- $as_echo_n "(cached) " >&6 --else -- case $PKG_CONFIG in -- [\\/]* | ?:[\\/]*) -- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. -- ;; -- *) -- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR --for as_dir in $PATH --do -- IFS=$as_save_IFS -- test -z "$as_dir" && as_dir=. -- for ac_exec_ext in '' $ac_executable_extensions; do -- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -- ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" -- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -- break 2 -- fi --done -- done --IFS=$as_save_IFS -- -- ;; --esac --fi --PKG_CONFIG=$ac_cv_path_PKG_CONFIG --if test -n "$PKG_CONFIG"; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 --$as_echo "$PKG_CONFIG" >&6; } --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } --fi -- -- --fi --if test -z "$ac_cv_path_PKG_CONFIG"; then -- ac_pt_PKG_CONFIG=$PKG_CONFIG -- # Extract the first word of "pkg-config", so it can be a program name with args. --set dummy pkg-config; ac_word=$2 --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 --$as_echo_n "checking for $ac_word... " >&6; } --if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : -- $as_echo_n "(cached) " >&6 --else -- case $ac_pt_PKG_CONFIG in -- [\\/]* | ?:[\\/]*) -- ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. -- ;; -- *) -- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR --for as_dir in $PATH --do -- IFS=$as_save_IFS -- test -z "$as_dir" && as_dir=. -- for ac_exec_ext in '' $ac_executable_extensions; do -- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -- ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" -- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -- break 2 -- fi --done -- done --IFS=$as_save_IFS -- -- ;; --esac --fi --ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG --if test -n "$ac_pt_PKG_CONFIG"; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 --$as_echo "$ac_pt_PKG_CONFIG" >&6; } --else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } --fi -- -- if test "x$ac_pt_PKG_CONFIG" = x; then -- PKG_CONFIG="" -- else -- case $cross_compiling:$ac_tool_warned in --yes:) --{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 --$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} --ac_tool_warned=yes ;; --esac -- PKG_CONFIG=$ac_pt_PKG_CONFIG -- fi --else -- PKG_CONFIG="$ac_cv_path_PKG_CONFIG" --fi -- --fi --if test -n "$PKG_CONFIG"; then -- _pkg_min_version=0.9.0 -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 --$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } -- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 --$as_echo "yes" >&6; } -- else -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } -- PKG_CONFIG="" -- fi --fi -- - pkg_failed=no --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM" >&5 --$as_echo_n "checking for RPM... " >&6; } -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rpm" >&5 -+$as_echo_n "checking for rpm... " >&6; } - - if test -n "$RPM_CFLAGS"; then - pkg_cv_RPM_CFLAGS="$RPM_CFLAGS" -@@ -18437,6 +18314,30 @@ fi - pkg_failed=untried - fi - -+if test $pkg_failed = no; then -+ pkg_save_LDFLAGS="$LDFLAGS" -+ LDFLAGS="$LDFLAGS $pkg_cv_RPM_LIBS" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ -+else -+ pkg_failed=yes -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ LDFLAGS=$pkg_save_LDFLAGS -+fi -+ - - - if test $pkg_failed = yes; then -@@ -18531,7 +18432,7 @@ $as_echo "#define HAVE_LIBRPM 1" >>confdefs.h - LIBS="$LIBS $RPM_LIBS" - else - if $RPM_REQUIRE; then -- as_fn_error "$RPM_PKG_ERRORS" "$LINENO" 5 -+ as_fn_error $? "$RPM_PKG_ERRORS" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $RPM_PKG_ERRORS" >&5 - $as_echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;} -@@ -21164,6 +21065,7 @@ if test x"$prefer_curses" = xyes; then +@@ -20663,6 +20663,7 @@ if test x"$prefer_curses" = xyes; then # search /usr/local/include, if ncurses is installed in /usr/local. A # default installation of ncurses on alpha*-dec-osf* will lead to such # a situation. @@ -282,7 +20,7 @@ diff --git a/gdb/configure b/gdb/configure { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5 $as_echo_n "checking for library containing waddstr... " >&6; } if ${ac_cv_search_waddstr+:} false; then : -@@ -21188,7 +21090,7 @@ return waddstr (); +@@ -20687,7 +20688,7 @@ return waddstr (); return 0; } _ACEOF @@ -291,7 +29,7 @@ diff --git a/gdb/configure b/gdb/configure if test -z "$ac_lib"; then ac_res="none required" else -@@ -21260,6 +21162,7 @@ case $host_os in +@@ -20759,6 +20760,7 @@ case $host_os in esac # These are the libraries checked by Readline. @@ -299,7 +37,7 @@ diff --git a/gdb/configure b/gdb/configure { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5 $as_echo_n "checking for library containing tgetent... " >&6; } if ${ac_cv_search_tgetent+:} false; then : -@@ -21284,7 +21187,7 @@ return tgetent (); +@@ -20783,7 +20785,7 @@ return tgetent (); return 0; } _ACEOF @@ -311,7 +49,7 @@ diff --git a/gdb/configure b/gdb/configure diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -749,7 +749,8 @@ if test x"$prefer_curses" = xyes; then +@@ -555,7 +555,8 @@ if test x"$prefer_curses" = xyes; then # search /usr/local/include, if ncurses is installed in /usr/local. A # default installation of ncurses on alpha*-dec-osf* will lead to such # a situation. @@ -321,7 +59,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac [curses_found=yes AC_DEFINE([HAVE_LIBCURSES], [1], [Define to 1 if curses is enabled.]) -@@ -789,7 +790,8 @@ case $host_os in +@@ -595,7 +596,8 @@ case $host_os in esac # These are the libraries checked by Readline. diff --git a/gdb-glibc-strstr-workaround.patch b/gdb-glibc-strstr-workaround.patch index c2f50ff..3863324 100644 --- a/gdb-glibc-strstr-workaround.patch +++ b/gdb-glibc-strstr-workaround.patch @@ -10,7 +10,7 @@ diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp b/gdb/testsu new file mode 100644 --- /dev/null +++ b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp -@@ -0,0 +1,119 @@ +@@ -0,0 +1,117 @@ +# Copyright (C) 2012 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -30,9 +30,7 @@ new file mode 100644 +# invalid IFUNC DW_AT_linkage_name: memmove strstr time +# http://sourceware.org/bugzilla/show_bug.cgi?id=14166 + -+if {[skip_shlib_tests]} { -+ return 0 -+} ++require allow_shlib_tests + +set testfile "gnu-ifunc-strstr-workaround" +set executable ${testfile} diff --git a/gdb-handle-no-python-gdb-module.patch b/gdb-handle-no-python-gdb-module.patch new file mode 100644 index 0000000..788f984 --- /dev/null +++ b/gdb-handle-no-python-gdb-module.patch @@ -0,0 +1,30 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Tom Tromey +Date: Wed, 15 Nov 2023 06:48:55 -0700 +Subject: gdb-handle-no-python-gdb-module.patch + +;; Backport upstream commit 7d21600b31fe. + +Check gdb_python_module in gdbpy_handle_missing_debuginfo + +If you run gdb in the build tree without --data-directory, on a +program that does not have debug info, it will crash, because +gdbpy_handle_missing_debuginfo unconditionally uses gdb_python_module. + +Other code in gdb using gdb_python_module checks it first and it +seemes harmless to do the same thing here. (gdb_python_initialized +does not cover this case so that python can be partially initialized +and still somewhat work.) + +diff --git a/gdb/python/python.c b/gdb/python/python.c +--- a/gdb/python/python.c ++++ b/gdb/python/python.c +@@ -1676,7 +1676,7 @@ gdbpy_handle_missing_debuginfo (const struct extension_language_defn *extlang, + struct objfile *objfile) + { + /* Early exit if Python is not initialised. */ +- if (!gdb_python_initialized) ++ if (!gdb_python_initialized || gdb_python_module == nullptr) + return {}; + + struct gdbarch *gdbarch = objfile->arch (); diff --git a/gdb-merge-debug-symbol-lookup.patch b/gdb-merge-debug-symbol-lookup.patch new file mode 100644 index 0000000..0968ba0 --- /dev/null +++ b/gdb-merge-debug-symbol-lookup.patch @@ -0,0 +1,265 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Fri, 13 Oct 2023 09:50:33 +0100 +Subject: gdb-merge-debug-symbol-lookup.patch + +;; Backport upstream commit 27807da5849. + +gdb: merge debug symbol file lookup code from coffread & elfread paths + +This commit merges the code that looks for and loads the separate +debug symbol files from coffread.c and elfread.c. The factored out +code is moved into a new objfile::find_and_add_separate_symbol_file() +method. + +For the elfread.c path there should be no user visible changes after +this commit. + +For the coffread.c path GDB will now attempt to perform a debuginfod +lookup for the missing debug information, assuming that GDB can find a +build-id in the COFF file. + +I don't know if COFF files can include a build-id, but I the existing +coffread.c code already includes a call to +find_separate_debug_file_by_build-id, so I know that it is at least OK +for GDB to ask a COFF file for a build-id. If the COFF file doesn't +include a build-id then the debuginfod lookup code will not trigger +and the new code is harmless. + +If the COFF file does include a build-id, then we're going to end up +asking debuginfod for the debug file. As build-ids should be unique, +this should be harmless, even if debuginfod doesn't contain any +suitable debug data, it just costs us one debuginfod lookup, so I'm +not too worried about this for now. + +As with the previous commit, I've done some minimal testing using the +mingw toolchain on a Linux machine, GDB seems to still access the +split debug information just fine. + +Approved-By: Tom Tromey + +diff --git a/gdb/coffread.c b/gdb/coffread.c +--- a/gdb/coffread.c ++++ b/gdb/coffread.c +@@ -40,8 +40,6 @@ + + #include "coff-pe-read.h" + +-#include "build-id.h" +- + /* The objfile we are currently reading. */ + + static struct objfile *coffread_objfile; +@@ -729,26 +727,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) + && objfile->separate_debug_objfile == NULL + && objfile->separate_debug_objfile_backlink == NULL) + { +- deferred_warnings warnings; +- std::string debugfile +- = find_separate_debug_file_by_buildid (objfile, &warnings); +- +- if (debugfile.empty ()) +- debugfile +- = find_separate_debug_file_by_debuglink (objfile, &warnings); +- +- if (!debugfile.empty ()) +- { +- gdb_bfd_ref_ptr debug_bfd (symfile_bfd_open (debugfile.c_str ())); +- +- symbol_file_add_separate (debug_bfd, debugfile.c_str (), +- symfile_flags, objfile); +- } +- /* If all the methods to collect the debuginfo failed, print any +- warnings that were collected, this is a no-op if there are no +- warnings. */ +- if (debugfile.empty ()) +- warnings.emit (); ++ if (objfile->find_and_add_separate_symbol_file (symfile_flags)) ++ gdb_assert (objfile->separate_debug_objfile != nullptr); + } + } + +diff --git a/gdb/elfread.c b/gdb/elfread.c +--- a/gdb/elfread.c ++++ b/gdb/elfread.c +@@ -41,14 +41,12 @@ + #include "regcache.h" + #include "bcache.h" + #include "gdb_bfd.h" +-#include "build-id.h" + #include "location.h" + #include "auxv.h" + #include "mdebugread.h" + #include "ctfread.h" + #include "gdbsupport/gdb_string_view.h" + #include "gdbsupport/scoped_fd.h" +-#include "debuginfod-support.h" + #include "dwarf2/public.h" + #include "cli/cli-cmds.h" + +@@ -1218,59 +1216,10 @@ elf_symfile_read_dwarf2 (struct objfile *objfile, + && objfile->separate_debug_objfile == NULL + && objfile->separate_debug_objfile_backlink == NULL) + { +- deferred_warnings warnings; +- +- std::string debugfile +- = find_separate_debug_file_by_buildid (objfile, &warnings); +- +- if (debugfile.empty ()) +- debugfile = find_separate_debug_file_by_debuglink (objfile, &warnings); +- +- if (!debugfile.empty ()) +- { +- gdb_bfd_ref_ptr debug_bfd +- (symfile_bfd_open_no_error (debugfile.c_str ())); +- +- if (debug_bfd != nullptr) +- symbol_file_add_separate (debug_bfd, debugfile.c_str (), +- symfile_flags, objfile); +- } ++ if (objfile->find_and_add_separate_symbol_file (symfile_flags)) ++ gdb_assert (objfile->separate_debug_objfile != nullptr); + else +- { +- has_dwarf2 = false; +- const struct bfd_build_id *build_id +- = build_id_bfd_get (objfile->obfd.get ()); +- const char *filename = bfd_get_filename (objfile->obfd.get ()); +- +- if (build_id != nullptr) +- { +- gdb::unique_xmalloc_ptr symfile_path; +- scoped_fd fd (debuginfod_debuginfo_query (build_id->data, +- build_id->size, +- filename, +- &symfile_path)); +- +- if (fd.get () >= 0) +- { +- /* File successfully retrieved from server. */ +- gdb_bfd_ref_ptr debug_bfd +- (symfile_bfd_open_no_error (symfile_path.get ())); +- +- if (debug_bfd != nullptr +- && build_id_verify (debug_bfd.get (), build_id->size, +- build_id->data)) +- { +- symbol_file_add_separate (debug_bfd, symfile_path.get (), +- symfile_flags, objfile); +- has_dwarf2 = true; +- } +- } +- } +- } +- /* If all the methods to collect the debuginfo failed, print the +- warnings, this is a no-op if there are no warnings. */ +- if (debugfile.empty () && !has_dwarf2) +- warnings.emit (); ++ has_dwarf2 = false; + } + + return has_dwarf2; +diff --git a/gdb/objfiles.h b/gdb/objfiles.h +--- a/gdb/objfiles.h ++++ b/gdb/objfiles.h +@@ -513,6 +513,16 @@ struct objfile + + bool has_partial_symbols (); + ++ /* Look for a separate debug symbol file for this objfile, make use of ++ build-id, debug-link, and debuginfod as necessary. If a suitable ++ separate debug symbol file is found then it is loaded using a call to ++ symbol_file_add_separate (SYMFILE_FLAGS is passed through unmodified ++ to this call) and this function returns true. If no suitable separate ++ debug symbol file is found and loaded then this function returns ++ false. */ ++ ++ bool find_and_add_separate_symbol_file (symfile_add_flags symfile_flags); ++ + /* Return true if this objfile has any unexpanded symbols. A return + value of false indicates either, that this objfile has all its + symbols fully expanded (i.e. fully read in), or that this objfile has +diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c +--- a/gdb/symfile-debug.c ++++ b/gdb/symfile-debug.c +@@ -35,6 +35,8 @@ + #include "block.h" + #include "filenames.h" + #include "cli/cli-style.h" ++#include "build-id.h" ++#include "debuginfod-support.h" + + /* We need to save a pointer to the real symbol functions. + Plus, the debug versions are malloc'd because we have to NULL out the +@@ -558,6 +560,70 @@ objfile::require_partial_symbols (bool verbose) + } + } + ++/* See objfiles.h. */ ++ ++bool ++objfile::find_and_add_separate_symbol_file (symfile_add_flags symfile_flags) ++{ ++ bool has_dwarf2 = true; ++ ++ deferred_warnings warnings; ++ ++ std::string debugfile ++ = find_separate_debug_file_by_buildid (this, &warnings); ++ ++ if (debugfile.empty ()) ++ debugfile = find_separate_debug_file_by_debuglink (this, &warnings); ++ ++ if (!debugfile.empty ()) ++ { ++ gdb_bfd_ref_ptr debug_bfd ++ (symfile_bfd_open_no_error (debugfile.c_str ())); ++ ++ if (debug_bfd != nullptr) ++ symbol_file_add_separate (debug_bfd, debugfile.c_str (), ++ symfile_flags, this); ++ } ++ else ++ { ++ has_dwarf2 = false; ++ const struct bfd_build_id *build_id ++ = build_id_bfd_get (this->obfd.get ()); ++ const char *filename = bfd_get_filename (this->obfd.get ()); ++ ++ if (build_id != nullptr) ++ { ++ gdb::unique_xmalloc_ptr symfile_path; ++ scoped_fd fd (debuginfod_debuginfo_query (build_id->data, ++ build_id->size, ++ filename, ++ &symfile_path)); ++ ++ if (fd.get () >= 0) ++ { ++ /* File successfully retrieved from server. */ ++ gdb_bfd_ref_ptr debug_bfd ++ (symfile_bfd_open_no_error (symfile_path.get ())); ++ ++ if (debug_bfd != nullptr ++ && build_id_verify (debug_bfd.get (), build_id->size, ++ build_id->data)) ++ { ++ symbol_file_add_separate (debug_bfd, symfile_path.get (), ++ symfile_flags, this); ++ has_dwarf2 = true; ++ } ++ } ++ } ++ } ++ /* If all the methods to collect the debuginfo failed, print the ++ warnings, this is a no-op if there are no warnings. */ ++ if (debugfile.empty () && !has_dwarf2) ++ warnings.emit (); ++ ++ return has_dwarf2; ++} ++ + + /* Debugging version of struct sym_probe_fns. */ + diff --git a/gdb-python-avoid-depending-on-the-curses-library.patch b/gdb-python-avoid-depending-on-the-curses-library.patch new file mode 100644 index 0000000..4a73ba1 --- /dev/null +++ b/gdb-python-avoid-depending-on-the-curses-library.patch @@ -0,0 +1,92 @@ +From ed298cb88f0345d32a412c481898d867677726b8 Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Mon, 9 Sep 2024 17:33:54 +0100 +Subject: [PATCH] gdb/python: avoid depending on the curses library + +The commit: + + commit 29c70787112e01cd52b53bf14bdcacb0a11e0725 + Date: Sun Sep 8 07:46:09 2024 +0200 + + [gdb/testsuite] Handle missing curses in gdb.python/py-missing-debug.exp + +Highlighted that in some cases we might be running on a system with an +older version of Python (earlier than 3.7), and on a system for which +the curses library has not been installed. + +In these circumstances the gdb.missing_debug module will not load as +it uses curses to provide isalnum() and isascii() functions. + +To avoid this problem I propose that we copy the isalnum() and +isascii() from the Python curses library. These functions are +basically trivial and removing the curses dependency means GDB will +work in more cases without increasing its dependencies. + +I did consider keeping the uses of curses and only having the function +definitions be a fallback for when the curses library failed to load, +but this felt like overkill. The function definitions are both tiny +and I think "obvious" given their specifications, so I figure we might +as well just use our own definitions if they are not available as +builtin methods on the str class. + +For testing I changed this line: + + if sys.version_info >= (3, 7): + +to + + if sys.version_info >= (3, 7) and False: + +then reran gdb.python/py-missing-debug.exp, there were no failures. + +Approved-By: Tom de Vries +--- + gdb/python/lib/gdb/missing_debug.py | 30 ++++++++++++++++++++++++++--- + 1 file changed, 27 insertions(+), 3 deletions(-) + +diff --git a/gdb/python/lib/gdb/missing_debug.py b/gdb/python/lib/gdb/missing_debug.py +index 7a768e5e05b..be6aacb1f41 100644 +--- a/gdb/python/lib/gdb/missing_debug.py ++++ b/gdb/python/lib/gdb/missing_debug.py +@@ -30,9 +30,33 @@ if sys.version_info >= (3, 7): + return ch.isalnum() + + else: +- # Fall back to curses.ascii.isascii() and curses.ascii.isalnum() for +- # earlier versions. +- from curses.ascii import isascii, isalnum ++ # Older version of Python doesn't have str.isascii() and ++ # str.isalnum() so provide our own. ++ # ++ # We could import isalnum() and isascii() from the curses library, ++ # but that adds an extra dependency. Given these functions are ++ # both small and trivial lets implement them here. ++ # ++ # These definitions are based on those in the curses library, but ++ # simplified as we know C will always be a single character 'str'. ++ ++ def isdigit(c): ++ return 48 <= ord(c) <= 57 ++ ++ def islower(c): ++ return 97 <= ord(c) <= 122 ++ ++ def isupper(c): ++ return 65 <= ord(c) <= 90 ++ ++ def isalpha(c): ++ return isupper(c) or islower(c) ++ ++ def isalnum(c): ++ return isalpha(c) or isdigit(c) ++ ++ def isascii(c): ++ return 0 <= ord(c) <= 127 + + + def _validate_name(name): + +base-commit: cdf77e047eba662880a85ca55489a96c83c34cfb +-- +2.43.0 + diff --git a/gdb-refactor-find-and-add-separate-symbol-file.patch b/gdb-refactor-find-and-add-separate-symbol-file.patch new file mode 100644 index 0000000..7a4b534 --- /dev/null +++ b/gdb-refactor-find-and-add-separate-symbol-file.patch @@ -0,0 +1,190 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Fri, 13 Oct 2023 16:17:20 +0100 +Subject: gdb-refactor-find-and-add-separate-symbol-file.patch + +;; Backport upstream commit 6234ba17598. + +gdb: refactor objfile::find_and_add_separate_symbol_file + +This is purely a refactoring commit. + +This commit splits objfile::find_and_add_separate_symbol_file into +some separate helper functions. My hope is that the steps for looking +up separate debug information are now clearer. + +In a later commit I'm going to extend +objfile::find_and_add_separate_symbol_file, with some additional +logic, so starting with a simpler function will make the following +changes easier. + +When reading objfile::find_and_add_separate_symbol_file after this +commit, you might be tempted to think that removing the `has_dwarf` +local variable would be a good additional cleanup. After the next +commit though it makes more sense to retain this local, so I've left +this in place for now. + +There should be no user visible changes after this commit. + +Approved-By: Tom Tromey + +diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c +--- a/gdb/symfile-debug.c ++++ b/gdb/symfile-debug.c +@@ -560,68 +560,109 @@ objfile::require_partial_symbols (bool verbose) + } + } + ++/* Call LOOKUP_FUNC to find the filename of a file containing the separate ++ debug information matching OBJFILE. If LOOKUP_FUNC does return a ++ filename then open this file and return a std::pair containing the ++ gdb_bfd_ref_ptr of the open file and the filename returned by ++ LOOKUP_FUNC, otherwise this function returns an empty pair; the first ++ item will be nullptr, and the second will be an empty string. ++ ++ Any warnings generated by this function, or by calling LOOKUP_FUNC are ++ placed into WARNINGS, these warnings are only displayed to the user if ++ GDB is unable to find the separate debug information via any route. */ ++static std::pair ++simple_find_and_open_separate_symbol_file ++ (struct objfile *objfile, ++ std::string (*lookup_func) (struct objfile *, deferred_warnings *), ++ deferred_warnings *warnings) ++{ ++ std::string filename = lookup_func (objfile, warnings); ++ ++ if (!filename.empty ()) ++ { ++ gdb_bfd_ref_ptr symfile_bfd ++ = symfile_bfd_open_no_error (filename.c_str ()); ++ if (symfile_bfd != nullptr) ++ return { symfile_bfd, filename }; ++ } ++ ++ return {}; ++} ++ ++/* Lookup separate debug information for OBJFILE via debuginfod. If ++ successful the debug information will be have been downloaded into the ++ debuginfod cache and this function will return a std::pair containing a ++ gdb_bfd_ref_ptr of the open debug information file and the filename for ++ the file within the debuginfod cache. If no debug information could be ++ found then this function returns an empty pair; the first item will be ++ nullptr, and the second will be an empty string. */ ++ ++static std::pair ++debuginfod_find_and_open_separate_symbol_file (struct objfile * objfile) ++{ ++ const struct bfd_build_id *build_id ++ = build_id_bfd_get (objfile->obfd.get ()); ++ const char *filename = bfd_get_filename (objfile->obfd.get ()); ++ ++ if (build_id != nullptr) ++ { ++ gdb::unique_xmalloc_ptr symfile_path; ++ scoped_fd fd (debuginfod_debuginfo_query (build_id->data, build_id->size, ++ filename, &symfile_path)); ++ ++ if (fd.get () >= 0) ++ { ++ /* File successfully retrieved from server. */ ++ gdb_bfd_ref_ptr debug_bfd ++ (symfile_bfd_open_no_error (symfile_path.get ())); ++ ++ if (debug_bfd != nullptr ++ && build_id_verify (debug_bfd.get (), ++ build_id->size, build_id->data)) ++ return { debug_bfd, std::string (symfile_path.get ()) }; ++ } ++ } ++ ++ return {}; ++} ++ + /* See objfiles.h. */ + + bool + objfile::find_and_add_separate_symbol_file (symfile_add_flags symfile_flags) + { +- bool has_dwarf2 = true; ++ bool has_dwarf = false; + + deferred_warnings warnings; + +- std::string debugfile +- = find_separate_debug_file_by_buildid (this, &warnings); +- +- if (debugfile.empty ()) +- debugfile = find_separate_debug_file_by_debuglink (this, &warnings); ++ gdb_bfd_ref_ptr debug_bfd; ++ std::string filename; + +- if (!debugfile.empty ()) +- { +- gdb_bfd_ref_ptr debug_bfd +- (symfile_bfd_open_no_error (debugfile.c_str ())); ++ std::tie (debug_bfd, filename) = simple_find_and_open_separate_symbol_file ++ (this, find_separate_debug_file_by_buildid, &warnings); + +- if (debug_bfd != nullptr) +- symbol_file_add_separate (debug_bfd, debugfile.c_str (), +- symfile_flags, this); +- } +- else +- { +- has_dwarf2 = false; +- const struct bfd_build_id *build_id +- = build_id_bfd_get (this->obfd.get ()); +- const char *filename = bfd_get_filename (this->obfd.get ()); +- +- if (build_id != nullptr) +- { +- gdb::unique_xmalloc_ptr symfile_path; +- scoped_fd fd (debuginfod_debuginfo_query (build_id->data, +- build_id->size, +- filename, +- &symfile_path)); ++ if (debug_bfd == nullptr) ++ std::tie (debug_bfd, filename) ++ = simple_find_and_open_separate_symbol_file ++ (this, find_separate_debug_file_by_debuglink, &warnings); + +- if (fd.get () >= 0) +- { +- /* File successfully retrieved from server. */ +- gdb_bfd_ref_ptr debug_bfd +- (symfile_bfd_open_no_error (symfile_path.get ())); ++ if (debug_bfd == nullptr) ++ std::tie (debug_bfd, filename) ++ = debuginfod_find_and_open_separate_symbol_file (this); + +- if (debug_bfd != nullptr +- && build_id_verify (debug_bfd.get (), build_id->size, +- build_id->data)) +- { +- symbol_file_add_separate (debug_bfd, symfile_path.get (), +- symfile_flags, this); +- has_dwarf2 = true; +- } +- } +- } ++ if (debug_bfd != nullptr) ++ { ++ symbol_file_add_separate (debug_bfd, filename.c_str (), symfile_flags, ++ this); ++ has_dwarf = true; + } +- /* If all the methods to collect the debuginfo failed, print the +- warnings, this is a no-op if there are no warnings. */ +- if (debugfile.empty () && !has_dwarf2) ++ ++ /* If we still have not got a separate debug symbol file, then ++ emit any warnings we've collected so far. */ ++ if (!has_dwarf) + warnings.emit (); + +- return has_dwarf2; ++ return has_dwarf; + } + + diff --git a/gdb-reformat-missing-debug-py-file.patch b/gdb-reformat-missing-debug-py-file.patch new file mode 100644 index 0000000..56c4863 --- /dev/null +++ b/gdb-reformat-missing-debug-py-file.patch @@ -0,0 +1,38 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 23 Nov 2023 07:37:19 +0100 +Subject: gdb-reformat-missing-debug-py-file.patch + +;; Backport upstream commit dd5516bf98f. + +[gdb/python] Reformat missing_debug.py using black + +Reformat gdb/python/lib/gdb/missing_debug.py with black after commit +e8c3dafa5f5 ("[gdb/python] Don't import curses.ascii module unless necessary"). + +diff --git a/gdb/python/lib/gdb/missing_debug.py b/gdb/python/lib/gdb/missing_debug.py +--- a/gdb/python/lib/gdb/missing_debug.py ++++ b/gdb/python/lib/gdb/missing_debug.py +@@ -19,18 +19,22 @@ MissingDebugHandler base class, and register_handler function. + + import gdb + import sys ++ + if sys.version_info >= (3, 7): + # Functions str.isascii() and str.isalnum are available starting Python + # 3.7. + def isascii(ch): + return ch.isascii() ++ + def isalnum(ch): + return ch.isalnum() ++ + else: + # Fall back to curses.ascii.isascii() and curses.ascii.isalnum() for + # earlier versions. + from curses.ascii import isascii, isalnum + ++ + def _validate_name(name): + """Validate a missing debug handler name string. + diff --git a/gdb-remove-path-in-test-name.patch b/gdb-remove-path-in-test-name.patch new file mode 100644 index 0000000..a7d4a8b --- /dev/null +++ b/gdb-remove-path-in-test-name.patch @@ -0,0 +1,29 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Tom Tromey +Date: Tue, 14 Nov 2023 11:47:27 -0700 +Subject: gdb-remove-path-in-test-name.patch + +;; Backport upstream commit 1146d27749f. + +Remove path name from test case + +'runtest' complains about a path in a test name, from the new test +case py-missing-debug.exp. + +This patch fixes the problem by providing an explicit test name to +gdb_test. I chose something very basic because the block in question +is already wrapped in with_test_prefix. + +diff --git a/gdb/testsuite/gdb.python/py-missing-debug.exp b/gdb/testsuite/gdb.python/py-missing-debug.exp +--- a/gdb/testsuite/gdb.python/py-missing-debug.exp ++++ b/gdb/testsuite/gdb.python/py-missing-debug.exp +@@ -321,7 +321,8 @@ with_test_prefix "enable 'abc-def'" { + set re [string_to_regexp $binfile] + + gdb_test "enable missing-debug-handler \"$re\" abc-def" \ +- "^1 missing debug handler enabled" ++ "^1 missing debug handler enabled" \ ++ "enable missing-debug-handler" + + gdb_test "info missing-debug-handlers" \ + [multi_line \ diff --git a/gdb-remove-use-of-py-isascii b/gdb-remove-use-of-py-isascii new file mode 100644 index 0000000..27d5a97 --- /dev/null +++ b/gdb-remove-use-of-py-isascii @@ -0,0 +1,46 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Thu, 16 Nov 2023 10:53:34 +0000 +Subject: gdb-remove-use-of-py-isascii + +;; Backport upstream commit 7db795bc67a. + +gdb/python: remove use of str.isascii() + +This commit: + + commit 8f6c452b5a4e50fbb55ff1d13328b392ad1fd416 + Date: Sun Oct 15 22:48:42 2023 +0100 + + gdb: implement missing debug handler hook for Python + +introduced a use of str.isascii(), which was only added in Python 3.7. + +This commit switches to use curses.ascii.isascii(), as this was +available in 3.6. + +The same is true for str.isalnum(), which is replaced with +curses.ascii.isalnum(). + +There should be no user visible changes after this commit. + +diff --git a/gdb/python/lib/gdb/missing_debug.py b/gdb/python/lib/gdb/missing_debug.py +--- a/gdb/python/lib/gdb/missing_debug.py ++++ b/gdb/python/lib/gdb/missing_debug.py +@@ -18,6 +18,7 @@ MissingDebugHandler base class, and register_handler function. + """ + + import gdb ++from curses.ascii import isascii, isalnum + + + def _validate_name(name): +@@ -38,7 +39,7 @@ def _validate_name(name): + name. + """ + for ch in name: +- if not ch.isascii() or not (ch.isalnum() or ch in "_-"): ++ if not isascii(ch) or not (isalnum(ch) or ch in "_-"): + raise ValueError("invalid character '%s' in handler name: %s" % (ch, name)) + + diff --git a/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch b/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch index 6eecc8f..5e40eaf 100644 --- a/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +++ b/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch @@ -64,7 +64,7 @@ diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memo new file mode 100644 --- /dev/null +++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp -@@ -0,0 +1,68 @@ +@@ -0,0 +1,72 @@ +# Copyright 2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -80,6 +80,10 @@ new file mode 100644 +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + ++load_lib gdb-python.exp ++ ++require allow_python_tests ++ +set testfile py-gdb-rhbz1007614-memleak-infpy_read_memory +set srcfile ${testfile}.c +set binfile [standard_output_file ${testfile}] @@ -88,8 +92,6 @@ new file mode 100644 + return -1 +} + -+if { [skip_python_tests] } { continue } -+ +set pid_of_gdb [exp_pid -i [board_info host fileid]] + +proc memory_v_pages_get {} { @@ -111,12 +113,14 @@ new file mode 100644 + +gdb_test "source ${remote_python_file}" "" + -+gdb_test "hello-world" "" ++gdb_test "hello-world" "" \ ++ "first hello-world test" + +set kbytes_before [memory_v_pages_get] +verbose -log "kbytes_before = $kbytes_before" + -+gdb_test "hello-world" "" ++gdb_test "hello-world" "" \ ++ "second hello-world test" + +set kbytes_after [memory_v_pages_get] +verbose -log "kbytes_after = $kbytes_after" diff --git a/gdb-sync-coffread-with-elfread.patch b/gdb-sync-coffread-with-elfread.patch new file mode 100644 index 0000000..f71b28f --- /dev/null +++ b/gdb-sync-coffread-with-elfread.patch @@ -0,0 +1,47 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Thu, 12 Oct 2023 19:42:19 +0100 +Subject: gdb-sync-coffread-with-elfread.patch + +;; Backport upstream commit 7628a997f27. + +gdb/coffread: bring separate debug file logic into line with elfread.c + +In this commit: + + commit 8a92335bfca80cc9b4cd217505ea0dcbfdefbf07 + Date: Fri Feb 1 19:39:04 2013 +0000 + +the logic for when we try to load a separate debug file in elfread.c +was extended. The new code checks that the objfile doesn't already +have a separate debug objfile linked to it, and that the objfile isn't +itself a separate debug objfile for some other objfile. + +The coffread code wasn't extended at the same time. + +I don't know if it's possible for the coffread code to get into the +same state where these checks are needed, but I don't see why having +these checks would be a problem. In a later commit I plan to merge +this part of the elfread and coffread code, so bringing these two +pieces of code into line first makes that job easier. + +I've tested this with a simple test binary compiled with the mingw +toolchain on a Linux host. After compiling the binary and splitting +out the debug info GDB still finds and loads the separate debug info. + +Approved-By: Tom Tromey + +diff --git a/gdb/coffread.c b/gdb/coffread.c +--- a/gdb/coffread.c ++++ b/gdb/coffread.c +@@ -725,7 +725,9 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) + } + + /* Try to add separate debug file if no symbols table found. */ +- if (!objfile->has_partial_symbols ()) ++ else if (!objfile->has_partial_symbols () ++ && objfile->separate_debug_objfile == NULL ++ && objfile->separate_debug_objfile_backlink == NULL) + { + deferred_warnings warnings; + std::string debugfile diff --git a/gdb.changes b/gdb.changes index 2f4f6f1..eb4b57c 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,37 @@ +------------------------------------------------------------------- +Thu Jan 23 11:40:47 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ 08bfd0a. +- Patches dropped: + * fixup-gdb-6.3-gstack-20050411.patch + * fixup-skip-tests.patch + * gdb-6.6-buildid-locate-rpm-librpm-workaround.patch + * gdb-6.6-buildid-locate-rpm.patch +- Patches added: + * gdb-add-missing-debug-ext-lang-hook.patch + * gdb-add-missing-debug-info-python-hook.patch + * gdb-add-rpm-suggestion-script.patch + * gdb-do-not-import-py-curses-ascii-module.patch + * gdb-handle-no-python-gdb-module.patch + * gdb-merge-debug-symbol-lookup.patch + * gdb-python-avoid-depending-on-the-curses-library.patch + * gdb-refactor-find-and-add-separate-symbol-file.patch + * gdb-reformat-missing-debug-py-file.patch + * gdb-remove-path-in-test-name.patch + * gdb-remove-use-of-py-isascii + * gdb-sync-coffread-with-elfread.patch +- Patches updated: + * fixup-gdb-bz634108-solib_address.patch + * gdb-6.3-gstack-20050411.patch + * gdb-6.6-buildid-locate-rpm-suse.patch + * gdb-6.6-buildid-locate-solib-missing-ids.patch + * gdb-6.6-buildid-locate.patch + * gdb-archer-next-over-throw-cxx-exec.patch + * gdb-bz634108-solib_address.patch + * gdb-fedora-libncursesw.patch + * gdb-glibc-strstr-workaround.patch + * gdb-rhbz1007614-memleak-infpy_read_memory-test.patch + ------------------------------------------------------------------- Thu Jan 23 09:14:28 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 5aaa3a0..2401dac 100644 --- a/gdb.spec +++ b/gdb.spec @@ -180,35 +180,44 @@ Patch8: gdb-6.3-attach-see-vdso-test.patch Patch9: gdb-6.5-bz243845-stale-testing-zombie-test.patch Patch10: gdb-6.6-buildid-locate.patch Patch11: gdb-6.6-buildid-locate-solib-missing-ids.patch -Patch12: gdb-6.6-buildid-locate-rpm.patch -Patch14: gdb-6.5-gcore-buffer-limit-test.patch -Patch15: gdb-6.3-mapping-zero-inode-test.patch -Patch16: gdb-6.5-section-num-fixup-test.patch -Patch18: gdb-simultaneous-step-resume-breakpoint-test.patch -Patch19: gdb-core-open-vdso-warning.patch -Patch20: gdb-archer-next-over-throw-cxx-exec.patch -Patch21: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch -Patch22: gdb-test-bt-cfi-without-die.patch -Patch23: gdb-bz634108-solib_address.patch -Patch24: gdb-test-dw2-aranges.patch -Patch25: gdb-glibc-strstr-workaround.patch -Patch26: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch27: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch -Patch28: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch -Patch31: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -Patch32: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -Patch33: gdb-fedora-libncursesw.patch -Patch34: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch36: gdb-linux_perf-bundle.patch -Patch38: gdb-rhbz2232086-refactor-selftest-support.patch -Patch39: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch -Patch40: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch -Patch41: gdb-rhbz-2232086-generate-gdb-index-consistently.patch -Patch42: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch -Patch43: gdb-rhbz2250652-gdbpy_gil.patch -Patch44: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch -Patch45: gdb-ftbs-swapped-calloc-args.patch -Patch46: gdb-rhbz2261580-intrusive_list-assertion-fix.patch +Patch13: gdb-6.5-gcore-buffer-limit-test.patch +Patch14: gdb-6.3-mapping-zero-inode-test.patch +Patch15: gdb-6.5-section-num-fixup-test.patch +Patch17: gdb-simultaneous-step-resume-breakpoint-test.patch +Patch18: gdb-core-open-vdso-warning.patch +Patch19: gdb-archer-next-over-throw-cxx-exec.patch +Patch20: gdb-test-bt-cfi-without-die.patch +Patch21: gdb-bz634108-solib_address.patch +Patch22: gdb-test-dw2-aranges.patch +Patch23: gdb-glibc-strstr-workaround.patch +Patch24: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch25: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +Patch26: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +Patch29: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch30: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch31: gdb-fedora-libncursesw.patch +Patch32: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch34: gdb-linux_perf-bundle.patch +Patch36: gdb-rhbz2232086-refactor-selftest-support.patch +Patch37: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch +Patch38: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch +Patch39: gdb-rhbz-2232086-generate-gdb-index-consistently.patch +Patch40: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch +Patch41: gdb-rhbz2250652-gdbpy_gil.patch +Patch42: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch +Patch43: gdb-ftbs-swapped-calloc-args.patch +Patch44: gdb-rhbz2261580-intrusive_list-assertion-fix.patch +Patch45: gdb-sync-coffread-with-elfread.patch +Patch46: gdb-merge-debug-symbol-lookup.patch +Patch47: gdb-refactor-find-and-add-separate-symbol-file.patch +Patch48: gdb-add-missing-debug-ext-lang-hook.patch +Patch49: gdb-add-missing-debug-info-python-hook.patch +Patch50: gdb-remove-use-of-py-isascii +Patch51: gdb-remove-path-in-test-name.patch +Patch52: gdb-do-not-import-py-curses-ascii-module.patch +Patch53: gdb-reformat-missing-debug-py-file.patch +Patch54: gdb-handle-no-python-gdb-module.patch +Patch55: gdb-add-rpm-suggestion-script.patch #Fedora Packages end # Fedora patches fixup @@ -221,12 +230,8 @@ Patch1004: fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch Patch1005: fixup-gdb-test-bt-cfi-without-die.patch Patch1007: fixup-gdb-test-dw2-aranges.patch Patch1008: fixup-gdb-bz634108-solib_address.patch -Patch1009: fixup-gdb-6.3-gstack-20050411.patch Patch1010: fixup-gdb-6.3-attach-see-vdso-test.patch Patch1012: fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch -# Fixes up several patches, should be dropped when updating to -# rawhide @ 08bfd0a. -Patch1013: fixup-skip-tests.patch # openSUSE specific @@ -350,6 +355,7 @@ Patch2091: gdb-testsuite-fix-gdb.fortran-array-bounds.exp-on-ar.patch Patch2092: gdb-symtab-return-correct-reader-for-top-level-cu-in.patch Patch2093: gdb-tdep-s390-add-arch15-record-replay-support.patch Patch2094: gdb-testsuite-avoid-intermittent-failures-on-a-debug.patch +Patch2095: gdb-python-avoid-depending-on-the-curses-library.patch # @@ -427,7 +433,7 @@ BuildRequires: mpfr-devel BuildRequires: ncurses-devel BuildRequires: pkg-config BuildRequires: readline-devel -BuildRequires: rpm-devel + # SLE-10 doesn't have xz-devel. %if 0%{suse_version} >= 1110 BuildRequires: xz-devel @@ -437,8 +443,10 @@ BuildRequires: zlib-devel %if 0%{!?_without_python:1} %if %{build_testsuite} BuildRequires: %{python}-base +BuildRequires: python3-rpm %else Requires: %{python}-base +Requires: python3-rpm %endif BuildRequires: %{python}-devel %endif # 0%{!?_without_python:1} @@ -708,10 +716,10 @@ find -name "*.info*"|xargs rm -f %patch -P 9 -p1 %patch -P 10 -p1 %patch -P 11 -p1 -%patch -P 12 -p1 +%patch -P 13 -p1 %patch -P 14 -p1 %patch -P 15 -p1 -%patch -P 16 -p1 +%patch -P 17 -p1 %patch -P 18 -p1 %patch -P 19 -p1 %patch -P 20 -p1 @@ -721,13 +729,13 @@ find -name "*.info*"|xargs rm -f %patch -P 24 -p1 %patch -P 25 -p1 %patch -P 26 -p1 -%patch -P 27 -p1 -%patch -P 28 -p1 +%patch -P 29 -p1 +%patch -P 30 -p1 %patch -P 31 -p1 %patch -P 32 -p1 -%patch -P 33 -p1 %patch -P 34 -p1 %patch -P 36 -p1 +%patch -P 37 -p1 %patch -P 38 -p1 %patch -P 39 -p1 %patch -P 40 -p1 @@ -737,6 +745,15 @@ find -name "*.info*"|xargs rm -f %patch -P 44 -p1 %patch -P 45 -p1 %patch -P 46 -p1 +%patch -P 47 -p1 +%patch -P 48 -p1 +%patch -P 49 -p1 +%patch -P 50 -p1 +%patch -P 51 -p1 +%patch -P 52 -p1 +%patch -P 53 -p1 +%patch -P 54 -p1 +%patch -P 55 -p1 #Fedora patching end %patch -P 1000 -p1 @@ -745,10 +762,8 @@ find -name "*.info*"|xargs rm -f %patch -P 1005 -p1 %patch -P 1007 -p1 %patch -P 1008 -p1 -%patch -P 1009 -p1 %patch -P 1010 -p1 %patch -P 1012 -p1 -%patch -P 1013 -p1 %patch -P 1100 -p1 %patch -P 1101 -p1 @@ -845,6 +860,7 @@ find -name "*.info*"|xargs rm -f %patch -P 2092 -p1 %patch -P 2093 -p1 %patch -P 2094 -p1 +%patch -P 2095 -p1 %patch -P 2100 -p1 %patch -P 2101 -p1 @@ -949,15 +965,6 @@ LDFLAGS="$LDFLAGS -L$PWD/processor-trace-%{libipt_version}-root%{_libdir}" export CXXFLAGS="$CFLAGS" -export LIBRPM=$(ldd /bin/rpm \ - | grep librpm.so \ - | awk '{print $3}') -if [ "$LIBRPM" != "" ]; then - [ -f "$LIBRPM" ] -else - export LIBRPM=no -fi - %ifarch %ix86 ia64 ppc ppc64 ppc64le s390 s390x x86_64 aarch64 riscv64 %define build_multitarget 1 %else @@ -1027,11 +1034,6 @@ $(: ppc64 host build crashes on ppc variant of libexpat.so ) \ %else --without-python \ %endif -%if %{suse_version} >= 1130 - --with-rpm=$LIBRPM \ -%else - --without-rpm \ -%endif %ifarch ia64 --with-libunwind-ia64 \ %else From 2002710072cb11057c190fc6e3e67009c66459ea953520964ce4f8d70cefc176 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 23 Jan 2025 15:08:29 +0000 Subject: [PATCH 05/34] - Update to fedora rawhide @ a54b5ef. - Patches dropped: * gdb-6.3-attach-see-vdso-test.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=410 --- gdb-6.3-attach-see-vdso-test.patch | 120 ----------------------------- gdb.changes | 7 ++ gdb.spec | 96 +++++++++++------------ 3 files changed, 53 insertions(+), 170 deletions(-) delete mode 100644 gdb-6.3-attach-see-vdso-test.patch diff --git a/gdb-6.3-attach-see-vdso-test.patch b/gdb-6.3-attach-see-vdso-test.patch deleted file mode 100644 index 5321c5f..0000000 --- a/gdb-6.3-attach-see-vdso-test.patch +++ /dev/null @@ -1,120 +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-6.3-attach-see-vdso-test.patch - -;; Test kernel VDSO decoding while attaching to an i386 process. -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.c b/gdb/testsuite/gdb.base/attach-see-vdso.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/attach-see-vdso.c -@@ -0,0 +1,25 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2007 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -+ -+#include -+ -+int main () -+{ -+ pause (); -+ return 1; -+} -diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.exp b/gdb/testsuite/gdb.base/attach-see-vdso.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/attach-see-vdso.exp -@@ -0,0 +1,77 @@ -+# Copyright 2007 -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ -+# This file was created by Jan Kratochvil . -+ -+# This test only works on Linux -+if { ![istarget "*-*-linux-gnu*"] } { -+ return 0 -+} -+ -+if {[use_gdb_stub]} { -+ untested "skipping test because of use_gdb_stub" -+ return -1 -+} -+ -+set testfile "attach-see-vdso" -+set srcfile ${testfile}.c -+set binfile [standard_output_file ${testfile}] -+set escapedbinfile [string_to_regexp [standard_output_file ${testfile}]] -+ -+# The kernel VDSO is used for the syscalls returns only on i386 (not x86_64). -+# -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-m32}] != "" } { -+ gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail." -+} -+ -+if [get_compiler_info ${binfile}] { -+ return -1 -+} -+ -+# Start the program running and then wait for a bit, to be sure -+# that it can be attached to. -+ -+set testpid [eval exec $binfile &] -+ -+# Avoid some race: -+sleep 2 -+ -+# Start with clean gdb -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+# Never call: gdb_load ${binfile} -+# as the former problem would not reproduce otherwise. -+ -+set test "attach" -+gdb_test_multiple "attach $testpid" "$test" { -+ -re "Attaching to process $testpid\r?\n.*$gdb_prompt $" { -+ pass "$test" -+ } -+} -+ -+gdb_test "bt" "#0 *0x\[0-9a-f\]* in \[^?\].*" "backtrace decodes VDSO" -+ -+# Exit and detach the process. -+ -+gdb_exit -+ -+# Make sure we don't leave a process around to confuse -+# the next test run (and prevent the compile by keeping -+# the text file busy), in case the "set should_exit" didn't -+# work. -+ -+remote_exec build "kill -9 ${testpid}" diff --git a/gdb.changes b/gdb.changes index eb4b57c..4f2fce1 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jan 23 15:05:22 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ a54b5ef. +- Patches dropped: + * gdb-6.3-attach-see-vdso-test.patch + ------------------------------------------------------------------- Thu Jan 23 11:40:47 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 2401dac..589cec8 100644 --- a/gdb.spec +++ b/gdb.spec @@ -176,48 +176,47 @@ Patch4: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch Patch5: gdb-6.6-bz229517-gcore-without-terminal.patch Patch6: gdb-6.6-testsuite-timeouts.patch Patch7: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch -Patch8: gdb-6.3-attach-see-vdso-test.patch -Patch9: gdb-6.5-bz243845-stale-testing-zombie-test.patch -Patch10: gdb-6.6-buildid-locate.patch -Patch11: gdb-6.6-buildid-locate-solib-missing-ids.patch -Patch13: gdb-6.5-gcore-buffer-limit-test.patch -Patch14: gdb-6.3-mapping-zero-inode-test.patch -Patch15: gdb-6.5-section-num-fixup-test.patch -Patch17: gdb-simultaneous-step-resume-breakpoint-test.patch -Patch18: gdb-core-open-vdso-warning.patch -Patch19: gdb-archer-next-over-throw-cxx-exec.patch -Patch20: gdb-test-bt-cfi-without-die.patch -Patch21: gdb-bz634108-solib_address.patch -Patch22: gdb-test-dw2-aranges.patch -Patch23: gdb-glibc-strstr-workaround.patch -Patch24: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch25: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch -Patch26: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch -Patch29: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -Patch30: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -Patch31: gdb-fedora-libncursesw.patch -Patch32: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch34: gdb-linux_perf-bundle.patch -Patch36: gdb-rhbz2232086-refactor-selftest-support.patch -Patch37: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch -Patch38: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch -Patch39: gdb-rhbz-2232086-generate-gdb-index-consistently.patch -Patch40: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch -Patch41: gdb-rhbz2250652-gdbpy_gil.patch -Patch42: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch -Patch43: gdb-ftbs-swapped-calloc-args.patch -Patch44: gdb-rhbz2261580-intrusive_list-assertion-fix.patch -Patch45: gdb-sync-coffread-with-elfread.patch -Patch46: gdb-merge-debug-symbol-lookup.patch -Patch47: gdb-refactor-find-and-add-separate-symbol-file.patch -Patch48: gdb-add-missing-debug-ext-lang-hook.patch -Patch49: gdb-add-missing-debug-info-python-hook.patch -Patch50: gdb-remove-use-of-py-isascii -Patch51: gdb-remove-path-in-test-name.patch -Patch52: gdb-do-not-import-py-curses-ascii-module.patch -Patch53: gdb-reformat-missing-debug-py-file.patch -Patch54: gdb-handle-no-python-gdb-module.patch -Patch55: gdb-add-rpm-suggestion-script.patch +Patch8: gdb-6.5-bz243845-stale-testing-zombie-test.patch +Patch9: gdb-6.6-buildid-locate.patch +Patch10: gdb-6.6-buildid-locate-solib-missing-ids.patch +Patch12: gdb-6.5-gcore-buffer-limit-test.patch +Patch13: gdb-6.3-mapping-zero-inode-test.patch +Patch14: gdb-6.5-section-num-fixup-test.patch +Patch16: gdb-simultaneous-step-resume-breakpoint-test.patch +Patch17: gdb-core-open-vdso-warning.patch +Patch18: gdb-archer-next-over-throw-cxx-exec.patch +Patch19: gdb-test-bt-cfi-without-die.patch +Patch20: gdb-bz634108-solib_address.patch +Patch21: gdb-test-dw2-aranges.patch +Patch22: gdb-glibc-strstr-workaround.patch +Patch23: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch24: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +Patch25: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +Patch28: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch29: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch30: gdb-fedora-libncursesw.patch +Patch31: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch33: gdb-linux_perf-bundle.patch +Patch35: gdb-rhbz2232086-refactor-selftest-support.patch +Patch36: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch +Patch37: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch +Patch38: gdb-rhbz-2232086-generate-gdb-index-consistently.patch +Patch39: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch +Patch40: gdb-rhbz2250652-gdbpy_gil.patch +Patch41: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch +Patch42: gdb-ftbs-swapped-calloc-args.patch +Patch43: gdb-rhbz2261580-intrusive_list-assertion-fix.patch +Patch44: gdb-sync-coffread-with-elfread.patch +Patch45: gdb-merge-debug-symbol-lookup.patch +Patch46: gdb-refactor-find-and-add-separate-symbol-file.patch +Patch47: gdb-add-missing-debug-ext-lang-hook.patch +Patch48: gdb-add-missing-debug-info-python-hook.patch +Patch49: gdb-remove-use-of-py-isascii +Patch50: gdb-remove-path-in-test-name.patch +Patch51: gdb-do-not-import-py-curses-ascii-module.patch +Patch52: gdb-reformat-missing-debug-py-file.patch +Patch53: gdb-handle-no-python-gdb-module.patch +Patch54: gdb-add-rpm-suggestion-script.patch #Fedora Packages end # Fedora patches fixup @@ -230,7 +229,6 @@ Patch1004: fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch Patch1005: fixup-gdb-test-bt-cfi-without-die.patch Patch1007: fixup-gdb-test-dw2-aranges.patch Patch1008: fixup-gdb-bz634108-solib_address.patch -Patch1010: fixup-gdb-6.3-attach-see-vdso-test.patch Patch1012: fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch # openSUSE specific @@ -715,10 +713,10 @@ find -name "*.info*"|xargs rm -f %patch -P 8 -p1 %patch -P 9 -p1 %patch -P 10 -p1 -%patch -P 11 -p1 +%patch -P 12 -p1 %patch -P 13 -p1 %patch -P 14 -p1 -%patch -P 15 -p1 +%patch -P 16 -p1 %patch -P 17 -p1 %patch -P 18 -p1 %patch -P 19 -p1 @@ -728,12 +726,12 @@ find -name "*.info*"|xargs rm -f %patch -P 23 -p1 %patch -P 24 -p1 %patch -P 25 -p1 -%patch -P 26 -p1 +%patch -P 28 -p1 %patch -P 29 -p1 %patch -P 30 -p1 %patch -P 31 -p1 -%patch -P 32 -p1 -%patch -P 34 -p1 +%patch -P 33 -p1 +%patch -P 35 -p1 %patch -P 36 -p1 %patch -P 37 -p1 %patch -P 38 -p1 @@ -753,7 +751,6 @@ find -name "*.info*"|xargs rm -f %patch -P 52 -p1 %patch -P 53 -p1 %patch -P 54 -p1 -%patch -P 55 -p1 #Fedora patching end %patch -P 1000 -p1 @@ -762,7 +759,6 @@ find -name "*.info*"|xargs rm -f %patch -P 1005 -p1 %patch -P 1007 -p1 %patch -P 1008 -p1 -%patch -P 1010 -p1 %patch -P 1012 -p1 %patch -P 1100 -p1 From 9a0da958c46f152b3caaca7f5616ee4d6e9f23544824ed603e7b79205e30eb45 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 23 Jan 2025 15:11:09 +0000 Subject: [PATCH 06/34] - Patches dropped (unused): * fixup-gdb-6.3-attach-see-vdso-test.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=411 --- fixup-gdb-6.3-attach-see-vdso-test.patch | 30 ------------------------ gdb.changes | 6 +++++ 2 files changed, 6 insertions(+), 30 deletions(-) delete mode 100644 fixup-gdb-6.3-attach-see-vdso-test.patch diff --git a/fixup-gdb-6.3-attach-see-vdso-test.patch b/fixup-gdb-6.3-attach-see-vdso-test.patch deleted file mode 100644 index 43ee239..0000000 --- a/fixup-gdb-6.3-attach-see-vdso-test.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 19dc95258888a9e110ad54fa25a613611956a13f Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Tue, 13 Jun 2023 15:04:32 +0200 -Subject: [PATCH 5/6] fixup gdb-6.3-attach-see-vdso-test.patch - ---- - gdb/testsuite/gdb.base/attach-see-vdso.exp | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.exp b/gdb/testsuite/gdb.base/attach-see-vdso.exp -index 5457ec4129d..35c49731f0b 100644 ---- a/gdb/testsuite/gdb.base/attach-see-vdso.exp -+++ b/gdb/testsuite/gdb.base/attach-see-vdso.exp -@@ -34,10 +34,11 @@ set escapedbinfile [string_to_regexp [standard_output_file ${testfile}]] - # The kernel VDSO is used for the syscalls returns only on i386 (not x86_64). - # - if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-m32}] != "" } { -- gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail." -+ unsupported "Testcase nonthreaded compile failed, so all tests in this file will automatically fail." -+ return - } - --if [get_compiler_info ${binfile}] { -+if [get_compiler_info] { - return -1 - } - --- -2.35.3 - diff --git a/gdb.changes b/gdb.changes index 4f2fce1..7e84ed9 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jan 23 15:10:16 UTC 2025 - Tom de Vries + +- Patches dropped (unused): + * fixup-gdb-6.3-attach-see-vdso-test.patch + ------------------------------------------------------------------- Thu Jan 23 15:05:22 UTC 2025 - Tom de Vries From d2572d161c8c826a54b1f574e345f5087b0ee8926b96e1396c6417e0d05353d5 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 23 Jan 2025 15:16:37 +0000 Subject: [PATCH 07/34] - Update to fedora rawhide @ 2024966. - Maintenance script import-fedora.sh: * Remove gdb-container-rh-pkg.patch from skip_patches. OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=412 --- gdb.changes | 7 +++++++ gdb.spec | 46 +++++++++++++++++++++++----------------------- import-fedora.sh | 1 - 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/gdb.changes b/gdb.changes index 7e84ed9..a3c3cf0 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jan 23 15:14:19 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ 2024966. +- Maintenance script import-fedora.sh: + * Remove gdb-container-rh-pkg.patch from skip_patches. + ------------------------------------------------------------------- Thu Jan 23 15:10:16 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 589cec8..bf0a869 100644 --- a/gdb.spec +++ b/gdb.spec @@ -196,27 +196,27 @@ Patch28: gdb-rhbz1149205-catch-syscall-after-fork-test.patch Patch29: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch Patch30: gdb-fedora-libncursesw.patch Patch31: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch33: gdb-linux_perf-bundle.patch -Patch35: gdb-rhbz2232086-refactor-selftest-support.patch -Patch36: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch -Patch37: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch -Patch38: gdb-rhbz-2232086-generate-gdb-index-consistently.patch -Patch39: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch -Patch40: gdb-rhbz2250652-gdbpy_gil.patch -Patch41: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch -Patch42: gdb-ftbs-swapped-calloc-args.patch -Patch43: gdb-rhbz2261580-intrusive_list-assertion-fix.patch -Patch44: gdb-sync-coffread-with-elfread.patch -Patch45: gdb-merge-debug-symbol-lookup.patch -Patch46: gdb-refactor-find-and-add-separate-symbol-file.patch -Patch47: gdb-add-missing-debug-ext-lang-hook.patch -Patch48: gdb-add-missing-debug-info-python-hook.patch -Patch49: gdb-remove-use-of-py-isascii -Patch50: gdb-remove-path-in-test-name.patch -Patch51: gdb-do-not-import-py-curses-ascii-module.patch -Patch52: gdb-reformat-missing-debug-py-file.patch -Patch53: gdb-handle-no-python-gdb-module.patch -Patch54: gdb-add-rpm-suggestion-script.patch +Patch32: gdb-linux_perf-bundle.patch +Patch34: gdb-rhbz2232086-refactor-selftest-support.patch +Patch35: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch +Patch36: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch +Patch37: gdb-rhbz-2232086-generate-gdb-index-consistently.patch +Patch38: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch +Patch39: gdb-rhbz2250652-gdbpy_gil.patch +Patch40: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch +Patch41: gdb-ftbs-swapped-calloc-args.patch +Patch42: gdb-rhbz2261580-intrusive_list-assertion-fix.patch +Patch43: gdb-sync-coffread-with-elfread.patch +Patch44: gdb-merge-debug-symbol-lookup.patch +Patch45: gdb-refactor-find-and-add-separate-symbol-file.patch +Patch46: gdb-add-missing-debug-ext-lang-hook.patch +Patch47: gdb-add-missing-debug-info-python-hook.patch +Patch48: gdb-remove-use-of-py-isascii +Patch49: gdb-remove-path-in-test-name.patch +Patch50: gdb-do-not-import-py-curses-ascii-module.patch +Patch51: gdb-reformat-missing-debug-py-file.patch +Patch52: gdb-handle-no-python-gdb-module.patch +Patch53: gdb-add-rpm-suggestion-script.patch #Fedora Packages end # Fedora patches fixup @@ -730,7 +730,8 @@ find -name "*.info*"|xargs rm -f %patch -P 29 -p1 %patch -P 30 -p1 %patch -P 31 -p1 -%patch -P 33 -p1 +%patch -P 32 -p1 +%patch -P 34 -p1 %patch -P 35 -p1 %patch -P 36 -p1 %patch -P 37 -p1 @@ -750,7 +751,6 @@ find -name "*.info*"|xargs rm -f %patch -P 51 -p1 %patch -P 52 -p1 %patch -P 53 -p1 -%patch -P 54 -p1 #Fedora patching end %patch -P 1000 -p1 diff --git a/import-fedora.sh b/import-fedora.sh index abefcac..999f322 100644 --- a/import-fedora.sh +++ b/import-fedora.sh @@ -8,7 +8,6 @@ skip_patches=( gdb-6.3-rh-testversion-20041202.patch gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch gdb-6.8-bz466901-backtrace-full-prelinked.patch - gdb-container-rh-pkg.patch # Fragile test-case, requires glibc to fail in a certain way. gdb-rhbz1156192-recursive-dlopen-test.patch From 45f836abe7e450afd2362c8a331d3f5881f056e3906474200b45448c2e8626b0 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 23 Jan 2025 15:20:11 +0000 Subject: [PATCH 08/34] - Update to fedora rawhide @ 94829f0. - Patches dropped: * fixup-gdb-bz634108-solib_address.patch * gdb-bz634108-solib_address.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=413 --- fixup-gdb-bz634108-solib_address.patch | 10 ---- gdb-bz634108-solib_address.patch | 42 ---------------- gdb.changes | 8 +++ gdb.spec | 68 ++++++++++++-------------- 4 files changed, 40 insertions(+), 88 deletions(-) delete mode 100644 fixup-gdb-bz634108-solib_address.patch delete mode 100644 gdb-bz634108-solib_address.patch diff --git a/fixup-gdb-bz634108-solib_address.patch b/fixup-gdb-bz634108-solib_address.patch deleted file mode 100644 index 8e397f2..0000000 --- a/fixup-gdb-bz634108-solib_address.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/gdb/testsuite/gdb.python/rh634108-solib_address.exp b/gdb/testsuite/gdb.python/rh634108-solib_address.exp -index 9bc31992613..078b69c5a6a 100644 ---- a/gdb/testsuite/gdb.python/rh634108-solib_address.exp -+++ b/gdb/testsuite/gdb.python/rh634108-solib_address.exp -@@ -22,4 +22,4 @@ require allow_python_tests - gdb_exit - gdb_start - --gdb_test "python print (gdb.solib_name(-1))" "None" "gdb.solib_name exists" -+gdb_test "python print (gdb.solib_name(0))" "None" "gdb.solib_name exists" diff --git a/gdb-bz634108-solib_address.patch b/gdb-bz634108-solib_address.patch deleted file mode 100644 index cec3245..0000000 --- a/gdb-bz634108-solib_address.patch +++ /dev/null @@ -1,42 +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-bz634108-solib_address.patch - -;; Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108). -;;=fedoratest - -Fix gdb.solib_address (fix by Phil Muldoon). - -s/solib_address/solib_name/ during upstreaming. - -diff --git a/gdb/testsuite/gdb.python/rh634108-solib_address.exp b/gdb/testsuite/gdb.python/rh634108-solib_address.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.python/rh634108-solib_address.exp -@@ -0,0 +1,25 @@ -+# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# https://bugzilla.redhat.com/show_bug.cgi?id=634108 -+ -+load_lib gdb-python.exp -+ -+require allow_python_tests -+ -+gdb_exit -+gdb_start -+ -+gdb_test "python print (gdb.solib_name(-1))" "None" "gdb.solib_name exists" diff --git a/gdb.changes b/gdb.changes index a3c3cf0..3477a8e 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Jan 23 15:19:19 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ 94829f0. +- Patches dropped: + * fixup-gdb-bz634108-solib_address.patch + * gdb-bz634108-solib_address.patch + ------------------------------------------------------------------- Thu Jan 23 15:14:19 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index bf0a869..cf23bb6 100644 --- a/gdb.spec +++ b/gdb.spec @@ -186,37 +186,36 @@ Patch16: gdb-simultaneous-step-resume-breakpoint-test.patch Patch17: gdb-core-open-vdso-warning.patch Patch18: gdb-archer-next-over-throw-cxx-exec.patch Patch19: gdb-test-bt-cfi-without-die.patch -Patch20: gdb-bz634108-solib_address.patch -Patch21: gdb-test-dw2-aranges.patch -Patch22: gdb-glibc-strstr-workaround.patch -Patch23: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch24: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch -Patch25: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch -Patch28: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -Patch29: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -Patch30: gdb-fedora-libncursesw.patch -Patch31: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch32: gdb-linux_perf-bundle.patch -Patch34: gdb-rhbz2232086-refactor-selftest-support.patch -Patch35: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch -Patch36: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch -Patch37: gdb-rhbz-2232086-generate-gdb-index-consistently.patch -Patch38: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch -Patch39: gdb-rhbz2250652-gdbpy_gil.patch -Patch40: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch -Patch41: gdb-ftbs-swapped-calloc-args.patch -Patch42: gdb-rhbz2261580-intrusive_list-assertion-fix.patch -Patch43: gdb-sync-coffread-with-elfread.patch -Patch44: gdb-merge-debug-symbol-lookup.patch -Patch45: gdb-refactor-find-and-add-separate-symbol-file.patch -Patch46: gdb-add-missing-debug-ext-lang-hook.patch -Patch47: gdb-add-missing-debug-info-python-hook.patch -Patch48: gdb-remove-use-of-py-isascii -Patch49: gdb-remove-path-in-test-name.patch -Patch50: gdb-do-not-import-py-curses-ascii-module.patch -Patch51: gdb-reformat-missing-debug-py-file.patch -Patch52: gdb-handle-no-python-gdb-module.patch -Patch53: gdb-add-rpm-suggestion-script.patch +Patch20: gdb-test-dw2-aranges.patch +Patch21: gdb-glibc-strstr-workaround.patch +Patch22: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch23: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +Patch24: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +Patch27: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch28: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch29: gdb-fedora-libncursesw.patch +Patch30: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch31: gdb-linux_perf-bundle.patch +Patch33: gdb-rhbz2232086-refactor-selftest-support.patch +Patch34: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch +Patch35: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch +Patch36: gdb-rhbz-2232086-generate-gdb-index-consistently.patch +Patch37: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch +Patch38: gdb-rhbz2250652-gdbpy_gil.patch +Patch39: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch +Patch40: gdb-ftbs-swapped-calloc-args.patch +Patch41: gdb-rhbz2261580-intrusive_list-assertion-fix.patch +Patch42: gdb-sync-coffread-with-elfread.patch +Patch43: gdb-merge-debug-symbol-lookup.patch +Patch44: gdb-refactor-find-and-add-separate-symbol-file.patch +Patch45: gdb-add-missing-debug-ext-lang-hook.patch +Patch46: gdb-add-missing-debug-info-python-hook.patch +Patch47: gdb-remove-use-of-py-isascii +Patch48: gdb-remove-path-in-test-name.patch +Patch49: gdb-do-not-import-py-curses-ascii-module.patch +Patch50: gdb-reformat-missing-debug-py-file.patch +Patch51: gdb-handle-no-python-gdb-module.patch +Patch52: gdb-add-rpm-suggestion-script.patch #Fedora Packages end # Fedora patches fixup @@ -228,7 +227,6 @@ Patch1003: fixup-gdb-glibc-strstr-workaround.patch Patch1004: fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch Patch1005: fixup-gdb-test-bt-cfi-without-die.patch Patch1007: fixup-gdb-test-dw2-aranges.patch -Patch1008: fixup-gdb-bz634108-solib_address.patch Patch1012: fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch # openSUSE specific @@ -725,12 +723,12 @@ find -name "*.info*"|xargs rm -f %patch -P 22 -p1 %patch -P 23 -p1 %patch -P 24 -p1 -%patch -P 25 -p1 +%patch -P 27 -p1 %patch -P 28 -p1 %patch -P 29 -p1 %patch -P 30 -p1 %patch -P 31 -p1 -%patch -P 32 -p1 +%patch -P 33 -p1 %patch -P 34 -p1 %patch -P 35 -p1 %patch -P 36 -p1 @@ -750,7 +748,6 @@ find -name "*.info*"|xargs rm -f %patch -P 50 -p1 %patch -P 51 -p1 %patch -P 52 -p1 -%patch -P 53 -p1 #Fedora patching end %patch -P 1000 -p1 @@ -758,7 +755,6 @@ find -name "*.info*"|xargs rm -f %patch -P 1004 -p1 %patch -P 1005 -p1 %patch -P 1007 -p1 -%patch -P 1008 -p1 %patch -P 1012 -p1 %patch -P 1100 -p1 From 7e9b1e6c37d07cb5bbbdcb956e191e7d3b3a5b3bd7be49cb3412f39228b2fdf8 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 23 Jan 2025 15:26:10 +0000 Subject: [PATCH 09/34] - Update to fedora rawhide @ 7b0d0c4. - Patches dropped: * gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch - Patches updated: * gdb-6.6-buildid-locate.patch * gdb-add-missing-debug-info-python-hook.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=414 --- ...337-resolve-tls-without-debuginfo-v2.patch | 265 ------------------ gdb-6.6-buildid-locate.patch | 2 +- gdb-add-missing-debug-info-python-hook.patch | 6 +- gdb.changes | 10 + gdb.spec | 98 ++++--- 5 files changed, 62 insertions(+), 319 deletions(-) delete mode 100644 gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch diff --git a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch deleted file mode 100644 index e5b6da9..0000000 --- a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +++ /dev/null @@ -1,265 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch - -;; Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337). -;;=push+jan: It should be replaced by Infinity project. - -https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=185337 - -2008-02-24 Jan Kratochvil - - Port to GDB-6.8pre. - -currently for trivial nonthreaded helloworld with no debug info up to -ggdb2 you -will get: - (gdb) p errno - [some error] - -* with -ggdb2 and less "errno" in fact does not exist anywhere as it was - compiled to "(*__errno_location ())" and the macro definition is not present. - Unfortunately gdb will find the TLS symbol and it will try to access it but - as the program has been compiled without -lpthread the TLS base register - (%gs on i386) is not setup and it will result in: - Cannot access memory at address 0x8 - -Attached suggestion patch how to deal with the most common "errno" symbol -for the most common under-ggdb3 compiled programs. - -Original patch hooked into target_translate_tls_address. But its inferior -call invalidates `struct frame *' in the callers - RH BZ 690908. - -https://bugzilla.redhat.com/show_bug.cgi?id=1166549 - -2007-11-03 Jan Kratochvil - - * ./gdb/dwarf2read.c (read_partial_die, dwarf2_linkage_name): Prefer - DW_AT_MIPS_linkage_name over DW_AT_name now only for non-C. - -glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug: - <81a2> DW_AT_name : (indirect string, offset: 0x280e): __errno_location - <81a8> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location - -diff --git a/gdb/printcmd.c b/gdb/printcmd.c ---- a/gdb/printcmd.c -+++ b/gdb/printcmd.c -@@ -1308,6 +1308,11 @@ process_print_command_args (const char *args, value_print_options *print_opts, - - if (exp != nullptr && *exp) - { -+ /* '*((int *(*) (void)) __errno_location) ()' is incompatible with -+ function descriptors. */ -+ if (target_has_execution () && strcmp (exp, "errno") == 0) -+ exp = "*(*(int *(*)(void)) __errno_location) ()"; -+ - /* This setting allows large arrays to be printed by limiting the - number of elements that are loaded into GDB's memory; we only - need to load as many array elements as we plan to print. */ -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.c b/gdb/testsuite/gdb.dwarf2/dw2-errno.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.c -@@ -0,0 +1,28 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2005, 2007 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@prep.ai.mit.edu */ -+ -+#include -+ -+int main() -+{ -+ errno = 42; -+ -+ return 0; /* breakpoint */ -+} -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno.exp -@@ -0,0 +1,60 @@ -+# Copyright 2007 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+set testfile dw2-errno -+set srcfile ${testfile}.c -+set binfile [standard_output_file ${testfile}] -+ -+proc prep {} { -+ global srcdir subdir binfile -+ gdb_exit -+ gdb_start -+ gdb_reinitialize_dir $srcdir/$subdir -+ gdb_load ${binfile} -+ -+ runto_main -+ -+ gdb_breakpoint [gdb_get_line_number "breakpoint"] -+ gdb_continue_to_breakpoint "breakpoint" -+} -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g2"] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+prep -+gdb_test "print errno" ".* = 42" "errno with macros=N threads=N" -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g3"] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+prep -+gdb_test "print errno" ".* = 42" "errno with macros=Y threads=N" -+ -+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g2"] != "" } { -+ return -1 -+} -+prep -+gdb_test "print errno" ".* = 42" "errno with macros=N threads=Y" -+ -+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g3"] != "" } { -+ return -1 -+} -+prep -+gdb_test "print errno" ".* = 42" "errno with macros=Y threads=Y" -+ -+# TODO: Test the error on resolving ERRNO with only libc loaded. -+# Just how to find the current libc filename? -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.c b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.c -@@ -0,0 +1,28 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2005, 2007 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@prep.ai.mit.edu */ -+ -+#include -+ -+int main() -+{ -+ errno = 42; -+ -+ return 0; /* breakpoint */ -+} -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-errno2.exp -@@ -0,0 +1,71 @@ -+# Copyright 2007 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+set testfile dw2-errno2 -+set srcfile ${testfile}.c -+set binfile [standard_output_file ${testfile}] -+ -+proc prep { message {do_xfail 0} } { with_test_prefix $message { -+ global srcdir subdir binfile variant -+ gdb_exit -+ gdb_start -+ gdb_reinitialize_dir $srcdir/$subdir -+ gdb_load ${binfile}${variant} -+ -+ runto_main -+ -+ gdb_breakpoint [gdb_get_line_number "breakpoint"] -+ gdb_continue_to_breakpoint "breakpoint" -+ -+ gdb_test "gcore ${binfile}${variant}.core" "\r\nSaved corefile .*" "gcore $variant" -+ -+ gdb_test "print errno" ".* = 42" -+ -+ gdb_test "kill" ".*" "kill" {Kill the program being debugged\? \(y or n\) } "y" -+ gdb_test "core-file ${binfile}${variant}.core" "\r\nCore was generated by .*" "core-file" -+ if $do_xfail { -+ setup_xfail "*-*-*" -+ } -+ gdb_test "print (int) errno" ".* = 42" "print errno for core" -+}} -+ -+set variant g2thrN -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g2"] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+prep "macros=N threads=N" 1 -+ -+set variant g3thrN -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g3"] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+prep "macros=Y threads=N" 1 -+ -+set variant g2thrY -+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g2"] != "" } { -+ return -1 -+} -+prep "macros=N threads=Y" -+ -+set variant g3thrY -+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}${variant}" executable "additional_flags=-g3"] != "" } { -+ return -1 -+} -+prep "macros=Y threads=Y" 1 -+ -+# TODO: Test the error on resolving ERRNO with only libc loaded. -+# Just how to find the current libc filename? diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index cc738e6..08b3c39 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -963,7 +963,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo -@@ -22296,6 +22296,27 @@ +@@ -22296,6 +22296,27 @@ information files. @end table diff --git a/gdb-add-missing-debug-info-python-hook.patch b/gdb-add-missing-debug-info-python-hook.patch index a9b2270..532aad0 100644 --- a/gdb-add-missing-debug-info-python-hook.patch +++ b/gdb-add-missing-debug-info-python-hook.patch @@ -107,7 +107,7 @@ diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi -@@ -229,6 +229,7 @@ +@@ -229,6 +229,7 @@ optional arguments while skipping others. Example: * Connections In Python:: Python representation of connections. * TUI Windows In Python:: Implementing new TUI windows. * Disassembly In Python:: Instruction Disassembly In Python @@ -115,7 +115,7 @@ diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi @end menu @node Basic Python -@@ -5191,6 +5192,12 @@ +@@ -5191,6 +5192,12 @@ The @code{frame_filters} attribute is a dictionary of frame filter objects. @xref{Frame Filter API}, for more information. @end defvar @@ -128,7 +128,7 @@ diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi A program space has the following methods: @defun Progspace.block_for_pc (pc) -@@ -7770,6 +7777,139 @@ +@@ -7770,6 +7777,139 @@ class NibbleSwapDisassembler(gdb.disassembler.Disassembler): gdb.disassembler.register_disassembler(NibbleSwapDisassembler()) @end smallexample diff --git a/gdb.changes b/gdb.changes index 3477a8e..ffb2ba9 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Thu Jan 23 15:23:25 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ 7b0d0c4. +- Patches dropped: + * gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +- Patches updated: + * gdb-6.6-buildid-locate.patch + * gdb-add-missing-debug-info-python-hook.patch + ------------------------------------------------------------------- Thu Jan 23 15:19:19 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index cf23bb6..eb6e9e0 100644 --- a/gdb.spec +++ b/gdb.spec @@ -171,51 +171,50 @@ NoSource: 20 #Fedora Packages begin Patch2: gdb-6.3-gstack-20050411.patch -Patch3: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch -Patch4: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch -Patch5: gdb-6.6-bz229517-gcore-without-terminal.patch -Patch6: gdb-6.6-testsuite-timeouts.patch -Patch7: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch -Patch8: gdb-6.5-bz243845-stale-testing-zombie-test.patch -Patch9: gdb-6.6-buildid-locate.patch -Patch10: gdb-6.6-buildid-locate-solib-missing-ids.patch -Patch12: gdb-6.5-gcore-buffer-limit-test.patch -Patch13: gdb-6.3-mapping-zero-inode-test.patch -Patch14: gdb-6.5-section-num-fixup-test.patch -Patch16: gdb-simultaneous-step-resume-breakpoint-test.patch -Patch17: gdb-core-open-vdso-warning.patch -Patch18: gdb-archer-next-over-throw-cxx-exec.patch -Patch19: gdb-test-bt-cfi-without-die.patch -Patch20: gdb-test-dw2-aranges.patch -Patch21: gdb-glibc-strstr-workaround.patch -Patch22: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch23: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch -Patch24: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch -Patch27: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -Patch28: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -Patch29: gdb-fedora-libncursesw.patch -Patch30: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch31: gdb-linux_perf-bundle.patch -Patch33: gdb-rhbz2232086-refactor-selftest-support.patch -Patch34: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch -Patch35: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch -Patch36: gdb-rhbz-2232086-generate-gdb-index-consistently.patch -Patch37: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch -Patch38: gdb-rhbz2250652-gdbpy_gil.patch -Patch39: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch -Patch40: gdb-ftbs-swapped-calloc-args.patch -Patch41: gdb-rhbz2261580-intrusive_list-assertion-fix.patch -Patch42: gdb-sync-coffread-with-elfread.patch -Patch43: gdb-merge-debug-symbol-lookup.patch -Patch44: gdb-refactor-find-and-add-separate-symbol-file.patch -Patch45: gdb-add-missing-debug-ext-lang-hook.patch -Patch46: gdb-add-missing-debug-info-python-hook.patch -Patch47: gdb-remove-use-of-py-isascii -Patch48: gdb-remove-path-in-test-name.patch -Patch49: gdb-do-not-import-py-curses-ascii-module.patch -Patch50: gdb-reformat-missing-debug-py-file.patch -Patch51: gdb-handle-no-python-gdb-module.patch -Patch52: gdb-add-rpm-suggestion-script.patch +Patch3: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch +Patch4: gdb-6.6-bz229517-gcore-without-terminal.patch +Patch5: gdb-6.6-testsuite-timeouts.patch +Patch6: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch +Patch7: gdb-6.5-bz243845-stale-testing-zombie-test.patch +Patch8: gdb-6.6-buildid-locate.patch +Patch9: gdb-6.6-buildid-locate-solib-missing-ids.patch +Patch11: gdb-6.5-gcore-buffer-limit-test.patch +Patch12: gdb-6.3-mapping-zero-inode-test.patch +Patch13: gdb-6.5-section-num-fixup-test.patch +Patch15: gdb-simultaneous-step-resume-breakpoint-test.patch +Patch16: gdb-core-open-vdso-warning.patch +Patch17: gdb-archer-next-over-throw-cxx-exec.patch +Patch18: gdb-test-bt-cfi-without-die.patch +Patch19: gdb-test-dw2-aranges.patch +Patch20: gdb-glibc-strstr-workaround.patch +Patch21: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch22: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +Patch23: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +Patch26: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch27: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch28: gdb-fedora-libncursesw.patch +Patch29: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch30: gdb-linux_perf-bundle.patch +Patch32: gdb-rhbz2232086-refactor-selftest-support.patch +Patch33: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch +Patch34: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch +Patch35: gdb-rhbz-2232086-generate-gdb-index-consistently.patch +Patch36: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch +Patch37: gdb-rhbz2250652-gdbpy_gil.patch +Patch38: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch +Patch39: gdb-ftbs-swapped-calloc-args.patch +Patch40: gdb-rhbz2261580-intrusive_list-assertion-fix.patch +Patch41: gdb-sync-coffread-with-elfread.patch +Patch42: gdb-merge-debug-symbol-lookup.patch +Patch43: gdb-refactor-find-and-add-separate-symbol-file.patch +Patch44: gdb-add-missing-debug-ext-lang-hook.patch +Patch45: gdb-add-missing-debug-info-python-hook.patch +Patch46: gdb-remove-use-of-py-isascii +Patch47: gdb-remove-path-in-test-name.patch +Patch48: gdb-do-not-import-py-curses-ascii-module.patch +Patch49: gdb-reformat-missing-debug-py-file.patch +Patch50: gdb-handle-no-python-gdb-module.patch +Patch51: gdb-add-rpm-suggestion-script.patch #Fedora Packages end # Fedora patches fixup @@ -710,10 +709,10 @@ find -name "*.info*"|xargs rm -f %patch -P 7 -p1 %patch -P 8 -p1 %patch -P 9 -p1 -%patch -P 10 -p1 +%patch -P 11 -p1 %patch -P 12 -p1 %patch -P 13 -p1 -%patch -P 14 -p1 +%patch -P 15 -p1 %patch -P 16 -p1 %patch -P 17 -p1 %patch -P 18 -p1 @@ -722,12 +721,12 @@ find -name "*.info*"|xargs rm -f %patch -P 21 -p1 %patch -P 22 -p1 %patch -P 23 -p1 -%patch -P 24 -p1 +%patch -P 26 -p1 %patch -P 27 -p1 %patch -P 28 -p1 %patch -P 29 -p1 %patch -P 30 -p1 -%patch -P 31 -p1 +%patch -P 32 -p1 %patch -P 33 -p1 %patch -P 34 -p1 %patch -P 35 -p1 @@ -747,7 +746,6 @@ find -name "*.info*"|xargs rm -f %patch -P 49 -p1 %patch -P 50 -p1 %patch -P 51 -p1 -%patch -P 52 -p1 #Fedora patching end %patch -P 1000 -p1 From e18b64ce07309f31f3c544136c4ac2e82773ef6dd53af4e8de608a68a3ac3240 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 23 Jan 2025 23:48:26 +0000 Subject: [PATCH 10/34] - Update to fedora rawhide @ deb8227. - Patches dropped: * fixup-gdb-linux_perf-bundle.patch * gdb-linux_perf-bundle.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=415 --- fixup-gdb-linux_perf-bundle.patch | 40 ------ gdb-linux_perf-bundle.patch | 226 ------------------------------ gdb.changes | 8 ++ gdb.spec | 46 +++--- 4 files changed, 29 insertions(+), 291 deletions(-) delete mode 100644 fixup-gdb-linux_perf-bundle.patch delete mode 100644 gdb-linux_perf-bundle.patch diff --git a/fixup-gdb-linux_perf-bundle.patch b/fixup-gdb-linux_perf-bundle.patch deleted file mode 100644 index c118deb..0000000 --- a/fixup-gdb-linux_perf-bundle.patch +++ /dev/null @@ -1,40 +0,0 @@ -From af4a87e2b3c2ac5acae1e6f4405fc59e1218de74 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 18 Apr 2024 14:26:58 +0200 -Subject: [PATCH] fixup-gdb-linux_perf-bundle - ---- - gdb/gdb.c | 8 -------- - 1 file changed, 8 deletions(-) - -diff --git a/gdb/gdb.c b/gdb/gdb.c -index 41a9b70c222..6e3ff0755ab 100644 ---- a/gdb/gdb.c -+++ b/gdb/gdb.c -@@ -21,10 +21,6 @@ - #include "interps.h" - #include "run-on-main-thread.h" - --#ifdef PERF_ATTR_SIZE_VER5_BUNDLE --extern "C" void __libipt_init(void); --#endif -- - int - main (int argc, char **argv) - { -@@ -36,10 +32,6 @@ main (int argc, char **argv) - - struct captured_main_args args; - --#ifdef PERF_ATTR_SIZE_VER5_BUNDLE -- __libipt_init(); --#endif -- - memset (&args, 0, sizeof args); - args.argc = argc; - args.argv = argv; - -base-commit: 254988c36fe592e89af5d92e1d35a6eb4b09cbb0 --- -2.35.3 - diff --git a/gdb-linux_perf-bundle.patch b/gdb-linux_perf-bundle.patch deleted file mode 100644 index 36dbe9f..0000000 --- a/gdb-linux_perf-bundle.patch +++ /dev/null @@ -1,226 +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-linux_perf-bundle.patch - -;; [dts+el7] [x86*] Bundle linux_perf.h for libipt (RH BZ 1256513). -;;=fedora - -diff --git a/gdb/gdb.c b/gdb/gdb.c ---- a/gdb/gdb.c -+++ b/gdb/gdb.c -@@ -21,6 +21,10 @@ - #include "interps.h" - #include "run-on-main-thread.h" - -+#ifdef PERF_ATTR_SIZE_VER5_BUNDLE -+extern "C" void __libipt_init(void); -+#endif -+ - int - main (int argc, char **argv) - { -@@ -32,6 +36,10 @@ main (int argc, char **argv) - - struct captured_main_args args; - -+#ifdef PERF_ATTR_SIZE_VER5_BUNDLE -+ __libipt_init(); -+#endif -+ - memset (&args, 0, sizeof args); - args.argc = argc; - args.argv = argv; -diff --git a/gdb/nat/linux-btrace.h b/gdb/nat/linux-btrace.h ---- a/gdb/nat/linux-btrace.h -+++ b/gdb/nat/linux-btrace.h -@@ -28,6 +28,177 @@ - # include - #endif - -+#ifdef PERF_ATTR_SIZE_VER5_BUNDLE -+#ifndef HAVE_LINUX_PERF_EVENT_H -+# error "PERF_ATTR_SIZE_VER5_BUNDLE && !HAVE_LINUX_PERF_EVENT_H" -+#endif -+#ifndef PERF_ATTR_SIZE_VER5 -+#define PERF_ATTR_SIZE_VER5 -+#define perf_event_mmap_page perf_event_mmap_page_bundle -+// kernel-headers-3.10.0-493.el7.x86_64/usr/include/linux/perf_event.h -+/* -+ * Structure of the page that can be mapped via mmap -+ */ -+struct perf_event_mmap_page { -+ __u32 version; /* version number of this structure */ -+ __u32 compat_version; /* lowest version this is compat with */ -+ -+ /* -+ * Bits needed to read the hw events in user-space. -+ * -+ * u32 seq, time_mult, time_shift, index, width; -+ * u64 count, enabled, running; -+ * u64 cyc, time_offset; -+ * s64 pmc = 0; -+ * -+ * do { -+ * seq = pc->lock; -+ * barrier() -+ * -+ * enabled = pc->time_enabled; -+ * running = pc->time_running; -+ * -+ * if (pc->cap_usr_time && enabled != running) { -+ * cyc = rdtsc(); -+ * time_offset = pc->time_offset; -+ * time_mult = pc->time_mult; -+ * time_shift = pc->time_shift; -+ * } -+ * -+ * index = pc->index; -+ * count = pc->offset; -+ * if (pc->cap_user_rdpmc && index) { -+ * width = pc->pmc_width; -+ * pmc = rdpmc(index - 1); -+ * } -+ * -+ * barrier(); -+ * } while (pc->lock != seq); -+ * -+ * NOTE: for obvious reason this only works on self-monitoring -+ * processes. -+ */ -+ __u32 lock; /* seqlock for synchronization */ -+ __u32 index; /* hardware event identifier */ -+ __s64 offset; /* add to hardware event value */ -+ __u64 time_enabled; /* time event active */ -+ __u64 time_running; /* time event on cpu */ -+ union { -+ __u64 capabilities; -+ struct { -+ __u64 cap_bit0 : 1, /* Always 0, deprecated, see commit 860f085b74e9 */ -+ cap_bit0_is_deprecated : 1, /* Always 1, signals that bit 0 is zero */ -+ -+ cap_user_rdpmc : 1, /* The RDPMC instruction can be used to read counts */ -+ cap_user_time : 1, /* The time_* fields are used */ -+ cap_user_time_zero : 1, /* The time_zero field is used */ -+ cap_____res : 59; -+ }; -+ }; -+ -+ /* -+ * If cap_user_rdpmc this field provides the bit-width of the value -+ * read using the rdpmc() or equivalent instruction. This can be used -+ * to sign extend the result like: -+ * -+ * pmc <<= 64 - width; -+ * pmc >>= 64 - width; // signed shift right -+ * count += pmc; -+ */ -+ __u16 pmc_width; -+ -+ /* -+ * If cap_usr_time the below fields can be used to compute the time -+ * delta since time_enabled (in ns) using rdtsc or similar. -+ * -+ * u64 quot, rem; -+ * u64 delta; -+ * -+ * quot = (cyc >> time_shift); -+ * rem = cyc & (((u64)1 << time_shift) - 1); -+ * delta = time_offset + quot * time_mult + -+ * ((rem * time_mult) >> time_shift); -+ * -+ * Where time_offset,time_mult,time_shift and cyc are read in the -+ * seqcount loop described above. This delta can then be added to -+ * enabled and possible running (if index), improving the scaling: -+ * -+ * enabled += delta; -+ * if (index) -+ * running += delta; -+ * -+ * quot = count / running; -+ * rem = count % running; -+ * count = quot * enabled + (rem * enabled) / running; -+ */ -+ __u16 time_shift; -+ __u32 time_mult; -+ __u64 time_offset; -+ /* -+ * If cap_usr_time_zero, the hardware clock (e.g. TSC) can be calculated -+ * from sample timestamps. -+ * -+ * time = timestamp - time_zero; -+ * quot = time / time_mult; -+ * rem = time % time_mult; -+ * cyc = (quot << time_shift) + (rem << time_shift) / time_mult; -+ * -+ * And vice versa: -+ * -+ * quot = cyc >> time_shift; -+ * rem = cyc & (((u64)1 << time_shift) - 1); -+ * timestamp = time_zero + quot * time_mult + -+ * ((rem * time_mult) >> time_shift); -+ */ -+ __u64 time_zero; -+ __u32 size; /* Header size up to __reserved[] fields. */ -+ -+ /* -+ * Hole for extension of the self monitor capabilities -+ */ -+ -+ __u8 __reserved[118*8+4]; /* align to 1k. */ -+ -+ /* -+ * Control data for the mmap() data buffer. -+ * -+ * User-space reading the @data_head value should issue an smp_rmb(), -+ * after reading this value. -+ * -+ * When the mapping is PROT_WRITE the @data_tail value should be -+ * written by userspace to reflect the last read data, after issueing -+ * an smp_mb() to separate the data read from the ->data_tail store. -+ * In this case the kernel will not over-write unread data. -+ * -+ * See perf_output_put_handle() for the data ordering. -+ * -+ * data_{offset,size} indicate the location and size of the perf record -+ * buffer within the mmapped area. -+ */ -+ __u64 data_head; /* head in the data section */ -+ __u64 data_tail; /* user-space written tail */ -+ __u64 data_offset; /* where the buffer starts */ -+ __u64 data_size; /* data buffer size */ -+ -+ /* -+ * AUX area is defined by aux_{offset,size} fields that should be set -+ * by the userspace, so that -+ * -+ * aux_offset >= data_offset + data_size -+ * -+ * prior to mmap()ing it. Size of the mmap()ed area should be aux_size. -+ * -+ * Ring buffer pointers aux_{head,tail} have the same semantics as -+ * data_{head,tail} and same ordering rules apply. -+ */ -+ __u64 aux_head; -+ __u64 aux_tail; -+ __u64 aux_offset; -+ __u64 aux_size; -+}; -+#endif // PERF_ATTR_SIZE_VER5 -+#endif // PERF_ATTR_SIZE_VER5_BUNDLE -+ - struct target_ops; - - #if HAVE_LINUX_PERF_EVENT_H -diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4 ---- a/gdbsupport/common.m4 -+++ b/gdbsupport/common.m4 -@@ -168,7 +168,7 @@ AC_DEFUN([GDB_AC_COMMON], [ - AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ - #include - #ifndef PERF_ATTR_SIZE_VER5 -- # error -+ // error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL - #endif - ]])], [perf_event=yes], [perf_event=no]) - if test "$perf_event" != yes; then diff --git a/gdb.changes b/gdb.changes index ffb2ba9..8373c25 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Jan 23 15:29:00 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ deb8227. +- Patches dropped: + * fixup-gdb-linux_perf-bundle.patch + * gdb-linux_perf-bundle.patch + ------------------------------------------------------------------- Thu Jan 23 15:23:25 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index eb6e9e0..3db88ef 100644 --- a/gdb.spec +++ b/gdb.spec @@ -194,34 +194,32 @@ Patch26: gdb-rhbz1149205-catch-syscall-after-fork-test.patch Patch27: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch Patch28: gdb-fedora-libncursesw.patch Patch29: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch30: gdb-linux_perf-bundle.patch -Patch32: gdb-rhbz2232086-refactor-selftest-support.patch -Patch33: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch -Patch34: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch -Patch35: gdb-rhbz-2232086-generate-gdb-index-consistently.patch -Patch36: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch -Patch37: gdb-rhbz2250652-gdbpy_gil.patch -Patch38: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch -Patch39: gdb-ftbs-swapped-calloc-args.patch -Patch40: gdb-rhbz2261580-intrusive_list-assertion-fix.patch -Patch41: gdb-sync-coffread-with-elfread.patch -Patch42: gdb-merge-debug-symbol-lookup.patch -Patch43: gdb-refactor-find-and-add-separate-symbol-file.patch -Patch44: gdb-add-missing-debug-ext-lang-hook.patch -Patch45: gdb-add-missing-debug-info-python-hook.patch -Patch46: gdb-remove-use-of-py-isascii -Patch47: gdb-remove-path-in-test-name.patch -Patch48: gdb-do-not-import-py-curses-ascii-module.patch -Patch49: gdb-reformat-missing-debug-py-file.patch -Patch50: gdb-handle-no-python-gdb-module.patch -Patch51: gdb-add-rpm-suggestion-script.patch +Patch31: gdb-rhbz2232086-refactor-selftest-support.patch +Patch32: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch +Patch33: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch +Patch34: gdb-rhbz-2232086-generate-gdb-index-consistently.patch +Patch35: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch +Patch36: gdb-rhbz2250652-gdbpy_gil.patch +Patch37: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch +Patch38: gdb-ftbs-swapped-calloc-args.patch +Patch39: gdb-rhbz2261580-intrusive_list-assertion-fix.patch +Patch40: gdb-sync-coffread-with-elfread.patch +Patch41: gdb-merge-debug-symbol-lookup.patch +Patch42: gdb-refactor-find-and-add-separate-symbol-file.patch +Patch43: gdb-add-missing-debug-ext-lang-hook.patch +Patch44: gdb-add-missing-debug-info-python-hook.patch +Patch45: gdb-remove-use-of-py-isascii +Patch46: gdb-remove-path-in-test-name.patch +Patch47: gdb-do-not-import-py-curses-ascii-module.patch +Patch48: gdb-reformat-missing-debug-py-file.patch +Patch49: gdb-handle-no-python-gdb-module.patch +Patch50: gdb-add-rpm-suggestion-script.patch #Fedora Packages end # Fedora patches fixup # These need a number with at least four digits, otherwise patchlist.pl removes # them when upgrading. -Patch1000: fixup-gdb-linux_perf-bundle.patch Patch1003: fixup-gdb-glibc-strstr-workaround.patch Patch1004: fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch Patch1005: fixup-gdb-test-bt-cfi-without-die.patch @@ -725,7 +723,7 @@ find -name "*.info*"|xargs rm -f %patch -P 27 -p1 %patch -P 28 -p1 %patch -P 29 -p1 -%patch -P 30 -p1 +%patch -P 31 -p1 %patch -P 32 -p1 %patch -P 33 -p1 %patch -P 34 -p1 @@ -745,10 +743,8 @@ find -name "*.info*"|xargs rm -f %patch -P 48 -p1 %patch -P 49 -p1 %patch -P 50 -p1 -%patch -P 51 -p1 #Fedora patching end -%patch -P 1000 -p1 %patch -P 1003 -p1 %patch -P 1004 -p1 %patch -P 1005 -p1 From 657be21d03e2b4497491ffe182c73830fea0fa2238a9292fc3cc979199ba72b5 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 24 Jan 2025 13:36:19 +0000 Subject: [PATCH 11/34] - Update to fedora rawhide @ 93db514. - Patches added: * gdb-rhbz2277160-apx-disasm.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=416 --- gdb-rhbz2277160-apx-disasm.patch | 7834 ++++++++++++++++++++++++++++++ gdb.changes | 7 + gdb.spec | 2 + 3 files changed, 7843 insertions(+) create mode 100644 gdb-rhbz2277160-apx-disasm.patch diff --git a/gdb-rhbz2277160-apx-disasm.patch b/gdb-rhbz2277160-apx-disasm.patch new file mode 100644 index 0000000..dbf8c4b --- /dev/null +++ b/gdb-rhbz2277160-apx-disasm.patch @@ -0,0 +1,7834 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Keith Seitz +Date: Wed, 15 May 2024 09:59:51 -0700 +Subject: gdb-rhbz2277160-apx-disasm.patch + +;; Update x86 disassembler + +Update x86 disassembler with APX improvements by syncing +with gdb-15.1 release candidate. + +Resolves: rhbz#2277160 + +diff --git a/include/opcode/i386.h b/include/opcode/i386.h +--- a/include/opcode/i386.h ++++ b/include/opcode/i386.h +@@ -1,5 +1,5 @@ + /* opcode/i386.h -- Intel 80386 opcode macros +- Copyright (C) 1989-2023 Free Software Foundation, Inc. ++ Copyright (C) 1989-2024 Free Software Foundation, Inc. + + This file is part of GAS, the GNU Assembler, and GDB, the GNU Debugger. + +@@ -112,9 +112,13 @@ + /* x86-64 extension prefix. */ + #define REX_OPCODE 0x40 + ++#define REX2_OPCODE 0xd5 ++ + /* Non-zero if OPCODE is the rex prefix. */ + #define REX_PREFIX_P(opcode) (((opcode) & 0xf0) == REX_OPCODE) + ++/* M0 in rex2 prefix represents map0 or map1. */ ++#define REX2_M 0x8 + /* Indicates 64 bit operand size. */ + #define REX_W 8 + /* High extension to reg field of modrm byte. */ +diff --git a/opcodes/i386-dis-evex-mod.h b/opcodes/i386-dis-evex-mod.h +--- a/opcodes/i386-dis-evex-mod.h ++++ b/opcodes/i386-dis-evex-mod.h +@@ -1 +1,10 @@ +-/* Nothing at present. */ ++ /* MOD_EVEX_MAP4_F8_P1 */ ++ { ++ { "enqcmds", { Gva, M }, 0 }, ++ { VEX_W_TABLE (EVEX_W_MAP4_F8_P1_M_1) }, ++ }, ++ /* MOD_EVEX_MAP4_F8_P3 */ ++ { ++ { "enqcmd", { Gva, M }, 0 }, ++ { VEX_W_TABLE (EVEX_W_MAP4_F8_P3_M_1) }, ++ }, +diff --git a/opcodes/i386-dis-evex-prefix.h b/opcodes/i386-dis-evex-prefix.h +--- a/opcodes/i386-dis-evex-prefix.h ++++ b/opcodes/i386-dis-evex-prefix.h +@@ -338,6 +338,29 @@ + { "vcmpp%XH", { MaskG, Vex, EXxh, EXxEVexS, CMP }, 0 }, + { "vcmps%XH", { MaskG, VexScalar, EXw, EXxEVexS, CMP }, 0 }, + }, ++ /* PREFIX_EVEX_MAP4_F0 */ ++ { ++ { "crc32A", { Gdq, Eb }, 0 }, ++ { "invept", { Gm, Mo }, 0 }, ++ }, ++ /* PREFIX_EVEX_MAP4_F1 */ ++ { ++ { "crc32Q", { Gdq, Ev }, 0 }, ++ { "invvpid", { Gm, Mo }, 0 }, ++ { "crc32Q", { Gdq, Ev }, 0 }, ++ }, ++ /* PREFIX_EVEX_MAP4_F2 */ ++ { ++ { Bad_Opcode }, ++ { "invpcid", { Gm, M }, 0 }, ++ }, ++ /* PREFIX_EVEX_MAP4_F8 */ ++ { ++ { Bad_Opcode }, ++ { MOD_TABLE (MOD_EVEX_MAP4_F8_P_1) }, ++ { "movdir64b", { Gva, M }, 0 }, ++ { MOD_TABLE (MOD_EVEX_MAP4_F8_P_3) }, ++ }, + /* PREFIX_EVEX_MAP5_10 */ + { + { Bad_Opcode }, +diff --git a/opcodes/i386-dis-evex-reg.h b/opcodes/i386-dis-evex-reg.h +--- a/opcodes/i386-dis-evex-reg.h ++++ b/opcodes/i386-dis-evex-reg.h +@@ -49,3 +49,74 @@ + { "vscatterpf0qp%XW", { MVexVSIBQWpX }, PREFIX_DATA }, + { "vscatterpf1qp%XW", { MVexVSIBQWpX }, PREFIX_DATA }, + }, ++ /* REG_EVEX_MAP4_80 */ ++ { ++ { "%NFaddA", { VexGb, Eb, Ib }, NO_PREFIX }, ++ { "%NForA", { VexGb, Eb, Ib }, NO_PREFIX }, ++ { "adcA", { VexGb, Eb, Ib }, NO_PREFIX }, ++ { "sbbA", { VexGb, Eb, Ib }, NO_PREFIX }, ++ { "%NFandA", { VexGb, Eb, Ib }, NO_PREFIX }, ++ { "%NFsubA", { VexGb, Eb, Ib }, NO_PREFIX }, ++ { "%NFxorA", { VexGb, Eb, Ib }, NO_PREFIX }, ++ }, ++ /* REG_EVEX_MAP4_81 */ ++ { ++ { "%NFaddQ", { VexGv, Ev, Iv }, PREFIX_NP_OR_DATA }, ++ { "%NForQ", { VexGv, Ev, Iv }, PREFIX_NP_OR_DATA }, ++ { "adcQ", { VexGv, Ev, Iv }, PREFIX_NP_OR_DATA }, ++ { "sbbQ", { VexGv, Ev, Iv }, PREFIX_NP_OR_DATA }, ++ { "%NFandQ", { VexGv, Ev, Iv }, PREFIX_NP_OR_DATA }, ++ { "%NFsubQ", { VexGv, Ev, Iv }, PREFIX_NP_OR_DATA }, ++ { "%NFxorQ", { VexGv, Ev, Iv }, PREFIX_NP_OR_DATA }, ++ }, ++ /* REG_EVEX_MAP4_83 */ ++ { ++ { "%NFaddQ", { VexGv, Ev, sIb }, PREFIX_NP_OR_DATA }, ++ { "%NForQ", { VexGv, Ev, sIb }, PREFIX_NP_OR_DATA }, ++ { "adcQ", { VexGv, Ev, sIb }, PREFIX_NP_OR_DATA }, ++ { "sbbQ", { VexGv, Ev, sIb }, PREFIX_NP_OR_DATA }, ++ { "%NFandQ", { VexGv, Ev, sIb }, PREFIX_NP_OR_DATA }, ++ { "%NFsubQ", { VexGv, Ev, sIb }, PREFIX_NP_OR_DATA }, ++ { "%NFxorQ", { VexGv, Ev, sIb }, PREFIX_NP_OR_DATA }, ++ }, ++ /* REG_EVEX_MAP4_8F */ ++ { ++ { VEX_W_TABLE (EVEX_W_MAP4_8F_R_0) }, ++ }, ++ /* REG_EVEX_MAP4_F6 */ ++ { ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { "notA", { VexGb, Eb }, NO_PREFIX }, ++ { "%NFnegA", { VexGb, Eb }, NO_PREFIX }, ++ { "%NFmulA", { Eb }, NO_PREFIX }, ++ { "%NFimulA", { Eb }, NO_PREFIX }, ++ { "%NFdivA", { Eb }, NO_PREFIX }, ++ { "%NFidivA", { Eb }, NO_PREFIX }, ++ }, ++ /* REG_EVEX_MAP4_F7 */ ++ { ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { "notQ", { VexGv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%NFnegQ", { VexGv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%NFmulQ", { Ev }, PREFIX_NP_OR_DATA }, ++ { "%NFimulQ", { Ev }, PREFIX_NP_OR_DATA }, ++ { "%NFdivQ", { Ev }, PREFIX_NP_OR_DATA }, ++ { "%NFidivQ", { Ev }, PREFIX_NP_OR_DATA }, ++ }, ++ /* REG_EVEX_MAP4_FE */ ++ { ++ { "%NFincA", { VexGb, Eb }, NO_PREFIX }, ++ { "%NFdecA", { VexGb, Eb }, NO_PREFIX }, ++ }, ++ /* REG_EVEX_MAP4_FF */ ++ { ++ { "%NFincQ", { VexGv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%NFdecQ", { VexGv, Ev }, PREFIX_NP_OR_DATA }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { VEX_W_TABLE (EVEX_W_MAP4_FF_R_6) }, ++ }, +diff --git a/opcodes/i386-dis-evex-w.h b/opcodes/i386-dis-evex-w.h +--- a/opcodes/i386-dis-evex-w.h ++++ b/opcodes/i386-dis-evex-w.h +@@ -442,6 +442,24 @@ + { Bad_Opcode }, + { "vpshrdw", { XM, Vex, EXx, Ib }, 0 }, + }, ++ /* EVEX_W_MAP4_8F_R_0 */ ++ { ++ { "pop2", { { PUSH2_POP2_Fixup, q_mode}, Eq }, NO_PREFIX }, ++ { "pop2p", { { PUSH2_POP2_Fixup, q_mode}, Eq }, NO_PREFIX }, ++ }, ++ /* EVEX_W_MAP4_F8_P1_M_1 */ ++ { ++ { "uwrmsr", { Gq, Eq }, 0 }, ++ }, ++ /* EVEX_W_MAP4_F8_P3_M_1 */ ++ { ++ { "urdmsr", { Eq, Gq }, 0 }, ++ }, ++ /* EVEX_W_MAP4_FF_R_6 */ ++ { ++ { "push2", { { PUSH2_POP2_Fixup, q_mode}, Eq }, 0 }, ++ { "push2p", { { PUSH2_POP2_Fixup, q_mode}, Eq }, 0 }, ++ }, + /* EVEX_W_MAP5_5B_P_0 */ + { + { "vcvtdq2ph%XY", { XMxmmq, EXx, EXxEVexR }, 0 }, +diff --git a/opcodes/i386-dis-evex.h b/opcodes/i386-dis-evex.h +--- a/opcodes/i386-dis-evex.h ++++ b/opcodes/i386-dis-evex.h +@@ -164,10 +164,10 @@ static const struct dis386 evex_table[][256] = { + { Bad_Opcode }, + { Bad_Opcode }, + /* 90 */ +- { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, ++ { X86_64_EVEX_W_TABLE (VEX_W_0F90_L_0) }, ++ { X86_64_EVEX_W_TABLE (VEX_W_0F91_L_0) }, ++ { X86_64_EVEX_W_TABLE (VEX_W_0F92_L_0) }, ++ { X86_64_EVEX_W_TABLE (VEX_W_0F93_L_0) }, + { Bad_Opcode }, + { Bad_Opcode }, + { Bad_Opcode }, +@@ -375,9 +375,9 @@ static const struct dis386 evex_table[][256] = { + { "vpsllv%DQ", { XM, Vex, EXx }, PREFIX_DATA }, + /* 48 */ + { Bad_Opcode }, ++ { X86_64_EVEX_MEM_W_TABLE (VEX_W_0F3849_X86_64_L_0) }, + { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, ++ { X86_64_EVEX_MEM_W_TABLE (VEX_W_0F384B_X86_64_L_0) }, + { "vrcp14p%XW", { XM, EXx }, PREFIX_DATA }, + { "vrcp14s%XW", { XMScalar, VexScalar, EXdq }, PREFIX_DATA }, + { "vrsqrt14p%XW", { XM, EXx }, 0 }, +@@ -545,32 +545,32 @@ static const struct dis386 evex_table[][256] = { + { "%XEvaesdecY", { XM, Vex, EXx }, PREFIX_DATA }, + { "%XEvaesdeclastY", { XM, Vex, EXx }, PREFIX_DATA }, + /* E0 */ +- { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, ++ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E0) }, ++ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E1) }, ++ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E2) }, ++ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E3) }, ++ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E4) }, ++ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E5) }, ++ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E6) }, ++ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E7) }, + /* E8 */ +- { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, ++ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E8) }, ++ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E9) }, ++ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38EA) }, ++ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38EB) }, ++ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38EC) }, ++ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38ED) }, ++ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38EE) }, ++ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38EF) }, + /* F0 */ + { Bad_Opcode }, + { Bad_Opcode }, ++ { X86_64_EVEX_PFX_TABLE (PREFIX_VEX_0F38F2_L_0) }, ++ { X86_64_EVEX_PFX_TABLE (PREFIX_VEX_0F38F3_L_0) }, + { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, +- { Bad_Opcode }, ++ { X86_64_EVEX_PFX_TABLE (PREFIX_VEX_0F38F5_L_0) }, ++ { X86_64_EVEX_PFX_TABLE (PREFIX_VEX_0F38F6_L_0) }, ++ { X86_64_EVEX_PFX_TABLE (PREFIX_VEX_0F38F7_L_0) }, + /* F8 */ + { Bad_Opcode }, + { Bad_Opcode }, +@@ -854,7 +854,7 @@ static const struct dis386 evex_table[][256] = { + { Bad_Opcode }, + { Bad_Opcode }, + /* F0 */ +- { Bad_Opcode }, ++ { X86_64_EVEX_PFX_TABLE (PREFIX_VEX_0F3AF0_L_0) }, + { Bad_Opcode }, + { Bad_Opcode }, + { Bad_Opcode }, +@@ -872,6 +872,297 @@ static const struct dis386 evex_table[][256] = { + { Bad_Opcode }, + { Bad_Opcode }, + }, ++ /* EVEX_MAP4_ */ ++ { ++ /* 00 */ ++ { "%NFaddB", { VexGb, Eb, Gb }, NO_PREFIX }, ++ { "%NFaddS", { VexGv, Ev, Gv }, PREFIX_NP_OR_DATA }, ++ { "%NFaddB", { VexGb, Gb, EbS }, NO_PREFIX }, ++ { "%NFaddS", { VexGv, Gv, EvS }, PREFIX_NP_OR_DATA }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* 08 */ ++ { "%NForB", { VexGb, Eb, Gb }, NO_PREFIX }, ++ { "%NForS", { VexGv, Ev, Gv }, PREFIX_NP_OR_DATA }, ++ { "%NForB", { VexGb, Gb, EbS }, NO_PREFIX }, ++ { "%NForS", { VexGv, Gv, EvS }, PREFIX_NP_OR_DATA }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* 10 */ ++ { "adcB", { VexGb, Eb, Gb }, NO_PREFIX }, ++ { "adcS", { VexGv, Ev, Gv }, PREFIX_NP_OR_DATA }, ++ { "adcB", { VexGb, Gb, EbS }, NO_PREFIX }, ++ { "adcS", { VexGv, Gv, EvS }, PREFIX_NP_OR_DATA }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* 18 */ ++ { "sbbB", { VexGb, Eb, Gb }, NO_PREFIX }, ++ { "sbbS", { VexGv, Ev, Gv }, PREFIX_NP_OR_DATA }, ++ { "sbbB", { VexGb, Gb, EbS }, NO_PREFIX }, ++ { "sbbS", { VexGv, Gv, EvS }, PREFIX_NP_OR_DATA }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* 20 */ ++ { "%NFandB", { VexGb, Eb, Gb }, NO_PREFIX }, ++ { "%NFandS", { VexGv, Ev, Gv }, PREFIX_NP_OR_DATA }, ++ { "%NFandB", { VexGb, Gb, EbS }, NO_PREFIX }, ++ { "%NFandS", { VexGv, Gv, EvS }, PREFIX_NP_OR_DATA }, ++ { "%NFshldS", { VexGv, Ev, Gv, Ib }, PREFIX_NP_OR_DATA }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* 28 */ ++ { "%NFsubB", { VexGb, Eb, Gb }, NO_PREFIX }, ++ { "%NFsubS", { VexGv, Ev, Gv }, PREFIX_NP_OR_DATA }, ++ { "%NFsubB", { VexGb, Gb, EbS }, NO_PREFIX }, ++ { "%NFsubS", { VexGv, Gv, EvS }, PREFIX_NP_OR_DATA }, ++ { "%NFshrdS", { VexGv, Ev, Gv, Ib }, PREFIX_NP_OR_DATA }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* 30 */ ++ { "%NFxorB", { VexGb, Eb, Gb }, NO_PREFIX }, ++ { "%NFxorS", { VexGv, Ev, Gv }, PREFIX_NP_OR_DATA }, ++ { "%NFxorB", { VexGb, Gb, EbS }, NO_PREFIX }, ++ { "%NFxorS", { VexGv, Gv, EvS }, PREFIX_NP_OR_DATA }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* 38 */ ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* 40 */ ++ { "%CFcmovoS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%CFcmovnoS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%CFcmovbS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%CFcmovaeS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%CFcmoveS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%CFcmovneS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%CFcmovbeS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%CFcmovaS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, ++ /* 48 */ ++ { "%CFcmovsS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%CFcmovnsS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%CFcmovpS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%CFcmovnpS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%CFcmovlS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%CFcmovgeS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%CFcmovleS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%CFcmovgS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, ++ /* 50 */ ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* 58 */ ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* 60 */ ++ { "%MEmovbeS", { Gv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%MEmovbeS", { Ev, Gv }, PREFIX_NP_OR_DATA }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { "wrussK", { M, Gdq }, PREFIX_DATA }, ++ { PREFIX_TABLE (PREFIX_0F38F6) }, ++ { Bad_Opcode }, ++ /* 68 */ ++ { Bad_Opcode }, ++ { "%NFimulS", { Gv, Ev, Iv }, PREFIX_NP_OR_DATA }, ++ { Bad_Opcode }, ++ { "%NFimulS", { Gv, Ev, sIb }, PREFIX_NP_OR_DATA }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* 70 */ ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* 78 */ ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* 80 */ ++ { REG_TABLE (REG_EVEX_MAP4_80) }, ++ { REG_TABLE (REG_EVEX_MAP4_81) }, ++ { Bad_Opcode }, ++ { REG_TABLE (REG_EVEX_MAP4_83) }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* 88 */ ++ { "%NFpopcntS", { Gv, Ev }, PREFIX_NP_OR_DATA }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { REG_TABLE (REG_EVEX_MAP4_8F) }, ++ /* 90 */ ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* 98 */ ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* A0 */ ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { "%NFshldS", { VexGv, Ev, Gv, CL }, PREFIX_NP_OR_DATA }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* A8 */ ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { "%NFshrdS", { VexGv, Ev, Gv, CL }, PREFIX_NP_OR_DATA }, ++ { Bad_Opcode }, ++ { "%NFimulS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, ++ /* B0 */ ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* B8 */ ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* C0 */ ++ { REG_TABLE (REG_C0) }, ++ { REG_TABLE (REG_C1) }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* C8 */ ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* D0 */ ++ { REG_TABLE (REG_D0) }, ++ { REG_TABLE (REG_D1) }, ++ { REG_TABLE (REG_D2) }, ++ { REG_TABLE (REG_D3) }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* D8 */ ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* E0 */ ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* E8 */ ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ /* F0 */ ++ { PREFIX_TABLE (PREFIX_EVEX_MAP4_F0) }, ++ { PREFIX_TABLE (PREFIX_EVEX_MAP4_F1) }, ++ { PREFIX_TABLE (PREFIX_EVEX_MAP4_F2) }, ++ { Bad_Opcode }, ++ { "%NFtzcntS", { Gv, Ev }, PREFIX_NP_OR_DATA }, ++ { "%NFlzcntS", { Gv, Ev }, PREFIX_NP_OR_DATA }, ++ { REG_TABLE (REG_EVEX_MAP4_F6) }, ++ { REG_TABLE (REG_EVEX_MAP4_F7) }, ++ /* F8 */ ++ { PREFIX_TABLE (PREFIX_EVEX_MAP4_F8) }, ++ { "movdiri", { Mdq, Gdq }, NO_PREFIX }, ++ { Bad_Opcode }, ++ { Bad_Opcode }, ++ { PREFIX_TABLE (PREFIX_0F38FC) }, ++ { Bad_Opcode }, ++ { REG_TABLE (REG_EVEX_MAP4_FE) }, ++ { REG_TABLE (REG_EVEX_MAP4_FF) }, ++ }, + /* EVEX_MAP5_ */ + { + /* 00 */ +diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c +--- a/opcodes/i386-dis.c ++++ b/opcodes/i386-dis.c +@@ -1,5 +1,5 @@ + /* Print i386 instructions for GDB, the GNU debugger. +- Copyright (C) 1988-2023 Free Software Foundation, Inc. ++ Copyright (C) 1988-2024 Free Software Foundation, Inc. + + This file is part of the GNU opcodes library. + +@@ -105,6 +105,8 @@ static bool FXSAVE_Fixup (instr_info *, int, int); + static bool MOVSXD_Fixup (instr_info *, int, int); + static bool DistinctDest_Fixup (instr_info *, int, int); + static bool PREFETCHI_Fixup (instr_info *, int, int); ++static bool PUSH2_POP2_Fixup (instr_info *, int, int); ++static bool JMPABS_Fixup (instr_info *, int, int); + + static void ATTRIBUTE_PRINTF_3 i386_dis_printf (const disassemble_info *, + enum disassembler_style, +@@ -132,6 +134,13 @@ enum x86_64_isa + intel64 + }; + ++enum evex_type ++{ ++ evex_default = 0, ++ evex_from_legacy, ++ evex_from_vex, ++}; ++ + struct instr_info + { + enum address_mode address_mode; +@@ -144,6 +153,12 @@ struct instr_info + /* Bits of REX we've already used. */ + uint8_t rex_used; + ++ /* Record W R4 X4 B4 bits for rex2. */ ++ unsigned char rex2; ++ /* Bits of rex2 we've already used. */ ++ unsigned char rex2_used; ++ unsigned char rex2_payload; ++ + bool need_modrm; + unsigned char need_vex; + bool has_sib; +@@ -169,6 +184,7 @@ struct instr_info + signed char last_data_prefix; + signed char last_addr_prefix; + signed char last_rex_prefix; ++ signed char last_rex2_prefix; + signed char last_seg_prefix; + signed char fwait_prefix; + /* The active segment register prefix. */ +@@ -205,14 +221,19 @@ struct instr_info + int ll; + bool w; + bool evex; +- bool r; + bool v; + bool zeroing; + bool b; + bool no_broadcast; ++ bool nf; + } + vex; + ++/* For APX EVEX-promoted prefix, EVEX.ND shares the same bit as vex.b. */ ++#define nd b ++ ++ enum evex_type evex_type; ++ + /* Remember if the current op is a jump instruction. */ + bool op_is_jump; + +@@ -221,6 +242,9 @@ struct instr_info + /* Record whether EVEX masking is used incorrectly. */ + bool illegal_masking; + ++ /* Record whether the modrm byte has been skipped. */ ++ bool has_skipped_modrm; ++ + unsigned char op_ad; + signed char op_index[MAX_OPERANDS]; + bool op_riprel[MAX_OPERANDS]; +@@ -262,8 +286,13 @@ struct dis_private { + { \ + if (value) \ + { \ +- if ((ins->rex & value)) \ ++ if (ins->rex & value) \ + ins->rex_used |= (value) | REX_OPCODE; \ ++ if (ins->rex2 & value) \ ++ { \ ++ ins->rex2_used |= (value); \ ++ ins->rex_used |= REX_OPCODE; \ ++ } \ + } \ + else \ + ins->rex_used |= REX_OPCODE; \ +@@ -273,6 +302,10 @@ struct dis_private { + #define EVEX_b_used 1 + #define EVEX_len_used 2 + ++ ++/* {rex2} is not printed when the REX2_SPECIAL is set. */ ++#define REX2_SPECIAL 16 ++ + /* Flags stored in PREFIXES. */ + #define PREFIX_REPZ 1 + #define PREFIX_REPNZ 2 +@@ -286,6 +319,9 @@ struct dis_private { + #define PREFIX_DATA 0x200 + #define PREFIX_ADDR 0x400 + #define PREFIX_FWAIT 0x800 ++#define PREFIX_REX2 0x1000 ++#define PREFIX_NP_OR_DATA 0x2000 ++#define NO_PREFIX 0x4000 + + /* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive) + to ADDR (exclusive) are valid. Returns true for success, false +@@ -367,6 +403,7 @@ fetch_error (const instr_info *ins) + #define PREFIX_IGNORED_DATA (PREFIX_DATA << PREFIX_IGNORED_SHIFT) + #define PREFIX_IGNORED_ADDR (PREFIX_ADDR << PREFIX_IGNORED_SHIFT) + #define PREFIX_IGNORED_LOCK (PREFIX_LOCK << PREFIX_IGNORED_SHIFT) ++#define PREFIX_REX2_ILLEGAL (PREFIX_REX2 << PREFIX_IGNORED_SHIFT) + + /* Opcode prefixes. */ + #define PREFIX_OPCODE (PREFIX_REPZ \ +@@ -418,6 +455,7 @@ fetch_error (const instr_info *ins) + #define Gv { OP_G, v_mode } + #define Gd { OP_G, d_mode } + #define Gdq { OP_G, dq_mode } ++#define Gq { OP_G, q_mode } + #define Gm { OP_G, m_mode } + #define Gva { OP_G, va_mode } + #define Gw { OP_G, w_mode } +@@ -527,7 +565,8 @@ fetch_error (const instr_info *ins) + #define EXEvexXNoBcst { OP_EX, evex_x_nobcst_mode } + #define Rd { OP_R, d_mode } + #define Rdq { OP_R, dq_mode } +-#define Nq { OP_R, q_mode } ++#define Rq { OP_R, q_mode } ++#define Nq { OP_R, q_mm_mode } + #define Ux { OP_R, x_mode } + #define Uxmm { OP_R, xmm_mode } + #define Rxmmq { OP_R, xmmq_mode } +@@ -548,6 +587,8 @@ fetch_error (const instr_info *ins) + #define VexGatherD { OP_VEX, vex_vsib_d_w_dq_mode } + #define VexGatherQ { OP_VEX, vex_vsib_q_w_dq_mode } + #define VexGdq { OP_VEX, dq_mode } ++#define VexGb { OP_VEX, b_mode } ++#define VexGv { OP_VEX, v_mode } + #define VexTmm { OP_VEX, tmm_mode } + #define XMVexI4 { OP_REG_VexI4, x_mode } + #define XMVexScalarI4 { OP_REG_VexI4, scalar_mode } +@@ -624,6 +665,8 @@ enum + d_swap_mode, + /* quad word operand */ + q_mode, ++ /* 8-byte MM operand */ ++ q_mm_mode, + /* quad word operand with operand swapped */ + q_swap_mode, + /* ten-byte operand */ +@@ -778,6 +821,10 @@ enum + USE_RM_TABLE, + USE_PREFIX_TABLE, + USE_X86_64_TABLE, ++ USE_X86_64_EVEX_FROM_VEX_TABLE, ++ USE_X86_64_EVEX_PFX_TABLE, ++ USE_X86_64_EVEX_W_TABLE, ++ USE_X86_64_EVEX_MEM_W_TABLE, + USE_3BYTE_TABLE, + USE_XOP_8F_TABLE, + USE_VEX_C4_TABLE, +@@ -796,6 +843,11 @@ enum + #define RM_TABLE(I) DIS386 (USE_RM_TABLE, (I)) + #define PREFIX_TABLE(I) DIS386 (USE_PREFIX_TABLE, (I)) + #define X86_64_TABLE(I) DIS386 (USE_X86_64_TABLE, (I)) ++#define X86_64_EVEX_FROM_VEX_TABLE(I) \ ++ DIS386 (USE_X86_64_EVEX_FROM_VEX_TABLE, (I)) ++#define X86_64_EVEX_PFX_TABLE(I) DIS386 (USE_X86_64_EVEX_PFX_TABLE, (I)) ++#define X86_64_EVEX_W_TABLE(I) DIS386 (USE_X86_64_EVEX_W_TABLE, (I)) ++#define X86_64_EVEX_MEM_W_TABLE(I) DIS386 (USE_X86_64_EVEX_MEM_W_TABLE, (I)) + #define THREE_BYTE_TABLE(I) DIS386 (USE_3BYTE_TABLE, (I)) + #define XOP_8F_TABLE() DIS386 (USE_XOP_8F_TABLE, 0) + #define VEX_C4_TABLE() DIS386 (USE_VEX_C4_TABLE, 0) +@@ -844,7 +896,8 @@ enum + REG_VEX_0F73, + REG_VEX_0FAE, + REG_VEX_0F3849_X86_64_L_0_W_0_M_1_P_0, +- REG_VEX_0F38F3_L_0, ++ REG_VEX_0F38F3_L_0_P_0, ++ REG_VEX_MAP7_F8_L_0_W_0, + + REG_XOP_09_01_L_0, + REG_XOP_09_02_L_0, +@@ -855,7 +908,15 @@ enum + REG_EVEX_0F72, + REG_EVEX_0F73, + REG_EVEX_0F38C6_L_2, +- REG_EVEX_0F38C7_L_2 ++ REG_EVEX_0F38C7_L_2, ++ REG_EVEX_MAP4_80, ++ REG_EVEX_MAP4_81, ++ REG_EVEX_MAP4_83, ++ REG_EVEX_MAP4_8F, ++ REG_EVEX_MAP4_F6, ++ REG_EVEX_MAP4_F7, ++ REG_EVEX_MAP4_FE, ++ REG_EVEX_MAP4_FF, + }; + + enum +@@ -893,8 +954,12 @@ enum + MOD_0FC7_REG_6, + MOD_0FC7_REG_7, + MOD_0F38DC_PREFIX_1, ++ MOD_0F38F8, + + MOD_VEX_0F3849_X86_64_L_0_W_0, ++ ++ MOD_EVEX_MAP4_F8_P_1, ++ MOD_EVEX_MAP4_F8_P_3, + }; + + enum +@@ -1010,7 +1075,8 @@ enum + PREFIX_0F38F0, + PREFIX_0F38F1, + PREFIX_0F38F6, +- PREFIX_0F38F8, ++ PREFIX_0F38F8_M_0, ++ PREFIX_0F38F8_M_1_X86_64, + PREFIX_0F38FA, + PREFIX_0F38FB, + PREFIX_0F38FC, +@@ -1069,10 +1135,13 @@ enum + PREFIX_VEX_0F38CC, + PREFIX_VEX_0F38CD, + PREFIX_VEX_0F38DA_W_0, ++ PREFIX_VEX_0F38F2_L_0, ++ PREFIX_VEX_0F38F3_L_0, + PREFIX_VEX_0F38F5_L_0, + PREFIX_VEX_0F38F6_L_0, + PREFIX_VEX_0F38F7_L_0, + PREFIX_VEX_0F3AF0_L_0, ++ PREFIX_VEX_MAP7_F8_L_0_W_0_R_0_X86_64, + + PREFIX_EVEX_0F5B, + PREFIX_EVEX_0F6F, +@@ -1130,6 +1199,11 @@ enum + PREFIX_EVEX_0F3A67, + PREFIX_EVEX_0F3AC2, + ++ PREFIX_EVEX_MAP4_F0, ++ PREFIX_EVEX_MAP4_F1, ++ PREFIX_EVEX_MAP4_F2, ++ PREFIX_EVEX_MAP4_F8, ++ + PREFIX_EVEX_MAP5_10, + PREFIX_EVEX_MAP5_11, + PREFIX_EVEX_MAP5_1D, +@@ -1217,6 +1291,7 @@ enum + X86_64_0F18_REG_7_MOD_0, + X86_64_0F24, + X86_64_0F26, ++ X86_64_0F38F8_M_1, + X86_64_0FC7_REG_6_MOD_3_PREFIX_1, + + X86_64_VEX_0F3849, +@@ -1240,6 +1315,8 @@ enum + X86_64_VEX_0F38ED, + X86_64_VEX_0F38EE, + X86_64_VEX_0F38EF, ++ ++ X86_64_VEX_MAP7_F8_L_0_W_0_R_0, + }; + + enum +@@ -1259,7 +1336,8 @@ enum + { + VEX_0F = 0, + VEX_0F38, +- VEX_0F3A ++ VEX_0F3A, ++ VEX_MAP7, + }; + + enum +@@ -1267,8 +1345,10 @@ enum + EVEX_0F = 0, + EVEX_0F38, + EVEX_0F3A, ++ EVEX_MAP4, + EVEX_MAP5, + EVEX_MAP6, ++ EVEX_MAP7, + }; + + enum +@@ -1350,6 +1430,7 @@ enum + VEX_LEN_0F3ADE_W_0, + VEX_LEN_0F3ADF, + VEX_LEN_0F3AF0, ++ VEX_LEN_MAP7_F8, + VEX_LEN_XOP_08_85, + VEX_LEN_XOP_08_86, + VEX_LEN_XOP_08_87, +@@ -1510,6 +1591,7 @@ enum + VEX_W_0F3ACE, + VEX_W_0F3ACF, + VEX_W_0F3ADE, ++ VEX_W_MAP7_F8_L_0, + + VEX_W_XOP_08_85_L_0, + VEX_W_XOP_08_86_L_0, +@@ -1656,6 +1738,11 @@ enum + EVEX_W_0F3A70, + EVEX_W_0F3A72, + ++ EVEX_W_MAP4_8F_R_0, ++ EVEX_W_MAP4_F8_P1_M_1, ++ EVEX_W_MAP4_F8_P3_M_1, ++ EVEX_W_MAP4_FF_R_6, ++ + EVEX_W_MAP5_5B_P_0, + EVEX_W_MAP5_7A_P_3, + }; +@@ -1673,7 +1760,7 @@ struct dis386 { + }; + + /* Upper case letters in the instruction names here are macros. +- 'A' => print 'b' if no register operands or suffix_always is true ++ 'A' => print 'b' if no (suitable) register operand or suffix_always is true + 'B' => print 'b' if suffix_always is true + 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand + size prefix +@@ -1686,14 +1773,14 @@ struct dis386 { + 'I' unused. + 'J' unused. + 'K' => print 'd' or 'q' if rex prefix is present. +- 'L' unused. ++ 'L' => print 'l' or 'q' if suffix_always is true + 'M' => print 'r' if intel_mnemonic is false. + 'N' => print 'n' if instruction has no wait "prefix" + 'O' => print 'd' or 'o' (or 'q' in Intel mode) + 'P' => behave as 'T' except with register operand outside of suffix_always + mode +- 'Q' => print 'w', 'l' or 'q' for memory operand or suffix_always +- is true ++ 'Q' => print 'w', 'l' or 'q' if no (suitable) register operand or ++ suffix_always is true + 'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode) + 'S' => print 'w', 'l' or 'q' if suffix_always is true + 'T' => print 'w', 'l'/'d', or 'q' if instruction has an operand size +@@ -1724,6 +1811,11 @@ struct dis386 { + "XV" => print "{vex} " pseudo prefix + "XE" => print "{evex} " pseudo prefix if no EVEX-specific functionality is + is used by an EVEX-encoded (AVX512VL) instruction. ++ "ME" => print "{evex} " pseudo prefix for ins->modrm.mod != 3,if no ++ EVEX-specific functionality is used by an EVEX-encoded (AVX512VL) ++ instruction. ++ "NF" => print "{nf} " pseudo prefix when EVEX.NF = 1 and print "{evex} " ++ pseudo prefix when instructions without NF, EGPR and VVVV, + "YK" keep unused, to avoid ambiguity with the combined use of Y and K. + "YX" keep unused, to avoid ambiguity with the combined use of Y and X. + "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory operand, cond +@@ -1836,23 +1928,23 @@ static const struct dis386 dis386[] = { + { "dec{S|}", { RMeSI }, 0 }, + { "dec{S|}", { RMeDI }, 0 }, + /* 50 */ +- { "push{!P|}", { RMrAX }, 0 }, +- { "push{!P|}", { RMrCX }, 0 }, +- { "push{!P|}", { RMrDX }, 0 }, +- { "push{!P|}", { RMrBX }, 0 }, +- { "push{!P|}", { RMrSP }, 0 }, +- { "push{!P|}", { RMrBP }, 0 }, +- { "push{!P|}", { RMrSI }, 0 }, +- { "push{!P|}", { RMrDI }, 0 }, ++ { "push!P", { RMrAX }, 0 }, ++ { "push!P", { RMrCX }, 0 }, ++ { "push!P", { RMrDX }, 0 }, ++ { "push!P", { RMrBX }, 0 }, ++ { "push!P", { RMrSP }, 0 }, ++ { "push!P", { RMrBP }, 0 }, ++ { "push!P", { RMrSI }, 0 }, ++ { "push!P", { RMrDI }, 0 }, + /* 58 */ +- { "pop{!P|}", { RMrAX }, 0 }, +- { "pop{!P|}", { RMrCX }, 0 }, +- { "pop{!P|}", { RMrDX }, 0 }, +- { "pop{!P|}", { RMrBX }, 0 }, +- { "pop{!P|}", { RMrSP }, 0 }, +- { "pop{!P|}", { RMrBP }, 0 }, +- { "pop{!P|}", { RMrSI }, 0 }, +- { "pop{!P|}", { RMrDI }, 0 }, ++ { "pop!P", { RMrAX }, 0 }, ++ { "pop!P", { RMrCX }, 0 }, ++ { "pop!P", { RMrDX }, 0 }, ++ { "pop!P", { RMrBX }, 0 }, ++ { "pop!P", { RMrSP }, 0 }, ++ { "pop!P", { RMrBP }, 0 }, ++ { "pop!P", { RMrSI }, 0 }, ++ { "pop!P", { RMrDI }, 0 }, + /* 60 */ + { X86_64_TABLE (X86_64_60) }, + { X86_64_TABLE (X86_64_61) }, +@@ -1872,23 +1964,23 @@ static const struct dis386 dis386[] = { + { "outs{b|}", { indirDXr, Xb }, 0 }, + { X86_64_TABLE (X86_64_6F) }, + /* 70 */ +- { "joH", { Jb, BND, cond_jump_flag }, 0 }, +- { "jnoH", { Jb, BND, cond_jump_flag }, 0 }, +- { "jbH", { Jb, BND, cond_jump_flag }, 0 }, +- { "jaeH", { Jb, BND, cond_jump_flag }, 0 }, +- { "jeH", { Jb, BND, cond_jump_flag }, 0 }, +- { "jneH", { Jb, BND, cond_jump_flag }, 0 }, +- { "jbeH", { Jb, BND, cond_jump_flag }, 0 }, +- { "jaH", { Jb, BND, cond_jump_flag }, 0 }, ++ { "joH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jnoH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jbH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jaeH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jeH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jneH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jbeH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jaH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, + /* 78 */ +- { "jsH", { Jb, BND, cond_jump_flag }, 0 }, +- { "jnsH", { Jb, BND, cond_jump_flag }, 0 }, +- { "jpH", { Jb, BND, cond_jump_flag }, 0 }, +- { "jnpH", { Jb, BND, cond_jump_flag }, 0 }, +- { "jlH", { Jb, BND, cond_jump_flag }, 0 }, +- { "jgeH", { Jb, BND, cond_jump_flag }, 0 }, +- { "jleH", { Jb, BND, cond_jump_flag }, 0 }, +- { "jgH", { Jb, BND, cond_jump_flag }, 0 }, ++ { "jsH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jnsH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jpH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jnpH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jlH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jgeH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jleH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jgH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, + /* 80 */ + { REG_TABLE (REG_80) }, + { REG_TABLE (REG_81) }, +@@ -1926,23 +2018,23 @@ static const struct dis386 dis386[] = { + { "sahf", { XX }, 0 }, + { "lahf", { XX }, 0 }, + /* a0 */ +- { "mov%LB", { AL, Ob }, 0 }, +- { "mov%LS", { eAX, Ov }, 0 }, +- { "mov%LB", { Ob, AL }, 0 }, +- { "mov%LS", { Ov, eAX }, 0 }, +- { "movs{b|}", { Ybr, Xb }, 0 }, +- { "movs{R|}", { Yvr, Xv }, 0 }, +- { "cmps{b|}", { Xb, Yb }, 0 }, +- { "cmps{R|}", { Xv, Yv }, 0 }, ++ { "mov%LB", { AL, Ob }, PREFIX_REX2_ILLEGAL }, ++ { "mov%LS", { { JMPABS_Fixup, eAX_reg }, { JMPABS_Fixup, v_mode } }, PREFIX_REX2_ILLEGAL }, ++ { "mov%LB", { Ob, AL }, PREFIX_REX2_ILLEGAL }, ++ { "mov%LS", { Ov, eAX }, PREFIX_REX2_ILLEGAL }, ++ { "movs{b|}", { Ybr, Xb }, PREFIX_REX2_ILLEGAL }, ++ { "movs{R|}", { Yvr, Xv }, PREFIX_REX2_ILLEGAL }, ++ { "cmps{b|}", { Xb, Yb }, PREFIX_REX2_ILLEGAL }, ++ { "cmps{R|}", { Xv, Yv }, PREFIX_REX2_ILLEGAL }, + /* a8 */ +- { "testB", { AL, Ib }, 0 }, +- { "testS", { eAX, Iv }, 0 }, +- { "stosB", { Ybr, AL }, 0 }, +- { "stosS", { Yvr, eAX }, 0 }, +- { "lodsB", { ALr, Xb }, 0 }, +- { "lodsS", { eAXr, Xv }, 0 }, +- { "scasB", { AL, Yb }, 0 }, +- { "scasS", { eAX, Yv }, 0 }, ++ { "testB", { AL, Ib }, PREFIX_REX2_ILLEGAL }, ++ { "testS", { eAX, Iv }, PREFIX_REX2_ILLEGAL }, ++ { "stosB", { Ybr, AL }, PREFIX_REX2_ILLEGAL }, ++ { "stosS", { Yvr, eAX }, PREFIX_REX2_ILLEGAL }, ++ { "lodsB", { ALr, Xb }, PREFIX_REX2_ILLEGAL }, ++ { "lodsS", { eAXr, Xv }, PREFIX_REX2_ILLEGAL }, ++ { "scasB", { AL, Yb }, PREFIX_REX2_ILLEGAL }, ++ { "scasS", { eAX, Yv }, PREFIX_REX2_ILLEGAL }, + /* b0 */ + { "movB", { RMAL, Ib }, 0 }, + { "movB", { RMCL, Ib }, 0 }, +@@ -1998,23 +2090,23 @@ static const struct dis386 dis386[] = { + { FLOAT }, + { FLOAT }, + /* e0 */ +- { "loopneFH", { Jb, XX, loop_jcxz_flag }, 0 }, +- { "loopeFH", { Jb, XX, loop_jcxz_flag }, 0 }, +- { "loopFH", { Jb, XX, loop_jcxz_flag }, 0 }, +- { "jEcxzH", { Jb, XX, loop_jcxz_flag }, 0 }, +- { "inB", { AL, Ib }, 0 }, +- { "inG", { zAX, Ib }, 0 }, +- { "outB", { Ib, AL }, 0 }, +- { "outG", { Ib, zAX }, 0 }, ++ { "loopneFH", { Jb, XX, loop_jcxz_flag }, PREFIX_REX2_ILLEGAL }, ++ { "loopeFH", { Jb, XX, loop_jcxz_flag }, PREFIX_REX2_ILLEGAL }, ++ { "loopFH", { Jb, XX, loop_jcxz_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jEcxzH", { Jb, XX, loop_jcxz_flag }, PREFIX_REX2_ILLEGAL }, ++ { "inB", { AL, Ib }, PREFIX_REX2_ILLEGAL }, ++ { "inG", { zAX, Ib }, PREFIX_REX2_ILLEGAL }, ++ { "outB", { Ib, AL }, PREFIX_REX2_ILLEGAL }, ++ { "outG", { Ib, zAX }, PREFIX_REX2_ILLEGAL }, + /* e8 */ + { X86_64_TABLE (X86_64_E8) }, + { X86_64_TABLE (X86_64_E9) }, + { X86_64_TABLE (X86_64_EA) }, +- { "jmp", { Jb, BND }, 0 }, +- { "inB", { AL, indirDX }, 0 }, +- { "inG", { zAX, indirDX }, 0 }, +- { "outB", { indirDX, AL }, 0 }, +- { "outG", { indirDX, zAX }, 0 }, ++ { "jmp", { Jb, BND }, PREFIX_REX2_ILLEGAL }, ++ { "inB", { AL, indirDX }, PREFIX_REX2_ILLEGAL }, ++ { "inG", { zAX, indirDX }, PREFIX_REX2_ILLEGAL }, ++ { "outB", { indirDX, AL }, PREFIX_REX2_ILLEGAL }, ++ { "outG", { indirDX, zAX }, PREFIX_REX2_ILLEGAL }, + /* f0 */ + { Bad_Opcode }, /* lock prefix */ + { "int1", { XX }, 0 }, +@@ -2091,12 +2183,12 @@ static const struct dis386 dis386_twobyte[] = { + { PREFIX_TABLE (PREFIX_0F2E) }, + { PREFIX_TABLE (PREFIX_0F2F) }, + /* 30 */ +- { "wrmsr", { XX }, 0 }, +- { "rdtsc", { XX }, 0 }, +- { "rdmsr", { XX }, 0 }, +- { "rdpmc", { XX }, 0 }, +- { "sysenter", { SEP }, 0 }, +- { "sysexit%LQ", { SEP }, 0 }, ++ { "wrmsr", { XX }, PREFIX_REX2_ILLEGAL }, ++ { "rdtsc", { XX }, PREFIX_REX2_ILLEGAL }, ++ { "rdmsr", { XX }, PREFIX_REX2_ILLEGAL }, ++ { "rdpmc", { XX }, PREFIX_REX2_ILLEGAL }, ++ { "sysenter", { SEP }, PREFIX_REX2_ILLEGAL }, ++ { "sysexit%LQ", { SEP }, PREFIX_REX2_ILLEGAL }, + { Bad_Opcode }, + { "getsec", { XX }, 0 }, + /* 38 */ +@@ -2181,23 +2273,23 @@ static const struct dis386 dis386_twobyte[] = { + { PREFIX_TABLE (PREFIX_0F7E) }, + { PREFIX_TABLE (PREFIX_0F7F) }, + /* 80 */ +- { "joH", { Jv, BND, cond_jump_flag }, 0 }, +- { "jnoH", { Jv, BND, cond_jump_flag }, 0 }, +- { "jbH", { Jv, BND, cond_jump_flag }, 0 }, +- { "jaeH", { Jv, BND, cond_jump_flag }, 0 }, +- { "jeH", { Jv, BND, cond_jump_flag }, 0 }, +- { "jneH", { Jv, BND, cond_jump_flag }, 0 }, +- { "jbeH", { Jv, BND, cond_jump_flag }, 0 }, +- { "jaH", { Jv, BND, cond_jump_flag }, 0 }, ++ { "joH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jnoH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jbH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jaeH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jeH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jneH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jbeH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jaH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, + /* 88 */ +- { "jsH", { Jv, BND, cond_jump_flag }, 0 }, +- { "jnsH", { Jv, BND, cond_jump_flag }, 0 }, +- { "jpH", { Jv, BND, cond_jump_flag }, 0 }, +- { "jnpH", { Jv, BND, cond_jump_flag }, 0 }, +- { "jlH", { Jv, BND, cond_jump_flag }, 0 }, +- { "jgeH", { Jv, BND, cond_jump_flag }, 0 }, +- { "jleH", { Jv, BND, cond_jump_flag }, 0 }, +- { "jgH", { Jv, BND, cond_jump_flag }, 0 }, ++ { "jsH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jnsH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jpH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jnpH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jlH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jgeH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jleH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, ++ { "jgH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, + /* 90 */ + { "seto", { Eb }, 0 }, + { "setno", { Eb }, 0 }, +@@ -2390,22 +2482,30 @@ static const char intel_index16[][6] = { + + static const char att_names64[][8] = { + "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi", +- "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15" ++ "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", ++ "%r16", "%r17", "%r18", "%r19", "%r20", "%r21", "%r22", "%r23", ++ "%r24", "%r25", "%r26", "%r27", "%r28", "%r29", "%r30", "%r31", + }; + static const char att_names32[][8] = { + "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi", +- "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d" ++ "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d", ++ "%r16d", "%r17d", "%r18d", "%r19d", "%r20d", "%r21d", "%r22d", "%r23d", ++ "%r24d", "%r25d", "%r26d", "%r27d", "%r28d", "%r29d", "%r30d", "%r31d", + }; + static const char att_names16[][8] = { + "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di", +- "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w" ++ "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w", ++ "%r16w", "%r17w", "%r18w", "%r19w", "%r20w", "%r21w", "%r22w", "%r23w", ++ "%r24w", "%r25w", "%r26w", "%r27w", "%r28w", "%r29w", "%r30w", "%r31w", + }; + static const char att_names8[][8] = { + "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh", + }; + static const char att_names8rex[][8] = { + "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil", +- "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b" ++ "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b", ++ "%r16b", "%r17b", "%r18b", "%r19b", "%r20b", "%r21b", "%r22b", "%r23b", ++ "%r24b", "%r25b", "%r26b", "%r27b", "%r28b", "%r29b", "%r30b", "%r31b", + }; + static const char att_names_seg[][4] = { + "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?", +@@ -2520,25 +2620,25 @@ static const struct dis386 reg_table[][8] = { + }, + /* REG_C0 */ + { +- { "rolA", { Eb, Ib }, 0 }, +- { "rorA", { Eb, Ib }, 0 }, +- { "rclA", { Eb, Ib }, 0 }, +- { "rcrA", { Eb, Ib }, 0 }, +- { "shlA", { Eb, Ib }, 0 }, +- { "shrA", { Eb, Ib }, 0 }, +- { "shlA", { Eb, Ib }, 0 }, +- { "sarA", { Eb, Ib }, 0 }, ++ { "%NFrolA", { VexGb, Eb, Ib }, NO_PREFIX }, ++ { "%NFrorA", { VexGb, Eb, Ib }, NO_PREFIX }, ++ { "rclA", { VexGb, Eb, Ib }, NO_PREFIX }, ++ { "rcrA", { VexGb, Eb, Ib }, NO_PREFIX }, ++ { "%NFshlA", { VexGb, Eb, Ib }, NO_PREFIX }, ++ { "%NFshrA", { VexGb, Eb, Ib }, NO_PREFIX }, ++ { "%NFshlA", { VexGb, Eb, Ib }, NO_PREFIX }, ++ { "%NFsarA", { VexGb, Eb, Ib }, NO_PREFIX }, + }, + /* REG_C1 */ + { +- { "rolQ", { Ev, Ib }, 0 }, +- { "rorQ", { Ev, Ib }, 0 }, +- { "rclQ", { Ev, Ib }, 0 }, +- { "rcrQ", { Ev, Ib }, 0 }, +- { "shlQ", { Ev, Ib }, 0 }, +- { "shrQ", { Ev, Ib }, 0 }, +- { "shlQ", { Ev, Ib }, 0 }, +- { "sarQ", { Ev, Ib }, 0 }, ++ { "%NFrolQ", { VexGv, Ev, Ib }, PREFIX_NP_OR_DATA }, ++ { "%NFrorQ", { VexGv, Ev, Ib }, PREFIX_NP_OR_DATA }, ++ { "rclQ", { VexGv, Ev, Ib }, PREFIX_NP_OR_DATA }, ++ { "rcrQ", { VexGv, Ev, Ib }, PREFIX_NP_OR_DATA }, ++ { "%NFshlQ", { VexGv, Ev, Ib }, PREFIX_NP_OR_DATA }, ++ { "%NFshrQ", { VexGv, Ev, Ib }, PREFIX_NP_OR_DATA }, ++ { "%NFshlQ", { VexGv, Ev, Ib }, PREFIX_NP_OR_DATA }, ++ { "%NFsarQ", { VexGv, Ev, Ib }, PREFIX_NP_OR_DATA }, + }, + /* REG_C6 */ + { +@@ -2564,47 +2664,47 @@ static const struct dis386 reg_table[][8] = { + }, + /* REG_D0 */ + { +- { "rolA", { Eb, I1 }, 0 }, +- { "rorA", { Eb, I1 }, 0 }, +- { "rclA", { Eb, I1 }, 0 }, +- { "rcrA", { Eb, I1 }, 0 }, +- { "shlA", { Eb, I1 }, 0 }, +- { "shrA", { Eb, I1 }, 0 }, +- { "shlA", { Eb, I1 }, 0 }, +- { "sarA", { Eb, I1 }, 0 }, ++ { "%NFrolA", { VexGb, Eb, I1 }, NO_PREFIX }, ++ { "%NFrorA", { VexGb, Eb, I1 }, NO_PREFIX }, ++ { "rclA", { VexGb, Eb, I1 }, NO_PREFIX }, ++ { "rcrA", { VexGb, Eb, I1 }, NO_PREFIX }, ++ { "%NFshlA", { VexGb, Eb, I1 }, NO_PREFIX }, ++ { "%NFshrA", { VexGb, Eb, I1 }, NO_PREFIX }, ++ { "%NFshlA", { VexGb, Eb, I1 }, NO_PREFIX }, ++ { "%NFsarA", { VexGb, Eb, I1 }, NO_PREFIX }, + }, + /* REG_D1 */ + { +- { "rolQ", { Ev, I1 }, 0 }, +- { "rorQ", { Ev, I1 }, 0 }, +- { "rclQ", { Ev, I1 }, 0 }, +- { "rcrQ", { Ev, I1 }, 0 }, +- { "shlQ", { Ev, I1 }, 0 }, +- { "shrQ", { Ev, I1 }, 0 }, +- { "shlQ", { Ev, I1 }, 0 }, +- { "sarQ", { Ev, I1 }, 0 }, ++ { "%NFrolQ", { VexGv, Ev, I1 }, PREFIX_NP_OR_DATA }, ++ { "%NFrorQ", { VexGv, Ev, I1 }, PREFIX_NP_OR_DATA }, ++ { "rclQ", { VexGv, Ev, I1 }, PREFIX_NP_OR_DATA }, ++ { "rcrQ", { VexGv, Ev, I1 }, PREFIX_NP_OR_DATA }, ++ { "%NFshlQ", { VexGv, Ev, I1 }, PREFIX_NP_OR_DATA }, ++ { "%NFshrQ", { VexGv, Ev, I1 }, PREFIX_NP_OR_DATA }, ++ { "%NFshlQ", { VexGv, Ev, I1 }, PREFIX_NP_OR_DATA }, ++ { "%NFsarQ", { VexGv, Ev, I1 }, PREFIX_NP_OR_DATA }, + }, + /* REG_D2 */ + { +- { "rolA", { Eb, CL }, 0 }, +- { "rorA", { Eb, CL }, 0 }, +- { "rclA", { Eb, CL }, 0 }, +- { "rcrA", { Eb, CL }, 0 }, +- { "shlA", { Eb, CL }, 0 }, +- { "shrA", { Eb, CL }, 0 }, +- { "shlA", { Eb, CL }, 0 }, +- { "sarA", { Eb, CL }, 0 }, ++ { "%NFrolA", { VexGb, Eb, CL }, NO_PREFIX }, ++ { "%NFrorA", { VexGb, Eb, CL }, NO_PREFIX }, ++ { "rclA", { VexGb, Eb, CL }, NO_PREFIX }, ++ { "rcrA", { VexGb, Eb, CL }, NO_PREFIX }, ++ { "%NFshlA", { VexGb, Eb, CL }, NO_PREFIX }, ++ { "%NFshrA", { VexGb, Eb, CL }, NO_PREFIX }, ++ { "%NFshlA", { VexGb, Eb, CL }, NO_PREFIX }, ++ { "%NFsarA", { VexGb, Eb, CL }, NO_PREFIX }, + }, + /* REG_D3 */ + { +- { "rolQ", { Ev, CL }, 0 }, +- { "rorQ", { Ev, CL }, 0 }, +- { "rclQ", { Ev, CL }, 0 }, +- { "rcrQ", { Ev, CL }, 0 }, +- { "shlQ", { Ev, CL }, 0 }, +- { "shrQ", { Ev, CL }, 0 }, +- { "shlQ", { Ev, CL }, 0 }, +- { "sarQ", { Ev, CL }, 0 }, ++ { "%NFrolQ", { VexGv, Ev, CL }, PREFIX_NP_OR_DATA }, ++ { "%NFrorQ", { VexGv, Ev, CL }, PREFIX_NP_OR_DATA }, ++ { "rclQ", { VexGv, Ev, CL }, PREFIX_NP_OR_DATA }, ++ { "rcrQ", { VexGv, Ev, CL }, PREFIX_NP_OR_DATA }, ++ { "%NFshlQ", { VexGv, Ev, CL }, PREFIX_NP_OR_DATA }, ++ { "%NFshrQ", { VexGv, Ev, CL }, PREFIX_NP_OR_DATA }, ++ { "%NFshlQ", { VexGv, Ev, CL }, PREFIX_NP_OR_DATA }, ++ { "%NFsarQ", { VexGv, Ev, CL }, PREFIX_NP_OR_DATA }, + }, + /* REG_F6 */ + { +@@ -2794,9 +2894,9 @@ static const struct dis386 reg_table[][8] = { + { Bad_Opcode }, + { "cmpxchg8b", { { CMPXCHG8B_Fixup, q_mode } }, 0 }, + { Bad_Opcode }, +- { "xrstors", { FXSAVE }, 0 }, +- { "xsavec", { FXSAVE }, 0 }, +- { "xsaves", { FXSAVE }, 0 }, ++ { "xrstors", { FXSAVE }, PREFIX_REX2_ILLEGAL }, ++ { "xsavec", { FXSAVE }, PREFIX_REX2_ILLEGAL }, ++ { "xsaves", { FXSAVE }, PREFIX_REX2_ILLEGAL }, + { MOD_TABLE (MOD_0FC7_REG_6) }, + { MOD_TABLE (MOD_0FC7_REG_7) }, + }, +@@ -2842,12 +2942,16 @@ static const struct dis386 reg_table[][8] = { + { + { RM_TABLE (RM_VEX_0F3849_X86_64_L_0_W_0_M_1_P_0_R_0) }, + }, +- /* REG_VEX_0F38F3_L_0 */ ++ /* REG_VEX_0F38F3_L_0_P_0 */ + { + { Bad_Opcode }, +- { "blsrS", { VexGdq, Edq }, PREFIX_OPCODE }, +- { "blsmskS", { VexGdq, Edq }, PREFIX_OPCODE }, +- { "blsiS", { VexGdq, Edq }, PREFIX_OPCODE }, ++ { "%NFblsrS", { VexGdq, Edq }, 0 }, ++ { "%NFblsmskS", { VexGdq, Edq }, 0 }, ++ { "%NFblsiS", { VexGdq, Edq }, 0 }, ++ }, ++ /* REG_VEX_MAP7_F8_L_0_W_0 */ ++ { ++ { X86_64_TABLE (X86_64_VEX_MAP7_F8_L_0_W_0_R_0) }, + }, + /* REG_XOP_09_01_L_0 */ + { +@@ -3364,7 +3468,7 @@ static const struct dis386 prefix_table[][4] = { + + /* PREFIX_0FAE_REG_4_MOD_0 */ + { +- { "xsave", { FXSAVE }, 0 }, ++ { "xsave", { FXSAVE }, PREFIX_REX2_ILLEGAL }, + { "ptwrite{%LQ|}", { Edq }, 0 }, + }, + +@@ -3382,7 +3486,7 @@ static const struct dis386 prefix_table[][4] = { + + /* PREFIX_0FAE_REG_6_MOD_0 */ + { +- { "xsaveopt", { FXSAVE }, PREFIX_OPCODE }, ++ { "xsaveopt", { FXSAVE }, PREFIX_OPCODE | PREFIX_REX2_ILLEGAL }, + { "clrssbsy", { Mq }, PREFIX_OPCODE }, + { "clwb", { Mb }, PREFIX_OPCODE }, + }, +@@ -3550,18 +3654,27 @@ static const struct dis386 prefix_table[][4] = { + /* PREFIX_0F38F6 */ + { + { "wrssK", { M, Gdq }, 0 }, +- { "adoxS", { Gdq, Edq}, 0 }, +- { "adcxS", { Gdq, Edq}, 0 }, ++ { "adoxL", { VexGdq, Gdq, Edq }, 0 }, ++ { "adcxL", { VexGdq, Gdq, Edq }, 0 }, + { Bad_Opcode }, + }, + +- /* PREFIX_0F38F8 */ ++ /* PREFIX_0F38F8_M_0 */ + { + { Bad_Opcode }, + { "enqcmds", { Gva, M }, 0 }, + { "movdir64b", { Gva, M }, 0 }, + { "enqcmd", { Gva, M }, 0 }, + }, ++ ++ /* PREFIX_0F38F8_M_1_X86_64 */ ++ { ++ { Bad_Opcode }, ++ { "uwrmsr", { Gq, Rq }, 0 }, ++ { Bad_Opcode }, ++ { "urdmsr", { Rq, Gq }, 0 }, ++ }, ++ + /* PREFIX_0F38FA */ + { + { Bad_Opcode }, +@@ -3768,38 +3881,38 @@ static const struct dis386 prefix_table[][4] = { + + /* PREFIX_VEX_0F90_L_0_W_0 */ + { +- { "kmovw", { MaskG, MaskE }, 0 }, ++ { "%XEkmovw", { MaskG, MaskE }, 0 }, + { Bad_Opcode }, +- { "kmovb", { MaskG, MaskBDE }, 0 }, ++ { "%XEkmovb", { MaskG, MaskBDE }, 0 }, + }, + + /* PREFIX_VEX_0F90_L_0_W_1 */ + { +- { "kmovq", { MaskG, MaskE }, 0 }, ++ { "%XEkmovq", { MaskG, MaskE }, 0 }, + { Bad_Opcode }, +- { "kmovd", { MaskG, MaskBDE }, 0 }, ++ { "%XEkmovd", { MaskG, MaskBDE }, 0 }, + }, + + /* PREFIX_VEX_0F91_L_0_W_0 */ + { +- { "kmovw", { Mw, MaskG }, 0 }, ++ { "%XEkmovw", { Mw, MaskG }, 0 }, + { Bad_Opcode }, +- { "kmovb", { Mb, MaskG }, 0 }, ++ { "%XEkmovb", { Mb, MaskG }, 0 }, + }, + + /* PREFIX_VEX_0F91_L_0_W_1 */ + { +- { "kmovq", { Mq, MaskG }, 0 }, ++ { "%XEkmovq", { Mq, MaskG }, 0 }, + { Bad_Opcode }, +- { "kmovd", { Md, MaskG }, 0 }, ++ { "%XEkmovd", { Md, MaskG }, 0 }, + }, + + /* PREFIX_VEX_0F92_L_0_W_0 */ + { +- { "kmovw", { MaskG, Rdq }, 0 }, ++ { "%XEkmovw", { MaskG, Rdq }, 0 }, + { Bad_Opcode }, +- { "kmovb", { MaskG, Rdq }, 0 }, +- { "kmovd", { MaskG, Rdq }, 0 }, ++ { "%XEkmovb", { MaskG, Rdq }, 0 }, ++ { "%XEkmovd", { MaskG, Rdq }, 0 }, + }, + + /* PREFIX_VEX_0F92_L_0_W_1 */ +@@ -3807,15 +3920,15 @@ static const struct dis386 prefix_table[][4] = { + { Bad_Opcode }, + { Bad_Opcode }, + { Bad_Opcode }, +- { "kmovK", { MaskG, Rdq }, 0 }, ++ { "%XEkmovK", { MaskG, Rdq }, 0 }, + }, + + /* PREFIX_VEX_0F93_L_0_W_0 */ + { +- { "kmovw", { Gdq, MaskR }, 0 }, ++ { "%XEkmovw", { Gdq, MaskR }, 0 }, + { Bad_Opcode }, +- { "kmovb", { Gdq, MaskR }, 0 }, +- { "kmovd", { Gdq, MaskR }, 0 }, ++ { "%XEkmovb", { Gdq, MaskR }, 0 }, ++ { "%XEkmovd", { Gdq, MaskR }, 0 }, + }, + + /* PREFIX_VEX_0F93_L_0_W_1 */ +@@ -3823,7 +3936,7 @@ static const struct dis386 prefix_table[][4] = { + { Bad_Opcode }, + { Bad_Opcode }, + { Bad_Opcode }, +- { "kmovK", { Gdq, MaskR }, 0 }, ++ { "%XEkmovK", { Gdq, MaskR }, 0 }, + }, + + /* PREFIX_VEX_0F98_L_0_W_0 */ +@@ -3982,12 +4095,22 @@ static const struct dis386 prefix_table[][4] = { + { "vsm4rnds4", { XM, Vex, EXx }, 0 }, + }, + ++ /* PREFIX_VEX_0F38F2_L_0 */ ++ { ++ { "%NFandnS", { Gdq, VexGdq, Edq }, 0 }, ++ }, ++ ++ /* PREFIX_VEX_0F38F3_L_0 */ ++ { ++ { REG_TABLE (REG_VEX_0F38F3_L_0_P_0) }, ++ }, ++ + /* PREFIX_VEX_0F38F5_L_0 */ + { +- { "bzhiS", { Gdq, Edq, VexGdq }, 0 }, +- { "pextS", { Gdq, VexGdq, Edq }, 0 }, ++ { "%NFbzhiS", { Gdq, Edq, VexGdq }, 0 }, ++ { "%XEpextS", { Gdq, VexGdq, Edq }, 0 }, + { Bad_Opcode }, +- { "pdepS", { Gdq, VexGdq, Edq }, 0 }, ++ { "%XEpdepS", { Gdq, VexGdq, Edq }, 0 }, + }, + + /* PREFIX_VEX_0F38F6_L_0 */ +@@ -3995,15 +4118,15 @@ static const struct dis386 prefix_table[][4] = { + { Bad_Opcode }, + { Bad_Opcode }, + { Bad_Opcode }, +- { "mulxS", { Gdq, VexGdq, Edq }, 0 }, ++ { "%XEmulxS", { Gdq, VexGdq, Edq }, 0 }, + }, + + /* PREFIX_VEX_0F38F7_L_0 */ + { +- { "bextrS", { Gdq, Edq, VexGdq }, 0 }, +- { "sarxS", { Gdq, Edq, VexGdq }, 0 }, +- { "shlxS", { Gdq, Edq, VexGdq }, 0 }, +- { "shrxS", { Gdq, Edq, VexGdq }, 0 }, ++ { "%NFbextrS", { Gdq, Edq, VexGdq }, 0 }, ++ { "%XEsarxS", { Gdq, Edq, VexGdq }, 0 }, ++ { "%XEshlxS", { Gdq, Edq, VexGdq }, 0 }, ++ { "%XEshrxS", { Gdq, Edq, VexGdq }, 0 }, + }, + + /* PREFIX_VEX_0F3AF0_L_0 */ +@@ -4011,7 +4134,15 @@ static const struct dis386 prefix_table[][4] = { + { Bad_Opcode }, + { Bad_Opcode }, + { Bad_Opcode }, +- { "rorxS", { Gdq, Edq, Ib }, 0 }, ++ { "%XErorxS", { Gdq, Edq, Ib }, 0 }, ++ }, ++ ++ /* PREFIX_VEX_MAP7_F8_L_0_W_0_R_0_X86_64 */ ++ { ++ { Bad_Opcode }, ++ { "uwrmsr", { Skip_MODRM, Id, Rq }, 0 }, ++ { Bad_Opcode }, ++ { "urdmsr", { Rq, Id }, 0 }, + }, + + #include "i386-dis-evex-prefix.h" +@@ -4160,13 +4291,13 @@ static const struct dis386 x86_64_table[][2] = { + /* X86_64_E8 */ + { + { "callP", { Jv, BND }, 0 }, +- { "call@", { Jv, BND }, 0 } ++ { "call@", { Jv, BND }, PREFIX_REX2_ILLEGAL } + }, + + /* X86_64_E9 */ + { + { "jmpP", { Jv, BND }, 0 }, +- { "jmp@", { Jv, BND }, 0 } ++ { "jmp@", { Jv, BND }, PREFIX_REX2_ILLEGAL } + }, + + /* X86_64_EA */ +@@ -4322,6 +4453,12 @@ static const struct dis386 x86_64_table[][2] = { + { "movZ", { Td, Em }, 0 }, + }, + ++ { ++ /* X86_64_0F38F8_M_1 */ ++ { Bad_Opcode }, ++ { PREFIX_TABLE (PREFIX_0F38F8_M_1_X86_64) }, ++ }, ++ + /* X86_64_0FC7_REG_6_MOD_3_PREFIX_1 */ + { + { Bad_Opcode }, +@@ -4361,97 +4498,103 @@ static const struct dis386 x86_64_table[][2] = { + /* X86_64_VEX_0F38E0 */ + { + { Bad_Opcode }, +- { "cmpoxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, ++ { "%XEcmpoxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, + }, + + /* X86_64_VEX_0F38E1 */ + { + { Bad_Opcode }, +- { "cmpnoxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, ++ { "%XEcmpnoxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, + }, + + /* X86_64_VEX_0F38E2 */ + { + { Bad_Opcode }, +- { "cmpbxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, ++ { "%XEcmpbxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, + }, + + /* X86_64_VEX_0F38E3 */ + { + { Bad_Opcode }, +- { "cmpnbxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, ++ { "%XEcmpnbxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, + }, + + /* X86_64_VEX_0F38E4 */ + { + { Bad_Opcode }, +- { "cmpzxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, ++ { "%XEcmpzxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, + }, + + /* X86_64_VEX_0F38E5 */ + { + { Bad_Opcode }, +- { "cmpnzxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, ++ { "%XEcmpnzxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, + }, + + /* X86_64_VEX_0F38E6 */ + { + { Bad_Opcode }, +- { "cmpbexadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, ++ { "%XEcmpbexadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, + }, + + /* X86_64_VEX_0F38E7 */ + { + { Bad_Opcode }, +- { "cmpnbexadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, ++ { "%XEcmpnbexadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, + }, + + /* X86_64_VEX_0F38E8 */ + { + { Bad_Opcode }, +- { "cmpsxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, ++ { "%XEcmpsxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, + }, + + /* X86_64_VEX_0F38E9 */ + { + { Bad_Opcode }, +- { "cmpnsxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, ++ { "%XEcmpnsxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, + }, + + /* X86_64_VEX_0F38EA */ + { + { Bad_Opcode }, +- { "cmppxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, ++ { "%XEcmppxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, + }, + + /* X86_64_VEX_0F38EB */ + { + { Bad_Opcode }, +- { "cmpnpxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, ++ { "%XEcmpnpxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, + }, + + /* X86_64_VEX_0F38EC */ + { + { Bad_Opcode }, +- { "cmplxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, ++ { "%XEcmplxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, + }, + + /* X86_64_VEX_0F38ED */ + { + { Bad_Opcode }, +- { "cmpnlxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, ++ { "%XEcmpnlxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, + }, + + /* X86_64_VEX_0F38EE */ + { + { Bad_Opcode }, +- { "cmplexadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, ++ { "%XEcmplexadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, + }, + + /* X86_64_VEX_0F38EF */ + { + { Bad_Opcode }, +- { "cmpnlexadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, ++ { "%XEcmpnlexadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, ++ }, ++ ++ /* X86_64_VEX_MAP7_F8_L_0_W_0_R_0 */ ++ { ++ { Bad_Opcode }, ++ { PREFIX_TABLE (PREFIX_VEX_MAP7_F8_L_0_W_0_R_0_X86_64) }, + }, + }; + +@@ -4739,7 +4882,7 @@ static const struct dis386 three_byte_table[][256] = { + { PREFIX_TABLE (PREFIX_0F38F6) }, + { Bad_Opcode }, + /* f8 */ +- { PREFIX_TABLE (PREFIX_0F38F8) }, ++ { MOD_TABLE (MOD_0F38F8) }, + { "movdiri", { Mdq, Gdq }, PREFIX_OPCODE }, + { PREFIX_TABLE (PREFIX_0F38FA) }, + { PREFIX_TABLE (PREFIX_0F38FB) }, +@@ -7039,12 +7182,12 @@ static const struct dis386 vex_len_table[][2] = { + + /* VEX_LEN_0F38F2 */ + { +- { "andnS", { Gdq, VexGdq, Edq }, PREFIX_OPCODE }, ++ { PREFIX_TABLE (PREFIX_VEX_0F38F2_L_0) }, + }, + + /* VEX_LEN_0F38F3 */ + { +- { REG_TABLE(REG_VEX_0F38F3_L_0) }, ++ { PREFIX_TABLE (PREFIX_VEX_0F38F3_L_0) }, + }, + + /* VEX_LEN_0F38F5 */ +@@ -7205,6 +7348,11 @@ static const struct dis386 vex_len_table[][2] = { + { PREFIX_TABLE (PREFIX_VEX_0F3AF0_L_0) }, + }, + ++ /* VEX_LEN_MAP7_F8 */ ++ { ++ { VEX_W_TABLE (VEX_W_MAP7_F8_L_0) }, ++ }, ++ + /* VEX_LEN_XOP_08_85 */ + { + { VEX_W_TABLE (VEX_W_XOP_08_85_L_0) }, +@@ -7811,6 +7959,10 @@ static const struct dis386 vex_w_table[][2] = { + /* VEX_W_0F3ADE */ + { VEX_LEN_TABLE (VEX_LEN_0F3ADE_W_0) }, + }, ++ { ++ /* VEX_W_MAP7_F8_L_0 */ ++ { REG_TABLE (REG_VEX_MAP7_F8_L_0_W_0) }, ++ }, + /* VEX_W_XOP_08_85_L_0 */ + { + { "vpmacssww", { XM, Vex, EXx, XMVexI4 }, 0 }, +@@ -8125,7 +8277,7 @@ static const struct dis386 mod_table[][2] = { + }, + { + /* MOD_0FAE_REG_5 */ +- { "xrstor", { FXSAVE }, PREFIX_OPCODE }, ++ { "xrstor", { FXSAVE }, PREFIX_OPCODE | PREFIX_REX2_ILLEGAL }, + { PREFIX_TABLE (PREFIX_0FAE_REG_5_MOD_3) }, + }, + { +@@ -8153,6 +8305,11 @@ static const struct dis386 mod_table[][2] = { + { "aesenc128kl", { XM, M }, 0 }, + { "loadiwkey", { XM, EXx }, 0 }, + }, ++ /* MOD_0F38F8 */ ++ { ++ { PREFIX_TABLE (PREFIX_0F38F8_M_0) }, ++ { X86_64_TABLE (X86_64_0F38F8_M_1) }, ++ }, + { + /* MOD_VEX_0F3849_X86_64_L_0_W_0 */ + { PREFIX_TABLE (PREFIX_VEX_0F3849_X86_64_L_0_W_0_M_0) }, +@@ -8323,6 +8480,24 @@ ckprefix (instr_info *ins) + return ckp_okay; + ins->last_rex_prefix = i; + break; ++ /* REX2 must be the last prefix. */ ++ case REX2_OPCODE: ++ if (ins->address_mode == mode_64bit) ++ { ++ if (ins->last_rex_prefix >= 0) ++ return ckp_bogus; ++ ++ ins->codep++; ++ if (!fetch_code (ins->info, ins->codep + 1)) ++ return ckp_fetch_error; ++ ins->rex2_payload = *ins->codep; ++ ins->rex2 = ins->rex2_payload >> 4; ++ ins->rex = (ins->rex2_payload & 0xf) | REX_OPCODE; ++ ins->codep++; ++ ins->last_rex2_prefix = i; ++ ins->all_prefixes[i] = REX2_OPCODE; ++ } ++ return ckp_okay; + case 0xf3: + ins->prefixes |= PREFIX_REPZ; + ins->last_repz_prefix = i; +@@ -8490,6 +8665,8 @@ prefix_name (enum address_mode mode, uint8_t pref, int sizeflag) + return "bnd"; + case NOTRACK_PREFIX: + return "notrack"; ++ case REX2_OPCODE: ++ return "rex2"; + default: + return NULL; + } +@@ -8507,10 +8684,10 @@ with the -M switch (multiple options should be separated by commas):\n")); + fprintf (stream, _(" i8086 Disassemble in 16bit mode\n")); + fprintf (stream, _(" att Display instruction in AT&T syntax\n")); + fprintf (stream, _(" intel Display instruction in Intel syntax\n")); +- fprintf (stream, _(" att-mnemonic\n" +- " Display instruction in AT&T mnemonic\n")); +- fprintf (stream, _(" intel-mnemonic\n" +- " Display instruction in Intel mnemonic\n")); ++ fprintf (stream, _(" att-mnemonic (AT&T syntax only)\n" ++ " Display instruction with AT&T mnemonic\n")); ++ fprintf (stream, _(" intel-mnemonic (AT&T syntax only)\n" ++ " Display instruction with Intel mnemonic\n")); + fprintf (stream, _(" addr64 Assume 64bit address size\n")); + fprintf (stream, _(" addr32 Assume 32bit address size\n")); + fprintf (stream, _(" addr16 Assume 16bit address size\n")); +@@ -8527,6 +8704,8 @@ static const struct dis386 bad_opcode = { "(bad)", { XX }, 0 }; + /* Fetch error indicator. */ + static const struct dis386 err_opcode = { NULL, { XX }, 0 }; + ++static const struct dis386 map7_f8_opcode = { VEX_LEN_TABLE (VEX_LEN_MAP7_F8) }; ++ + /* Get a pointer to struct dis386 with a valid name. */ + + static const struct dis386 * +@@ -8553,6 +8732,7 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) + break; + + case USE_PREFIX_TABLE: ++ use_prefix_table: + if (ins->need_vex) + { + /* The prefix in VEX is implicit. */ +@@ -8622,12 +8802,40 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) + dp = &prefix_table[dp->op[1].bytemode][vindex]; + break; + ++ case USE_X86_64_EVEX_FROM_VEX_TABLE: ++ case USE_X86_64_EVEX_PFX_TABLE: ++ case USE_X86_64_EVEX_W_TABLE: ++ case USE_X86_64_EVEX_MEM_W_TABLE: ++ ins->evex_type = evex_from_vex; ++ /* EVEX from VEX instructions are 64-bit only and require that EVEX.z, ++ EVEX.L'L, EVEX.b, and the lower 2 bits of EVEX.aaa must be 0. */ ++ if (ins->address_mode != mode_64bit ++ || (ins->vex.mask_register_specifier & 0x3) != 0 ++ || ins->vex.ll != 0 ++ || ins->vex.zeroing != 0 ++ || ins->vex.b) ++ return &bad_opcode; ++ ++ if (dp->op[0].bytemode == USE_X86_64_EVEX_PFX_TABLE) ++ goto use_prefix_table; ++ if (dp->op[0].bytemode == USE_X86_64_EVEX_W_TABLE) ++ goto use_vex_w_table; ++ if (dp->op[0].bytemode == USE_X86_64_EVEX_MEM_W_TABLE) ++ { ++ if (ins->modrm.mod == 3) ++ return &bad_opcode; ++ goto use_vex_w_table; ++ } ++ ++ /* Fall through. */ + case USE_X86_64_TABLE: + vindex = ins->address_mode == mode_64bit ? 1 : 0; + dp = &x86_64_table[dp->op[1].bytemode][vindex]; + break; + + case USE_3BYTE_TABLE: ++ if (ins->last_rex2_prefix >= 0) ++ return &err_opcode; + if (!fetch_code (ins->info, ins->codep + 2)) + return &err_opcode; + vindex = *ins->codep++; +@@ -8769,6 +8977,9 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) + case 0x3: + vex_table_index = VEX_0F3A; + break; ++ case 0x7: ++ vex_table_index = VEX_MAP7; ++ break; + } + ins->codep++; + ins->vex.w = *ins->codep & 0x80; +@@ -8803,7 +9014,12 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) + ins->need_vex = 3; + ins->codep++; + vindex = *ins->codep++; +- dp = &vex_table[vex_table_index][vindex]; ++ if (vex_table_index != VEX_MAP7) ++ dp = &vex_table[vex_table_index][vindex]; ++ else if (vindex == 0xf8) ++ dp = &map7_f8_opcode; ++ else ++ dp = &bad_opcode; + ins->end_codep = ins->codep; + /* There is no MODRM byte for VEX0F 77. */ + if ((vex_table_index != VEX_0F || vindex != 0x77) +@@ -8846,6 +9062,7 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) + break; + + case USE_VEX_W_TABLE: ++ use_vex_w_table: + if (!ins->need_vex) + abort (); + +@@ -8859,9 +9076,13 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) + if (!fetch_code (ins->info, ins->codep + 4)) + return &err_opcode; + /* The first byte after 0x62. */ ++ if (*ins->codep & 0x8) ++ ins->rex2 |= REX_B; ++ if (!(*ins->codep & 0x10)) ++ ins->rex2 |= REX_R; ++ + ins->rex = ~(*ins->codep >> 5) & 0x7; +- ins->vex.r = *ins->codep & 0x10; +- switch ((*ins->codep & 0xf)) ++ switch (*ins->codep & 0x7) + { + default: + return &bad_opcode; +@@ -8874,12 +9095,21 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) + case 0x3: + vex_table_index = EVEX_0F3A; + break; ++ case 0x4: ++ vex_table_index = EVEX_MAP4; ++ ins->evex_type = evex_from_legacy; ++ if (ins->address_mode != mode_64bit) ++ return &bad_opcode; ++ break; + case 0x5: + vex_table_index = EVEX_MAP5; + break; + case 0x6: + vex_table_index = EVEX_MAP6; + break; ++ case 0x7: ++ vex_table_index = EVEX_MAP7; ++ break; + } + + /* The second byte after 0x62. */ +@@ -8890,9 +9120,8 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) + + ins->vex.register_specifier = (~(*ins->codep >> 3)) & 0xf; + +- /* The U bit. */ + if (!(*ins->codep & 0x4)) +- return &bad_opcode; ++ ins->rex2 |= REX_X; + + switch ((*ins->codep & 0x3)) + { +@@ -8919,24 +9148,54 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) + ins->vex.v = *ins->codep & 0x8; + ins->vex.mask_register_specifier = *ins->codep & 0x7; + ins->vex.zeroing = *ins->codep & 0x80; ++ /* Set the NF bit for EVEX-Promoted instructions, this bit will be cleared ++ when it's an evex_default one. */ ++ ins->vex.nf = *ins->codep & 0x4; + + if (ins->address_mode != mode_64bit) + { ++ /* Report bad for !evex_default and when two fixed values of evex ++ change.. */ ++ if (ins->evex_type != evex_default ++ || (ins->rex2 & (REX_B | REX_X))) ++ return &bad_opcode; + /* In 16/32-bit mode silently ignore following bits. */ + ins->rex &= ~REX_B; +- ins->vex.r = true; ++ ins->rex2 &= ~REX_R; + } + ++ /* EVEX from legacy instructions, when the EVEX.ND bit is 0, ++ all bits of EVEX.vvvv and EVEX.V' must be 1. */ ++ if (ins->evex_type == evex_from_legacy && !ins->vex.nd ++ && (ins->vex.register_specifier || !ins->vex.v)) ++ return &bad_opcode; ++ + ins->need_vex = 4; ++ ++ /* EVEX from legacy instructions require that EVEX.z, EVEX.L’L and the ++ lower 2 bits of EVEX.aaa must be 0. */ ++ if (ins->evex_type == evex_from_legacy ++ && ((ins->vex.mask_register_specifier & 0x3) != 0 ++ || ins->vex.ll != 0 ++ || ins->vex.zeroing != 0)) ++ return &bad_opcode; ++ + ins->codep++; + vindex = *ins->codep++; +- dp = &evex_table[vex_table_index][vindex]; ++ if (vex_table_index != EVEX_MAP7) ++ dp = &evex_table[vex_table_index][vindex]; ++ else if (vindex == 0xf8) ++ dp = &map7_f8_opcode; ++ else ++ dp = &bad_opcode; + ins->end_codep = ins->codep; + if (!fetch_modrm (ins)) + return &err_opcode; + +- /* Set vector length. */ +- if (ins->modrm.mod == 3 && ins->vex.b) ++ /* Set vector length. For EVEX-promoted instructions, evex.ll == 0b00, ++ which has the same encoding as vex.length == 128 and they can share ++ the same processing with vex.length in OP_VEX. */ ++ if (ins->modrm.mod == 3 && ins->vex.b && ins->evex_type != evex_from_legacy) + ins->vex.length = 512; + else + { +@@ -9128,6 +9387,7 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) + .last_data_prefix = -1, + .last_addr_prefix = -1, + .last_rex_prefix = -1, ++ .last_rex2_prefix = -1, + .last_seg_prefix = -1, + .fwait_prefix = -1, + }; +@@ -9167,9 +9427,10 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) + } + else if (startswith (p, "intel")) + { +- ins.intel_syntax = 1; + if (startswith (p + 5, "-mnemonic")) + ins.intel_mnemonic = true; ++ else ++ ins.intel_syntax = 1; + } + else if (startswith (p, "att")) + { +@@ -9292,24 +9553,25 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) + goto out; + } + +- if (*ins.codep == 0x0f) ++ /* REX2.M in rex2 prefix represents map0 or map1. */ ++ if (ins.last_rex2_prefix < 0 ? *ins.codep == 0x0f : (ins.rex2 & REX2_M)) + { +- unsigned char threebyte; ++ if (!ins.rex2) ++ { ++ ins.codep++; ++ if (!fetch_code (info, ins.codep + 1)) ++ goto fetch_error_out; ++ } + +- ins.codep++; +- if (!fetch_code (info, ins.codep + 1)) +- goto fetch_error_out; +- threebyte = *ins.codep; +- dp = &dis386_twobyte[threebyte]; +- ins.need_modrm = twobyte_has_modrm[threebyte]; +- ins.codep++; ++ dp = &dis386_twobyte[*ins.codep]; ++ ins.need_modrm = twobyte_has_modrm[*ins.codep]; + } + else + { + dp = &dis386[*ins.codep]; + ins.need_modrm = onebyte_has_modrm[*ins.codep]; +- ins.codep++; + } ++ ins.codep++; + + /* Save sizeflag for printing the extra ins.prefixes later before updating + it for mnemonic and operand processing. The prefix names depend +@@ -9335,6 +9597,22 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) + dp = get_valid_dis386 (dp, &ins); + if (dp == &err_opcode) + goto fetch_error_out; ++ ++ /* For APX instructions promoted from legacy maps 0/1, embedded prefix ++ is interpreted as the operand size override. */ ++ if (ins.evex_type == evex_from_legacy ++ && ins.vex.prefix == DATA_PREFIX_OPCODE) ++ sizeflag ^= DFLAG; ++ ++ if(ins.evex_type == evex_default) ++ ins.vex.nf = false; ++ else ++ /* For EVEX-promoted formats, we need to clear EVEX.NF (ccmp and ctest ++ are cleared separately.) in mask_register_specifier and keep the low ++ 2 bits of mask_register_specifier to report errors for invalid cases ++ . */ ++ ins.vex.mask_register_specifier &= 0x3; ++ + if (dp != NULL && putop (&ins, dp->name, sizeflag) == 0) + { + if (!get_sib (&ins, sizeflag)) +@@ -9387,10 +9665,13 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) + oappend (&ins, "/(bad)"); + } + } ++ /* vex.nf is cleared after being consumed. */ ++ if (ins.vex.nf) ++ oappend (&ins, "{bad-nf}"); + + /* Check whether rounding control was enabled for an insn not +- supporting it. */ +- if (ins.modrm.mod == 3 && ins.vex.b ++ supporting it, when evex.b is not treated as evex.nd. */ ++ if (ins.modrm.mod == 3 && ins.vex.b && ins.evex_type == evex_default + && !(ins.evex_used & EVEX_b_used)) + { + for (i = 0; i < MAX_OPERANDS; ++i) +@@ -9454,7 +9735,15 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) + goto out; + } + +- switch (dp->prefix_requirement) ++ if ((dp->prefix_requirement & PREFIX_REX2_ILLEGAL) ++ && ins.last_rex2_prefix >= 0 && (ins.rex2 & REX2_SPECIAL) == 0) ++ { ++ i386_dis_printf (info, dis_style_text, "(bad)"); ++ ret = ins.end_codep - priv.the_buffer; ++ goto out; ++ } ++ ++ switch (dp->prefix_requirement & ~PREFIX_REX2_ILLEGAL) + { + case PREFIX_DATA: + /* If only the data prefix is marked as mandatory, its absence renders +@@ -9506,6 +9795,25 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) + if (ins.last_repnz_prefix >= 0) + ins.all_prefixes[ins.last_repnz_prefix] = 0xf2; + break; ++ ++ case PREFIX_NP_OR_DATA: ++ if (ins.vex.prefix == REPE_PREFIX_OPCODE ++ || ins.vex.prefix == REPNE_PREFIX_OPCODE) ++ { ++ i386_dis_printf (info, dis_style_text, "(bad)"); ++ ret = ins.end_codep - priv.the_buffer; ++ goto out; ++ } ++ break; ++ ++ case NO_PREFIX: ++ if (ins.vex.prefix) ++ { ++ i386_dis_printf (info, dis_style_text, "(bad)"); ++ ret = ins.end_codep - priv.the_buffer; ++ goto out; ++ } ++ break; + } + + /* Check if the REX prefix is used. */ +@@ -9513,6 +9821,14 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) + && !ins.need_vex && ins.last_rex_prefix >= 0) + ins.all_prefixes[ins.last_rex_prefix] = 0; + ++ /* Check if the REX2 prefix is used. */ ++ if (ins.last_rex2_prefix >= 0 ++ && ((ins.rex2 & REX2_SPECIAL) ++ || (((ins.rex2 & 7) ^ (ins.rex2_used & 7)) == 0 ++ && (ins.rex ^ ins.rex_used) == 0 ++ && (ins.rex2 & 7)))) ++ ins.all_prefixes[ins.last_rex2_prefix] = 0; ++ + /* Check if the SEG prefix is used. */ + if ((ins.prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS | PREFIX_ES + | PREFIX_FS | PREFIX_GS)) != 0 +@@ -9541,7 +9857,11 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) + if (name == NULL) + abort (); + prefix_length += strlen (name) + 1; +- i386_dis_printf (info, dis_style_mnemonic, "%s ", name); ++ if (ins.all_prefixes[i] == REX2_OPCODE) ++ i386_dis_printf (info, dis_style_mnemonic, "{%s 0x%x} ", name, ++ (unsigned int) ins.rex2_payload); ++ else ++ i386_dis_printf (info, dis_style_mnemonic, "%s ", name); + } + + /* Check maximum code length. */ +@@ -10077,6 +10397,16 @@ putop (instr_info *ins, const char *in_template, int sizeflag) + int cond = 1; + unsigned int l = 0, len = 0; + char last[4]; ++ bool evex_printed = false; ++ ++ /* We don't want to add any prefix or suffix to (bad), so return early. */ ++ if (!strncmp (in_template, "(bad)", 5)) ++ { ++ oappend (ins, "(bad)"); ++ *ins->obufp = 0; ++ ins->mnemonicendp = ins->obufp; ++ return 0; ++ } + + for (p = in_template; *p; p++) + { +@@ -10090,6 +10420,12 @@ putop (instr_info *ins, const char *in_template, int sizeflag) + switch (*p) + { + default: ++ if (ins->evex_type == evex_from_legacy && !ins->vex.nd ++ && !(ins->rex2 & 7) && !evex_printed) ++ { ++ oappend (ins, "{evex} "); ++ evex_printed = true; ++ } + *ins->obufp++ = *p; + break; + case '%': +@@ -10120,7 +10456,7 @@ putop (instr_info *ins, const char *in_template, int sizeflag) + case 'A': + if (ins->intel_syntax) + break; +- if ((ins->need_modrm && ins->modrm.mod != 3) ++ if ((ins->need_modrm && ins->modrm.mod != 3 && !ins->vex.nd) + || (sizeflag & SUFFIX_ALWAYS)) + *ins->obufp++ = 'b'; + break; +@@ -10204,7 +10540,7 @@ putop (instr_info *ins, const char *in_template, int sizeflag) + { + case 'X': + if (!ins->vex.evex || ins->vex.b || ins->vex.ll >= 2 +- || !ins->vex.r ++ || (ins->rex2 & 7) + || (ins->modrm.mod == 3 && (ins->rex & REX_X)) + || !ins->vex.v || ins->vex.mask_register_specifier) + break; +@@ -10226,6 +10562,11 @@ putop (instr_info *ins, const char *in_template, int sizeflag) + *ins->obufp++ = '}'; + *ins->obufp++ = ' '; + break; ++ case 'M': ++ if (ins->modrm.mod != 3 && !(ins->rex2 & 7)) ++ oappend (ins, "{evex} "); ++ evex_printed = true; ++ break; + default: + abort (); + } +@@ -10245,16 +10586,39 @@ putop (instr_info *ins, const char *in_template, int sizeflag) + ins->used_prefixes |= (ins->prefixes & PREFIX_ADDR); + break; + case 'F': +- if (ins->intel_syntax) ++ if (l == 0) ++ { ++ if (ins->intel_syntax) ++ break; ++ if ((ins->prefixes & PREFIX_ADDR) || (sizeflag & SUFFIX_ALWAYS)) ++ { ++ if (sizeflag & AFLAG) ++ *ins->obufp++ = ins->address_mode == mode_64bit ? 'q' : 'l'; ++ else ++ *ins->obufp++ = ins->address_mode == mode_64bit ? 'l' : 'w'; ++ ins->used_prefixes |= (ins->prefixes & PREFIX_ADDR); ++ } ++ } ++ else if (l == 1 && last[0] == 'C') + break; +- if ((ins->prefixes & PREFIX_ADDR) || (sizeflag & SUFFIX_ALWAYS)) ++ else if (l == 1 && last[0] == 'N') + { +- if (sizeflag & AFLAG) +- *ins->obufp++ = ins->address_mode == mode_64bit ? 'q' : 'l'; +- else +- *ins->obufp++ = ins->address_mode == mode_64bit ? 'l' : 'w'; +- ins->used_prefixes |= (ins->prefixes & PREFIX_ADDR); ++ if (ins->vex.nf) ++ { ++ oappend (ins, "{nf} "); ++ /* This bit needs to be cleared after it is consumed. */ ++ ins->vex.nf = false; ++ evex_printed = true; ++ } ++ else if (ins->evex_type == evex_from_vex && !(ins->rex2 & 7) ++ && ins->vex.v) ++ { ++ oappend (ins, "{evex} "); ++ evex_printed = true; ++ } + } ++ else ++ abort (); + break; + case 'G': + if (ins->intel_syntax || (ins->obufp[-1] != 's' +@@ -10311,7 +10675,16 @@ putop (instr_info *ins, const char *in_template, int sizeflag) + *ins->obufp++ = 'd'; + break; + case 'L': +- abort (); ++ if (ins->intel_syntax) ++ break; ++ if (sizeflag & SUFFIX_ALWAYS) ++ { ++ if (ins->rex & REX_W) ++ *ins->obufp++ = 'q'; ++ else ++ *ins->obufp++ = 'l'; ++ } ++ break; + case 'M': + if (ins->intel_mnemonic != cond) + *ins->obufp++ = 'r'; +@@ -10346,6 +10719,19 @@ putop (instr_info *ins, const char *in_template, int sizeflag) + case 'P': + if (l == 0) + { ++ if (!cond && ins->last_rex2_prefix >= 0 && (ins->rex & REX_W)) ++ { ++ /* For pushp and popp, p is printed and do not print {rex2} ++ for them. */ ++ *ins->obufp++ = 'p'; ++ ins->rex2 |= REX2_SPECIAL; ++ break; ++ } ++ ++ /* For "!P" print nothing else in Intel syntax. */ ++ if (!cond && ins->intel_syntax) ++ break; ++ + if ((ins->modrm.mod == 3 || !cond) + && !(sizeflag & SUFFIX_ALWAYS)) + break; +@@ -10390,7 +10776,7 @@ putop (instr_info *ins, const char *in_template, int sizeflag) + if (ins->intel_syntax && !alt) + break; + USED_REX (REX_W); +- if ((ins->need_modrm && ins->modrm.mod != 3) ++ if ((ins->need_modrm && ins->modrm.mod != 3 && !ins->vex.nd) + || (sizeflag & SUFFIX_ALWAYS)) + { + if (ins->rex & REX_W) +@@ -10818,7 +11204,8 @@ print_displacement (instr_info *ins, bfd_signed_vma val) + static void + intel_operand_size (instr_info *ins, int bytemode, int sizeflag) + { +- if (ins->vex.b) ++ /* Check if there is a broadcast, when evex.b is not treated as evex.nd. */ ++ if (ins->vex.b && ins->evex_type == evex_default) + { + if (!ins->vex.no_broadcast) + switch (bytemode) +@@ -11088,6 +11475,8 @@ print_register (instr_info *ins, unsigned int reg, unsigned int rexmask, + USED_REX (rexmask); + if (ins->rex & rexmask) + reg += 8; ++ if (ins->rex2 & rexmask) ++ reg += 16; + + switch (bytemode) + { +@@ -11095,7 +11484,7 @@ print_register (instr_info *ins, unsigned int reg, unsigned int rexmask, + case b_swap_mode: + if (reg & 4) + USED_REX (0); +- if (ins->rex) ++ if (ins->rex || ins->rex2) + names = att_names8rex; + else + names = att_names8; +@@ -11300,6 +11689,7 @@ OP_Skip_MODRM (instr_info *ins, int bytemode ATTRIBUTE_UNUSED, + /* Skip mod/rm byte. */ + MODRM_CHECK; + ins->codep++; ++ ins->has_skipped_modrm = true; + return true; + } + +@@ -11310,7 +11700,10 @@ OP_E_memory (instr_info *ins, int bytemode, int sizeflag) + int riprel = 0; + int shift; + +- if (ins->vex.evex) ++ add += (ins->rex2 & REX_B) ? 16 : 0; ++ ++ /* Handles EVEX other than APX EVEX-promoted instructions. */ ++ if (ins->vex.evex && ins->evex_type == evex_default) + { + + /* Zeroing-masking is invalid for memory destinations. Set the flag +@@ -11454,6 +11847,13 @@ OP_E_memory (instr_info *ins, int bytemode, int sizeflag) + abort (); + if (ins->vex.evex) + { ++ /* S/G EVEX insns require EVEX.X4 not to be set. */ ++ if (ins->rex2 & REX_X) ++ { ++ oappend (ins, "(bad)"); ++ return true; ++ } ++ + if (!ins->vex.v) + vindex += 16; + check_gather = ins->obufp == ins->op_out[1]; +@@ -11483,6 +11883,9 @@ OP_E_memory (instr_info *ins, int bytemode, int sizeflag) + } + break; + default: ++ if (ins->rex2 & REX_X) ++ vindex += 16; ++ + if (vindex != 4) + indexes = ins->address_mode == mode_64bit && !addr32flag + ? att_names64 : att_names32; +@@ -11653,7 +12056,7 @@ OP_E_memory (instr_info *ins, int bytemode, int sizeflag) + + if (ins->rex & REX_R) + modrm_reg += 8; +- if (!ins->vex.r) ++ if (ins->rex2 & REX_R) + modrm_reg += 16; + if (vindex == modrm_reg) + oappend (ins, "/(bad)"); +@@ -11735,7 +12138,7 @@ OP_E_memory (instr_info *ins, int bytemode, int sizeflag) + print_operand_value (ins, disp & 0xffff, dis_style_text); + } + } +- if (ins->vex.b) ++ if (ins->vex.b && ins->evex_type == evex_default) + { + ins->evex_used |= EVEX_b_used; + +@@ -11818,7 +12221,11 @@ OP_E (instr_info *ins, int bytemode, int sizeflag) + { + /* Skip mod/rm byte. */ + MODRM_CHECK; +- ins->codep++; ++ if (!ins->has_skipped_modrm) ++ { ++ ins->codep++; ++ ins->has_skipped_modrm = true; ++ } + + if (ins->modrm.mod == 3) + { +@@ -11855,10 +12262,7 @@ OP_indirE (instr_info *ins, int bytemode, int sizeflag) + static bool + OP_G (instr_info *ins, int bytemode, int sizeflag) + { +- if (ins->vex.evex && !ins->vex.r && ins->address_mode == mode_64bit) +- oappend (ins, "(bad)"); +- else +- print_register (ins, ins->modrm.reg, REX_R, bytemode, sizeflag); ++ print_register (ins, ins->modrm.reg, REX_R, bytemode, sizeflag); + return true; + } + +@@ -11866,7 +12270,7 @@ static bool + OP_REG (instr_info *ins, int code, int sizeflag) + { + const char *s; +- int add; ++ int add = 0; + + switch (code) + { +@@ -11879,8 +12283,8 @@ OP_REG (instr_info *ins, int code, int sizeflag) + USED_REX (REX_B); + if (ins->rex & REX_B) + add = 8; +- else +- add = 0; ++ if (ins->rex2 & REX_B) ++ add += 16; + + switch (code) + { +@@ -12011,6 +12415,8 @@ OP_I (instr_info *ins, int bytemode, int sizeflag) + case const_1_mode: + if (ins->intel_syntax) + oappend (ins, "1"); ++ else ++ oappend (ins, "$1"); + return true; + default: + oappend (ins, INTERNAL_DISASSEMBLER_ERROR); +@@ -12487,7 +12893,7 @@ OP_XMM (instr_info *ins, int bytemode, int sizeflag ATTRIBUTE_UNUSED) + reg += 8; + if (ins->vex.evex) + { +- if (!ins->vex.r) ++ if (ins->rex2 & REX_R) + reg += 16; + } + +@@ -12592,6 +12998,8 @@ OP_EX (instr_info *ins, int bytemode, int sizeflag) + USED_REX (REX_B); + if (ins->rex & REX_B) + reg += 8; ++ if (ins->rex2 & REX_B) ++ reg += 16; + if (ins->vex.evex) + { + USED_REX (REX_X); +@@ -12623,9 +13031,10 @@ OP_R (instr_info *ins, int bytemode, int sizeflag) + { + case d_mode: + case dq_mode: ++ case q_mode: + case mask_mode: + return OP_E (ins, bytemode, sizeflag); +- case q_mode: ++ case q_mm_mode: + return OP_EM (ins, x_mode, sizeflag); + case xmm_mode: + if (ins->vex.length <= 128) +@@ -13095,6 +13504,13 @@ OP_VEX (instr_info *ins, int bytemode, int sizeflag ATTRIBUTE_UNUSED) + if (!ins->need_vex) + return true; + ++ if (ins->evex_type == evex_from_legacy) ++ { ++ ins->evex_used |= EVEX_b_used; ++ if (!ins->vex.nd) ++ return true; ++ } ++ + reg = ins->vex.register_specifier; + ins->vex.register_specifier = 0; + if (ins->address_mode != mode_64bit) +@@ -13186,12 +13602,22 @@ OP_VEX (instr_info *ins, int bytemode, int sizeflag ATTRIBUTE_UNUSED) + names = att_names_xmm; + ins->evex_used |= EVEX_len_used; + break; ++ case v_mode: + case dq_mode: + if (ins->rex & REX_W) + names = att_names64; ++ else if (bytemode == v_mode ++ && !(sizeflag & DFLAG)) ++ names = att_names16; + else + names = att_names32; + break; ++ case b_mode: ++ names = att_names8rex; ++ break; ++ case q_mode: ++ names = att_names64; ++ break; + case mask_bd_mode: + case mask_mode: + if (reg > 0x7) +@@ -13491,7 +13917,7 @@ DistinctDest_Fixup (instr_info *ins, int bytemode, int sizeflag) + /* Calc destination register number. */ + if (ins->rex & REX_R) + modrm_reg += 8; +- if (!ins->vex.r) ++ if (ins->rex2 & REX_R) + modrm_reg += 16; + + /* Calc src1 register number. */ +@@ -13576,3 +14002,58 @@ PREFETCHI_Fixup (instr_info *ins, int bytemode, int sizeflag) + + return OP_M (ins, bytemode, sizeflag); + } ++ ++static bool ++PUSH2_POP2_Fixup (instr_info *ins, int bytemode, int sizeflag) ++{ ++ if (ins->modrm.mod != 3) ++ return true; ++ ++ unsigned int vvvv_reg = ins->vex.register_specifier ++ | (!ins->vex.v << 4); ++ unsigned int rm_reg = ins->modrm.rm + (ins->rex & REX_B ? 8 : 0) ++ + (ins->rex2 & REX_B ? 16 : 0); ++ ++ /* Push2/Pop2 cannot use RSP and Pop2 cannot pop two same registers. */ ++ if (!ins->vex.nd || vvvv_reg == 0x4 || rm_reg == 0x4 ++ || (!ins->modrm.reg ++ && vvvv_reg == rm_reg)) ++ { ++ oappend (ins, "(bad)"); ++ return true; ++ } ++ ++ return OP_VEX (ins, bytemode, sizeflag); ++} ++ ++static bool ++JMPABS_Fixup (instr_info *ins, int bytemode, int sizeflag) ++{ ++ if (ins->last_rex2_prefix >= 0) ++ { ++ uint64_t op; ++ ++ if ((ins->prefixes & (PREFIX_OPCODE | PREFIX_ADDR | PREFIX_LOCK)) != 0x0 ++ || (ins->rex & REX_W) != 0x0) ++ { ++ oappend (ins, "(bad)"); ++ return true; ++ } ++ ++ if (bytemode == eAX_reg) ++ return true; ++ ++ if (!get64 (ins, &op)) ++ return false; ++ ++ ins->mnemonicendp = stpcpy (ins->obuf, "jmpabs"); ++ ins->rex2 |= REX2_SPECIAL; ++ oappend_immediate (ins, op); ++ ++ return true; ++ } ++ ++ if (bytemode == eAX_reg) ++ return OP_IMREG (ins, bytemode, sizeflag); ++ return OP_OFF64 (ins, bytemode, sizeflag); ++} +diff --git a/opcodes/i386-gen.c b/opcodes/i386-gen.c +--- a/opcodes/i386-gen.c ++++ b/opcodes/i386-gen.c +@@ -1,4 +1,4 @@ +-/* Copyright (C) 2007-2023 Free Software Foundation, Inc. ++/* Copyright (C) 2007-2024 Free Software Foundation, Inc. + + This file is part of the GNU opcodes library. + +@@ -63,7 +63,7 @@ static const dependency isa_dependencies[] = + { "NOCONA", + "GENERIC64|FISTTP|SSE3|MONITOR|CX16" }, + { "CORE", +- "P4|FISTTP|SSE3|MONITOR|CX16" }, ++ "P4|FISTTP|SSE3|MONITOR" }, + { "CORE2", + "NOCONA|SSSE3" }, + { "COREI7", +@@ -94,6 +94,8 @@ static const dependency isa_dependencies[] = + "ZNVER2|INVLPGB|TLBSYNC|VAES|VPCLMULQDQ|INVPCID|SNP|OSPKE" }, + { "ZNVER4", + "ZNVER3|AVX512F|AVX512DQ|AVX512IFMA|AVX512CD|AVX512BW|AVX512VL|AVX512_BF16|AVX512VBMI|AVX512_VBMI2|AVX512_VNNI|AVX512_BITALG|AVX512_VPOPCNTDQ|GFNI|RMPQUERY" }, ++ { "ZNVER5", ++ "ZNVER4|AVX_VNNI|MOVDIRI|MOVDIR64B|AVX512_VP2INTERSECT|PREFETCHI" }, + { "BTVER1", + "GENERIC64|FISTTP|MONITOR|CX16|LAHF_SAHF|Rdtscp|SSSE3|SSE4A|ABM|PRFCHW|Clflush|FISTTP|SVME" }, + { "BTVER2", +@@ -166,6 +168,10 @@ static const dependency isa_dependencies[] = + "AVX2" }, + { "AVX_NE_CONVERT", + "AVX2" }, ++ { "CX16", ++ "64" }, ++ { "LKGS", ++ "64" }, + { "FRED", + "LKGS" }, + { "AVX512F", +@@ -240,13 +246,13 @@ static const dependency isa_dependencies[] = + { "SNP", + "SEV_ES" }, + { "RMPQUERY", +- "SNP" }, ++ "SNP|64" }, + { "TSX", + "RTM|HLE" }, + { "TSXLDTRK", + "RTM" }, + { "AMX_TILE", +- "XSAVE" }, ++ "XSAVE|64" }, + { "AMX_INT8", + "AMX_TILE" }, + { "AMX_BF16", +@@ -259,6 +265,20 @@ static const dependency isa_dependencies[] = + "SSE2" }, + { "WIDEKL", + "KL" }, ++ { "PBNDKB", ++ "64" }, ++ { "UINTR", ++ "64" }, ++ { "PREFETCHI", ++ "64" }, ++ { "CMPCCXADD", ++ "64" }, ++ { "MSRLIST", ++ "64" }, ++ { "USER_MSR", ++ "64" }, ++ { "APX_F", ++ "XSAVE|64" }, + }; + + /* This array is populated as process_i386_initializers() walks cpu_flags[]. */ +@@ -380,6 +400,8 @@ static bitfield cpu_flags[] = + BITFIELD (RAO_INT), + BITFIELD (FRED), + BITFIELD (LKGS), ++ BITFIELD (USER_MSR), ++ BITFIELD (APX_F), + BITFIELD (MWAITX), + BITFIELD (CLZERO), + BITFIELD (OSPKE), +@@ -463,12 +485,12 @@ static bitfield opcode_modifiers[] = + BITFIELD (StaticRounding), + BITFIELD (SAE), + BITFIELD (Disp8MemShift), +- BITFIELD (Vsz), + BITFIELD (Optimize), +- BITFIELD (ATTMnemonic), +- BITFIELD (ATTSyntax), +- BITFIELD (IntelSyntax), ++ BITFIELD (Dialect), + BITFIELD (ISA64), ++ BITFIELD (NoEgpr), ++ BITFIELD (NF), ++ BITFIELD (Rex2), + }; + + #define CLASS(n) #n, n +@@ -587,7 +609,7 @@ static void + process_copyright (FILE *fp) + { + fprintf (fp, "/* This file is automatically generated by i386-gen. Do not edit! */\n\ +-/* Copyright (C) 2007-2023 Free Software Foundation, Inc.\n\ ++/* Copyright (C) 2007-2024 Free Software Foundation, Inc.\n\ + \n\ + This file is part of the GNU opcodes library.\n\ + \n\ +@@ -771,8 +793,10 @@ add_isa_dependencies (bitfield *flags, const char *f, int value, + } + free (deps); + +- /* ISA extensions with dependencies need CPU_ANY_*_FLAGS emitted. */ +- if (reverse < ARRAY_SIZE (isa_reverse_deps[0])) ++ /* ISA extensions with dependencies need CPU_ANY_*_FLAGS emitted, ++ unless the sole dependency is the "64-bit mode only" one. */ ++ if (reverse < ARRAY_SIZE (isa_reverse_deps[0]) ++ && strcmp (isa_dependencies[i].deps, "64")) + isa_reverse_deps[reverse][reverse] = 1; + + is_avx = orig_is_avx; +@@ -787,15 +811,16 @@ add_isa_dependencies (bitfield *flags, const char *f, int value, + + static void + output_cpu_flags (FILE *table, bitfield *flags, unsigned int size, +- int macro, const char *comma, const char *indent, int lineno) ++ int mode, const char *comma, const char *indent, int lineno) + { + unsigned int i = 0, j = 0; + +- memset (&active_cpu_flags, 0, sizeof(active_cpu_flags)); ++ if (mode < 0) ++ memset (&active_cpu_flags, 0, sizeof(active_cpu_flags)); + + fprintf (table, "%s{ { ", indent); + +- if (!macro) ++ if (mode <= 0) + { + for (j = ~0u; i < CpuAttrEnums; i++) + { +@@ -806,7 +831,8 @@ output_cpu_flags (FILE *table, bitfield *flags, unsigned int size, + fail ("%s: %d: invalid combination of CPU identifiers\n", + filename, lineno); + j = i; +- active_cpu_flags.array[i / 32] |= 1U << (i % 32); ++ if (mode) ++ active_cpu_flags.array[i / 32] |= 1U << (i % 32); + } + + /* Write 0 to indicate "no associated flag". */ +@@ -824,16 +850,25 @@ output_cpu_flags (FILE *table, bitfield *flags, unsigned int size, + if (((j + 1) % 20) == 0) + { + /* We need \\ for macro. */ +- if (macro) ++ if (mode > 0) + fprintf (table, " \\\n %s", indent); + else + fprintf (table, "\n %s", indent); + } +- if (flags[i].value) ++ if (mode < 0 && flags[i].value) + active_cpu_flags.array[i / 32] |= 1U << (i % 32); + } + +- fprintf (table, "%d } }%s\n", flags[i].value, comma); ++#if defined(CpuAttrUnused) != defined(CpuUnused) ++ if (mode <= 0) ++# ifdef CpuUnused ++ fprintf (table, " } }%s\n", comma); ++# else ++ fprintf (table, "%d, 0 } }%s\n", flags[i].value, comma); ++# endif ++ else ++#endif ++ fprintf (table, "%d } }%s\n", flags[i].value, comma); + } + + static void +@@ -846,15 +881,17 @@ process_i386_cpu_flag (FILE *table, char *flag, + unsigned int i; + int value = 1; + bool is_isa = false; +- bitfield flags [ARRAY_SIZE (cpu_flags)]; ++ bitfield all [ARRAY_SIZE (cpu_flags)]; ++ bitfield any [ARRAY_SIZE (cpu_flags)]; + + /* Copy the default cpu flags. */ +- memcpy (flags, cpu_flags, sizeof (cpu_flags)); ++ memcpy (all, cpu_flags, sizeof (cpu_flags)); ++ memcpy (any, cpu_flags, sizeof (cpu_flags)); + + if (flag == NULL) + { + for (i = 0; i < ARRAY_SIZE (isa_reverse_deps[0]); ++i) +- flags[i].value = isa_reverse_deps[reverse][i]; ++ any[i].value = isa_reverse_deps[reverse][i]; + goto output; + } + +@@ -876,9 +913,9 @@ process_i386_cpu_flag (FILE *table, char *flag, + + /* First we turn on everything except for cpuno64 and - if + present - the padding field. */ +- for (i = 0; i < ARRAY_SIZE (flags); i++) +- if (flags[i].position < CpuNo64) +- flags[i].value = 1; ++ for (i = 0; i < ARRAY_SIZE (any); i++) ++ if (any[i].position < CpuNo64) ++ any[i].value = 1; + + /* Turn off selective bits. */ + value = 0; +@@ -886,10 +923,10 @@ process_i386_cpu_flag (FILE *table, char *flag, + + if (name != NULL && value != 0) + { +- for (i = 0; i < ARRAY_SIZE (flags); i++) +- if (strcasecmp (flags[i].name, name) == 0) ++ for (i = 0; i < ARRAY_SIZE (any); i++) ++ if (strcasecmp (any[i].name, name) == 0) + { +- add_isa_dependencies (flags, name, 1, reverse); ++ add_isa_dependencies (any, name, 1, reverse); + is_isa = true; + break; + } +@@ -897,18 +934,40 @@ process_i386_cpu_flag (FILE *table, char *flag, + + if (strcmp (flag, "0")) + { ++ bool combined = false; ++ + if (is_isa) + return; + + /* Turn on/off selective bits. */ + last = flag + strlen (flag); ++ if (name == NULL && strchr (flag, '&')) ++ { ++ for (; next < last && *next != '('; ) ++ { ++ str = next_field (next, '&', &next, last); ++ set_bitfield (str, all, value, ARRAY_SIZE (all), lineno); ++ } ++ if (*next == '(') ++ { ++ if (*--last != ')') ++ fail ("%s: %d: missing `)' in bitfield: %s\n", filename, ++ lineno, flag); ++ ++next; ++ *last = '\0'; ++ } ++ combined = true; ++ } + for (; next && next < last; ) + { + str = next_field (next, '|', &next, last); +- if (name == NULL) +- set_bitfield (str, flags, value, ARRAY_SIZE (flags), lineno); +- else +- add_isa_dependencies (flags, str, value, reverse); ++ if (name) ++ add_isa_dependencies (any, str, value, reverse); ++ else if (combined || next < last) ++ set_bitfield (str, any, value, ARRAY_SIZE (any), lineno); ++ else /* Singular specifiers go into "all". */ ++ set_bitfield (str, all, value, ARRAY_SIZE (all), lineno); ++ combined = true; + } + } + +@@ -918,6 +977,15 @@ process_i386_cpu_flag (FILE *table, char *flag, + size_t len = strlen (name); + char *upper = xmalloc (len + 1); + ++ /* Cpu64 is special: It specifies a mode dependency, not an ISA one. Zap ++ the flag from ISA initializer macros (and from CPU_ANY_64_FLAGS ++ itself we only care about tracking its dependents. Also don't emit the ++ (otherwise all zero) CPU_64_FLAGS. */ ++ if (flag != NULL && reverse == Cpu64) ++ return; ++ if (is_isa || flag == NULL) ++ any[Cpu64].value = 0; ++ + for (i = 0; i < len; ++i) + { + /* Don't emit #define-s for auxiliary entries. */ +@@ -930,8 +998,18 @@ process_i386_cpu_flag (FILE *table, char *flag, + flag != NULL ? "": "ANY_", upper); + free (upper); + } ++ else ++ { ++ /* Synthesize "64-bit mode only" dependencies from the dependencies we ++ have accumulated. */ ++ for (i = 0; i < ARRAY_SIZE (isa_reverse_deps[0]); ++i) ++ if (all[i].value && isa_reverse_deps[Cpu64][i]) ++ all[Cpu64].value = 1; ++ ++ output_cpu_flags(table, all, ARRAY_SIZE (all), -1, comma, indent, lineno); ++ } + +- output_cpu_flags (table, flags, ARRAY_SIZE (flags), name != NULL, ++ output_cpu_flags (table, any, ARRAY_SIZE (any), name != NULL, + comma, indent, lineno); + } + +@@ -1008,10 +1086,44 @@ get_element_size (char **opnd, int lineno) + return elem_size; + } + ++static bool ++rex2_disallowed (const unsigned long long opcode, unsigned int length, ++ unsigned int space, const char *cpu_flags) ++{ ++ /* Some opcodes encode a ModR/M-like byte directly in the opcode. */ ++ unsigned int base_opcode = opcode >> (8 * length - 8); ++ ++ /* All opcodes listed map0 0x4*, 0x7*, 0xa*, 0xe* and map1 0x3*, 0x8* ++ are reserved under REX2 and triggers #UD when prefixed with REX2 */ ++ if (space == 0) ++ switch (base_opcode >> 4) ++ { ++ case 0x4: ++ case 0x7: ++ case 0xA: ++ case 0xE: ++ return true; ++ default: ++ return false; ++ } ++ ++ if (space == SPACE_0F) ++ switch (base_opcode >> 4) ++ { ++ case 0x3: ++ case 0x8: ++ return true; ++ default: ++ return false; ++ } ++ ++ return false; ++} ++ + static void + process_i386_opcode_modifier (FILE *table, char *mod, unsigned int space, + unsigned int prefix, const char *extension_opcode, +- char **opnd, int lineno) ++ char **opnd, int lineno, bool rex2_disallowed) + { + char *str, *next, *last; + bitfield modifiers [ARRAY_SIZE (opcode_modifiers)]; +@@ -1021,8 +1133,10 @@ process_i386_opcode_modifier (FILE *table, char *mod, unsigned int space, + SPACE(0F), + SPACE(0F38), + SPACE(0F3A), ++ SPACE(EVEXMAP4), + SPACE(EVEXMAP5), + SPACE(EVEXMAP6), ++ SPACE(VEXMAP7), + SPACE(XOP08), + SPACE(XOP09), + SPACE(XOP0A), +@@ -1127,6 +1241,22 @@ process_i386_opcode_modifier (FILE *table, char *mod, unsigned int space, + fprintf (table, " SPACE_%s, %s,\n", + spaces[space], extension_opcode ? extension_opcode : "None"); + ++ /* Rather than evaluating multiple conditions at runtime to determine ++ whether an EVEX encoding is being dealt with, derive that information ++ right here. A missing EVex attribute means "dynamic". */ ++ if (!modifiers[EVex].value ++ && (modifiers[Disp8MemShift].value ++ || modifiers[Broadcast].value ++ || modifiers[Masking].value ++ || modifiers[SAE].value)) ++ modifiers[EVex].value = EVEXDYN; ++ ++ /* Vex, legacy map2 and map3 and rex2_disallowed do not support EGPR. ++ For templates supporting both Vex and EVex allowing EGPR. */ ++ if ((modifiers[Vex].value || space > SPACE_0F || rex2_disallowed) ++ && !modifiers[EVex].value) ++ modifiers[NoEgpr].value = 1; ++ + output_opcode_modifier (table, modifiers, ARRAY_SIZE (modifiers)); + } + +@@ -1351,7 +1481,9 @@ output_i386_opcode (FILE *table, const char *name, char *str, + free (ident); + + process_i386_opcode_modifier (table, opcode_modifier, space, prefix, +- extension_opcode, operand_types, lineno); ++ extension_opcode, operand_types, lineno, ++ rex2_disallowed (opcode, length, space, ++ cpu_flags)); + + process_i386_cpu_flag (table, cpu_flags, NULL, ",", " ", lineno, CpuMax); + +@@ -1406,10 +1538,10 @@ opcode_hash_eq (const void *p, const void *q) + return strcmp (name, entry->name) == 0; + } + +-static void ++static bool + parse_template (char *buf, int lineno) + { +- char sep, *end, *name; ++ char sep, *end, *ptr; + struct template *tmpl; + struct template_instance *last_inst = NULL; + +@@ -1436,8 +1568,16 @@ parse_template (char *buf, int lineno) + prev->next = tmpl->next; + else + templates = tmpl->next; +- return; ++ return true; + } ++ ++ /* Check whether this actually is a reference to an existing template: ++ If there's '>' ahead of ':', it can't be a new template definition ++ (and template undefs have are dealt with above). */ ++ ptr = strchr (buf, '>'); ++ if (ptr != NULL && ptr < end) ++ return false; ++ + *end++ = '\0'; + remove_trailing_whitespaces (buf); + +@@ -1512,6 +1652,8 @@ parse_template (char *buf, int lineno) + + tmpl->next = templates; + templates = tmpl; ++ ++ return true; + } + + static unsigned int +@@ -1768,10 +1910,12 @@ process_i386_opcodes (FILE *table) + /* Ignore comments. */ + case '\0': + continue; +- break; ++ + case '<': +- parse_template (p, lineno); +- continue; ++ if (parse_template (p, lineno)) ++ continue; ++ break; ++ + default: + if (!marker) + continue; +@@ -1808,23 +1952,26 @@ process_i386_opcodes (FILE *table) + + /* Generate opcode sets array. */ + fprintf (table, "\n/* i386 opcode sets table. */\n\n"); +- fprintf (table, "static const insn_template *const i386_op_sets[] =\n{\n"); +- fprintf (table, " i386_optab,\n"); ++ fprintf (table, "typedef unsigned short i386_op_off_t;\n"); ++ fprintf (table, "static const i386_op_off_t i386_op_sets[] =\n{\n "); + + for (nr = j = 0; j < i; j++) + { + struct opcode_entry *next = &opcode_array[j]->entry; + ++ if ((j + 1) % 8 != 0) ++ fprintf (table, "%5u,", nr); ++ else ++ fprintf (table, "%5u,\n ", nr); + do + { + ++nr; + next = next->next; + } + while (next); +- fprintf (table, " i386_optab + %u,\n", nr); + } + +- fprintf (table, "};\n"); ++ fprintf (table, "%5u\n};\n", nr); + + /* Emit mnemonics and associated #define-s. */ + qsort (opcode_array, i, sizeof (*opcode_array), mnemonic_cmp); +@@ -2140,6 +2287,8 @@ main (int argc, char **argv) + qsort (operand_types, ARRAY_SIZE (operand_types), + sizeof (operand_types [0]), compare); + ++ process_i386_initializers (); ++ + table = fopen ("i386-tbl.h", "w"); + if (table == NULL) + fail ("can't create i386-tbl.h, errno = %s\n", +@@ -2149,7 +2298,6 @@ main (int argc, char **argv) + + process_i386_opcodes (table); + process_i386_registers (table); +- process_i386_initializers (); + + fclose (table); + +diff --git a/opcodes/i386-init.h b/opcodes/i386-init.h +--- a/opcodes/i386-init.h ++++ b/opcodes/i386-init.h +@@ -1,5 +1,5 @@ + /* This file is automatically generated by i386-gen. Do not edit! */ +-/* Copyright (C) 2007-2023 Free Software Foundation, Inc. ++/* Copyright (C) 2007-2024 Free Software Foundation, Inc. + + This file is part of the GNU opcodes library. + +@@ -26,7 +26,7 @@ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 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, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ +- 0, 1, 0, 0 } } ++ 0, 0, 1, 0, 0, 0 } } ++ ++#define CPU_ANY_APX_F_FLAGS \ ++ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ ++ 0, 0, 0, 1, 0, 0 } } + +diff --git a/opcodes/i386-opc.tbl b/opcodes/i386-opc.tbl +--- a/opcodes/i386-opc.tbl ++++ b/opcodes/i386-opc.tbl +@@ -1,5 +1,5 @@ + // i386 opcode table. +-// Copyright (C) 2007-2023 Free Software Foundation, Inc. ++// Copyright (C) 2007-2024 Free Software Foundation, Inc. + // + // This file is part of the GNU opcodes library. + // +@@ -85,6 +85,11 @@ + #define RegKludge OperandConstraint=REG_KLUDGE + #define SwapSources OperandConstraint=SWAP_SOURCES + #define Ugh OperandConstraint=UGH ++#define ImplicitStackOp OperandConstraint=IMPLICIT_STACK_OP ++ ++#define ATTSyntax Dialect=ATT_SYNTAX ++#define ATTMnemonic Dialect=ATT_MNEMONIC ++#define IntelSyntax Dialect=INTEL_SYNTAX + + #define IgnoreSize MnemonicSize=IGNORESIZE + #define DefaultSize MnemonicSize=DEFAULTSIZE +@@ -109,9 +114,12 @@ + #define SpaceXOP09 OpcodeSpace=SPACE_XOP09 + #define SpaceXOP0A OpcodeSpace=SPACE_XOP0A + ++#define EVexMap4 OpcodeSpace=SPACE_EVEXMAP4|EVex128 + #define EVexMap5 OpcodeSpace=SPACE_EVEXMAP5 + #define EVexMap6 OpcodeSpace=SPACE_EVEXMAP6 + ++#define VexMap7 OpcodeSpace=SPACE_VEXMAP7 ++ + #define VexW0 VexW=VEXW0 + #define VexW1 VexW=VEXW1 + #define VexWIG VexW=VEXWIG +@@ -133,12 +141,22 @@ + + #define Disp8ShiftVL Disp8MemShift=DISP8_SHIFT_VL + +-#define Vsz256 Vsz=VSZ256 +-#define Vsz512 Vsz=VSZ512 ++#define DstVVVV VexVVVV=VexVVVV_DST ++ ++// The template supports VEX format for cpuid and EVEX format for cpuid & APX_F. ++// While therefore we really mean cpuid|(cpuid&APX_F) here, this can't be ++// expressed in the generated templates. It's equivalent to just cpuid|APX_F ++// anyway, but that is not what we want (as APX_F alone isn't a sufficient ++// prereq for such insns). Instead the assembler will massage the CPU specifier ++// to the equivalent of either cpuid&(cpuid) or cpuid&(APX_F) (or something ++// substantially similar), depending on what encoding was requested. ++#define APX_F(cpuid) cpuid&(cpuid|APX_F) + + // The EVEX purpose of StaticRounding appears only together with SAE. Re-use + // the bit to mark commutative VEX encodings where swapping the source + // operands may allow to switch from 3-byte to 2-byte VEX encoding. ++// And re-use the bit to mark some NDD insns that swapping the source operands ++// may allow to switch from EVEX encoding to REX2 encoding. + #define C StaticRounding + + #define FP 387|287|8087 +@@ -156,6 +174,8 @@ + #define i287 287 + #define i387 387 + #define i687 687 ++// Note: Don't add this one to any templates already specifying a 64-bit-mode- ++// only ISA extension: i386-gen takes care of adding such dependencies. + #define x64 64 + + ### MARKER ### +@@ -164,11 +184,11 @@ + mov, 0xa0, No64, D|W|CheckOperandSize|No_sSuf|No_qSuf, { Disp16|Disp32|Unspecified|Byte|Word|Dword, Acc|Byte|Word|Dword } + mov, 0xa0, x64, D|W|CheckOperandSize|No_sSuf, { Disp64|Unspecified|Byte|Word|Dword|Qword, Acc|Byte|Word|Dword|Qword } + movabs, 0xa0, x64, D|W|CheckOperandSize|No_sSuf, { Disp64|Unspecified|Byte|Word|Dword|Qword, Acc|Byte|Word|Dword|Qword } +-mov, 0x88, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixRelease, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } ++mov, 0x88, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixRelease, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } + // In the 64bit mode the short form mov immediate is redefined to have + // 64bit value. + mov, 0xb0, 0, W|No_sSuf|No_qSuf, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32 } +-mov, 0xc6/0, 0, W|Modrm|No_sSuf|HLEPrefixRelease|Optimize, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } ++mov, 0xc6/0, 0, W|Modrm|No_sSuf|HLEPrefixRelease|Optimize, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } + mov, 0xb8, x64, No_bSuf|No_wSuf|No_lSuf|No_sSuf|Optimize, { Imm64, Reg64 } + movabs, 0xb8, x64, No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Imm64, Reg64 } + // The segment register moves accept WordReg so that a segment register +@@ -181,14 +201,18 @@ mov, 0x8c, 0, D|Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { SReg, Word|U + mov, 0x8e, 0, Modrm|IgnoreSize|No_bSuf|No_sSuf|NoRex64, { Reg16|Reg32|Reg64, SReg } + // Move to/from control debug registers. In the 16 or 32bit modes + // they are 32bit. In the 64bit mode they are 64bit. +-mov, 0xf20, i386|No64, D|RegMem|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Control, Reg32 } ++mov, 0xf20, i386&No64, D|RegMem|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Control, Reg32 } + mov, 0xf20, x64, D|RegMem|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Control, Reg64 } +-mov, 0xf21, i386|No64, D|RegMem|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Debug, Reg32 } ++mov, 0xf21, i386&No64, D|RegMem|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Debug, Reg32 } + mov, 0xf21, x64, D|RegMem|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Debug, Reg64 } +-mov, 0xf24, i386|No64, D|RegMem|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Test, Reg32 } ++mov, 0xf24, i386&No64, D|RegMem|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Test, Reg32 } + + // Move after swapping the bytes + movbe, 0x0f38f0, Movbe, D|Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++movbe, 0x60, Movbe&APX_F, D|Modrm|CheckOperandSize|No_bSuf|No_sSuf|EVexMap4, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++// This needs to live here for easy EVEX -> REX2 conversion, which wants to ++// restart with the next sequential template. ++bswap, 0xfc8, i486, No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64 } + + // Move with sign extend. + movsb, 0xfbe, i386, Modrm|No_bSuf|No_sSuf, { Reg8|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } +@@ -201,37 +225,39 @@ movsxd, 0x63, x64, Amd64|Modrm|NoSuf, { Reg32|Unspecified|BaseIndex, Reg16 } + movsxd, 0x63, x64, Intel64|Modrm|NoSuf, { Reg16|Unspecified|BaseIndex, Reg16 } + + // Move with zero extend. +-movzb, 0xfb6, i386, Modrm|No_bSuf|No_sSuf, { Reg8|Byte|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } +-movzw, 0xfb7, i386, Modrm|No_bSuf|No_wSuf|No_sSuf, { Reg16|Word|Unspecified|BaseIndex, Reg32|Reg64 } ++movzb, 0xfb6, i386, Modrm|No_bSuf|No_sSuf, { Reg8|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++movzw, 0xfb7, i386, Modrm|No_bSuf|No_wSuf|No_sSuf, { Reg16|Unspecified|BaseIndex, Reg32|Reg64 } + // The 64-bit variant is not particularly useful since the zero extend + // 32->64 is implicit, but we can encode them. + movzx, 0xfb6, i386, W|Modrm|No_lSuf|No_sSuf|No_qSuf, { Reg8|Reg16|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } + + // Push instructions. +-push, 0x50, No64, No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32 } +-push, 0xff/6, No64, Modrm|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32|Word|Dword|Unspecified|BaseIndex } +-push, 0x6a, i186|No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Imm8S } +-push, 0x68, i186|No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Imm16|Imm32 } +-push, 0x6, No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, { SReg } ++push, 0x50, No64, ImplicitStackOp|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32 } ++push, 0xff/6, No64, Modrm|ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32|Unspecified|BaseIndex } ++push, 0x6a, i186&No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Imm8S } ++push, 0x68, i186&No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Imm16|Imm32 } ++push, 0x6, No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { SReg } + // In 64bit mode, the operand size is implicitly 64bit. +-push, 0x50, x64, No_bSuf|No_lSuf|No_sSuf|NoRex64, { Reg16|Reg64 } +-push, 0xff/6, x64, Modrm|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Reg16|Reg64|Word|Qword|Unspecified|BaseIndex } +-push, 0x6a, x64, DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Imm8S } +-push, 0x68, x64, DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Imm16|Imm32S } +-push, 0xfa0, x64, DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { SReg } ++push, 0x50, x64, ImplicitStackOp|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Reg16|Reg64 } ++pushp, 0x50, APX_F, ImplicitStackOp|No_bSuf|No_wSuf|No_lSuf|No_sSuf|Rex2, { Reg64 } ++push, 0xff/6, x64, Modrm|ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Reg16|Reg64|Unspecified|BaseIndex } ++push, 0x6a, x64, ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Imm8S } ++push, 0x68, x64, ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Imm16|Imm32S } ++push, 0xfa0, x64, ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { SReg } + +-pusha, 0x60, i186|No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} ++pusha, 0x60, i186&No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} + + // Pop instructions. +-pop, 0x58, No64, No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32 } +-pop, 0x8f/0, No64, Modrm|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32|Word|Dword|Unspecified|BaseIndex } +-pop, 0x7, No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, { SReg } ++pop, 0x58, No64, ImplicitStackOp|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32 } ++pop, 0x8f/0, No64, Modrm|ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32|Unspecified|BaseIndex } ++pop, 0x7, No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { SReg } + // In 64bit mode, the operand size is implicitly 64bit. +-pop, 0x58, x64, No_bSuf|No_lSuf|No_sSuf|NoRex64, { Reg16|Reg64 } +-pop, 0x8f/0, x64, Modrm|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Reg16|Reg64|Word|Qword|Unspecified|BaseIndex } +-pop, 0xfa1, x64, DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { SReg } ++pop, 0x58, x64, ImplicitStackOp|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Reg16|Reg64 } ++popp, 0x58, APX_F, ImplicitStackOp|No_bSuf|No_wSuf|No_lSuf|No_sSuf|Rex2, { Reg64 } ++pop, 0x8f/0, x64, Modrm|ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Reg16|Reg64|Unspecified|BaseIndex } ++pop, 0xfa1, x64, ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { SReg } + +-popa, 0x61, i186|No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} ++popa, 0x61, i186&No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} + + // Exchange instructions. + // xchg commutes: we allow both operand orders. +@@ -273,70 +299,67 @@ lahf, 0x9f, No64, NoSuf, {} + lahf, 0x9f, LAHF_SAHF, NoSuf, {} + sahf, 0x9e, No64, NoSuf, {} + sahf, 0x9e, LAHF_SAHF, NoSuf, {} +-pushf, 0x9c, No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} +-pushf, 0x9c, x64, DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, {} +-popf, 0x9d, No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} +-popf, 0x9d, x64, DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, {} ++pushf, 0x9c, No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} ++pushf, 0x9c, x64, ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, {} ++popf, 0x9d, No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} ++popf, 0x9d, x64, ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, {} + stc, 0xf9, 0, NoSuf, {} + std, 0xfd, 0, NoSuf, {} + sti, 0xfb, 0, NoSuf, {} + + // Arithmetic. +-add, 0x0, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-add, 0x83/0, 0, Modrm|No_bSuf|No_sSuf|HLEPrefixLock, { Imm8S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } +-add, 0x4, 0, W|No_sSuf, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } +-add, 0x80/0, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +- +-inc, 0x40, No64, No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32 } +-inc, 0xfe/0, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } + +-sub, 0x28, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock|Optimize, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-sub, 0x83/5, 0, Modrm|No_bSuf|No_sSuf|HLEPrefixLock, { Imm8S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } +-sub, 0x2c, 0, W|No_sSuf, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } +-sub, 0x80/5, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } ++ ++ ++, << 3, APX_F, D||W|CheckOperandSize|Modrm|No_sSuf|DstVVVV|EVexMap4||, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg8|Reg16|Reg32|Reg64 } ++, << 3, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock||, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++, << 3, APX_F, D|W|CheckOperandSize|Modrm|No_sSuf|EVexMap4|, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++, 0x83/, APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|DstVVVV|EVexMap4|, { Imm8S, Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++, 0x83/, 0, Modrm|No_bSuf|No_sSuf|HLEPrefixLock|, { Imm8S, Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++, 0x83/, 0, Modrm|No_bSuf|No_sSuf|EVexMap4|, { Imm8S, Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++, 0x04 | ( << 3), 0, W|No_sSuf|, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } ++, 0x80/, APX_F, W|Modrm|CheckOperandSize|No_sSuf|DstVVVV|EVexMap4|, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg8|Reg16|Reg32|Reg64 } ++, 0x80/, 0, W|Modrm|No_sSuf|HLEPrefixLock|, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++, 0x80/, APX_F, W|Modrm|EVexMap4|No_sSuf|, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++ ++ + +-dec, 0x48, No64, No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32 } +-dec, 0xfe/1, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +- +-sbb, 0x18, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-sbb, 0x83/3, 0, Modrm|No_bSuf|No_sSuf|HLEPrefixLock, { Imm8S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } +-sbb, 0x1c, 0, W|No_sSuf, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } +-sbb, 0x80/3, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } ++// clr with 1 operand is really xor with 2 operands. ++clr, 0x30, 0, W|Modrm|No_sSuf|RegKludge|Optimize, { Reg8|Reg16|Reg32|Reg64 } ++clr, 0x30, APX_F, W|Modrm|No_sSuf|RegKludge|EVexMap4|NF, { Reg8|Reg16|Reg32|Reg64 } + +-cmp, 0x38, 0, D|W|CheckOperandSize|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-cmp, 0x83/7, 0, Modrm|No_bSuf|No_sSuf, { Imm8S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } ++cmp, 0x38, 0, D|W|CheckOperandSize|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++cmp, 0x83/7, 0, Modrm|No_bSuf|No_sSuf, { Imm8S, Reg16|Reg32|Reg64|Unspecified|BaseIndex } + cmp, 0x3c, 0, W|No_sSuf, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } +-cmp, 0x80/7, 0, W|Modrm|No_sSuf, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } ++cmp, 0x80/7, 0, W|Modrm|No_sSuf, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } + + test, 0x84, 0, D|W|C|CheckOperandSize|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } + test, 0xa8, 0, W|No_sSuf|Optimize, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } +-test, 0xf6/0, 0, W|Modrm|No_sSuf|Optimize, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } ++test, 0xf6/0, 0, W|Modrm|No_sSuf|Optimize, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } + +-and, 0x20, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock|Optimize, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-and, 0x83/4, 0, Modrm|No_bSuf|No_sSuf|HLEPrefixLock|Optimize, { Imm8S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } +-and, 0x24, 0, W|No_sSuf|Optimize, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } +-and, 0x80/4, 0, W|Modrm|No_sSuf|HLEPrefixLock|Optimize, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } ++ + +-or, 0x8, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock|Optimize, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-or, 0x83/1, 0, Modrm|No_bSuf|No_sSuf|HLEPrefixLock, { Imm8S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } +-or, 0xc, 0, W|No_sSuf, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } +-or, 0x80/1, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } ++, 0x40 | ( << 3), No64, No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32 } ++, 0xfe/, APX_F, W|Modrm|No_sSuf|CheckOperandSize|DstVVVV|EVexMap4|NF, {Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg8|Reg16|Reg32|Reg64} ++, 0xfe/, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++, 0xfe/, APX_F, W|Modrm|No_sSuf|EVexMap4|NF, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } + +-xor, 0x30, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock|Optimize, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-xor, 0x83/6, 0, Modrm|No_bSuf|No_sSuf|HLEPrefixLock, { Imm8S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } +-xor, 0x34, 0, W|No_sSuf, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } +-xor, 0x80/6, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } ++ + +-// clr with 1 operand is really xor with 2 operands. +-clr, 0x30, 0, W|Modrm|No_sSuf|RegKludge|Optimize, { Reg8|Reg16|Reg32|Reg64 } ++ + +-adc, 0x10, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-adc, 0x83/2, 0, Modrm|No_bSuf|No_sSuf|HLEPrefixLock, { Imm8S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } +-adc, 0x14, 0, W|No_sSuf, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } +-adc, 0x80/2, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } ++, 0xf6/, APX_F, W|Modrm|CheckOperandSize|No_sSuf|DstVVVV|EVexMap4|, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg8|Reg16|Reg32|Reg64 } ++, 0xf6/, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++, 0xf6/, APX_F, W|Modrm|No_sSuf|EVexMap4|, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } + +-neg, 0xf6/3, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-not, 0xf6/2, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } ++ + + aaa, 0x37, No64, NoSuf, {} + aas, 0x3f, No64, NoSuf, {} +@@ -367,81 +390,82 @@ cqto, 0x99, x64, Size64|NoSuf, {} + // expanding 64-bit multiplies, and *cannot* be selected to accomplish + // 'imul %ebx, %eax' (opcode 0x0faf must be used in this case) + // These multiplies can only be selected with single operand forms. +-mul, 0xf6/4, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-imul, 0xf6/5, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-imul, 0xfaf, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Unspecified|Word|Dword|Qword|BaseIndex, Reg16|Reg32|Reg64 } +-imul, 0x6b, i186, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Imm8S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } +-imul, 0x69, i186, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Imm16|Imm32|Imm32S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++ ++ ++, 0xf6/, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++, 0xf6/, APX_F, W|Modrm|No_sSuf|EVexMap4|NF, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++imul, 0xaf, APX_F, C|Modrm|CheckOperandSize|No_bSuf|No_sSuf|DstVVVV|EVexMap4|NF, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64 } ++imul, 0xfaf, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++imul, 0xaf, APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|EVexMap4|NF, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++imul, 0x6b, i186, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Imm8S, Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++imul, 0x6b, APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|EVexMap4|NF, { Imm8S, Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++imul, 0x69, i186, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Imm16|Imm32|Imm32S, Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++imul, 0x69, APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|EVexMap4|NF, { Imm16|Imm32|Imm32S, Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } + // imul with 2 operands mimics imul with 3 by putting the register in + // both i.rm.reg & i.rm.regmem fields. RegKludge enables this + // transformation. + imul, 0x6b, i186, Modrm|No_bSuf|No_sSuf|RegKludge, { Imm8S, Reg16|Reg32|Reg64 } ++imul, 0x6b, APX_F, Modrm|No_bSuf|No_sSuf|RegKludge|EVexMap4|NF, { Imm8S, Reg16|Reg32|Reg64 } + imul, 0x69, i186, Modrm|No_bSuf|No_sSuf|RegKludge, { Imm16|Imm32|Imm32S, Reg16|Reg32|Reg64 } +- +-div, 0xf6/6, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-div, 0xf6/6, 0, W|CheckOperandSize|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex, Acc|Byte|Word|Dword|Qword } +-idiv, 0xf6/7, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-idiv, 0xf6/7, 0, W|CheckOperandSize|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex, Acc|Byte|Word|Dword|Qword } +- +-rol, 0xd0/0, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-rol, 0xc0/0, i186, W|Modrm|No_sSuf, { Imm8|Imm8S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-rol, 0xd2/0, 0, W|Modrm|No_sSuf, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-rol, 0xd0/0, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +- +-ror, 0xd0/1, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-ror, 0xc0/1, i186, W|Modrm|No_sSuf, { Imm8|Imm8S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-ror, 0xd2/1, 0, W|Modrm|No_sSuf, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-ror, 0xd0/1, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +- +-rcl, 0xd0/2, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-rcl, 0xc0/2, i186, W|Modrm|No_sSuf, { Imm8, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-rcl, 0xd2/2, 0, W|Modrm|No_sSuf, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-rcl, 0xd0/2, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +- +-rcr, 0xd0/3, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-rcr, 0xc0/3, i186, W|Modrm|No_sSuf, { Imm8, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-rcr, 0xd2/3, 0, W|Modrm|No_sSuf, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-rcr, 0xd0/3, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +- +-sal, 0xd0/4, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-sal, 0xc0/4, i186, W|Modrm|No_sSuf, { Imm8, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-sal, 0xd2/4, 0, W|Modrm|No_sSuf, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-sal, 0xd0/4, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +- +-shl, 0xd0/4, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-shl, 0xc0/4, i186, W|Modrm|No_sSuf, { Imm8, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-shl, 0xd2/4, 0, W|Modrm|No_sSuf, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-shl, 0xd0/4, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +- +-shr, 0xd0/5, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-shr, 0xc0/5, i186, W|Modrm|No_sSuf, { Imm8, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-shr, 0xd2/5, 0, W|Modrm|No_sSuf, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-shr, 0xd0/5, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +- +-sar, 0xd0/7, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-sar, 0xc0/7, i186, W|Modrm|No_sSuf, { Imm8, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-sar, 0xd2/7, 0, W|Modrm|No_sSuf, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-sar, 0xd0/7, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +- +-shld, 0xfa4, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Imm8, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } +-shld, 0xfa5, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { ShiftCount, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } +-shld, 0xfa5, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } +- +-shrd, 0xfac, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Imm8, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } +-shrd, 0xfad, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { ShiftCount, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } +-shrd, 0xfad, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } ++imul, 0x69, APX_F, Modrm|No_bSuf|No_sSuf|RegKludge|EVexMap4|NF, { Imm16|Imm32|Imm32S, Reg16|Reg32|Reg64 } ++ ++ ++ ++ ++ ++
, 0xf6/, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++
, 0xf6/, APX_F, W|Modrm|No_sSuf|EVexMap4|NF, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++
, 0xf6/, 0, W|CheckOperandSize|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Acc|Byte|Word|Dword|Qword } ++
, 0xf6/, APX_F, W|CheckOperandSize|Modrm|No_sSuf|EVexMap4|NF, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Acc|Byte|Word|Dword|Qword } ++ ++
++ ++ ++ ++, 0xd0/, APX_F, W|Modrm|No_sSuf|CheckOperandSize|DstVVVV|EVexMap4|, { Imm1, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg8|Reg16|Reg32|Reg64 } ++, 0xd0/, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++, 0xd0/, APX_F, W|Modrm|No_sSuf|EVexMap4|, { Imm1, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++, 0xc0/, APX_F, W|Modrm|No_sSuf|CheckOperandSize|DstVVVV|EVexMap4|, { , Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg8|Reg16|Reg32|Reg64 } ++, 0xc0/, i186, W|Modrm|No_sSuf, { , Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++, 0xc0/, APX_F, W|Modrm|No_sSuf|EVexMap4|, { , Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++, 0xd2/, APX_F, W|Modrm|No_sSuf|CheckOperandSize|DstVVVV|EVexMap4|, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg8|Reg16|Reg32|Reg64 } ++, 0xd2/, 0, W|Modrm|No_sSuf, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++, 0xd2/, APX_F, W|Modrm|No_sSuf|EVexMap4|, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++, 0xd0/, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++ ++ ++ ++ ++ ++shd, 0x24 | , APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|DstVVVV|EVexMap4|NF, { Imm8, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++shd, 0x0fa4 | , i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Imm8, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++shd, 0x24 | , APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|EVexMap4|NF, { Imm8, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++shd, 0xa5 | , APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|DstVVVV|EVexMap4|NF, { ShiftCount, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++shd, 0x0fa5 | , i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { ShiftCount, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++shd, 0xa5 | , APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|EVexMap4|NF, { ShiftCount, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++shd, 0x0fa5 | , i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++ ++ + + // Control transfer instructions. +-call, 0xe8, No64, JumpDword|DefaultSize|No_bSuf|No_sSuf|No_qSuf|BNDPrefixOk, { Disp16|Disp32 } +-call, 0xe8, x64, Amd64|JumpDword|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64|BNDPrefixOk, { Disp16|Disp32 } +-call, 0xe8, x64, Intel64|JumpDword|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64|BNDPrefixOk, { Disp32 } +-call, 0xff/2, No64, Modrm|JumpAbsolute|DefaultSize|No_bSuf|No_sSuf|No_qSuf|BNDPrefixOk|NoTrackPrefixOk, { Reg16|Reg32|Unspecified|BaseIndex } +-call, 0xff/2, x64, Amd64|Modrm|JumpAbsolute|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64|BNDPrefixOk|NoTrackPrefixOk, { Reg16|Reg64|Unspecified|BaseIndex } +-call, 0xff/2, x64, Intel64|Modrm|JumpAbsolute|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64|BNDPrefixOk|NoTrackPrefixOk, { Reg64|Unspecified|BaseIndex } ++call, 0xe8, No64, JumpDword|ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf|BNDPrefixOk, { Disp16|Disp32 } ++call, 0xe8, x64, Amd64|JumpDword|ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64|BNDPrefixOk, { Disp16|Disp32 } ++call, 0xe8, x64, Intel64|JumpDword|ImplicitStackOp|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64|BNDPrefixOk, { Disp32 } ++call, 0xff/2, No64, Modrm|JumpAbsolute|ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf|BNDPrefixOk|NoTrackPrefixOk, { Reg16|Reg32|Unspecified|BaseIndex } ++call, 0xff/2, x64, Amd64|Modrm|JumpAbsolute|ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64|BNDPrefixOk|NoTrackPrefixOk, { Reg16|Reg64|Unspecified|BaseIndex } ++call, 0xff/2, x64, Intel64|Modrm|JumpAbsolute|ImplicitStackOp|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64|BNDPrefixOk|NoTrackPrefixOk, { Reg64|Unspecified|BaseIndex } + // Intel Syntax remaining call instances. +-call, 0x9a, No64, JumpInterSegment|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Imm16, Imm16|Imm32 } +-call, 0xff/3, 0, Amd64|Modrm|JumpAbsolute|DefaultSize|NoSuf, { Dword|Fword|BaseIndex } +-call, 0xff/3, x64, Intel64|Modrm|JumpAbsolute|NoSuf, { Dword|Fword|Tbyte|BaseIndex } ++call, 0x9a, No64, JumpInterSegment|ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Imm16, Imm16|Imm32 } ++call, 0xff/3, 0, Amd64|Modrm|JumpAbsolute|ImplicitStackOp|DefaultSize|NoSuf, { Dword|Fword|BaseIndex } ++call, 0xff/3, x64, Intel64|Modrm|JumpAbsolute|ImplicitStackOp|NoSuf, { Dword|Fword|Tbyte|BaseIndex } + lcall, 0x9a, No64, JumpInterSegment|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Imm16, Imm16|Imm32 } + lcall, 0xff/3, 0, Amd64|Modrm|JumpAbsolute|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Unspecified|BaseIndex } + lcall, 0xff/3, x64, Intel64|Modrm|JumpAbsolute|No_bSuf|No_sSuf, { Unspecified|BaseIndex } +@@ -459,22 +483,22 @@ ljmp, 0xea, No64, JumpInterSegment|No_bSuf|No_sSuf|No_qSuf, { Imm16, Imm16|Imm32 + ljmp, 0xff/5, 0, Amd64|Modrm|JumpAbsolute|No_bSuf|No_sSuf|No_qSuf, { Unspecified|BaseIndex } + ljmp, 0xff/5, x64, Intel64|Modrm|JumpAbsolute|No_bSuf|No_sSuf, { Unspecified|BaseIndex } + +-ret, 0xc3, No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf|RepPrefixOk|BNDPrefixOk, {} +-ret, 0xc2, No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf|RepPrefixOk|BNDPrefixOk, { Imm16 } +-ret, 0xc3, x64, Amd64|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64|RepPrefixOk|BNDPrefixOk, {} +-ret, 0xc2, x64, Amd64|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64|RepPrefixOk|BNDPrefixOk, { Imm16 } +-ret, 0xc3, x64, Intel64|Size64|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64|RepPrefixOk|BNDPrefixOk, {} +-ret, 0xc2, x64, Intel64|Size64|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64|RepPrefixOk|BNDPrefixOk, { Imm16 } ++ret, 0xc3, No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf|RepPrefixOk|BNDPrefixOk, {} ++ret, 0xc2, No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf|RepPrefixOk|BNDPrefixOk, { Imm16 } ++ret, 0xc3, x64, Amd64|ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64|RepPrefixOk|BNDPrefixOk, {} ++ret, 0xc2, x64, Amd64|ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64|RepPrefixOk|BNDPrefixOk, { Imm16 } ++ret, 0xc3, x64, Intel64|ImplicitStackOp|Size64|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64|RepPrefixOk|BNDPrefixOk, {} ++ret, 0xc2, x64, Intel64|ImplicitStackOp|Size64|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64|RepPrefixOk|BNDPrefixOk, { Imm16 } + lret, 0xcb, 0, DefaultSize|No_bSuf|No_sSuf, {} + lret, 0xca, 0, DefaultSize|No_bSuf|No_sSuf, { Imm16 } + // Intel Syntax. + retf, 0xcb, 0, DefaultSize|No_bSuf|No_sSuf, {} + retf, 0xca, 0, DefaultSize|No_bSuf|No_sSuf, { Imm16 } + +-enter, 0xc8, i186|No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Imm16, Imm8 } +-enter, 0xc8, x64, DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Imm16, Imm8 } +-leave, 0xc9, i186|No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} +-leave, 0xc9, x64, DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, {} ++enter, 0xc8, i186&No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Imm16, Imm8 } ++enter, 0xc8, x64, ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Imm16, Imm8 } ++leave, 0xc9, i186&No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} ++leave, 0xc9, x64, ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, {} + + +@@ -503,7 +527,7 @@ loopne, 0xe0, No64, JumpByte|No_bSuf|No_sSuf|No_qSuf, { Disp8 } + loopne, 0xe0, x64, JumpByte|No_bSuf|No_wSuf|No_sSuf|NoRex64, { Disp8 } + + // Set byte on flag instructions. +-set, 0xf9/0, i386, Modrm|No_wSuf|No_lSuf|No_sSuf|No_qSuf, { Reg8|Byte|Unspecified|BaseIndex } ++set, 0xf9/0, i386, Modrm|No_wSuf|No_lSuf|No_sSuf|No_qSuf, { Reg8|Unspecified|BaseIndex } + + // String manipulation. + cmps, 0xa6, 0, W|No_sSuf|RepPrefixOk, {} +@@ -540,58 +564,58 @@ xlat, 0xd7, 0, No_wSuf|No_lSuf|No_sSuf|No_qSuf, {} + xlat, 0xd7, 0, No_wSuf|No_lSuf|No_sSuf|No_qSuf|IsString, { Byte|Unspecified|BaseIndex } + + // Bit manipulation. +-bsf, 0xfbc, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|RepPrefixOk, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } +-bsr, 0xfbd, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|RepPrefixOk, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } +-bt, 0xfa3, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } ++bsf, 0xfbc, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|RepPrefixOk, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++bsr, 0xfbd, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|RepPrefixOk, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++bt, 0xfa3, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex } + bt, 0xfba/4, i386, Modrm|No_bSuf|No_sSuf|Optimize, { Imm8, Reg16|Reg32|Reg64|Unspecified|BaseIndex } +-btc, 0xfbb, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|HLEPrefixLock, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } ++btc, 0xfbb, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|HLEPrefixLock, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex } + btc, 0xfba/7, i386, Modrm|No_bSuf|No_sSuf|Optimize|HLEPrefixLock, { Imm8, Reg16|Reg32|Reg64|Unspecified|BaseIndex } +-btr, 0xfb3, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|HLEPrefixLock, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } ++btr, 0xfb3, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|HLEPrefixLock, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex } + btr, 0xfba/6, i386, Modrm|No_bSuf|No_sSuf|Optimize|HLEPrefixLock, { Imm8, Reg16|Reg32|Reg64|Unspecified|BaseIndex } +-bts, 0xfab, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|HLEPrefixLock, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } ++bts, 0xfab, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|HLEPrefixLock, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex } + bts, 0xfba/5, i386, Modrm|No_bSuf|No_sSuf|Optimize|HLEPrefixLock, { Imm8, Reg16|Reg32|Reg64|Unspecified|BaseIndex } + + // Interrupts & op. sys insns. + // See gas/config/tc-i386.c for conversion of 'int $3' into the special + // int 3 insn. +-int, 0xcd, 0, NoSuf, { Imm8 } +-int1, 0xf1, 0, NoSuf, {} +-int3, 0xcc, 0, NoSuf, {} +-into, 0xce, No64, NoSuf, {} +-iret, 0xcf, 0, DefaultSize|No_bSuf|No_sSuf, {} ++int, 0xcd, 0, ImplicitStackOp|NoSuf, { Imm8 } ++int1, 0xf1, 0, ImplicitStackOp|NoSuf, {} ++int3, 0xcc, 0, ImplicitStackOp|NoSuf, {} ++into, 0xce, No64, ImplicitStackOp|NoSuf, {} ++iret, 0xcf, 0, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf, {} + // i386sl, i486sl, later 486, and Pentium. + rsm, 0xfaa, i386, NoSuf, {} + +-bound, 0x62, i186|No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32, Dword|Qword|Unspecified|BaseIndex } ++bound, 0x62, i186&No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32, Dword|Qword|Unspecified|BaseIndex } + + hlt, 0xf4, 0, NoSuf, {} + +-nop, 0xf1f/0, Nop, Modrm|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } ++nop, 0xf1f/0, Nop, Modrm|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Unspecified|BaseIndex } + + // nop is actually "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in + // 32bit mode and "xchg %rax,%rax" in 64bit mode. + nop, 0x90, 0, NoSuf|RepPrefixOk, {} + + // Protection control. +-arpl, 0x63, i286|No64, RegMem|CheckOperandSize|IgnoreSize|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32, Reg16|Reg32 } +-arpl, 0x63, i286|No64, Modrm|IgnoreSize|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32, Word|Unspecified|BaseIndex } ++arpl, 0x63, i286&No64, RegMem|CheckOperandSize|IgnoreSize|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32, Reg16|Reg32 } ++arpl, 0x63, i286&No64, Modrm|IgnoreSize|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32, Word|Unspecified|BaseIndex } + lar, 0xf02, i286, Modrm|CheckOperandSize|No_bSuf|No_sSuf|NoRex64, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64 } + lar, 0xf02, i286, Modrm|No_bSuf|No_sSuf|NoRex64, { Reg16|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } +-lgdt, 0xf01/2, i286|No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } ++lgdt, 0xf01/2, i286&No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } + lgdt, 0xf01/2, x64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Tbyte|Unspecified|BaseIndex } +-lidt, 0xf01/3, i286|No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } ++lidt, 0xf01/3, i286&No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } + lidt, 0xf01/3, x64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Tbyte|Unspecified|BaseIndex } + lldt, 0xf00/2, i286, Modrm|IgnoreSize|No_bSuf|No_sSuf|NoRex64, { Reg16|Reg32|Reg64 } + lldt, 0xf00/2, i286, Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { Word|Unspecified|BaseIndex } +-lmsw, 0xf01/6, i286, Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { Reg16|Word|Unspecified|BaseIndex } ++lmsw, 0xf01/6, i286, Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { Reg16|Unspecified|BaseIndex } + lsl, 0xf03, i286, Modrm|CheckOperandSize|No_bSuf|No_sSuf|NoRex64, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64 } + lsl, 0xf03, i286, Modrm|No_bSuf|No_sSuf|NoRex64, { Reg16|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } + ltr, 0xf00/3, i286, Modrm|IgnoreSize|No_bSuf|No_sSuf|NoRex64, { Reg16|Reg32|Reg64 } + ltr, 0xf00/3, i286, Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { Word|Unspecified|BaseIndex } + +-sgdt, 0xf01/0, i286|No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } ++sgdt, 0xf01/0, i286&No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } + sgdt, 0xf01/0, x64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Tbyte|Unspecified|BaseIndex } +-sidt, 0xf01/1, i286|No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } ++sidt, 0xf01/1, i286&No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } + sidt, 0xf01/1, x64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Tbyte|Unspecified|BaseIndex } + sldt, 0xf00/0, i286, Modrm|No_bSuf|No_sSuf|NoRex64, { Reg16|Reg32|Reg64 } + sldt, 0xf00/0, i286, Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { Word|Unspecified|BaseIndex } +@@ -700,14 +724,13 @@ faddp, 0xdec1, FP, NoSuf, {} + fsub, 0xd8/4, FP, Modrm|NoSuf, { FloatReg } + fsub, 0xd8/4, FP, D|Modrm|NoSuf, { FloatReg, FloatAcc } + // alias for fsubp +-fsub, 0xdee1, FP, NoSuf|Ugh|ATTMnemonic|ATTSyntax, {} +-fsub, 0xdee9, FP, NoSuf|Ugh|ATTMnemonic, {} ++fsub, 0xdee1, FP, NoSuf|Ugh|ATTMnemonic, {} + fsub, 0xd8/4, FP, Modrm|FloatMF|No_bSuf|No_wSuf|No_qSuf, { Dword|Qword|Unspecified|BaseIndex } + fisub, 0xde/4, FP, Modrm|FloatMF|No_bSuf|No_wSuf|No_qSuf, { Word|Dword|Unspecified|BaseIndex } + +-fsubp, 0xde/4, FP, Modrm|NoSuf|ATTMnemonic|ATTSyntax, { FloatAcc, FloatReg } +-fsubp, 0xde/4, FP, Modrm|NoSuf|ATTMnemonic|ATTSyntax, { FloatReg } +-fsubp, 0xdee1, FP, NoSuf|ATTMnemonic|ATTSyntax, {} ++fsubp, 0xde/4, FP, Modrm|NoSuf|ATTMnemonic, { FloatAcc, FloatReg } ++fsubp, 0xde/4, FP, Modrm|NoSuf|ATTMnemonic, { FloatReg } ++fsubp, 0xdee1, FP, NoSuf|ATTMnemonic, {} + fsubp, 0xde/5, FP, Modrm|NoSuf, { FloatAcc, FloatReg } + fsubp, 0xde/5, FP, Modrm|NoSuf, { FloatReg } + fsubp, 0xdee9, FP, NoSuf, {} +@@ -716,14 +739,13 @@ fsubp, 0xdee9, FP, NoSuf, {} + fsubr, 0xd8/5, FP, Modrm|NoSuf, { FloatReg } + fsubr, 0xd8/5, FP, D|Modrm|NoSuf, { FloatReg, FloatAcc } + // alias for fsubrp +-fsubr, 0xdee9, FP, NoSuf|Ugh|ATTMnemonic|ATTSyntax, {} +-fsubr, 0xdee1, FP, NoSuf|Ugh|ATTMnemonic, {} ++fsubr, 0xdee9, FP, NoSuf|Ugh|ATTMnemonic, {} + fsubr, 0xd8/5, FP, Modrm|FloatMF|No_bSuf|No_wSuf|No_qSuf, { Dword|Qword|Unspecified|BaseIndex } + fisubr, 0xde/5, FP, Modrm|FloatMF|No_bSuf|No_wSuf|No_qSuf, { Word|Dword|Unspecified|BaseIndex } + +-fsubrp, 0xde/5, FP, Modrm|NoSuf|ATTMnemonic|ATTSyntax, { FloatAcc, FloatReg } +-fsubrp, 0xde/5, FP, Modrm|NoSuf|ATTMnemonic|ATTSyntax, { FloatReg } +-fsubrp, 0xdee9, FP, NoSuf|ATTMnemonic|ATTSyntax, {} ++fsubrp, 0xde/5, FP, Modrm|NoSuf|ATTMnemonic, { FloatAcc, FloatReg } ++fsubrp, 0xde/5, FP, Modrm|NoSuf|ATTMnemonic, { FloatReg } ++fsubrp, 0xdee9, FP, NoSuf|ATTMnemonic, {} + fsubrp, 0xde/4, FP, Modrm|NoSuf, { FloatAcc, FloatReg } + fsubrp, 0xde/4, FP, Modrm|NoSuf, { FloatReg } + fsubrp, 0xdee1, FP, NoSuf, {} +@@ -745,14 +767,13 @@ fmulp, 0xdec9, FP, NoSuf, {} + fdiv, 0xd8/6, FP, Modrm|NoSuf, { FloatReg } + fdiv, 0xd8/6, FP, D|Modrm|NoSuf, { FloatReg, FloatAcc } + // alias for fdivp +-fdiv, 0xdef1, FP, NoSuf|Ugh|ATTMnemonic|ATTSyntax, {} +-fdiv, 0xdef9, FP, NoSuf|Ugh|ATTMnemonic, {} ++fdiv, 0xdef1, FP, NoSuf|Ugh|ATTMnemonic, {} + fdiv, 0xd8/6, FP, Modrm|FloatMF|No_bSuf|No_wSuf|No_qSuf, { Dword|Qword|Unspecified|BaseIndex } + fidiv, 0xde/6, FP, Modrm|FloatMF|No_bSuf|No_wSuf|No_qSuf, { Word|Dword|Unspecified|BaseIndex } + +-fdivp, 0xde/6, FP, Modrm|NoSuf|ATTMnemonic|ATTSyntax, { FloatAcc, FloatReg } +-fdivp, 0xde/6, FP, Modrm|NoSuf|ATTMnemonic|ATTSyntax, { FloatReg } +-fdivp, 0xdef1, FP, NoSuf|ATTMnemonic|ATTSyntax, {} ++fdivp, 0xde/6, FP, Modrm|NoSuf|ATTMnemonic, { FloatAcc, FloatReg } ++fdivp, 0xde/6, FP, Modrm|NoSuf|ATTMnemonic, { FloatReg } ++fdivp, 0xdef1, FP, NoSuf|ATTMnemonic, {} + fdivp, 0xde/7, FP, Modrm|NoSuf, { FloatAcc, FloatReg } + fdivp, 0xde/7, FP, Modrm|NoSuf, { FloatReg } + fdivp, 0xdef9, FP, NoSuf, {} +@@ -761,14 +782,13 @@ fdivp, 0xdef9, FP, NoSuf, {} + fdivr, 0xd8/7, FP, Modrm|NoSuf, { FloatReg } + fdivr, 0xd8/7, FP, D|Modrm|NoSuf, { FloatReg, FloatAcc } + // alias for fdivrp +-fdivr, 0xdef9, FP, NoSuf|Ugh|ATTMnemonic|ATTSyntax, {} +-fdivr, 0xdef1, FP, NoSuf|Ugh|ATTMnemonic, {} ++fdivr, 0xdef9, FP, NoSuf|Ugh|ATTMnemonic, {} + fdivr, 0xd8/7, FP, Modrm|FloatMF|No_bSuf|No_wSuf|No_qSuf, { Dword|Qword|Unspecified|BaseIndex } + fidivr, 0xde/7, FP, Modrm|FloatMF|No_bSuf|No_wSuf|No_qSuf, { Word|Dword|Unspecified|BaseIndex } + +-fdivrp, 0xde/7, FP, Modrm|NoSuf|ATTMnemonic|ATTSyntax, { FloatAcc, FloatReg } +-fdivrp, 0xde/7, FP, Modrm|NoSuf|ATTMnemonic|ATTSyntax, { FloatReg } +-fdivrp, 0xdef9, FP, NoSuf|ATTMnemonic|ATTSyntax, {} ++fdivrp, 0xde/7, FP, Modrm|NoSuf|ATTMnemonic, { FloatAcc, FloatReg } ++fdivrp, 0xde/7, FP, Modrm|NoSuf|ATTMnemonic, { FloatReg } ++fdivrp, 0xdef9, FP, NoSuf|ATTMnemonic, {} + fdivrp, 0xde/6, FP, Modrm|NoSuf, { FloatAcc, FloatReg } + fdivrp, 0xde/6, FP, Modrm|NoSuf, { FloatReg } + fdivrp, 0xdef1, FP, NoSuf, {} +@@ -831,14 +851,14 @@ fwait, 0x9b, FP, NoSuf, {} + + // Opcode prefixes; we allow them as separate insns too. + +-addr16, 0x67, i386|No64, Size16|IgnoreSize|NoSuf|IsPrefix, {} ++addr16, 0x67, i386&No64, Size16|IgnoreSize|NoSuf|IsPrefix, {} + addr32, 0x67, i386, Size32|IgnoreSize|NoSuf|IsPrefix, {} +-aword, 0x67, i386|No64, Size16|IgnoreSize|NoSuf|IsPrefix, {} ++aword, 0x67, i386&No64, Size16|IgnoreSize|NoSuf|IsPrefix, {} + adword, 0x67, i386, Size32|IgnoreSize|NoSuf|IsPrefix, {} + data16, 0x66, i386, Size16|IgnoreSize|NoSuf|IsPrefix, {} +-data32, 0x66, i386|No64, Size32|IgnoreSize|NoSuf|IsPrefix, {} ++data32, 0x66, i386&No64, Size32|IgnoreSize|NoSuf|IsPrefix, {} + word, 0x66, i386, Size16|IgnoreSize|NoSuf|IsPrefix, {} +-dword, 0x66, i386|No64, Size32|IgnoreSize|NoSuf|IsPrefix, {} ++dword, 0x66, i386&No64, Size32|IgnoreSize|NoSuf|IsPrefix, {} + lock, 0xf0, 0, NoSuf|IsPrefix, {} + wait, 0x9b, 0, NoSuf|IsPrefix, {} + cs, 0x2e, 0, NoSuf|IsPrefix, {} +@@ -888,18 +908,18 @@ rex.wrxb, 0x4f, x64, NoSuf|IsPrefix, {} + + // Pseudo prefixes (base_opcode == PSEUDO_PREFIX) + +- ++ rex:REX:x64, rex2:REX2:APX_F, nf:NF:APX_F, + ++ nooptimize:NoOptimize:0> + + {}, PSEUDO_PREFIX/Prefix_, , NoSuf|IsPrefix, {} + +-// 486 extensions. ++// 486 extensions (BSWAP moved elsewhere). + +-bswap, 0xfc8, i486, No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64 } +-xadd, 0xfc0, i486, W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } +-cmpxchg, 0xfb0, i486, W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } ++xadd, 0xfc0, i486, W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } ++cmpxchg, 0xfb0, i486, W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } + invd, 0xf08, i486, NoSuf, {} + wbinvd, 0xf09, i486, NoSuf, {} + invlpg, 0xf01/7, i486, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex } +@@ -915,13 +935,13 @@ cmpxchg8b, 0xfc7/1, i586, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64|HLEPrefi + + // Pentium II/Pentium Pro extensions. + sysenter, 0xf34, x64, Intel64Only|NoSuf, {} +-sysenter, 0xf34, i686|No64, NoSuf, {} ++sysenter, 0xf34, i686&No64, NoSuf, {} + sysexit, 0xf35, x64, Intel64Only|No_bSuf|No_wSuf|No_sSuf, {} +-sysexit, 0xf35, i686|No64, NoSuf, {} ++sysexit, 0xf35, i686&No64, NoSuf, {} + fxsave, 0xfae/0, FXSR, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Unspecified|BaseIndex } +-fxsave64, 0xfae/0, FXSR|x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } ++fxsave64, 0xfae/0, FXSR&x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } + fxrstor, 0xfae/1, FXSR, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Unspecified|BaseIndex } +-fxrstor64, 0xfae/1, FXSR|x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } ++fxrstor64, 0xfae/1, FXSR&x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } + rdpmc, 0xf33, i686, NoSuf, {} + // official undefined instr. + ud2, 0xf0b, i186, NoSuf, {} +@@ -934,7 +954,8 @@ ud2b, 0xfb9, i186, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|U + // 3rd official undefined instr (older CPUs don't take a ModR/M byte) + ud0, 0xfff, i186, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } + +-cmov, 0xf4, CMOV, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++cmov, 0x4, CMOV&APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|DstVVVV|EVexMap4, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64 } ++cmov, 0xf4, CMOV, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } + + fcmovb, 0xda/0, i687, Modrm|NoSuf, { FloatReg, FloatAcc } + fcmovnae, 0xda/0, i687, Modrm|NoSuf, { FloatReg, FloatAcc } +@@ -992,9 +1013,9 @@ pause, 0xf390, i186, NoSuf, {} + b:0:VexW0:Byte:AVX512DQ:66:AVX512VBMI, + + w:1:VexW1:Word:AVX512F::AVX512BW> + +- ++ + + emms, 0xf77, MMX, NoSuf, {} + // These really shouldn't allow for Reg64 (movq is the right mnemonic for +@@ -1002,21 +1023,21 @@ emms, 0xf77, MMX, NoSuf, {} + // spec). AMD's spec, having been in existence for much longer, failed to + // recognize that and specified movd for 32- and 64-bit operations. + movd, 0x666e, AVX, D|Modrm|Vex128|Space0F|VexW0|NoSuf|SSE2AVX, { Reg32|Unspecified|BaseIndex, RegXMM } +-movd, 0x666e, AVX|x64, D|Modrm|Vex=1|Space0F|VexW1|NoSuf|Size64|SSE2AVX, { Reg64|BaseIndex, RegXMM } ++movd, 0x666e, AVX&x64, D|Modrm|Vex=1|Space0F|VexW1|NoSuf|Size64|SSE2AVX, { Reg64|BaseIndex, RegXMM } + movd, 0x660f6e, SSE2, D|Modrm|IgnoreSize|NoSuf, { Reg32|Unspecified|BaseIndex, RegXMM } +-movd, 0x660f6e, SSE2|x64, D|Modrm|NoSuf|Size64, { Reg64|BaseIndex, RegXMM } ++movd, 0x660f6e, SSE2&x64, D|Modrm|NoSuf|Size64, { Reg64|BaseIndex, RegXMM } + // The MMX templates have to remain after at least the SSE2AVX ones. + movd, 0xf6e, MMX, D|Modrm|IgnoreSize|NoSuf, { Reg32|Unspecified|BaseIndex, RegMMX } +-movd, 0xf6e, MMX|x64, D|Modrm|NoSuf|Size64, { Reg64|BaseIndex, RegMMX } +-movq, 0xf37e, AVX, Load|Modrm|Vex=1|Space0F|VexWIG|NoSuf|SSE2AVX, { Qword|Unspecified|BaseIndex|RegXMM, RegXMM } +-movq, 0x66d6, AVX, Modrm|Vex=1|Space0F|VexWIG|NoSuf|SSE2AVX, { RegXMM, Qword|Unspecified|BaseIndex|RegXMM } +-movq, 0x666e, AVX|x64, D|Modrm|Vex=1|Space0F|VexW1|NoSuf|Size64|SSE2AVX, { Reg64|Unspecified|BaseIndex, RegXMM } ++movd, 0xf6e, MMX&x64, D|Modrm|NoSuf|Size64, { Reg64|BaseIndex, RegMMX } ++movq, 0xf37e, AVX, Load|Modrm|Vex128|Space0F|VexW0|NoSuf|SSE2AVX, { Qword|Unspecified|BaseIndex|RegXMM, RegXMM } ++movq, 0x66d6, AVX, Modrm|Vex128|Space0F|VexW0|NoSuf|SSE2AVX, { RegXMM, Qword|Unspecified|BaseIndex|RegXMM } ++movq, 0x666e, AVX&x64, D|Modrm|Vex=1|Space0F|VexW1|NoSuf|Size64|SSE2AVX, { Reg64|Unspecified|BaseIndex, RegXMM } + movq, 0xf30f7e, SSE2, Load|Modrm|NoSuf, { Unspecified|Qword|BaseIndex|RegXMM, RegXMM } + movq, 0x660fd6, SSE2, Modrm|NoSuf, { RegXMM, Unspecified|Qword|BaseIndex|RegXMM } +-movq, 0x660f6e, SSE2|x64, D|Modrm|NoSuf|Size64, { Reg64|Unspecified|BaseIndex, RegXMM } ++movq, 0x660f6e, SSE2&x64, D|Modrm|NoSuf|Size64, { Reg64|Unspecified|BaseIndex, RegXMM } + // The MMX templates have to remain after at least the SSE2AVX ones. + movq, 0xf6f, MMX, D|Modrm|NoSuf, { Unspecified|Qword|BaseIndex|RegMMX, RegMMX } +-movq, 0xf6e, MMX|x64, D|Modrm|NoSuf|Size64, { Reg64|Unspecified|BaseIndex, RegMMX } ++movq, 0xf6e, MMX&x64, D|Modrm|NoSuf|Size64, { Reg64|Unspecified|BaseIndex, RegMMX } + packssdw, 0x0f6b, , Modrm||NoSuf, { ||Unspecified|BaseIndex, } + packsswb, 0x0f63, , Modrm||NoSuf, { ||Unspecified|BaseIndex, } + packuswb, 0x0f67, , Modrm||NoSuf, { ||Unspecified|BaseIndex, } +@@ -1083,11 +1104,11 @@ cmpss, 0xf30fc2, , Modrm|||NoSuf, { Imm8, Dwor + comiss, 0x0f2f, , Modrm||NoSuf, { Dword|Unspecified|BaseIndex|RegXMM, RegXMM } + cvtpi2ps, 0xf2a, SSE, Modrm|NoSuf, { Qword|Unspecified|BaseIndex|RegMMX, RegXMM } + cvtps2pi, 0xf2d, SSE, Modrm|NoSuf, { Qword|Unspecified|BaseIndex|RegXMM, RegMMX } +-cvtsi2ss, 0xf30f2a, |No64, Modrm|||IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Reg32|Unspecified|BaseIndex, RegXMM } +-cvtsi2ss, 0xf32a, AVX|x64, Modrm|Vex=3|Space0F|VexVVVV|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|SSE2AVX|ATTSyntax, { Reg32|Reg64|Dword|Qword|Unspecified|BaseIndex, RegXMM } +-cvtsi2ss, 0xf32a, AVX|x64, Modrm|Vex=3|Space0F|VexVVVV|No_bSuf|No_wSuf|No_sSuf|SSE2AVX|IntelSyntax, { Reg32|Reg64|Dword|Qword|Unspecified|BaseIndex, RegXMM } +-cvtsi2ss, 0xf30f2a, SSE|x64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|ATTSyntax, { Reg32|Reg64|Dword|Qword|Unspecified|BaseIndex, RegXMM } +-cvtsi2ss, 0xf30f2a, SSE|x64, Modrm|No_bSuf|No_wSuf|No_sSuf|IntelSyntax, { Reg32|Reg64|Dword|Qword|Unspecified|BaseIndex, RegXMM } ++cvtsi2ss, 0xf30f2a, &No64, Modrm|||IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Reg32|Unspecified|BaseIndex, RegXMM } ++cvtsi2ss, 0xf32a, AVX&x64, Modrm|Vex=3|Space0F|VexVVVV|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|SSE2AVX|ATTSyntax, { Reg32|Reg64|Unspecified|BaseIndex, RegXMM } ++cvtsi2ss, 0xf32a, AVX&x64, Modrm|Vex=3|Space0F|VexVVVV|No_bSuf|No_wSuf|No_sSuf|SSE2AVX|IntelSyntax, { Reg32|Reg64|Unspecified|BaseIndex, RegXMM } ++cvtsi2ss, 0xf30f2a, SSE&x64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|ATTSyntax, { Reg32|Reg64|Unspecified|BaseIndex, RegXMM } ++cvtsi2ss, 0xf30f2a, SSE&x64, Modrm|No_bSuf|No_wSuf|No_sSuf|IntelSyntax, { Reg32|Reg64|Unspecified|BaseIndex, RegXMM } + cvtss2si, 0xf32d, AVX, Modrm|VexLIG|Space0F|No_bSuf|No_wSuf|No_sSuf|SSE2AVX, { Dword|Unspecified|BaseIndex|RegXMM, Reg32|Reg64 } + cvtss2si, 0xf30f2d, SSE, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Dword|Unspecified|BaseIndex|RegXMM, Reg32|Reg64 } + cvttps2pi, 0xf2c, SSE, Modrm|NoSuf, { Qword|Unspecified|BaseIndex|RegXMM, RegMMX } +@@ -1178,11 +1199,11 @@ comisd, 0x660f2f, , Modrm||NoSuf, { Qword|Unspecified + cvtpi2pd, 0x660f2a, SSE2, Modrm|NoSuf, { RegMMX, RegXMM } + cvtpi2pd, 0xf3e6, AVX, Modrm|Vex|Space0F|VexW0|NoSuf|SSE2AVX, { Qword|Unspecified|BaseIndex, RegXMM } + cvtpi2pd, 0x660f2a, SSE2, Modrm|NoSuf, { Qword|Unspecified|BaseIndex, RegXMM } +-cvtsi2sd, 0xf20f2a, |No64, Modrm|IgnoreSize|||No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Reg32|Unspecified|BaseIndex, RegXMM } +-cvtsi2sd, 0xf22a, AVX|x64, Modrm|Vex=3|Space0F|VexVVVV|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|SSE2AVX|ATTSyntax, { Reg32|Reg64|Dword|Qword|Unspecified|BaseIndex, RegXMM } +-cvtsi2sd, 0xf22a, AVX|x64, Modrm|Vex=3|Space0F|VexVVVV|No_bSuf|No_wSuf|No_sSuf|SSE2AVX|IntelSyntax, { Reg32|Reg64|Dword|Qword|Unspecified|BaseIndex, RegXMM } +-cvtsi2sd, 0xf20f2a, SSE2|x64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|ATTSyntax, { Reg32|Reg64|Dword|Qword|Unspecified|BaseIndex, RegXMM } +-cvtsi2sd, 0xf20f2a, SSE2|x64, Modrm|No_bSuf|No_wSuf|No_sSuf|IntelSyntax, { Reg32|Reg64|Dword|Qword|Unspecified|BaseIndex, RegXMM } ++cvtsi2sd, 0xf20f2a, &No64, Modrm|IgnoreSize|||No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Reg32|Unspecified|BaseIndex, RegXMM } ++cvtsi2sd, 0xf22a, AVX&x64, Modrm|Vex=3|Space0F|VexVVVV|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|SSE2AVX|ATTSyntax, { Reg32|Reg64|Unspecified|BaseIndex, RegXMM } ++cvtsi2sd, 0xf22a, AVX&x64, Modrm|Vex=3|Space0F|VexVVVV|No_bSuf|No_wSuf|No_sSuf|SSE2AVX|IntelSyntax, { Reg32|Reg64|Unspecified|BaseIndex, RegXMM } ++cvtsi2sd, 0xf20f2a, SSE2&x64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|ATTSyntax, { Reg32|Reg64|Unspecified|BaseIndex, RegXMM } ++cvtsi2sd, 0xf20f2a, SSE2&x64, Modrm|No_bSuf|No_wSuf|No_sSuf|IntelSyntax, { Reg32|Reg64|Unspecified|BaseIndex, RegXMM } + divpd, 0x660f5e, , Modrm|||NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM } + divsd, 0xf20f5e, , Modrm|||NoSuf, { Qword|Unspecified|BaseIndex|RegXMM, RegXMM } + maxpd, 0x660f5f, , Modrm|||NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM } +@@ -1271,7 +1292,7 @@ fisttpll, 0xdd/1, FISTTP, Modrm|NoSuf|ATTSyntax, { Unspecified|BaseIndex } + + // CMPXCHG16B instruction. + +-cmpxchg16b, 0xfc7/1, CX16|x64, Modrm|NoSuf|Size64|LockPrefixOk, { Oword|Unspecified|BaseIndex } ++cmpxchg16b, 0xfc7/1, CX16, Modrm|NoSuf|Size64|LockPrefixOk, { Oword|Unspecified|BaseIndex } + + // MONITOR instructions. + +@@ -1281,7 +1302,7 @@ monitor, 0xf01c8, MONITOR, NoSuf, {} + // all modes. + monitor, 0xf01c8, MONITOR, AddrPrefixOpReg|NoSuf, { Acc|Word|Dword|Qword, RegC|Dword, RegD|Dword } + // The 64-bit form exists only for compatibility with older gas. +-monitor, 0xf01c8, MONITOR|x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword, RegD|Qword } ++monitor, 0xf01c8, MONITOR&x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword, RegD|Qword } + mwait, 0xf01c9, MONITOR, NoSuf, {} + // mwait is very special. AX and CX are always 32 bits. + // The 64-bit form exists only for compatibility with older gas. +@@ -1295,10 +1316,10 @@ vmlaunch, 0xf01c2, VMX, NoSuf, {} + vmresume, 0xf01c3, VMX, NoSuf, {} + vmptrld, 0xfc7/6, VMX, Modrm|NoSuf, { Qword|Unspecified|BaseIndex } + vmptrst, 0xfc7/7, VMX, Modrm|NoSuf, { Qword|Unspecified|BaseIndex } +-vmread, 0xf78, VMX|No64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Reg32, Reg32|Unspecified|BaseIndex } +-vmread, 0xf78, VMX|x64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Reg64, Reg64|Qword|Unspecified|BaseIndex } +-vmwrite, 0xf79, VMX|No64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Reg32|Unspecified|BaseIndex, Reg32 } +-vmwrite, 0xf79, VMX|x64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Reg64|Qword|Unspecified|BaseIndex, Reg64 } ++vmread, 0xf78, VMX&No64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Reg32, Reg32|Unspecified|BaseIndex } ++vmread, 0xf78, VMX&x64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Reg64, Reg64|Unspecified|BaseIndex } ++vmwrite, 0xf79, VMX&No64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Reg32|Unspecified|BaseIndex, Reg32 } ++vmwrite, 0xf79, VMX&x64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Reg64|Unspecified|BaseIndex, Reg64 } + vmxoff, 0xf01c4, VMX, NoSuf, {} + vmxon, 0xf30fc7/6, VMX, Modrm|NoSuf, { Qword|Unspecified|BaseIndex } + +@@ -1312,15 +1333,18 @@ getsec, 0xf37, SMX, NoSuf, {} + + // EPT instructions. + +-invept, 0x660f3880, EPT|No64, Modrm|IgnoreSize|NoSuf, { Oword|Unspecified|BaseIndex, Reg32 } +-invept, 0x660f3880, EPT|x64, Modrm|NoSuf|NoRex64, { Oword|Unspecified|BaseIndex, Reg64 } +-invvpid, 0x660f3881, EPT|No64, Modrm|IgnoreSize|NoSuf, { Oword|Unspecified|BaseIndex, Reg32 } +-invvpid, 0x660f3881, EPT|x64, Modrm|NoSuf|NoRex64, { Oword|Unspecified|BaseIndex, Reg64 } ++invept, 0x660f3880, EPT&No64, Modrm|IgnoreSize|NoSuf, { Oword|Unspecified|BaseIndex, Reg32 } ++invept, 0x660f3880, EPT&x64, Modrm|NoSuf|NoRex64, { Oword|Unspecified|BaseIndex, Reg64 } ++invept, 0xf3f0, EPT&APX_F, Modrm|NoSuf|EVexMap4|VexWIG, { Oword|Unspecified|BaseIndex, Reg64 } ++invvpid, 0x660f3881, EPT&No64, Modrm|IgnoreSize|NoSuf, { Oword|Unspecified|BaseIndex, Reg32 } ++invvpid, 0x660f3881, EPT&x64, Modrm|NoSuf|NoRex64, { Oword|Unspecified|BaseIndex, Reg64 } ++invvpid, 0xf3f1, EPT&APX_F, Modrm|NoSuf|EVexMap4|VexWIG, { Oword|Unspecified|BaseIndex, Reg64 } + + // INVPCID instruction + +-invpcid, 0x660f3882, INVPCID|No64, Modrm|IgnoreSize|NoSuf, { Oword|Unspecified|BaseIndex, Reg32 } +-invpcid, 0x660f3882, INVPCID|x64, Modrm|NoSuf|NoRex64, { Oword|Unspecified|BaseIndex, Reg64 } ++invpcid, 0x660f3882, INVPCID&No64, Modrm|IgnoreSize|NoSuf, { Oword|Unspecified|BaseIndex, Reg32 } ++invpcid, 0x660f3882, INVPCID&x64, Modrm|NoSuf|NoRex64, { Oword|Unspecified|BaseIndex, Reg64 } ++invpcid, 0xf3f2, INVPCID&APX_F, Modrm|NoSuf|EVexMap4|VexWIG, { Oword|Unspecified|BaseIndex, Reg64 } + + // SSSE3 instructions. + +@@ -1355,10 +1379,10 @@ blendvp, 0x664a | , AVX, Modrm|Vex128|Space0F3A|VexVVVV|VexW0|NoSuf| + blendvp, 0x660f3814 | , SSE4_1, Modrm|NoSuf, { Acc|Xmmword, RegXMM|Unspecified|BaseIndex, RegXMM } + blendvp, 0x660f3814 | , SSE4_1, Modrm|NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM } + dpp, 0x660f3a40 | , , Modrm|||NoSuf, { Imm8|Imm8S, RegXMM|Unspecified|BaseIndex, RegXMM } +-extractps, 0x6617, AVX, Modrm|Vex|Space0F3A|VexWIG|NoSuf|SSE2AVX, { Imm8, RegXMM, Reg32|Dword|Unspecified|BaseIndex } +-extractps, 0x6617, AVX|x64, RegMem|Vex|Space0F3A|VexWIG|NoSuf|SSE2AVX, { Imm8, RegXMM, Reg64 } +-extractps, 0x660f3a17, SSE4_1, Modrm|IgnoreSize|NoSuf, { Imm8, RegXMM, Reg32|Dword|Unspecified|BaseIndex } +-extractps, 0x660f3a17, SSE4_1|x64, RegMem|NoSuf|NoRex64, { Imm8, RegXMM, Reg64 } ++extractps, 0x6617, AVX, Modrm|Vex128|Space0F3A|VexW0|NoSuf|SSE2AVX, { Imm8, RegXMM, Reg32|Unspecified|BaseIndex } ++extractps, 0x6617, AVX&x64, RegMem|Vex128|Space0F3A|VexW1|NoSuf|SSE2AVX, { Imm8, RegXMM, Reg64 } ++extractps, 0x660f3a17, SSE4_1, Modrm|IgnoreSize|NoSuf, { Imm8, RegXMM, Reg32|Unspecified|BaseIndex } ++extractps, 0x660f3a17, SSE4_1&x64, RegMem|NoSuf|NoRex64, { Imm8, RegXMM, Reg64 } + insertps, 0x660f3a21, , Modrm|||NoSuf, { Imm8, Dword|Unspecified|BaseIndex|RegXMM, RegXMM } + movntdqa, 0x660f382a, , Modrm||NoSuf, { Xmmword|Unspecified|BaseIndex, RegXMM } + mpsadbw, 0x660f3a42, , Modrm|||NoSuf, { Imm8|Imm8S, RegXMM|Unspecified|BaseIndex, RegXMM } +@@ -1372,14 +1396,14 @@ pcmpeqq, 0x660f3829, , Modrm|||NoSuf|O + pextr, 0x660f3a14 | , , RegMem||NoSuf|IgnoreSize|NoRex64, { Imm8, RegXMM, Reg32|Reg64 } + pextr, 0x660f3a14 | , , Modrm||NoSuf, { Imm8, RegXMM, |Unspecified|BaseIndex } + pextrd, 0x660f3a16, , Modrm||NoSuf|IgnoreSize, { Imm8, RegXMM, Reg32|Unspecified|BaseIndex } +-pextrq, 0x6616, AVX|x64, Modrm|Vex|Space0F3A|VexW1|NoSuf|SSE2AVX, { Imm8, RegXMM, Reg64|Unspecified|BaseIndex } +-pextrq, 0x660f3a16, SSE4_1|x64, Modrm|Size64|NoSuf, { Imm8, RegXMM, Reg64|Unspecified|BaseIndex } ++pextrq, 0x6616, AVX&x64, Modrm|Vex|Space0F3A|VexW1|NoSuf|SSE2AVX, { Imm8, RegXMM, Reg64|Unspecified|BaseIndex } ++pextrq, 0x660f3a16, SSE4_1&x64, Modrm|Size64|NoSuf, { Imm8, RegXMM, Reg64|Unspecified|BaseIndex } + phminposuw, 0x660f3841, , Modrm||NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM } + pinsrb, 0x660f3a20, , Modrm|||NoSuf|IgnoreSize|NoRex64, { Imm8, Reg32|Reg64, RegXMM } + pinsrb, 0x660f3a20, , Modrm|||NoSuf, { Imm8, Byte|Unspecified|BaseIndex, RegXMM } + pinsrd, 0x660f3a22, , Modrm|||NoSuf|IgnoreSize, { Imm8, Reg32|Unspecified|BaseIndex, RegXMM } +-pinsrq, 0x6622, AVX|x64, Modrm|Vex|Space0F3A|VexVVVV|VexW1|NoSuf|SSE2AVX, { Imm8, Reg64|Unspecified|BaseIndex, RegXMM } +-pinsrq, 0x660f3a22, SSE4_1|x64, Modrm|Size64|NoSuf, { Imm8, Reg64|Unspecified|BaseIndex, RegXMM } ++pinsrq, 0x6622, AVX&x64, Modrm|Vex|Space0F3A|VexVVVV|VexW1|NoSuf|SSE2AVX, { Imm8, Reg64|Unspecified|BaseIndex, RegXMM } ++pinsrq, 0x660f3a22, SSE4_1&x64, Modrm|Size64|NoSuf, { Imm8, Reg64|Unspecified|BaseIndex, RegXMM } + pmaxsb, 0x660f383c, , Modrm|||NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM } + pmaxsd, 0x660f383d, , Modrm|||NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM } + pmaxud, 0x660f383f, , Modrm|||NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM } +@@ -1411,33 +1435,36 @@ rounds, 0x660f3a0a | , , Modrm|| + + pcmpgtq, 0x660f3837, , Modrm|||NoSuf|Optimize, { RegXMM|Unspecified|BaseIndex, RegXMM } +-pcmpestri, 0x660f3a61, |No64, Modrm||NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } +-pcmpestri, 0x6661, AVX|x64, Modrm|Vex|Space0F3A|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|SSE2AVX, { Imm8, Xmmword|Unspecified|BaseIndex|RegXMM, RegXMM } +-pcmpestri, 0x660f3a61, SSE4_2|x64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Imm8, Xmmword|Unspecified|BaseIndex|RegXMM, RegXMM } +-pcmpestrm, 0x660f3a60, |No64, Modrm||NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } +-pcmpestrm, 0x6660, AVX|x64, Modrm|Vex|Space0F3A|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|SSE2AVX, { Imm8, Xmmword|Unspecified|BaseIndex|RegXMM, RegXMM } +-pcmpestrm, 0x660f3a60, SSE4_2|x64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Imm8, Xmmword|Unspecified|BaseIndex|RegXMM, RegXMM } ++pcmpestri, 0x660f3a61, &No64, Modrm||NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } ++pcmpestri, 0x6661, AVX&x64, Modrm|Vex|Space0F3A|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|SSE2AVX, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } ++pcmpestri, 0x660f3a61, SSE4_2&x64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } ++pcmpestrm, 0x660f3a60, &No64, Modrm||NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } ++pcmpestrm, 0x6660, AVX&x64, Modrm|Vex|Space0F3A|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|SSE2AVX, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } ++pcmpestrm, 0x660f3a60, SSE4_2&x64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } + pcmpistri, 0x660f3a63, , Modrm||NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } + pcmpistrm, 0x660f3a62, , Modrm||NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } + crc32, 0xf20f38f0, SSE4_2, W|Modrm|No_sSuf|No_qSuf, { Reg8|Reg16|Reg32|Unspecified|BaseIndex, Reg32 } +-crc32, 0xf20f38f0, SSE4_2|x64, W|Modrm|No_wSuf|No_lSuf|No_sSuf, { Reg8|Reg64|Unspecified|BaseIndex, Reg64 } ++crc32, 0xf20f38f0, SSE4_2&x64, W|Modrm|No_wSuf|No_lSuf|No_sSuf, { Reg8|Reg64|Unspecified|BaseIndex, Reg64 } ++crc32, 0xf0, APX_F, W|Modrm|No_sSuf|No_qSuf|EVexMap4, { Reg8|Reg16|Reg32|Unspecified|BaseIndex, Reg32 } ++crc32, 0xf0, APX_F, W|Modrm|No_wSuf|No_lSuf|No_sSuf|EVexMap4, { Reg8|Reg64|Unspecified|BaseIndex, Reg64 } + + // xsave/xrstor New Instructions. + +-xsave, 0xfae/4, Xsave, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Unspecified|BaseIndex } +-xsave64, 0xfae/4, Xsave|x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } +-xrstor, 0xfae/5, Xsave, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Unspecified|BaseIndex } +-xrstor64, 0xfae/5, Xsave|x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } ++xsave, 0xfae/4, Xsave, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoEgpr, { Unspecified|BaseIndex } ++xsave64, 0xfae/4, Xsave&x64, Modrm|NoSuf|Size64|NoEgpr, { Unspecified|BaseIndex } ++xrstor, 0xfae/5, Xsave, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoEgpr, { Unspecified|BaseIndex } ++xrstor64, 0xfae/5, Xsave&x64, Modrm|NoSuf|Size64|NoEgpr, { Unspecified|BaseIndex } + xgetbv, 0xf01d0, Xsave, NoSuf, {} + xsetbv, 0xf01d1, Xsave, NoSuf, {} + + // xsaveopt +-xsaveopt, 0xfae/6, Xsaveopt, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Unspecified|BaseIndex } +-xsaveopt64, 0xfae/6, Xsaveopt|x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } ++ ++xsaveopt, 0xfae/6, Xsaveopt, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoEgpr, { Unspecified|BaseIndex } ++xsaveopt64, 0xfae/6, Xsaveopt&x64, Modrm|NoSuf|Size64|NoEgpr, { Unspecified|BaseIndex } + + // AES instructions. + +- ++ + + aesdec, 0x660f38de, AES, Modrm|||NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM } + aesdeclast, 0x660f38df, AES, Modrm|||NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM } +@@ -1448,7 +1475,7 @@ aeskeygenassist, 0x660f3adf, AES, Modrm||NoSuf, { Imm8, + + // PCLMULQDQ + +- ++ + + pclmulqdq, 0x660f3a44, PCLMULQDQ, Modrm||NoSuf, { Imm8|Imm8S, RegXMM|Unspecified|BaseIndex, RegXMM } + pclmullqlqdq, 0x660f3a44/0x00, PCLMULQDQ, Modrm||NoSuf|ImmExt, { RegXMM|Unspecified|BaseIndex, RegXMM } +@@ -1458,7 +1485,7 @@ pclmulhqhqdq, 0x660f3a44/0x11, PCLMULQDQ, Modrm| ++ + + gf2p8affineqb, 0x660f3ace, GFNI, Modrm||NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } + gf2p8affineinvqb, 0x660f3acf, GFNI, Modrm||NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } +@@ -1477,6 +1504,9 @@ gf2p8mulb, 0x660f38cf, GFNI, Modrm||NoSuf, { RegXMM|Uns + true_us:1f:C> + + // is used for VEX instructions with x/y suffixes. ++// NOTE: The order of the "unnamed" ($-prefixed) entries here needs to remain ++// in sync with , for match_template()'s EVEX-to-VEX lowering to ++// continue to work. + , 0x55, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSiz + vandp, 0x54, AVX, Modrm|C|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } + vblendp, 0x660c | , AVX, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } + vblendvp, 0x664a | , AVX, Modrm|Vex|Space0F3A|VexVVVV|VexW0|CheckOperandSize|NoSuf, { RegXMM|RegYMM, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } +-vbroadcastf128, 0x661a, AVX, Modrm|Vex=2|Space0F38|VexW=1|NoSuf, { Xmmword|Unspecified|BaseIndex, RegYMM } ++vbroadcastf128, 0x661a, AVX, Modrm|Vex256|Space0F38|VexW0|NoSuf, { Xmmword|Unspecified|BaseIndex, RegYMM } ++// vbroadcastf32x4 in disguise (see vround{p,s}{s,d} comment) ++vbroadcastf128, 0x661a, APX_F&AVX512VL, Modrm|EVex256|Space0F38|VexW0|Disp8MemShift=4|NoSuf, { Xmmword|Unspecified|BaseIndex, RegYMM } + vbroadcastsd, 0x6619, AVX, Modrm|Vex256|Space0F38|VexW0|NoSuf, { Qword|Unspecified|BaseIndex, RegYMM } + vbroadcastss, 0x6618, AVX, Modrm|Vex128|Space0F38|VexW0|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM|RegYMM } + vcmpp, 0xc2/0x, AVX, Modrm||Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|Unspecified|BaseIndex, RegXMM|RegYMM, RegXMM|RegYMM } +@@ -1519,14 +1551,18 @@ vdivp, 0x5e, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize + vdivs, 0x5e, AVX, Modrm|VexLIG|Space0F|VexVVVV|VexWIG|NoSuf, { |Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } + vdppd, 0x6641, AVX, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } + vdpps, 0x6640, AVX, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } +-vextractf128, 0x6619, AVX, Modrm|Vex=2|Space0F3A|VexW=1|NoSuf, { Imm8, RegYMM, Unspecified|BaseIndex|RegXMM } +-vextractps, 0x6617, AVX|AVX512F, Modrm|Vex128|EVex128|Space0F3A|VexWIG|Disp8MemShift=2|NoSuf, { Imm8, RegXMM, Reg32|Dword|Unspecified|BaseIndex } +-vextractps, 0x6617, AVX|AVX512F|x64, RegMem|Vex128|EVex128|Space0F3A|VexWIG|NoSuf, { Imm8, RegXMM, Reg64 } ++vextractf128, 0x6619, AVX, Modrm|Vex256|Space0F3A|VexW0|NoSuf, { Imm8, RegYMM, Unspecified|BaseIndex|RegXMM } ++// vextractf32x4 in disguise (see vround{p,s}{s,d} comment) ++vextractf128, 0x6619, APX_F&AVX512VL, Modrm|EVex256|Space0F3A|VexW0|Disp8MemShift=4|NoSuf, { Imm8, RegYMM, Xmmword|Unspecified|BaseIndex } ++vextractps, 0x6617, AVX|AVX512F, Modrm|Vex128|EVex128|Space0F3A|VexWIG|Disp8MemShift=2|NoSuf, { Imm8, RegXMM, Reg32|Unspecified|BaseIndex } ++vextractps, 0x6617, x64&(AVX|AVX512F), RegMem|Vex128|EVex128|Space0F3A|VexWIG|NoSuf, { Imm8, RegXMM, Reg64 } + vhaddpd, 0x667c, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } + vhaddps, 0xf27c, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } + vhsubpd, 0x667d, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } + vhsubps, 0xf27d, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } + vinsertf128, 0x6618, AVX, Modrm|Vex256|Space0F3A|VexVVVV|VexW0|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegYMM, RegYMM } ++// vinsertf32x4 in disguise (see vround{p,s}{s,d} comment) ++vinsertf128, 0x6618, APX_F&AVX512VL, Modrm|EVex256|Space0F3A|VexVVVV|VexW0|Disp8MemShift=4|NoSuf, { Imm8, Xmmword|Unspecified|BaseIndex, RegYMM, RegYMM } + vinsertps, 0x6621, AVX, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8, Dword|Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } + vlddqu, 0xf2f0, AVX, Modrm|Vex|Space0F|VexWIG|CheckOperandSize|NoSuf, { Xmmword|Ymmword|Unspecified|BaseIndex, RegXMM|RegYMM } + vldmxcsr, 0xae/2, AVX, Modrm|Vex128|Space0F|VexWIG|NoSuf, { Dword|Unspecified|BaseIndex } +@@ -1544,7 +1580,7 @@ vmovap, 0x28, AVX, D|Modrm|Vex|Space0F|VexWIG|CheckOperandSize|NoSu + // support assembler for AMD64, we accept 64bit operand on vmovd so + // that we can use one template for both SSE and AVX instructions. + vmovd, 0x666e, AVX|AVX512F, D|Modrm|Vex128|EVex128|Space0F|Disp8MemShift=2|NoSuf, { Reg32|Unspecified|BaseIndex, RegXMM } +-vmovd, 0x667e, AVX|x64, D|RegMem|Vex=1|Space0F|VexW=2|NoSuf|Size64, { RegXMM, Reg64 } ++vmovd, 0x667e, AVX&x64, D|RegMem|Vex=1|Space0F|VexW=2|NoSuf|Size64, { RegXMM, Reg64 } + vmovddup, 0xf212, AVX, Modrm|Vex|Space0F|VexWIG|NoSuf, { Qword|Unspecified|BaseIndex|RegXMM, RegXMM } + vmovddup, 0xf212, AVX, Modrm|Vex=2|Space0F|VexWIG|NoSuf, { Unspecified|BaseIndex|RegYMM, RegYMM } + vmovdqa, 0x666f, AVX, D|Modrm|Vex|Space0F|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM } +@@ -1561,7 +1597,7 @@ vmovntdqa, 0x662a, AVX|AVX2, Modrm|Vex|Space0F38|VexWIG|CheckOperandSize|NoSuf, + vmovntp, 0x2b, AVX, Modrm|Vex|Space0F|VexWIG|CheckOperandSize|NoSuf, { RegXMM|RegYMM, Xmmword|Ymmword|Unspecified|BaseIndex } + vmovq, 0xf37e, AVX, Load|Modrm|Vex=1|Space0F|VexWIG|NoSuf, { Qword|Unspecified|BaseIndex|RegXMM, RegXMM } + vmovq, 0x66d6, AVX, Modrm|Vex=1|Space0F|VexWIG|NoSuf, { RegXMM, Qword|Unspecified|BaseIndex|RegXMM } +-vmovq, 0x666e, AVX|AVX512F|x64, D|Modrm|Vex128|EVex128|Space0F|VexW1|Disp8MemShift=3|NoSuf, { Reg64|Unspecified|BaseIndex, RegXMM } ++vmovq, 0x666e, x64&(AVX|AVX512F), D|Modrm|Vex128|EVex128|Space0F|VexW1|Disp8MemShift=3|NoSuf, { Reg64|Unspecified|BaseIndex, RegXMM } + vmovs, 0x10, AVX, D|Modrm|VexLIG|Space0F|VexWIG|NoSuf, { |Unspecified|BaseIndex, RegXMM } + vmovs, 0x10, AVX, D|Modrm|VexLIG|Space0F|VexVVVV|VexWIG|NoSuf, { RegXMM, RegXMM, RegXMM } + vmovshdup, 0xf316, AVX, Modrm|Vex|Space0F|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM } +@@ -1591,10 +1627,10 @@ vpblendw, 0x660e, AVX|AVX2, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|CheckOperandSize| + vpcmpeq, 0x6674 | , AVX|AVX2, Modrm|C|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } + vpcmpeqd, 0x6676, AVX|AVX2, Modrm|C|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } + vpcmpeqq, 0x6629, AVX|AVX2, Modrm|Vex|Space0F38|VexVVVV|VexWIG|CheckOperandSize|NoSuf|Optimize, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } +-vpcmpestri, 0x6661, AVX|No64, Modrm|Vex|Space0F3A|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegXMM } +-vpcmpestri, 0x6661, AVX|x64, Modrm|Vex|Space0F3A|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Imm8, Xmmword|Unspecified|BaseIndex|RegXMM, RegXMM } +-vpcmpestrm, 0x6660, AVX|No64, Modrm|Vex|Space0F3A|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegXMM } +-vpcmpestrm, 0x6660, AVX|x64, Modrm|Vex|Space0F3A|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Imm8, Xmmword|Unspecified|BaseIndex|RegXMM, RegXMM } ++vpcmpestri, 0x6661, AVX&No64, Modrm|Vex|Space0F3A|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegXMM } ++vpcmpestri, 0x6661, AVX&x64, Modrm|Vex|Space0F3A|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegXMM } ++vpcmpestrm, 0x6660, AVX&No64, Modrm|Vex|Space0F3A|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegXMM } ++vpcmpestrm, 0x6660, AVX&x64, Modrm|Vex|Space0F3A|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegXMM } + vpcmpgt, 0x6664 | , AVX|AVX2, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf|Optimize, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } + vpcmpgtd, 0x6666, AVX|AVX2, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf|Optimize, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } + vpcmpgtq, 0x6637, AVX|AVX2, Modrm|Vex|Space0F38|VexVVVV|VexWIG|CheckOperandSize|NoSuf|Optimize, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } +@@ -1605,7 +1641,7 @@ vpermilps, 0x660c, AVX|AVX512F, Modrm|Vex|EVexDYN|Masking|Space0F38|VexVVVV|VexW + vpermilps, 0x6604, AVX|AVX512F, Modrm|Vex|EVexDYN|Masking|Space0F3A|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8|Imm8S, RegXMM|RegYMM|RegZMM|Dword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } + vpermilpd, 0x660d, AVX, Modrm|Vex|Space0F38|VexVVVV|VexW0|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } + vpermilpd, 0x6605, AVX, Modrm|Vex|Space0F3A|VexW0|CheckOperandSize|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM } +-vpextr, 0x6616, AVX|, Modrm|Vex|Space0F3A||NoSuf, { Imm8, RegXMM, |Unspecified|BaseIndex } ++vpextr, 0x6616, AVX&, Modrm|Vex|Space0F3A||NoSuf, { Imm8, RegXMM, |Unspecified|BaseIndex } + vpextrw, 0x66c5, AVX, Load|Modrm|Vex|Space0F|VexWIG|No_bSuf|No_wSuf|No_sSuf, { Imm8, RegXMM, Reg32|Reg64 } + vpextr, 0x6614 | , AVX, RegMem|Vex|Space0F3A|VexWIG|NoSuf, { Imm8, RegXMM, Reg32|Reg64 } + vpextr, 0x6614 | , AVX, Modrm|Vex|Space0F3A|VexWIG|NoSuf, { Imm8, RegXMM, |Unspecified|BaseIndex } +@@ -1618,7 +1654,7 @@ vphsubsw, 0x6607, AVX|AVX2, Modrm|Vex|Space0F38|VexVVVV|VexWIG|CheckOperandSize| + vphsubw, 0x6605, AVX|AVX2, Modrm|Vex|Space0F38|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } + vpinsrb, 0x6620, AVX, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8, Reg32|Reg64, RegXMM, RegXMM } + vpinsrb, 0x6620, AVX, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8, Byte|Unspecified|BaseIndex, RegXMM, RegXMM } +-vpinsr, 0x6622, AVX|, Modrm|Vex|Space0F3A|VexVVVV||NoSuf, { Imm8, |Unspecified|BaseIndex, RegXMM, RegXMM } ++vpinsr, 0x6622, AVX&, Modrm|Vex|Space0F3A|VexVVVV||NoSuf, { Imm8, |Unspecified|BaseIndex, RegXMM, RegXMM } + vpinsrw, 0x66c4, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|No_bSuf|No_wSuf|No_sSuf, { Imm8, Reg32|Reg64, RegXMM, RegXMM } + vpinsrw, 0x66c4, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|NoSuf, { Imm8, Word|Unspecified|BaseIndex, RegXMM, RegXMM } + vpmaddubsw, 0x6604, AVX|AVX2, Modrm|Vex|Space0F38|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } +@@ -1636,18 +1672,18 @@ vpminub, 0x66da, AVX|AVX2, Modrm|C|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|N + vpminud, 0x663b, AVX|AVX2, Modrm|Vex|Space0F38|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } + vpminuw, 0x663a, AVX|AVX2, Modrm|Vex|Space0F38|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } + vpmovmskb, 0x66d7, AVX|AVX2, Modrm|Vex|Space0F|VexWIG|No_bSuf|No_wSuf|No_sSuf, { RegXMM|RegYMM, Reg32|Reg64 } +-vpmovsxbd, 0x6621, AVX|AVX512F|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM } +-vpmovsxbq, 0x6622, AVX|AVX512F|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=1|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegXMM } ++vpmovsxbd, 0x6621, AVX|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM } ++vpmovsxbq, 0x6622, AVX|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=1|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegXMM } + vpmovsxbw, 0x6620, AVX, Modrm|Vex|Space0F38|VexWIG|NoSuf, { Qword|Unspecified|BaseIndex|RegXMM, RegXMM } + vpmovsxdq, 0x6625, AVX, Modrm|Vex|Space0F38|VexWIG|NoSuf, { Qword|Unspecified|BaseIndex|RegXMM, RegXMM } +-vpmovsxwd, 0x6623, AVX|AVX512F|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } +-vpmovsxwq, 0x6624, AVX|AVX512F|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM } +-vpmovzxbd, 0x6631, AVX|AVX512F|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM } +-vpmovzxbq, 0x6632, AVX|AVX512F|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=1|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegXMM } ++vpmovsxwd, 0x6623, AVX|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } ++vpmovsxwq, 0x6624, AVX|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM } ++vpmovzxbd, 0x6631, AVX|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM } ++vpmovzxbq, 0x6632, AVX|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=1|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegXMM } + vpmovzxbw, 0x6630, AVX, Modrm|Vex|Space0F38|VexWIG|NoSuf, { Qword|Unspecified|BaseIndex|RegXMM, RegXMM } + vpmovzxdq, 0x6635, AVX, Modrm|Vex|Space0F38|VexWIG|NoSuf, { Qword|Unspecified|BaseIndex|RegXMM, RegXMM } +-vpmovzxwd, 0x6633, AVX|AVX512F|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } +-vpmovzxwq, 0x6634, AVX|AVX512F|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM } ++vpmovzxwd, 0x6633, AVX|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } ++vpmovzxwq, 0x6634, AVX|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM } + vpmuldq, 0x6628, AVX|AVX2, Modrm|Vex|Space0F38|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } + vpmulhrsw, 0x660b, AVX|AVX2, Modrm|Vex|Space0F38|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } + vpmulhuw, 0x66e4, AVX|AVX2, Modrm|C|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } +@@ -1695,6 +1731,10 @@ vrcpps, 0x53, AVX, Modrm|Vex|Space0F|VexWIG|CheckOperandSize|NoSuf, { Unspecifie + vrcpss, 0xf353, AVX, Modrm|Vex=3|Space0F|VexVVVV|VexWIG|NoSuf, { Dword|Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } + vroundp, 0x6608 | , AVX, Modrm|Vex|Space0F3A|VexWIG|CheckOperandSize|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM } + vrounds, 0x660a | , AVX, Modrm|VexLIG|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8, |Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } ++// These are really clones of VRNDSCALE{P,S}{S,D}, with broadcast, masking, SAE, ++// 512-bit operand size, and register sources dropped. ++vroundp, 0x6608 | , APX_F&AVX512VL, Modrm|Space0F3A||Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8, Xmmword|Ymmword|Unspecified|BaseIndex, RegXMM|RegYMM } ++vrounds, 0x660a | , APX_F&AVX512F, Modrm|EVexLIG|Space0F3A|VexVVVV||Disp8MemShift|NoSuf, { Imm8, |Unspecified|BaseIndex, RegXMM, RegXMM } + vrsqrtps, 0x52, AVX, Modrm|Vex|Space0F|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM } + vrsqrtss, 0xf352, AVX, Modrm|Vex=3|Space0F|VexVVVV|VexWIG|NoSuf, { Dword|Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } + vshufp, 0xc6, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } +@@ -1714,22 +1754,24 @@ vzeroupper, 0x77, AVX, Vex|Space0F|VexWIG|NoSuf, {} + + // 256bit integer AVX2 instructions. + +-vpmovsxbd, 0x6621, AVX2|AVX512F|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegYMM } +-vpmovsxbq, 0x6622, AVX2|AVX512F|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } ++vpmovsxbd, 0x6621, AVX2|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegYMM } ++vpmovsxbq, 0x6622, AVX2|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } + vpmovsxbw, 0x6620, AVX2, Modrm|Vex=2|Space0F38|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegYMM } + vpmovsxdq, 0x6625, AVX2, Modrm|Vex=2|Space0F38|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegYMM } +-vpmovsxwd, 0x6623, AVX2|AVX512F|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } +-vpmovsxwq, 0x6624, AVX2|AVX512F|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegYMM } +-vpmovzxbd, 0x6631, AVX2|AVX512F|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegYMM } +-vpmovzxbq, 0x6632, AVX2|AVX512F|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } ++vpmovsxwd, 0x6623, AVX2|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } ++vpmovsxwq, 0x6624, AVX2|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegYMM } ++vpmovzxbd, 0x6631, AVX2|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegYMM } ++vpmovzxbq, 0x6632, AVX2|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } + vpmovzxbw, 0x6630, AVX2, Modrm|Vex=2|Space0F38|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegYMM } + vpmovzxdq, 0x6635, AVX2, Modrm|Vex=2|Space0F38|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegYMM } +-vpmovzxwd, 0x6633, AVX2|AVX512F|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } +-vpmovzxwq, 0x6634, AVX2|AVX512F|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegYMM } ++vpmovzxwd, 0x6633, AVX2|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } ++vpmovzxwq, 0x6634, AVX2|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegYMM } + + // New AVX2 instructions. + +-vbroadcasti128, 0x665A, AVX2, Modrm|Vex=2|Space0F38|VexW=1|NoSuf, { Xmmword|Unspecified|BaseIndex, RegYMM } ++vbroadcasti128, 0x665A, AVX2, Modrm|Vex256|Space0F38|VexW0|NoSuf, { Xmmword|Unspecified|BaseIndex, RegYMM } ++// vbroadcasti32x4 in disguise (see vround{p,s}{s,d} comment) ++vbroadcasti128, 0x665a, APX_F&AVX512VL, Modrm|EVex256|Space0F38|VexW0|Disp8MemShift=4|NoSuf, { Xmmword|Unspecified|BaseIndex, RegYMM } + vbroadcastsd, 0x6619, AVX2, Modrm|Vex=2|Space0F38|VexW=1|NoSuf, { RegXMM, RegYMM } + vbroadcastss, 0x6618, AVX2|AVX512F, Modrm|Vex|EVexDYN|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } + vpblendd, 0x6602, AVX2, Modrm|Vex|Space0F3A|VexVVVV|VexW0|CheckOperandSize|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } +@@ -1741,8 +1783,12 @@ vpermd, 0x6636, AVX2|AVX512F, Modrm|Vex256|EVexDYN|Masking|Space0F38|VexVVVV|Vex + vpermpd, 0x6601, AVX2|AVX512F, Modrm|Vex256|EVexDYN|Masking|Space0F3A|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8|Imm8S, RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegYMM|RegZMM } + vpermps, 0x6616, AVX2|AVX512F, Modrm|Vex256|EVexDYN|Masking|Space0F38|VexVVVV|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegYMM|RegZMM|Dword|Unspecified|BaseIndex, RegYMM|RegZMM, RegYMM|RegZMM } + vpermq, 0x6600, AVX2|AVX512F, Modrm|Vex256|EVexDYN|Masking|Space0F3A|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8|Imm8S, RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegYMM|RegZMM } +-vextracti128, 0x6639, AVX2, Modrm|Vex=2|Space0F3A|VexW=1|NoSuf, { Imm8, RegYMM, Unspecified|BaseIndex|RegXMM } ++vextracti128, 0x6639, AVX2, Modrm|Vex256|Space0F3A|VexW0|NoSuf, { Imm8, RegYMM, Unspecified|BaseIndex|RegXMM } ++// vextracti32x4 in disguise (see vround{p,s}{s,d} comment) ++vextracti128, 0x6639, APX_F&AVX512VL, Modrm|EVex256|Space0F3A|VexW0|Disp8MemShift=4|NoSuf, { Imm8, RegYMM, Xmmword|Unspecified|BaseIndex } + vinserti128, 0x6638, AVX2, Modrm|Vex256|Space0F3A|VexVVVV|VexW0|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegYMM, RegYMM } ++// vinserti32x4 in disguise (see vround{p,s}{s,d} comment) ++vinserti128, 0x6638, APX_F&AVX512VL, Modrm|EVex256|Space0F3A|VexVVVV|VexW0|Disp8MemShift=4|NoSuf, { Imm8, Xmmword|Unspecified|BaseIndex, RegYMM, RegYMM } + vpmaskmov, 0x668e, AVX2, Modrm|Vex|Space0F38|VexVVVV||CheckOperandSize|NoSuf, { RegXMM|RegYMM, RegXMM|RegYMM, Xmmword|Ymmword|Unspecified|BaseIndex } + vpmaskmov, 0x668c, AVX2, Modrm|Vex|Space0F38|VexVVVV||CheckOperandSize|NoSuf, { Xmmword|Ymmword|Unspecified|BaseIndex, RegXMM|RegYMM, RegXMM|RegYMM } + vpsllv, 0x6647, AVX2|AVX512F, Modrm|Vex|EVexDYN|Masking|Space0F38|VexVVVV||Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM||Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } +@@ -1765,26 +1811,26 @@ vpgatherqq, 0x6691, AVX2, Modrm|Vex256|Space0F38|VexVVVV|VexW1|SwapSources|NoSuf + + // AES + AVX + +-vaesdec, 0x66de, AVX|AES, Modrm|Vex|Space0F38|VexVVVV|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } +-vaesdeclast, 0x66df, AVX|AES, Modrm|Vex|Space0F38|VexVVVV|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } +-vaesenc, 0x66dc, AVX|AES, Modrm|Vex|Space0F38|VexVVVV|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } +-vaesenclast, 0x66dd, AVX|AES, Modrm|Vex|Space0F38|VexVVVV|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } +-vaesimc, 0x66db, AVX|AES, Modrm|Vex|Space0F38|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM } +-vaeskeygenassist, 0x66df, AVX|AES, Modrm|Vex|Space0F3A|VexWIG|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegXMM } ++vaesdec, 0x66de, AVX&AES, Modrm|Vex|Space0F38|VexVVVV|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } ++vaesdeclast, 0x66df, AVX&AES, Modrm|Vex|Space0F38|VexVVVV|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } ++vaesenc, 0x66dc, AVX&AES, Modrm|Vex|Space0F38|VexVVVV|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } ++vaesenclast, 0x66dd, AVX&AES, Modrm|Vex|Space0F38|VexVVVV|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } ++vaesimc, 0x66db, AVX&AES, Modrm|Vex|Space0F38|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM } ++vaeskeygenassist, 0x66df, AVX&AES, Modrm|Vex|Space0F3A|VexWIG|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegXMM } + + // PCLMULQDQ + AVX + +-vpclmulqdq, 0x6644, AVX|PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } +-vpclmullqlqdq, 0x6644/0x00, AVX|PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } +-vpclmulhqlqdq, 0x6644/0x01, AVX|PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } +-vpclmullqhqdq, 0x6644/0x10, AVX|PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } +-vpclmulhqhqdq, 0x6644/0x11, AVX|PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } ++vpclmulqdq, 0x6644, AVX&PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } ++vpclmullqlqdq, 0x6644/0x00, AVX&PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } ++vpclmulhqlqdq, 0x6644/0x01, AVX&PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } ++vpclmullqhqdq, 0x6644/0x10, AVX&PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } ++vpclmulhqhqdq, 0x6644/0x11, AVX&PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } + + // GFNI + AVX + +-vgf2p8affineinvqb, 0x66cf, AVX|GFNI, Modrm|Vex|Space0F3A|VexVVVV|VexW1|CheckOperandSize|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } +-vgf2p8affineqb, 0x66ce, AVX|GFNI, Modrm|Vex|Space0F3A|VexVVVV|VexW1|CheckOperandSize|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } +-vgf2p8mulb, 0x66cf, GFNI|AVX|AVX512F, Modrm|Vex|EVexDYN|Masking|Space0F38|VexVVVV|VexW0|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } ++vgf2p8affineinvqb, 0x66cf, AVX&GFNI, Modrm|Vex|Space0F3A|VexVVVV|VexW1|CheckOperandSize|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } ++vgf2p8affineqb, 0x66ce, AVX&GFNI, Modrm|Vex|Space0F3A|VexVVVV|VexW1|CheckOperandSize|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } ++vgf2p8mulb, 0x66cf, GFNI&(AVX|AVX512F), Modrm|Vex|EVexDYN|Masking|Space0F38|VexVVVV|VexW0|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } + + // FSGSBASE, RDRND and F16C + +@@ -1803,8 +1849,8 @@ vcvtps2ph, 0x661d, F16C, Modrm|Vex=2|Space0F3A|VexW=1|NoSuf, { Imm8, RegYMM, Uns + + + + + vfmaddp, 0x6688 | 0x, , Modrm||Masking||VexVVVV||Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|StaticRounding|SAE, { RegXMM|RegYMM|RegZMM||Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } +@@ -1831,14 +1877,14 @@ xtest, 0xf01d6, HLE|RTM, NoSuf, {} + + // BMI2 instructions. + +-bzhi, 0xf5, BMI2, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } +-mulx, 0xf2f6, BMI2, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 } +-pdep, 0xf2f5, BMI2, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 } +-pext, 0xf3f5, BMI2, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 } +-rorx, 0xf2f0, BMI2, Modrm|CheckOperandSize|Vex128|Space0F3A|No_bSuf|No_wSuf|No_sSuf, { Imm8|Imm8S, Reg32|Reg64|Dword|Qword|Unspecified|BaseIndex, Reg32|Reg64 } +-sarx, 0xf3f7, BMI2, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } +-shlx, 0x66f7, BMI2, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } +-shrx, 0xf2f7, BMI2, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } ++bzhi, 0xf5, APX_F(BMI2), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf|NF, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } ++mulx, 0xf2f6, APX_F(BMI2), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 } ++pdep, 0xf2f5, APX_F(BMI2), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 } ++pext, 0xf3f5, APX_F(BMI2), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 } ++rorx, 0xf2f0, APX_F(BMI2), Modrm|CheckOperandSize|Vex128|EVex128|Space0F3A|No_bSuf|No_wSuf|No_sSuf, { Imm8|Imm8S, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } ++sarx, 0xf3f7, APX_F(BMI2), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } ++shlx, 0x66f7, APX_F(BMI2), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } ++shrx, 0xf2f7, APX_F(BMI2), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } + + // FMA4 instructions + +@@ -1908,12 +1954,13 @@ lwpins, 0x12/0, LWP, Modrm|SpaceXOP0A|NoSuf|VexVVVV|Vex, { Imm32|Imm32S, Reg32|U + + // BMI instructions + +-andn, 0xf2, BMI, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 } +-bextr, 0xf7, BMI, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } +-blsi, 0xf3/3, BMI, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } +-blsmsk, 0xf3/2, BMI, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } +-blsr, 0xf3/1, BMI, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } +-tzcnt, 0xf30fbc, BMI, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++andn, 0xf2, APX_F(BMI), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf|NF, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 } ++bextr, 0xf7, APX_F(BMI), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf|NF, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } ++blsi, 0xf3/3, APX_F(BMI), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf|NF, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } ++blsmsk, 0xf3/2, APX_F(BMI), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf|NF, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } ++blsr, 0xf3/1, APX_F(BMI), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf|NF, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } ++tzcnt, 0xf30fbc, BMI, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++tzcnt, 0xf4, BMI&APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|EVexMap4|NF, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } + + // TBM instructions + +@@ -1990,10 +2037,12 @@ insertq, 0xf20f79, SSE4a, Modrm|NoSuf, { RegXMM, RegXMM } + insertq, 0xf20f78, SSE4a, Modrm|NoSuf, { Imm8, Imm8, RegXMM, RegXMM } + + // LZCNT instruction +-lzcnt, 0xf30fbd, LZCNT, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++lzcnt, 0xf30fbd, LZCNT, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++lzcnt, 0xf5, LZCNT&APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|EVexMap4|NF, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } + + // POPCNT instruction +-popcnt, 0xf30fb8, POPCNT, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++popcnt, 0xf30fb8, POPCNT, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++popcnt, 0x88, POPCNT&APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|EVexMap4|NF, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } + + // VIA PadLock extensions. + xstore-rng, 0xfa7c0, PadLock, NoSuf|RepPrefixOk, {} +@@ -2016,8 +2065,11 @@ xcryptofb, 0xf30fa7e8, PadLock, NoSuf|RepPrefixOk, {} + xstore, 0xfa7c0, PadLock, NoSuf|RepPrefixOk, {} + + // Multy-precision Add Carry, rdseed instructions. +-adcx, 0x660f38f6, ADX, Modrm|CheckOperandSize|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } +-adox, 0xf30f38f6, ADX, Modrm|CheckOperandSize|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } ++ ++adx, 0x66, ADX&APX_F, C|Modrm|CheckOperandSize|No_bSuf|No_wSuf|No_sSuf|DstVVVV|EVexMap4, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 } ++adx, 0x0f38f6, ADX, Modrm|CheckOperandSize|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } ++adx, 0x66, ADX&APX_F, Modrm|CheckOperandSize|No_bSuf|No_wSuf|No_sSuf|EVexMap4, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } ++ + rdseed, 0xfc7/7, RdSeed, Modrm|NoSuf, { Reg16|Reg32|Reg64 } + + // SMAP instructions. +@@ -2030,12 +2082,12 @@ bnd, 0xf2, MPX, NoSuf|IsPrefix, {} + // MPX instructions. + bndmk, 0xf30f1b, MPX, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex, RegBND } + bndmov, 0x660f1a, MPX, D|Modrm|NoSuf, { Xmmword|Unspecified|BaseIndex|RegBND, RegBND } +-bndcl, 0xf30f1a, MPX|No64, Modrm|Anysize|IgnoreSize|NoSuf, { Reg32|BaseIndex, RegBND } +-bndcl, 0xf30f1a, MPX|x64, Modrm|Anysize|IgnoreSize|NoSuf|NoRex64, { Reg64|BaseIndex, RegBND } +-bndcu, 0xf20f1a, MPX|No64, Modrm|Anysize|IgnoreSize|NoSuf, { Reg32|BaseIndex, RegBND } +-bndcu, 0xf20f1a, MPX|x64, Modrm|Anysize|IgnoreSize|NoSuf|NoRex64, { Reg64|BaseIndex, RegBND } +-bndcn, 0xf20f1b, MPX|No64, Modrm|Anysize|IgnoreSize|NoSuf, { Reg32|BaseIndex, RegBND } +-bndcn, 0xf20f1b, MPX|x64, Modrm|Anysize|IgnoreSize|NoSuf|NoRex64, { Reg64|BaseIndex, RegBND } ++bndcl, 0xf30f1a, MPX&No64, Modrm|Anysize|IgnoreSize|NoSuf, { Reg32|BaseIndex, RegBND } ++bndcl, 0xf30f1a, MPX&x64, Modrm|Anysize|IgnoreSize|NoSuf|NoRex64, { Reg64|BaseIndex, RegBND } ++bndcu, 0xf20f1a, MPX&No64, Modrm|Anysize|IgnoreSize|NoSuf, { Reg32|BaseIndex, RegBND } ++bndcu, 0xf20f1a, MPX&x64, Modrm|Anysize|IgnoreSize|NoSuf|NoRex64, { Reg64|BaseIndex, RegBND } ++bndcn, 0xf20f1b, MPX&No64, Modrm|Anysize|IgnoreSize|NoSuf, { Reg32|BaseIndex, RegBND } ++bndcn, 0xf20f1b, MPX&x64, Modrm|Anysize|IgnoreSize|NoSuf|NoRex64, { Reg64|BaseIndex, RegBND } + bndstx, 0x0f1b, MPX, Modrm|Anysize|IgnoreSize|NoSuf, { RegBND, BaseIndex } + bndldx, 0x0f1a, MPX, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex, RegBND } + +@@ -2073,26 +2125,29 @@ vsm4rnds4, 0xf2da, SM4, Modrm|Space0F38|Vex|VexVVVV|VexW0|CheckOperandSize|NoSuf + + // VAES + +-vaesdec, 0x66de, VAES|AVX|AVX512F, Modrm|Vex|EVexDYN|Space0F38|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } +-vaesdeclast, 0x66df, VAES|AVX|AVX512F, Modrm|Vex|EVexDYN|Space0F38|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } +-vaesenc, 0x66dc, VAES|AVX|AVX512F, Modrm|Vex|EVexDYN|Space0F38|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } +-vaesenclast, 0x66dd, VAES|AVX|AVX512F, Modrm|Vex|EVexDYN|Space0F38|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } ++vaesdec, 0x66de, VAES&(AVX|AVX512F), Modrm|Vex|EVexDYN|Space0F38|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } ++vaesdeclast, 0x66df, VAES&(AVX|AVX512F), Modrm|Vex|EVexDYN|Space0F38|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } ++vaesenc, 0x66dc, VAES&(AVX|AVX512F), Modrm|Vex|EVexDYN|Space0F38|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } ++vaesenclast, 0x66dd, VAES&(AVX|AVX512F), Modrm|Vex|EVexDYN|Space0F38|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } + + // VAES instructions end + + // VPCLMULQDQ instructions + +-vpclmulqdq, 0x6644, VPCLMULQDQ|AVX|AVX512F, Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8|Imm8S, RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } +-vpclmullqlqdq, 0x6644/0x00, VPCLMULQDQ|AVX|AVX512F, Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } +-vpclmulhqlqdq, 0x6644/0x01, VPCLMULQDQ|AVX|AVX512F, Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } +-vpclmullqhqdq, 0x6644/0x10, VPCLMULQDQ|AVX|AVX512F, Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } +-vpclmulhqhqdq, 0x6644/0x11, VPCLMULQDQ|AVX|AVX512F, Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } ++vpclmulqdq, 0x6644, VPCLMULQDQ&(AVX|AVX512F), Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8|Imm8S, RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } ++vpclmullqlqdq, 0x6644/0x00, VPCLMULQDQ&(AVX|AVX512F), Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } ++vpclmulhqlqdq, 0x6644/0x01, VPCLMULQDQ&(AVX|AVX512F), Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } ++vpclmullqhqdq, 0x6644/0x10, VPCLMULQDQ&(AVX|AVX512F), Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } ++vpclmulhqhqdq, 0x6644/0x11, VPCLMULQDQ&(AVX|AVX512F), Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } + + // VPCLMULQDQ instructions end + + // AVX512F instructions. + + // is used for EVEX instructions with x/y suffixes. ++// NOTE: The order of the "unnamed" ($-prefixed) entries here needs to remain ++// in sync with , for match_template()'s EVEX-to-VEX lowering to ++// continue to work. + , 0x45, , Modrm|Vex256|Space0F|VexVVVV|VexW0|NoSuf, { R + kxnor, 0x46, , Modrm|Vex256|Space0F|VexVVVV|VexW0|NoSuf, { RegMask, RegMask, RegMask } + kxor, 0x47, , Modrm|Vex256|Space0F|VexVVVV|VexW0|NoSuf, { RegMask, RegMask, RegMask } + +-kmov, 0x90, , Modrm|Vex128|Space0F|VexW0|NoSuf, { RegMask||Unspecified|BaseIndex, RegMask } +-kmov, 0x91, , Modrm|Vex128|Space0F|VexW0|NoSuf, { RegMask, |Unspecified|BaseIndex } +-kmov, 0x92, , D|Modrm|Vex128|Space0F|VexW0|NoSuf, { Reg32, RegMask } ++kmov, 0x90, APX_F(), Modrm|Vex128|EVex128|Space0F|VexW0|NoSuf, { RegMask||Unspecified|BaseIndex, RegMask } ++kmov, 0x91, APX_F(), Modrm|Vex128|EVex128|Space0F|VexW0|NoSuf, { RegMask, |Unspecified|BaseIndex } ++kmov, 0x92, APX_F(), D|Modrm|Vex128|EVex128|Space0F|VexW0|NoSuf, { Reg32, RegMask } + + knot, 0x44, , Modrm|Vex128|Space0F|VexW0|NoSuf, { RegMask, RegMask } + kortest, 0x98, , Modrm|Vex128|Space0F|VexW0|NoSuf, { RegMask, RegMask } +@@ -2188,11 +2243,11 @@ vcvtudq2pd, 0xF37A, AVX512F, Modrm|EVex=1|Masking|Space0F|VexW=1|Broadcast|Disp8 + vcvtdq2ps, 0x5B, AVX512F, Modrm|Masking|Space0F|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|StaticRounding|SAE, { RegXMM|RegYMM|RegZMM|Dword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } + vcvtps2udq, 0x79, AVX512F, Modrm|Masking|Space0F|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|StaticRounding|SAE, { RegXMM|RegYMM|RegZMM|Dword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } + +-vcvtpd2dq, 0xf2e6, AVX512F|, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } ++vcvtpd2dq, 0xf2e6, AVX512F&, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } + +-vcvtpd2ps, 0x665a, AVX512F|, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } ++vcvtpd2ps, 0x665a, AVX512F&, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } + +-vcvtpd2udq, 0x79, AVX512F|, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } ++vcvtpd2udq, 0x79, AVX512F&, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } + + vcvtph2ps, 0x6613, AVX512F, Modrm|EVex512|Masking|Space0F38|VexW0|Disp8MemShift=5|NoSuf|SAE, { RegYMM|Unspecified|BaseIndex, RegZMM } + +@@ -2223,8 +2278,8 @@ vcvtusi2ss, 0xF37B, AVX512F, Modrm|EVexLIG|Space0F|VexVVVV|Disp8ShiftVL|No_bSuf| + + vcvtss2sd, 0xF35A, AVX512F, Modrm|EVexLIG|Masking|Space0F|VexVVVV|VexW0|Disp8MemShift=2|NoSuf|SAE, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM, RegXMM } + +-vcvttpd2dq, 0x66e6, AVX512F|, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } +-vcvttpd2udq, 0x78, AVX512F|, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } ++vcvttpd2dq, 0x66e6, AVX512F&, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } ++vcvttpd2udq, 0x78, AVX512F&, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } + + vcvttps2dq, 0xF35B, AVX512F, Modrm|Masking|Space0F|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|SAE, { RegXMM|RegYMM|RegZMM|Dword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } + vcvttps2udq, 0x78, AVX512F, Modrm|Masking|Space0F|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|SAE, { RegXMM|RegYMM|RegZMM|Dword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } +@@ -2272,8 +2327,8 @@ vmovntdqa, 0x662A, AVX512F, Modrm|Space0F38|VexW=1|Disp8ShiftVL|CheckOperandSize + vgetexpp, 0x6642, , Modrm|Masking|||Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|SAE, { RegXMM|RegYMM|RegZMM||Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } + vgetexps, 0x6643, , Modrm|EVexLIG|Masking||VexVVVV||Disp8MemShift|NoSuf|SAE, { RegXMM||Unspecified|BaseIndex, RegXMM, RegXMM } + +-vinsertf32x4, 0x6618, AVX512F, Modrm|Masking|Space0F3A|VexVVVV|VexW0|Disp8MemShift=4|CheckOperandSize|NoSuf, { Imm8, RegXMM|XMMword|Unspecified|BaseIndex, RegYMM|RegZMM, RegYMM|RegZMM } +-vinserti32x4, 0x6638, AVX512F, Modrm|Masking|Space0F3A|VexVVVV|VexW0|Disp8MemShift=4|CheckOperandSize|NoSuf, { Imm8, RegXMM|XMMword|Unspecified|BaseIndex, RegYMM|RegZMM, RegYMM|RegZMM } ++vinsertf32x4, 0x6618, AVX512F, Modrm|Masking|Space0F3A|VexVVVV|VexW0|Disp8MemShift=4|CheckOperandSize|NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegYMM|RegZMM, RegYMM|RegZMM } ++vinserti32x4, 0x6638, AVX512F, Modrm|Masking|Space0F3A|VexVVVV|VexW0|Disp8MemShift=4|CheckOperandSize|NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegYMM|RegZMM, RegYMM|RegZMM } + + vinsertf64x4, 0x661A, AVX512F, Modrm|EVex=1|Masking|Space0F3A|VexVVVV|VexW1|Disp8MemShift=5|NoSuf, { Imm8, RegYMM|Unspecified|BaseIndex, RegZMM, RegZMM } + vinserti64x4, 0x663A, AVX512F, Modrm|EVex=1|Masking|Space0F3A|VexVVVV|VexW1|Disp8MemShift=5|NoSuf, { Imm8, RegYMM|Unspecified|BaseIndex, RegZMM, RegZMM } +@@ -2470,17 +2525,17 @@ clflushopt, 0x660fae/7, ClflushOpt, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex + + // XSAVES/XRSTORS instructions. + +-xrstors, 0xfc7/3, XSAVES, Modrm|NoSuf, { Unspecified|BaseIndex } +-xrstors64, 0xfc7/3, XSAVES|x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } +-xsaves, 0xfc7/5, XSAVES, Modrm|NoSuf, { Unspecified|BaseIndex } +-xsaves64, 0xfc7/5, XSAVES|x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } ++xrstors, 0xfc7/3, XSAVES, Modrm|NoSuf|NoEgpr, { Unspecified|BaseIndex } ++xrstors64, 0xfc7/3, XSAVES&x64, Modrm|NoSuf|Size64|NoEgpr, { Unspecified|BaseIndex } ++xsaves, 0xfc7/5, XSAVES, Modrm|NoSuf|NoEgpr, { Unspecified|BaseIndex } ++xsaves64, 0xfc7/5, XSAVES&x64, Modrm|NoSuf|Size64|NoEgpr, { Unspecified|BaseIndex } + + // XSAVES instructions end. + + // XSAVEC instructions. + +-xsavec, 0xfc7/4, XSAVEC, Modrm|NoSuf, { Unspecified|BaseIndex } +-xsavec64, 0xfc7/4, XSAVEC|x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } ++xsavec, 0xfc7/4, XSAVEC, Modrm|NoSuf|NoEgpr, { Unspecified|BaseIndex } ++xsavec64, 0xfc7/4, XSAVEC&x64, Modrm|NoSuf|Size64|NoEgpr, { Unspecified|BaseIndex } + + // XSAVEC instructions end. + +@@ -2494,108 +2549,108 @@ enclv, 0xf01c0, SE1, NoSuf, {} + + // AVX512VL instructions. + +-vgatherdpd, 0x6692, AVX512F|AVX512VL, Modrm|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB128|NoSuf, { Qword|Unspecified|BaseIndex, RegXMM|RegYMM } +-vgatherdps, 0x6692, AVX512F|AVX512VL, Modrm|EVex=2|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB128|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM } +-vgatherdps, 0x6692, AVX512F|AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { Dword|Unspecified|BaseIndex, RegYMM } +-vgatherqp, 0x6693, AVX512F|AVX512VL, Modrm|EVex128|Masking|NoDefMask|Space0F38||Disp8MemShift|VecSIB128|NoSuf, { |Unspecified|BaseIndex, RegXMM } +-vgatherqpd, 0x6693, AVX512F|AVX512VL, Modrm|EVex256|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB256|NoSuf, { Qword|Unspecified|BaseIndex, RegYMM } +-vgatherqps, 0x6693, AVX512F|AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM } +-vpgatherdd, 0x6690, AVX512F|AVX512VL, Modrm|EVex=2|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB128|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM } +-vpgatherdd, 0x6690, AVX512F|AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { Dword|Unspecified|BaseIndex, RegYMM } +-vpgatherdq, 0x6690, AVX512F|AVX512VL, Modrm|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB128|NoSuf, { Qword|Unspecified|BaseIndex, RegXMM|RegYMM } +-vpgatherq, 0x6691, AVX512F|AVX512VL, Modrm|EVex128|Masking|NoDefMask|Space0F38||Disp8MemShift|VecSIB128|NoSuf, { |Unspecified|BaseIndex, RegXMM } +-vpgatherqd, 0x6691, AVX512F|AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM } +-vpgatherqq, 0x6691, AVX512F|AVX512VL, Modrm|EVex256|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB256|NoSuf, { Qword|Unspecified|BaseIndex, RegYMM } +- +-vpscatterdd, 0x66A0, AVX512F|AVX512VL, Modrm|EVex=2|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB128|NoSuf, { RegXMM, Dword|Unspecified|BaseIndex } +-vpscatterdd, 0x66A0, AVX512F|AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { RegYMM, Dword|Unspecified|BaseIndex } +-vpscatterdq, 0x66A0, AVX512F|AVX512VL, Modrm|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB128|NoSuf, { RegXMM|RegYMM, Qword|Unspecified|BaseIndex } +-vpscatterq, 0x66A1, AVX512F|AVX512VL, Modrm|EVex128|Masking|NoDefMask|Space0F38||Disp8MemShift|VecSIB128|NoSuf, { RegXMM, |Unspecified|BaseIndex } +-vpscatterqd, 0x66A1, AVX512F|AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { RegXMM, Dword|Unspecified|BaseIndex } +-vpscatterqq, 0x66A1, AVX512F|AVX512VL, Modrm|EVex256|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB256|NoSuf, { RegYMM, Qword|Unspecified|BaseIndex } +-vscatterdpd, 0x66A2, AVX512F|AVX512VL, Modrm|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB128|NoSuf, { RegXMM|RegYMM, Qword|Unspecified|BaseIndex } +-vscatterdps, 0x66A2, AVX512F|AVX512VL, Modrm|EVex=2|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB128|NoSuf, { RegXMM, Dword|Unspecified|BaseIndex } +-vscatterdps, 0x66A2, AVX512F|AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { RegYMM, Dword|Unspecified|BaseIndex } +-vscatterqp, 0x66A3, AVX512F|AVX512VL, Modrm|EVex128|Masking|NoDefMask|Space0F38||Disp8MemShift|VecSIB128|NoSuf, { RegXMM, |Unspecified|BaseIndex } +-vscatterqpd, 0x66A3, AVX512F|AVX512VL, Modrm|EVex256|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB256|NoSuf, { RegYMM, Qword|Unspecified|BaseIndex } +-vscatterqps, 0x66A3, AVX512F|AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { RegXMM, Dword|Unspecified|BaseIndex } +- +-vcvtdq2pd, 0xF3E6, AVX512F|AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } +-vcvtdq2pd, 0xF3E6, AVX512F|AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } +-vcvtudq2pd, 0xF37A, AVX512F|AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } +-vcvtudq2pd, 0xF37A, AVX512F|AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } +- +-vcvtph2ps, 0x6613, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } +-vcvtph2ps, 0x6613, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } +- +-vcvtps2pd, 0x5A, AVX512F|AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } +-vcvtps2pd, 0x5A, AVX512F|AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } +- +-vcvtps2ph, 0x661D, AVX512F|AVX512VL, Modrm|EVex128|Masking|Space0F3A|VexW0|Disp8MemShift=3|NoSuf, { Imm8, RegXMM, RegXMM|Qword|Unspecified|BaseIndex } +-vcvtps2ph, 0x661D, AVX512F|AVX512VL, Modrm|EVex256|Masking|Space0F3A|VexW0|Disp8MemShift=4|NoSuf, { Imm8, RegYMM, RegXMM|Unspecified|BaseIndex } +- +-vmovddup, 0xF212, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F|VexW1|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } +- +-vpmovdb, 0xF331, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } +-vpmovdb, 0xF331, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } +-vpmovsdb, 0xF321, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } +-vpmovsdb, 0xF321, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } +-vpmovusdb, 0xF311, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } +-vpmovusdb, 0xF311, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } +- +-vpmovdw, 0xF333, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } +-vpmovdw, 0xF333, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } +-vpmovsdw, 0xF323, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } +-vpmovsdw, 0xF323, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } +-vpmovusdw, 0xF313, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } +-vpmovusdw, 0xF313, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } +- +-vpmovqb, 0xF332, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=1|NoSuf, { RegXMM, RegXMM|Word|Unspecified|BaseIndex } +-vpmovqb, 0xF332, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegYMM, RegXMM|Dword|Unspecified|BaseIndex } +-vpmovsqb, 0xF322, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=1|NoSuf, { RegXMM, RegXMM|Word|Unspecified|BaseIndex } +-vpmovsqb, 0xF322, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegYMM, RegXMM|Dword|Unspecified|BaseIndex } +-vpmovusqb, 0xF312, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=1|NoSuf, { RegXMM, RegXMM|Word|Unspecified|BaseIndex } +-vpmovusqb, 0xF312, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegYMM, RegXMM|Dword|Unspecified|BaseIndex } +- +-vpmovqd, 0xF335, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } +-vpmovqd, 0xF335, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } +-vpmovsqd, 0xF325, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } +-vpmovsqd, 0xF325, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } +-vpmovusqd, 0xF315, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } +-vpmovusqd, 0xF315, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } +- +-vpmovqw, 0xF334, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } +-vpmovqw, 0xF334, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } +-vpmovsqw, 0xF324, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } +-vpmovsqw, 0xF324, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } +-vpmovusqw, 0xF314, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } +-vpmovusqw, 0xF314, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } +- +-vpmovsxdq, 0x6625, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } +-vpmovsxdq, 0x6625, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } +-vpmovzxdq, 0x6635, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } +-vpmovzxdq, 0x6635, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } ++vgatherdpd, 0x6692, AVX512VL, Modrm|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB128|NoSuf, { Qword|Unspecified|BaseIndex, RegXMM|RegYMM } ++vgatherdps, 0x6692, AVX512VL, Modrm|EVex=2|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB128|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM } ++vgatherdps, 0x6692, AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { Dword|Unspecified|BaseIndex, RegYMM } ++vgatherqp, 0x6693, AVX512VL, Modrm|EVex128|Masking|NoDefMask|Space0F38||Disp8MemShift|VecSIB128|NoSuf, { |Unspecified|BaseIndex, RegXMM } ++vgatherqpd, 0x6693, AVX512VL, Modrm|EVex256|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB256|NoSuf, { Qword|Unspecified|BaseIndex, RegYMM } ++vgatherqps, 0x6693, AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM } ++vpgatherdd, 0x6690, AVX512VL, Modrm|EVex=2|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB128|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM } ++vpgatherdd, 0x6690, AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { Dword|Unspecified|BaseIndex, RegYMM } ++vpgatherdq, 0x6690, AVX512VL, Modrm|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB128|NoSuf, { Qword|Unspecified|BaseIndex, RegXMM|RegYMM } ++vpgatherq, 0x6691, AVX512VL, Modrm|EVex128|Masking|NoDefMask|Space0F38||Disp8MemShift|VecSIB128|NoSuf, { |Unspecified|BaseIndex, RegXMM } ++vpgatherqd, 0x6691, AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM } ++vpgatherqq, 0x6691, AVX512VL, Modrm|EVex256|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB256|NoSuf, { Qword|Unspecified|BaseIndex, RegYMM } ++ ++vpscatterdd, 0x66A0, AVX512VL, Modrm|EVex=2|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB128|NoSuf, { RegXMM, Dword|Unspecified|BaseIndex } ++vpscatterdd, 0x66A0, AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { RegYMM, Dword|Unspecified|BaseIndex } ++vpscatterdq, 0x66A0, AVX512VL, Modrm|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB128|NoSuf, { RegXMM|RegYMM, Qword|Unspecified|BaseIndex } ++vpscatterq, 0x66A1, AVX512VL, Modrm|EVex128|Masking|NoDefMask|Space0F38||Disp8MemShift|VecSIB128|NoSuf, { RegXMM, |Unspecified|BaseIndex } ++vpscatterqd, 0x66A1, AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { RegXMM, Dword|Unspecified|BaseIndex } ++vpscatterqq, 0x66A1, AVX512VL, Modrm|EVex256|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB256|NoSuf, { RegYMM, Qword|Unspecified|BaseIndex } ++vscatterdpd, 0x66A2, AVX512VL, Modrm|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB128|NoSuf, { RegXMM|RegYMM, Qword|Unspecified|BaseIndex } ++vscatterdps, 0x66A2, AVX512VL, Modrm|EVex=2|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB128|NoSuf, { RegXMM, Dword|Unspecified|BaseIndex } ++vscatterdps, 0x66A2, AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { RegYMM, Dword|Unspecified|BaseIndex } ++vscatterqp, 0x66A3, AVX512VL, Modrm|EVex128|Masking|NoDefMask|Space0F38||Disp8MemShift|VecSIB128|NoSuf, { RegXMM, |Unspecified|BaseIndex } ++vscatterqpd, 0x66A3, AVX512VL, Modrm|EVex256|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB256|NoSuf, { RegYMM, Qword|Unspecified|BaseIndex } ++vscatterqps, 0x66A3, AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { RegXMM, Dword|Unspecified|BaseIndex } ++ ++vcvtdq2pd, 0xF3E6, AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } ++vcvtdq2pd, 0xF3E6, AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } ++vcvtudq2pd, 0xF37A, AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } ++vcvtudq2pd, 0xF37A, AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } ++ ++vcvtph2ps, 0x6613, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } ++vcvtph2ps, 0x6613, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } ++ ++vcvtps2pd, 0x5A, AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } ++vcvtps2pd, 0x5A, AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } ++ ++vcvtps2ph, 0x661D, AVX512VL, Modrm|EVex128|Masking|Space0F3A|VexW0|Disp8MemShift=3|NoSuf, { Imm8, RegXMM, RegXMM|Qword|Unspecified|BaseIndex } ++vcvtps2ph, 0x661D, AVX512VL, Modrm|EVex256|Masking|Space0F3A|VexW0|Disp8MemShift=4|NoSuf, { Imm8, RegYMM, RegXMM|Unspecified|BaseIndex } ++ ++vmovddup, 0xF212, AVX512VL, Modrm|EVex=2|Masking|Space0F|VexW1|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } ++ ++vpmovdb, 0xF331, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } ++vpmovdb, 0xF331, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } ++vpmovsdb, 0xF321, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } ++vpmovsdb, 0xF321, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } ++vpmovusdb, 0xF311, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } ++vpmovusdb, 0xF311, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } ++ ++vpmovdw, 0xF333, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } ++vpmovdw, 0xF333, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } ++vpmovsdw, 0xF323, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } ++vpmovsdw, 0xF323, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } ++vpmovusdw, 0xF313, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } ++vpmovusdw, 0xF313, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } ++ ++vpmovqb, 0xF332, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=1|NoSuf, { RegXMM, RegXMM|Word|Unspecified|BaseIndex } ++vpmovqb, 0xF332, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegYMM, RegXMM|Dword|Unspecified|BaseIndex } ++vpmovsqb, 0xF322, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=1|NoSuf, { RegXMM, RegXMM|Word|Unspecified|BaseIndex } ++vpmovsqb, 0xF322, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegYMM, RegXMM|Dword|Unspecified|BaseIndex } ++vpmovusqb, 0xF312, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=1|NoSuf, { RegXMM, RegXMM|Word|Unspecified|BaseIndex } ++vpmovusqb, 0xF312, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegYMM, RegXMM|Dword|Unspecified|BaseIndex } ++ ++vpmovqd, 0xF335, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } ++vpmovqd, 0xF335, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } ++vpmovsqd, 0xF325, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } ++vpmovsqd, 0xF325, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } ++vpmovusqd, 0xF315, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } ++vpmovusqd, 0xF315, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } ++ ++vpmovqw, 0xF334, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } ++vpmovqw, 0xF334, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } ++vpmovsqw, 0xF324, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } ++vpmovsqw, 0xF324, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } ++vpmovusqw, 0xF314, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } ++vpmovusqw, 0xF314, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } ++ ++vpmovsxdq, 0x6625, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } ++vpmovsxdq, 0x6625, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } ++vpmovzxdq, 0x6635, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } ++vpmovzxdq, 0x6635, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } + + // AVX512VL instructions end. + + // AVX512BW instructions. + +-kadd, 0x4a, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1||NoSuf, { RegMask, RegMask, RegMask } +-kand, 0x41, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1||NoSuf, { RegMask, RegMask, RegMask } +-kandn, 0x42, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1||NoSuf|Optimize, { RegMask, RegMask, RegMask } +-kmov, 0x90, AVX512BW, Modrm|Vex128|Space0F|VexW1||NoSuf, { RegMask||Unspecified|BaseIndex, RegMask } +-kmov, 0x91, AVX512BW, Modrm|Vex128|Space0F|VexW1||NoSuf, { RegMask, |Unspecified|BaseIndex } +-kmov, 0xf292, AVX512BW, D|Modrm|Vex128|Space0F|||NoSuf, { , RegMask } +-knot, 0x44, AVX512BW, Modrm|Vex128|Space0F|VexW1||NoSuf, { RegMask, RegMask } +-kor, 0x45, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1||NoSuf, { RegMask, RegMask, RegMask } +-kortest, 0x98, AVX512BW, Modrm|Vex128|Space0F|VexW1||NoSuf, { RegMask, RegMask } +-ktest, 0x99, AVX512BW, Modrm|Vex128|Space0F|VexW1||NoSuf, { RegMask, RegMask } +-kxnor, 0x46, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1||NoSuf, { RegMask, RegMask, RegMask } +-kxor, 0x47, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1||NoSuf|Optimize, { RegMask, RegMask, RegMask } +-kunpckdq, 0x4B, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1|Vsz512|NoSuf, { RegMask, RegMask, RegMask } +-kunpckwd, 0x4B, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW0|Vsz256|NoSuf, { RegMask, RegMask, RegMask } +-kshiftl, 0x6633, AVX512BW, Modrm|Vex128|Space0F3A|||NoSuf, { Imm8, RegMask, RegMask } +-kshiftr, 0x6631, AVX512BW, Modrm|Vex128|Space0F3A|||NoSuf, { Imm8, RegMask, RegMask } ++kadd, 0x4a, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1|NoSuf, { RegMask, RegMask, RegMask } ++kand, 0x41, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1|NoSuf, { RegMask, RegMask, RegMask } ++kandn, 0x42, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1|NoSuf|Optimize, { RegMask, RegMask, RegMask } ++kmov, 0x90, APX_F(AVX512BW), Modrm|Vex128|EVex128|Space0F|VexW1|NoSuf, { RegMask||Unspecified|BaseIndex, RegMask } ++kmov, 0x91, APX_F(AVX512BW), Modrm|Vex128|EVex128|Space0F|VexW1|NoSuf, { RegMask, |Unspecified|BaseIndex } ++kmov, 0xf292, APX_F(AVX512BW), D|Modrm|Vex128|EVex128|Space0F||NoSuf, { , RegMask } ++knot, 0x44, AVX512BW, Modrm|Vex128|Space0F|VexW1|NoSuf, { RegMask, RegMask } ++kor, 0x45, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1|NoSuf, { RegMask, RegMask, RegMask } ++kortest, 0x98, AVX512BW, Modrm|Vex128|Space0F|VexW1|NoSuf, { RegMask, RegMask } ++ktest, 0x99, AVX512BW, Modrm|Vex128|Space0F|VexW1|NoSuf, { RegMask, RegMask } ++kxnor, 0x46, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1|NoSuf, { RegMask, RegMask, RegMask } ++kxor, 0x47, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1|NoSuf|Optimize, { RegMask, RegMask, RegMask } ++kunpckdq, 0x4B, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1|NoSuf, { RegMask, RegMask, RegMask } ++kunpckwd, 0x4B, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW0|NoSuf, { RegMask, RegMask, RegMask } ++kshiftl, 0x6633, AVX512BW, Modrm|Vex128|Space0F3A||NoSuf, { Imm8, RegMask, RegMask } ++kshiftr, 0x6631, AVX512BW, Modrm|Vex128|Space0F3A||NoSuf, { Imm8, RegMask, RegMask } + + vdbpsadbw, 0x6642, AVX512BW, Modrm|Masking|Space0F3A|VexVVVV|VexW0|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8|Imm8S, RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } + +@@ -2681,23 +2736,23 @@ vpmov2m, 0xf329, AVX512BW, Modrm|EVexDYN|Space0F38||NoSuf, { RegXMM + vpmovm2, 0xf328, AVX512BW, Modrm|EVexDYN|Space0F38||NoSuf, { RegMask, RegXMM|RegYMM|RegZMM } + + vpmovswb, 0xF320, AVX512BW, Modrm|EVex=1|Masking|Space0F38|VexW=1|Disp8MemShift=5|NoSuf, { RegZMM, RegYMM|Unspecified|BaseIndex } +-vpmovswb, 0xF320, AVX512BW|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } +-vpmovswb, 0xF320, AVX512BW|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } ++vpmovswb, 0xF320, AVX512BW&AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } ++vpmovswb, 0xF320, AVX512BW&AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } + + vpmovuswb, 0xF310, AVX512BW, Modrm|EVex=1|Masking|Space0F38|VexW=1|Disp8MemShift=5|NoSuf, { RegZMM, RegYMM|Unspecified|BaseIndex } +-vpmovuswb, 0xF310, AVX512BW|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } +-vpmovuswb, 0xF310, AVX512BW|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } ++vpmovuswb, 0xF310, AVX512BW&AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } ++vpmovuswb, 0xF310, AVX512BW&AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } + + vpmovwb, 0xF330, AVX512BW, Modrm|EVex=1|Masking|Space0F38|VexW=1|Disp8MemShift=5|NoSuf, { RegZMM, RegYMM|Unspecified|BaseIndex } +-vpmovwb, 0xF330, AVX512BW|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } +-vpmovwb, 0xF330, AVX512BW|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } ++vpmovwb, 0xF330, AVX512BW&AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } ++vpmovwb, 0xF330, AVX512BW&AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } + + vpmovsxbw, 0x6620, AVX512BW, Modrm|EVex=1|Masking|Space0F38|VexWIG|Disp8MemShift=5|NoSuf, { RegYMM|Unspecified|BaseIndex, RegZMM } +-vpmovsxbw, 0x6620, AVX512BW|AVX512VL, Modrm|EVex=2|Masking|VexWIG|Space0F38|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } +-vpmovsxbw, 0x6620, AVX512BW|AVX512VL, Modrm|EVex=3|Masking|VexWIG|Space0F38|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } ++vpmovsxbw, 0x6620, AVX512BW&AVX512VL, Modrm|EVex=2|Masking|VexWIG|Space0F38|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } ++vpmovsxbw, 0x6620, AVX512BW&AVX512VL, Modrm|EVex=3|Masking|VexWIG|Space0F38|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } + vpmovzxbw, 0x6630, AVX512BW, Modrm|EVex=1|Masking|Space0F38|VexWIG|Disp8MemShift=5|NoSuf, { RegYMM|Unspecified|BaseIndex, RegZMM } +-vpmovzxbw, 0x6630, AVX512BW|AVX512VL, Modrm|EVex=2|Masking|VexWIG|Space0F38|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } +-vpmovzxbw, 0x6630, AVX512BW|AVX512VL, Modrm|EVex=3|Masking|VexWIG|Space0F38|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } ++vpmovzxbw, 0x6630, AVX512BW&AVX512VL, Modrm|EVex=2|Masking|VexWIG|Space0F38|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } ++vpmovzxbw, 0x6630, AVX512BW&AVX512VL, Modrm|EVex=3|Masking|VexWIG|Space0F38|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } + + vpsadbw, 0x66F6, AVX512BW, Modrm|Space0F|VexVVVV|VexWIG|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } + +@@ -2738,36 +2793,36 @@ vcvtpd2qq, 0x667B, AVX512DQ, Modrm|Masking|Space0F|VexW1|Broadcast|Disp8ShiftVL| + vcvtpd2uqq, 0x6679, AVX512DQ, Modrm|Masking|Space0F|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|StaticRounding|SAE, { RegXMM|RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } + + vcvtps2qq, 0x667B, AVX512DQ, Modrm|EVex512|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=5|NoSuf|StaticRounding|SAE, { RegYMM|Dword|Unspecified|BaseIndex, RegZMM } +-vcvtps2qq, 0x667B, AVX512DQ|AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } +-vcvtps2qq, 0x667B, AVX512DQ|AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } ++vcvtps2qq, 0x667B, AVX512DQ&AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } ++vcvtps2qq, 0x667B, AVX512DQ&AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } + vcvtps2uqq, 0x6679, AVX512DQ, Modrm|EVex512|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=5|NoSuf|StaticRounding|SAE, { RegYMM|Dword|Unspecified|BaseIndex, RegZMM } +-vcvtps2uqq, 0x6679, AVX512DQ|AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } +-vcvtps2uqq, 0x6679, AVX512DQ|AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|RegXMM|Dword|Unspecified|BaseIndex, RegYMM } ++vcvtps2uqq, 0x6679, AVX512DQ&AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } ++vcvtps2uqq, 0x6679, AVX512DQ&AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|RegXMM|Dword|Unspecified|BaseIndex, RegYMM } + + vcvtqq2pd, 0xF3E6, AVX512DQ, Modrm|Masking|Space0F|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|StaticRounding|SAE, { RegXMM|RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } + vcvtuqq2pd, 0xF37A, AVX512DQ, Modrm|Masking|Space0F|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|StaticRounding|SAE, { RegXMM|RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } + +-vcvtqq2ps, 0x5b, AVX512DQ|, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } ++vcvtqq2ps, 0x5b, AVX512DQ&, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } + + vcvttpd2qq, 0x667A, AVX512DQ, Modrm|Masking|Space0F|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|SAE, { RegXMM|RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } + vcvttpd2uqq, 0x6678, AVX512DQ, Modrm|Masking|Space0F|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|SAE, { RegXMM|RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } + + vcvttps2qq, 0x667A, AVX512DQ, Modrm|EVex512|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=5|NoSuf|SAE, { RegYMM|Dword|Unspecified|BaseIndex, RegZMM } +-vcvttps2qq, 0x667A, AVX512DQ|AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } +-vcvttps2qq, 0x667A, AVX512DQ|AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } ++vcvttps2qq, 0x667A, AVX512DQ&AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } ++vcvttps2qq, 0x667A, AVX512DQ&AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } + vcvttps2uqq, 0x6678, AVX512DQ, Modrm|EVex512|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=5|NoSuf|SAE, { RegYMM|Dword|Unspecified|BaseIndex, RegZMM } +-vcvttps2uqq, 0x6678, AVX512DQ|AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } +-vcvttps2uqq, 0x6678, AVX512DQ|AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } ++vcvttps2uqq, 0x6678, AVX512DQ&AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } ++vcvttps2uqq, 0x6678, AVX512DQ&AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } + +-vcvtuqq2ps, 0xf27a, AVX512DQ|, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } ++vcvtuqq2ps, 0xf27a, AVX512DQ&, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } + + vextractf32x8, 0x661B, AVX512DQ, Modrm|EVex=1|Masking|Space0F3A|VexW=1|Disp8MemShift=5|NoSuf, { Imm8, RegZMM, RegYMM|Unspecified|BaseIndex } + vextracti32x8, 0x663B, AVX512DQ, Modrm|EVex=1|Masking|Space0F3A|VexW=1|Disp8MemShift=5|NoSuf, { Imm8, RegZMM, RegYMM|Unspecified|BaseIndex } + vinsertf32x8, 0x661A, AVX512DQ, Modrm|EVex512|Masking|Space0F3A|VexVVVV|VexW0|Disp8MemShift=5|NoSuf, { Imm8, RegYMM|Unspecified|BaseIndex, RegZMM, RegZMM } + vinserti32x8, 0x663A, AVX512DQ, Modrm|EVex512|Masking|Space0F3A|VexVVVV|VexW0|Disp8MemShift=5|NoSuf, { Imm8, RegYMM|Unspecified|BaseIndex, RegZMM, RegZMM } + +-vpextr, 0x6616, AVX512DQ|, Modrm|EVex128|Space0F3A||Disp8MemShift|NoSuf, { Imm8, RegXMM, |Unspecified|BaseIndex } +-vpinsr, 0x6622, AVX512DQ|, Modrm|EVex128|Space0F3A|VexVVVV||Disp8MemShift|NoSuf, { Imm8, |Unspecified|BaseIndex, RegXMM, RegXMM } ++vpextr, 0x6616, AVX512DQ&, Modrm|EVex128|Space0F3A||Disp8MemShift|NoSuf, { Imm8, RegXMM, |Unspecified|BaseIndex } ++vpinsr, 0x6622, AVX512DQ&, Modrm|EVex128|Space0F3A|VexVVVV||Disp8MemShift|NoSuf, { Imm8, |Unspecified|BaseIndex, RegXMM, RegXMM } + + vextractf64x2, 0x6619, AVX512DQ, Modrm|Masking|Space0F3A|VexW=2|Disp8MemShift=4|NoSuf, { Imm8, RegYMM|RegZMM, RegXMM|Unspecified|BaseIndex } + vextracti64x2, 0x6639, AVX512DQ, Modrm|Masking|Space0F3A|VexW=2|Disp8MemShift=4|NoSuf, { Imm8, RegYMM|RegZMM, RegXMM|Unspecified|BaseIndex } +@@ -2777,8 +2832,8 @@ vinserti64x2, 0x6638, AVX512DQ, Modrm|Masking|Space0F3A|VexVVVV|VexW1|Disp8MemSh + vfpclassp, 0x6666, AVX512DQ, Modrm|Masking|Space0F3A||Broadcast|Disp8ShiftVL|NoSuf|IntelSyntax, { Imm8|Imm8S, RegXMM|RegYMM|RegZMM||Unspecified|BaseIndex, RegMask } + vfpclassp, 0x6666, AVX512DQ, Modrm|Masking|Space0F3A||Broadcast|Disp8ShiftVL|NoSuf|ATTSyntax, { Imm8|Imm8S, RegXMM|RegYMM|RegZMM||BaseIndex, RegMask } + vfpclasspz, 0x6666, AVX512DQ, Modrm|EVex512|Masking|Space0F3A||Broadcast|Disp8MemShift=6|NoSuf, { Imm8|Imm8S, RegZMM||Unspecified|BaseIndex, RegMask } +-vfpclasspx, 0x6666, AVX512DQ|AVX512VL, Modrm|EVex128|Masking|Space0F3A||Broadcast|Disp8MemShift=4|NoSuf, { Imm8|Imm8S, RegXMM||Unspecified|BaseIndex, RegMask } +-vfpclasspy, 0x6666, AVX512DQ|AVX512VL, Modrm|EVex256|Masking|Space0F3A||Broadcast|Disp8MemShift=5|NoSuf, { Imm8|Imm8S, RegYMM||Unspecified|BaseIndex, RegMask } ++vfpclasspx, 0x6666, AVX512DQ&AVX512VL, Modrm|EVex128|Masking|Space0F3A||Broadcast|Disp8MemShift=4|NoSuf, { Imm8|Imm8S, RegXMM||Unspecified|BaseIndex, RegMask } ++vfpclasspy, 0x6666, AVX512DQ&AVX512VL, Modrm|EVex256|Masking|Space0F3A||Broadcast|Disp8MemShift=5|NoSuf, { Imm8|Imm8S, RegYMM||Unspecified|BaseIndex, RegMask } + vfpclasss, 0x67, , Modrm|EVexLIG|Masking|Space0F3A||Disp8MemShift|NoSuf, { Imm8|Imm8S, RegXMM||Unspecified|BaseIndex, RegMask } + + vpmov2m, 0xf339, AVX512DQ, Modrm|EVexDYN|Space0F38||NoSuf, { RegXMM|RegYMM|RegZMM, RegMask } +@@ -2916,8 +2971,8 @@ vpshufbitqmb, 0x668f, AVX512_BITALG, Modrm|Masking|Space0F38|VexVVVV|VexW0|Disp8 + + // AVX512 + GFNI instructions + +-vgf2p8affineinvqb, 0x66cf, GFNI|AVX512F, Modrm|Masking|Space0F3A|VexVVVV|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8, RegXMM|RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } +-vgf2p8affineqb, 0x66ce, GFNI|AVX512F, Modrm|Masking|Space0F3A|VexVVVV|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8, RegXMM|RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } ++vgf2p8affineinvqb, 0x66cf, GFNI&AVX512F, Modrm|Masking|Space0F3A|VexVVVV|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8, RegXMM|RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } ++vgf2p8affineqb, 0x66ce, GFNI&AVX512F, Modrm|Masking|Space0F3A|VexVVVV|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8, RegXMM|RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } + + // AVX512 + GFNI instructions end + +@@ -2946,7 +3001,7 @@ clzero, 0xf01fc, CLZERO, AddrPrefixOpReg|NoSuf, { Acc|Word|Dword|Qword } + monitorx, 0xf01fa, MWAITX, NoSuf, {} + monitorx, 0xf01fa, MWAITX, AddrPrefixOpReg|NoSuf, { Acc|Word|Dword|Qword, RegC|Dword, RegD|Dword } + // The 64-bit form exists only for compatibility with older gas. +-monitorx, 0xf01fa, MWAITX|x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword, RegD|Qword } ++monitorx, 0xf01fa, MWAITX&x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword, RegD|Qword } + + mwaitx, 0xf01fb, MWAITX, NoSuf, {} + // The 64-bit form exists only for compatibility with older gas. +@@ -2963,30 +3018,34 @@ wrpkru, 0xf01ef, OSPKE, NoSuf, {} + + // RDPID instructions. + +-rdpid, 0xf30fc7/7, RDPID|No64, Modrm|IgnoreSize|NoSuf, { Reg32 } +-rdpid, 0xf30fc7/7, RDPID|x64, Modrm|NoSuf|NoRex64, { Reg64 } ++rdpid, 0xf30fc7/7, RDPID&No64, Modrm|IgnoreSize|NoSuf, { Reg32 } ++rdpid, 0xf30fc7/7, RDPID&x64, Modrm|NoSuf|NoRex64, { Reg64 } + + // RDPID instructions end. + + // PTWRITE instructions. + +-ptwrite, 0xf30fae/4, PTWRITE|No64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Reg32|Unspecified|BaseIndex } +-ptwrite, 0xf30fae/4, PTWRITE|x64, Modrm|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex } ++ptwrite, 0xf30fae/4, PTWRITE&No64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Reg32|Unspecified|BaseIndex } ++ptwrite, 0xf30fae/4, PTWRITE&x64, Modrm|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex } + + // PTWRITE instructions end. + + // CET instructions. + + incsspd, 0xf30fae/5, SHSTK, Modrm|IgnoreSize|NoSuf, { Reg32 } +-incsspq, 0xf30fae/5, SHSTK|x64, Modrm|NoSuf, { Reg64 } ++incsspq, 0xf30fae/5, SHSTK&x64, Modrm|NoSuf, { Reg64 } + rdsspd, 0xf30f1e/1, SHSTK, Modrm|IgnoreSize|NoSuf, { Reg32 } +-rdsspq, 0xf30f1e/1, SHSTK|x64, Modrm|NoSuf, { Reg64 } ++rdsspq, 0xf30f1e/1, SHSTK&x64, Modrm|NoSuf, { Reg64 } + saveprevssp, 0xf30f01ea, SHSTK, NoSuf, {} + rstorssp, 0xf30f01/5, SHSTK, Modrm|NoSuf, { Qword|Unspecified|BaseIndex } + wrssd, 0x0f38f6, SHSTK, Modrm|IgnoreSize|NoSuf, { Reg32, Dword|Unspecified|BaseIndex } +-wrssq, 0x0f38f6, SHSTK|x64, Modrm|NoSuf|Size64, { Reg64, Qword|Unspecified|BaseIndex } ++wrssd, 0x66, SHSTK&APX_F, Modrm|NoSuf|EVexMap4, { Reg32, Dword|Unspecified|BaseIndex } ++wrssq, 0x0f38f6, SHSTK&x64, Modrm|NoSuf, { Reg64, Qword|Unspecified|BaseIndex } ++wrssq, 0x66, SHSTK&APX_F, Modrm|NoSuf|EVexMap4, { Reg64, Qword|Unspecified|BaseIndex } + wrussd, 0x660f38f5, SHSTK, Modrm|IgnoreSize|NoSuf, { Reg32, Dword|Unspecified|BaseIndex } +-wrussq, 0x660f38f5, SHSTK|x64, Modrm|NoSuf, { Reg64, Qword|Unspecified|BaseIndex } ++wrussd, 0x6665, SHSTK&APX_F, Modrm|NoSuf|EVexMap4, { Reg32, Dword|Unspecified|BaseIndex } ++wrussq, 0x660f38f5, SHSTK&x64, Modrm|NoSuf, { Reg64, Qword|Unspecified|BaseIndex } ++wrussq, 0x6665, SHSTK&APX_F, Modrm|NoSuf|EVexMap4, { Reg64, Qword|Unspecified|BaseIndex } + setssbsy, 0xf30f01e8, SHSTK, NoSuf, {} + clrssbsy, 0xf30fae/6, SHSTK, Modrm|NoSuf, { Qword|Unspecified|BaseIndex } + endbr64, 0xf30f1efa, IBT, NoSuf, {} +@@ -3011,7 +3070,7 @@ pconfig, 0x0f01c5, PCONFIG, NoSuf, {} + + // PBNDKB instruction. + +-pbndkb, 0x0f01c7, PBNDKB|x64, NoSuf, {} ++pbndkb, 0x0f01c7, PBNDKB, NoSuf, {} + + // PBNDKB instruction end. + +@@ -3034,7 +3093,9 @@ cldemote, 0x0f1c/0, CLDEMOTE, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex } + // MOVDIR[I,64B] instructions. + + movdiri, 0xf38f9, MOVDIRI, Modrm|CheckOperandSize|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } ++movdiri, 0xf9, MOVDIRI&APX_F, Modrm|CheckOperandSize|No_bSuf|No_wSuf|No_sSuf|EVexMap4, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } + movdir64b, 0x660f38f8, MOVDIR64B, Modrm|AddrPrefixOpReg|NoSuf, { Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++movdir64b, 0x66f8, MOVDIR64B&APX_F, Modrm|AddrPrefixOpReg|NoSuf|EVexMap4, { Unspecified|BaseIndex, Reg32|Reg64 } + + // MOVEDIR instructions end. + +@@ -3042,7 +3103,7 @@ movdir64b, 0x660f38f8, MOVDIR64B, Modrm|AddrPrefixOpReg|NoSuf, { Unspecified|Bas + + vcvtne2ps2bf16, 0xf272, AVX512_BF16, Modrm|Space0F38|VexVVVV|Masking|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Dword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } + +-vcvtneps2bf16, 0xf372, AVX512_BF16|, Modrm|Space0F38||Masking|VexW0|Broadcast|NoSuf, { |Dword, } ++vcvtneps2bf16, 0xf372, AVX512_BF16&, Modrm|Space0F38||Masking|VexW0|Broadcast|NoSuf, { |Dword, } + + vdpbf16ps, 0xf352, AVX512_BF16, Modrm|Space0F38|VexVVVV|Masking|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Dword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } + +@@ -3063,7 +3124,9 @@ vcvtneps2bf16, 0xf372, AVX_NE_CONVERT, Modrm||Space0F38|VexW0|NoSu + // ENQCMD instructions. + + enqcmd, 0xf20f38f8, ENQCMD, Modrm|AddrPrefixOpReg|NoSuf, { Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++enqcmd, 0xf2f8, APX_F(ENQCMD), Modrm|AddrPrefixOpReg|NoSuf|EVexMap4, { Unspecified|BaseIndex, Reg32|Reg64 } + enqcmds, 0xf30f38f8, ENQCMD, Modrm|AddrPrefixOpReg|NoSuf, { Unspecified|BaseIndex, Reg16|Reg32|Reg64 } ++enqcmds, 0xf3f8, APX_F(ENQCMD), Modrm|AddrPrefixOpReg|NoSuf|EVexMap4, { Unspecified|BaseIndex, Reg32|Reg64 } + + // ENQCMD instructions end. + +@@ -3081,25 +3144,25 @@ mcommit, 0xf30f01fa, MCOMMIT, NoSuf, {} + + // SNP instructions + +-psmash, 0xf30f01ff, SNP|x64, NoSuf, {} +-psmash, 0xf30f01ff, SNP|x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword } ++psmash, 0xf30f01ff, SNP&x64, NoSuf, {} ++psmash, 0xf30f01ff, SNP&x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword } + pvalidate, 0xf20f01ff, SNP, NoSuf, {} + pvalidate, 0xf20f01ff, SNP, AddrPrefixOpReg|NoSuf, { Acc|Word|Dword|Qword, RegC|Dword, RegD|Dword } +-rmpupdate, 0xf20f01fe, SNP|x64, NoSuf, {} +-rmpupdate, 0xf20f01fe, SNP|x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword } +-rmpadjust, 0xf30f01fe, SNP|x64, NoSuf, {} +-rmpadjust, 0xf30f01fe, SNP|x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword, RegD|Qword } ++rmpupdate, 0xf20f01fe, SNP&x64, NoSuf, {} ++rmpupdate, 0xf20f01fe, SNP&x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword } ++rmpadjust, 0xf30f01fe, SNP&x64, NoSuf, {} ++rmpadjust, 0xf30f01fe, SNP&x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword, RegD|Qword } + // The single-operand forms exist only for compatibility with older gas. + pvalidate, 0xf20f01ff, SNP, AddrPrefixOpReg|NoSuf, { Acc|Word|Dword|Qword } +-rmpupdate, 0xf20f01fe, SNP|x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword } +-rmpadjust, 0xf30f01fe, SNP|x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword } ++rmpupdate, 0xf20f01fe, SNP&x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword } ++rmpadjust, 0xf30f01fe, SNP&x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword } + + // SNP instructions end + + // RMPQUERY instruction + +-rmpquery, 0xf30f01fd, RMPQUERY|x64, NoSuf, {} +-rmpquery, 0xf30f01fd, RMPQUERY|x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword, RegD|Qword } ++rmpquery, 0xf30f01fd, RMPQUERY, NoSuf, {} ++rmpquery, 0xf30f01fd, RMPQUERY, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword, RegD|Qword } + + // RMPQUERY instruction end + +@@ -3124,26 +3187,26 @@ xresldtrk, 0xf20f01e9, TSXLDTRK, NoSuf, {} + + // AMX instructions. + +-ldtilecfg, 0x49/0, AMX_TILE|x64, Modrm|Vex128|Space0F38|VexW0|NoSuf, { Unspecified|BaseIndex } +-sttilecfg, 0x6649/0, AMX_TILE|x64, Modrm|Vex128|Space0F38|VexW0|NoSuf, { Unspecified|BaseIndex } ++ldtilecfg, 0x49/0, APX_F(AMX_TILE), Modrm|Vex128|EVex128|Space0F38|VexW0|NoSuf, { Unspecified|BaseIndex } ++sttilecfg, 0x6649/0, APX_F(AMX_TILE), Modrm|Vex128|EVex128|Space0F38|VexW0|NoSuf, { Unspecified|BaseIndex } + +-tcmmimfp16ps, 0x666c, AMX_COMPLEX|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } +-tcmmrlfp16ps, 0x6c, AMX_COMPLEX|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } ++tcmmimfp16ps, 0x666c, AMX_COMPLEX, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } ++tcmmrlfp16ps, 0x6c, AMX_COMPLEX, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } + +-tdpbf16ps, 0xf35c, AMX_BF16|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } +-tdpfp16ps, 0xf25c, AMX_FP16|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } +-tdpbssd, 0xf25e, AMX_INT8|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } +-tdpbuud, 0x5e, AMX_INT8|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } +-tdpbusd, 0x665e, AMX_INT8|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } +-tdpbsud, 0xf35e, AMX_INT8|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } ++tdpbf16ps, 0xf35c, AMX_BF16, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } ++tdpfp16ps, 0xf25c, AMX_FP16, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } ++tdpbssd, 0xf25e, AMX_INT8, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } ++tdpbuud, 0x5e, AMX_INT8, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } ++tdpbusd, 0x665e, AMX_INT8, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } ++tdpbsud, 0xf35e, AMX_INT8, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } + +-tileloadd, 0xf24b, AMX_TILE|x64, Sibmem|Vex128|Space0F38|VexW0|NoSuf, { Unspecified|BaseIndex, RegTMM } +-tileloaddt1, 0x664b, AMX_TILE|x64, Sibmem|Vex128|Space0F38|VexW0|NoSuf, { Unspecified|BaseIndex, RegTMM } +-tilestored, 0xf34b, AMX_TILE|x64, Sibmem|Vex128|Space0F38|VexW0|NoSuf, { RegTMM, Unspecified|BaseIndex } ++tileloadd, 0xf24b, APX_F(AMX_TILE), Sibmem|Vex128|EVex128|Space0F38|VexW0|NoSuf, { Unspecified|BaseIndex, RegTMM } ++tileloaddt1, 0x664b, APX_F(AMX_TILE), Sibmem|Vex128|EVex128|Space0F38|VexW0|NoSuf, { Unspecified|BaseIndex, RegTMM } ++tilestored, 0xf34b, APX_F(AMX_TILE), Sibmem|Vex128|EVex128|Space0F38|VexW0|NoSuf, { RegTMM, Unspecified|BaseIndex } + +-tilerelease, 0x49c0, AMX_TILE|x64, Vex128|Space0F38|VexW0|NoSuf, {} ++tilerelease, 0x49c0, AMX_TILE, Vex128|Space0F38|VexW0|NoSuf, {} + +-tilezero, 0xf249, AMX_TILE|x64, Modrm|Vex128|Space0F38|VexW0|NoSuf, { RegTMM } ++tilezero, 0xf249, AMX_TILE, Modrm|Vex128|Space0F38|VexW0|NoSuf, { RegTMM } + + // AMX instructions end. + +@@ -3166,19 +3229,19 @@ aesdecwide256kl, 0xf30f38d8/3, WideKL, Modrm|NoSuf, { Unspecified|BaseIndex } + // TDX instructions. + + tdcall, 0x660f01cc, TDX, NoSuf, {} +-seamret, 0x660f01cd, TDX|x64, NoSuf, {} +-seamops, 0x660f01ce, TDX|x64, NoSuf, {} +-seamcall, 0x660f01cf, TDX|x64, NoSuf, {} ++seamret, 0x660f01cd, TDX&x64, NoSuf, {} ++seamops, 0x660f01ce, TDX&x64, NoSuf, {} ++seamcall, 0x660f01cf, TDX&x64, NoSuf, {} + + // TDX instructions end. + + // UINTR instructions. + +-uiret, 0xf30f01ec, UINTR|x64, NoSuf, {} +-clui, 0xf30f01ee, UINTR|x64, NoSuf, {} +-stui, 0xf30f01ef, UINTR|x64, NoSuf, {} +-testui, 0xf30f01ed, UINTR|x64, NoSuf, {} +-senduipi, 0xf30fc7/6, UINTR|x64, Modrm|NoSuf|NoRex64, { Reg64 } ++uiret, 0xf30f01ec, UINTR, NoSuf, {} ++clui, 0xf30f01ee, UINTR, NoSuf, {} ++stui, 0xf30f01ef, UINTR, NoSuf, {} ++testui, 0xf30f01ed, UINTR, NoSuf, {} ++senduipi, 0xf30fc7/6, UINTR, Modrm|NoSuf|NoRex64, { Reg64 } + + // UINTR instructions end. + +@@ -3208,37 +3271,37 @@ vcmpph, 0xc2, AVX512_FP16, Modrm|Masking|Space0F3A|VexVVVV|VexW0|Broadcast|Disp8 + vcmpsh, 0xf3c2/0x, AVX512_FP16, Modrm|EVexLIG|Masking|Space0F3A|VexVVVV|VexW0|Disp8MemShift=1|NoSuf|ImmExt|SAE, { RegXMM|Word|Unspecified|BaseIndex, RegXMM, RegMask } + vcmpsh, 0xf3c2, AVX512_FP16, Modrm|EVexLIG|Masking|Space0F3A|VexVVVV|VexW0|Disp8MemShift=1|NoSuf|SAE, { Imm8, RegXMM|Word|Unspecified|BaseIndex, RegXMM, RegMask } + +-vcvtdq2ph, 0x5b, AVX512_FP16|, Modrm||Masking|EVexMap5|VexW0|Broadcast|NoSuf|, { |Dword, } +-vcvtudq2ph, 0xf27a, AVX512_FP16|, Modrm||Masking|EVexMap5|VexW0|Broadcast|NoSuf|, { |Dword, } ++vcvtdq2ph, 0x5b, AVX512_FP16&, Modrm||Masking|EVexMap5|VexW0|Broadcast|NoSuf|, { |Dword, } ++vcvtudq2ph, 0xf27a, AVX512_FP16&, Modrm||Masking|EVexMap5|VexW0|Broadcast|NoSuf|, { |Dword, } + +-vcvtqq2ph, 0x5b, AVX512_FP16|, Modrm||Masking|EVexMap5|VexW1|Broadcast|NoSuf||, { |Qword, RegXMM } +-vcvtuqq2ph, 0xf27a, AVX512_FP16|, Modrm||Masking|EVexMap5|VexW1|Broadcast|NoSuf||, { |Qword, RegXMM } ++vcvtqq2ph, 0x5b, AVX512_FP16&, Modrm||Masking|EVexMap5|VexW1|Broadcast|NoSuf||, { |Qword, RegXMM } ++vcvtuqq2ph, 0xf27a, AVX512_FP16&, Modrm||Masking|EVexMap5|VexW1|Broadcast|NoSuf||, { |Qword, RegXMM } + +-vcvtpd2ph, 0x665a, AVX512_FP16|, Modrm||Masking|EVexMap5|VexW1|Broadcast|NoSuf||, { |Qword, RegXMM } ++vcvtpd2ph, 0x665a, AVX512_FP16&, Modrm||Masking|EVexMap5|VexW1|Broadcast|NoSuf||, { |Qword, RegXMM } + +-vcvtps2phx, 0x661d, AVX512_FP16|, Modrm||Masking|EVexMap5|VexW0|Broadcast|NoSuf|, { |Dword, } ++vcvtps2phx, 0x661d, AVX512_FP16&, Modrm||Masking|EVexMap5|VexW0|Broadcast|NoSuf|, { |Dword, } + + vcvtw2ph, 0xf37d, AVX512_FP16, Modrm|Masking|EVexMap5|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|StaticRounding|SAE, { RegXMM|RegYMM|RegZMM|Word|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } + vcvtuw2ph, 0xf27d, AVX512_FP16, Modrm|Masking|EVexMap5|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|StaticRounding|SAE, { RegXMM|RegYMM|RegZMM|Word|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } + +-vcvtph2dq, 0x665b, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } +-vcvtph2dq, 0x665b, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } ++vcvtph2dq, 0x665b, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } ++vcvtph2dq, 0x665b, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } + vcvtph2dq, 0x665b, AVX512_FP16, Modrm|EVex512|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=5|NoSuf|StaticRounding|SAE, { RegYMM|Word|Unspecified|BaseIndex, RegZMM } + +-vcvtph2udq, 0x79, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } +-vcvtph2udq, 0x79, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } ++vcvtph2udq, 0x79, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } ++vcvtph2udq, 0x79, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } + vcvtph2udq, 0x79, AVX512_FP16, Modrm|EVex512|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=5|NoSuf|StaticRounding|SAE, { RegYMM|Word|Unspecified|BaseIndex, RegZMM } + +-vcvtph2qq, 0x667b, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } +-vcvtph2qq, 0x667b, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } ++vcvtph2qq, 0x667b, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } ++vcvtph2qq, 0x667b, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } + vcvtph2qq, 0x667b, AVX512_FP16, Modrm|EVex512|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf|StaticRounding|SAE, { RegXMM|Word|Unspecified|BaseIndex, RegZMM } + +-vcvtph2uqq, 0x6679, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } +-vcvtph2uqq, 0x6679, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } ++vcvtph2uqq, 0x6679, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } ++vcvtph2uqq, 0x6679, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } + vcvtph2uqq, 0x6679, AVX512_FP16, Modrm|EVex512|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf|StaticRounding|SAE, { RegXMM|Word|Unspecified|BaseIndex, RegZMM } + +-vcvtph2pd, 0x5a, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } +-vcvtph2pd, 0x5a, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } ++vcvtph2pd, 0x5a, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } ++vcvtph2pd, 0x5a, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } + vcvtph2pd, 0x5a, AVX512_FP16, Modrm|EVex512|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf|SAE, { RegXMM|Word|Unspecified|BaseIndex, RegZMM } + + vcvtph2w, 0x667d, AVX512_FP16, Modrm|Masking|EVexMap5|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|StaticRounding|SAE, { RegXMM|RegYMM|RegZMM|Word|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } +@@ -3258,24 +3321,24 @@ vcvtsh2ss, 0x13, AVX512_FP16, Modrm|EVexLIG|Masking|EVexMap6|VexVVVV|VexW0|Disp8 + + vcvtsh2si, 0xf32d, AVX512_FP16, Modrm|EVexLIG|EVexMap5|Disp8MemShift=1|NoSuf|StaticRounding|SAE, { RegXMM|Word|Unspecified|BaseIndex, Reg32|Reg64 } + +-vcvttph2dq, 0xf35b, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } +-vcvttph2dq, 0xf35b, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } ++vcvttph2dq, 0xf35b, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } ++vcvttph2dq, 0xf35b, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } + vcvttph2dq, 0xf35b, AVX512_FP16, Modrm|EVex512|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=5|NoSuf|SAE, { RegYMM|Word|Unspecified|BaseIndex, RegZMM } + +-vcvttph2udq, 0x78, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } +-vcvttph2udq, 0x78, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } ++vcvttph2udq, 0x78, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } ++vcvttph2udq, 0x78, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } + vcvttph2udq, 0x78, AVX512_FP16, Modrm|EVex512|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=5|NoSuf|SAE, { RegYMM|Word|Unspecified|BaseIndex, RegZMM } + +-vcvttph2qq, 0x667a, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } +-vcvttph2qq, 0x667a, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } ++vcvttph2qq, 0x667a, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } ++vcvttph2qq, 0x667a, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } + vcvttph2qq, 0x667a, AVX512_FP16, Modrm|EVex512|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf|SAE, { RegXMM|Word|Unspecified|BaseIndex, RegZMM } + +-vcvttph2uqq, 0x6678, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } +-vcvttph2uqq, 0x6678, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } ++vcvttph2uqq, 0x6678, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } ++vcvttph2uqq, 0x6678, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } + vcvttph2uqq, 0x6678, AVX512_FP16, Modrm|EVex512|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf|SAE, { RegXMM|Word|Unspecified|BaseIndex, RegZMM } + +-vcvtph2psx, 0x6613, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap6|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } +-vcvtph2psx, 0x6613, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap6|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } ++vcvtph2psx, 0x6613, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap6|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } ++vcvtph2psx, 0x6613, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap6|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } + vcvtph2psx, 0x6613, AVX512_FP16, Modrm|EVex512|Masking|EVexMap6|VexW0|Broadcast|Disp8MemShift=5|NoSuf|SAE, { RegYMM|Word|Unspecified|BaseIndex, RegZMM } + + vcvttph2w, 0x667c, AVX512_FP16, Modrm|Masking|EVexMap5|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|SAE, { RegXMM|RegYMM|RegZMM|Word|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } +@@ -3283,7 +3346,7 @@ vcvttph2uw, 0x7c, AVX512_FP16, Modrm|Masking|EVexMap5|VexW0|Broadcast|Disp8Shift + + vcvttsh2si, 0xf32c, AVX512_FP16, Modrm|EVexLIG|EVexMap5|Disp8MemShift=1|NoSuf|SAE, { RegXMM|Word|Unspecified|BaseIndex, Reg32|Reg64 } + +-vfpclassph, 0x66, AVX512_FP16|, Modrm||Masking|Space0F3A|VexW0|Broadcast|NoSuf|, { Imm8|Imm8S, |Word, RegMask } ++vfpclassph, 0x66, AVX512_FP16&, Modrm||Masking|Space0F3A|VexW0|Broadcast|NoSuf|, { Imm8|Imm8S, |Word, RegMask } + + vmovw, 0x666e, AVX512_FP16, D|Modrm|EVex128|VexWIG|EVexMap5|Disp8MemShift=1|NoSuf, { Word|Unspecified|BaseIndex, RegXMM } + vmovw, 0x667e, AVX512_FP16, D|RegMem|EVex128|VexWIG|EVexMap5|NoSuf, { RegXMM, Reg32 } +@@ -3300,14 +3363,14 @@ vrsqrtsh, 0x664f, AVX512_FP16, Modrm|EVexLIG|Masking|EVexMap6|VexVVVV|VexW0|Disp + + // PREFETCHI instructions. + +-prefetchit0, 0xf18/7, PREFETCHI|x64, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex } +-prefetchit1, 0xf18/6, PREFETCHI|x64, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex } ++prefetchit0, 0xf18/7, PREFETCHI, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex } ++prefetchit1, 0xf18/6, PREFETCHI, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex } + + // PREFETCHI instructions end. + + // CMPCCXADD instructions. + +-cmpxadd, 0x66e, CMPCCXADD|x64, Modrm|Vex|Space0F38|VexVVVV|SwapSources|CheckOperandSize|NoSuf, { Reg32|Reg64, Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } ++cmpxadd, 0x66e, APX_F(CMPCCXADD), Modrm|Vex|EVex128|Space0F38|VexVVVV|SwapSources|CheckOperandSize|NoSuf, { Reg32|Reg64, Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } + + // CMPCCXADD instructions end. + +@@ -3319,30 +3382,52 @@ wrmsrns, 0x0f01c6, WRMSRNS, NoSuf, {} + + // MSRLIST instructions. + +-rdmsrlist, 0xf20f01c6, MSRLIST|x64, NoSuf, {} +-wrmsrlist, 0xf30f01c6, MSRLIST|x64, NoSuf, {} ++rdmsrlist, 0xf20f01c6, MSRLIST, NoSuf, {} ++wrmsrlist, 0xf30f01c6, MSRLIST, NoSuf, {} + + // MSRLIST instructions end. + + // RAO-INT instructions. + +-aadd, 0xf38fc, RAO_INT, Modrm|IgnoreSize|CheckOperandSize|NoSuf, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } +-aand, 0x660f38fc, RAO_INT, Modrm|IgnoreSize|CheckOperandSize|NoSuf, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } +-aor, 0xf20f38fc, RAO_INT, Modrm|IgnoreSize|CheckOperandSize|NoSuf, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } +-axor, 0xf30f38fc, RAO_INT, Modrm|IgnoreSize|CheckOperandSize|NoSuf, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } ++ ++a, 0x0f38fc, RAO_INT, Modrm|IgnoreSize|CheckOperandSize|NoSuf, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } ++a, 0xfc, RAO_INT&APX_F, Modrm|CheckOperandSize|NoSuf|EVexMap4, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } ++ + + // RAO-INT instructions end. + + // LKGS instruction. + +-lkgs, 0xf20f00/6, LKGS|x64, Modrm|IgnoreSize|No_bSuf|No_sSuf|NoRex64, { Reg16|Reg32|Reg64 } +-lkgs, 0xf20f00/6, LKGS|x64, Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { Word|Unspecified|BaseIndex } ++lkgs, 0xf20f00/6, LKGS, Modrm|IgnoreSize|No_bSuf|No_sSuf|NoRex64, { Reg16|Reg32|Reg64 } ++lkgs, 0xf20f00/6, LKGS, Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { Word|Unspecified|BaseIndex } + + // LKGS instruction end. + + // FRED instructions. + +-erets, 0xf20f01ca, FRED|x64, NoSuf, {} +-eretu, 0xf30f01ca, FRED|x64, NoSuf, {} ++erets, 0xf20f01ca, FRED, NoSuf, {} ++eretu, 0xf30f01ca, FRED, NoSuf, {} + + // FRED instructions end. ++ ++// USER_MSR instructions. ++ ++urdmsr, 0xf20f38f8, USER_MSR, RegMem|NoSuf|NoRex64, { Reg64, Reg64 } ++urdmsr, 0xf2f8, USER_MSR&APX_F, RegMem|EVexMap4|VexW0|NoSuf, { Reg64, Reg64 } ++urdmsr, 0xf2f8/0, APX_F(USER_MSR), Modrm|Vex128|VexMap7|EVex128|VexW0|NoSuf, { Imm32, Reg64 } ++uwrmsr, 0xf30f38f8, USER_MSR, Modrm|NoSuf|NoRex64, { Reg64, Reg64 } ++uwrmsr, 0xf3f8, USER_MSR&APX_F, Modrm|EVexMap4|VexW0|NoSuf, { Reg64, Reg64 } ++// Immediates want to be first; md_assemble() takes care of swapping operands ++// accordingly. ++uwrmsr, 0xf3f8/0, APX_F(USER_MSR), Modrm|Vex128|VexMap7|EVex128|VexW0|NoSuf, { Imm32, Reg64 } ++ ++// USER_MSR instructions end. ++ ++// APX Push2/Pop2 instructions. ++ ++push2, 0xff/6, APX_F, Modrm|VexW0|EVexMap4|VexVVVV|ImplicitStackOp|No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Reg64, Reg64 } ++push2p, 0xff/6, APX_F, Modrm|VexW1|EVexMap4|VexVVVV|ImplicitStackOp|No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Reg64, Reg64 } ++pop2, 0x8f/0, APX_F, Modrm|VexW0|EVexMap4|VexVVVV|ImplicitStackOp|No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Reg64, Reg64 } ++pop2p, 0x8f/0, APX_F, Modrm|VexW1|EVexMap4|VexVVVV|ImplicitStackOp|No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Reg64, Reg64 } ++ ++// APX Push2/Pop2 instructions end. diff --git a/gdb.changes b/gdb.changes index 8373c25..13c97e4 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Jan 24 13:34:07 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ 93db514. +- Patches added: + * gdb-rhbz2277160-apx-disasm.patch + ------------------------------------------------------------------- Thu Jan 23 15:29:00 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 3db88ef..5148028 100644 --- a/gdb.spec +++ b/gdb.spec @@ -214,6 +214,7 @@ Patch47: gdb-do-not-import-py-curses-ascii-module.patch Patch48: gdb-reformat-missing-debug-py-file.patch Patch49: gdb-handle-no-python-gdb-module.patch Patch50: gdb-add-rpm-suggestion-script.patch +Patch51: gdb-rhbz2277160-apx-disasm.patch #Fedora Packages end # Fedora patches fixup @@ -743,6 +744,7 @@ find -name "*.info*"|xargs rm -f %patch -P 48 -p1 %patch -P 49 -p1 %patch -P 50 -p1 +%patch -P 51 -p1 #Fedora patching end %patch -P 1003 -p1 From bd80ac816589ca452cd04713648dc80e45f0a27d5995fad8182349ce8bce9189 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 24 Jan 2025 14:58:50 +0000 Subject: [PATCH 12/34] - Update to fedora rawhide @ f9386b1. - Patches dropped: * gdb-fedora-libncursesw.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=417 --- gdb-fedora-libncursesw.patch | 71 ------------------------------------ gdb.changes | 7 ++++ gdb.spec | 48 ++++++++++++------------ 3 files changed, 30 insertions(+), 96 deletions(-) delete mode 100644 gdb-fedora-libncursesw.patch diff --git a/gdb-fedora-libncursesw.patch b/gdb-fedora-libncursesw.patch deleted file mode 100644 index 99214df..0000000 --- a/gdb-fedora-libncursesw.patch +++ /dev/null @@ -1,71 +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-fedora-libncursesw.patch - -;; Force libncursesw over libncurses to match the includes (RH BZ 1270534). -;;=push+jan - -Fedora: Force libncursesw over libncurses to match the includes. -https://bugzilla.redhat.com/show_bug.cgi?id=1270534 - -diff --git a/gdb/configure b/gdb/configure ---- a/gdb/configure -+++ b/gdb/configure -@@ -20663,6 +20663,7 @@ if test x"$prefer_curses" = xyes; then - # search /usr/local/include, if ncurses is installed in /usr/local. A - # default installation of ncurses on alpha*-dec-osf* will lead to such - # a situation. -+ # Fedora: Force libncursesw over libncurses to match the includes. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5 - $as_echo_n "checking for library containing waddstr... " >&6; } - if ${ac_cv_search_waddstr+:} false; then : -@@ -20687,7 +20688,7 @@ return waddstr (); - return 0; - } - _ACEOF --for ac_lib in '' ncursesw ncurses cursesX curses; do -+for ac_lib in '' ncursesw; do - if test -z "$ac_lib"; then - ac_res="none required" - else -@@ -20759,6 +20760,7 @@ case $host_os in - esac - - # These are the libraries checked by Readline. -+# Fedora: Force libncursesw over libncurses to match the includes. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5 - $as_echo_n "checking for library containing tgetent... " >&6; } - if ${ac_cv_search_tgetent+:} false; then : -@@ -20783,7 +20785,7 @@ return tgetent (); - return 0; - } - _ACEOF --for ac_lib in '' termcap tinfow tinfo curses ncursesw ncurses; do -+for ac_lib in '' ncursesw; do - if test -z "$ac_lib"; then - ac_res="none required" - else -diff --git a/gdb/configure.ac b/gdb/configure.ac ---- a/gdb/configure.ac -+++ b/gdb/configure.ac -@@ -555,7 +555,8 @@ if test x"$prefer_curses" = xyes; then - # search /usr/local/include, if ncurses is installed in /usr/local. A - # default installation of ncurses on alpha*-dec-osf* will lead to such - # a situation. -- AC_SEARCH_LIBS(waddstr, [ncursesw ncurses cursesX curses], -+ # Fedora: Force libncursesw over libncurses to match the includes. -+ AC_SEARCH_LIBS(waddstr, [ncursesw], - [curses_found=yes - AC_DEFINE([HAVE_LIBCURSES], [1], - [Define to 1 if curses is enabled.]) -@@ -595,7 +596,8 @@ case $host_os in - esac - - # These are the libraries checked by Readline. --AC_SEARCH_LIBS(tgetent, [termcap tinfow tinfo curses ncursesw ncurses]) -+# Fedora: Force libncursesw over libncurses to match the includes. -+AC_SEARCH_LIBS(tgetent, [ncursesw]) - - if test "$ac_cv_search_tgetent" = no; then - CONFIG_OBS="$CONFIG_OBS stub-termcap.o" diff --git a/gdb.changes b/gdb.changes index 13c97e4..364f027 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Jan 24 13:37:51 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ f9386b1. +- Patches dropped: + * gdb-fedora-libncursesw.patch + ------------------------------------------------------------------- Fri Jan 24 13:34:07 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 5148028..9a9ccb8 100644 --- a/gdb.spec +++ b/gdb.spec @@ -192,29 +192,28 @@ Patch22: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch Patch23: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch Patch26: gdb-rhbz1149205-catch-syscall-after-fork-test.patch Patch27: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -Patch28: gdb-fedora-libncursesw.patch -Patch29: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch31: gdb-rhbz2232086-refactor-selftest-support.patch -Patch32: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch -Patch33: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch -Patch34: gdb-rhbz-2232086-generate-gdb-index-consistently.patch -Patch35: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch -Patch36: gdb-rhbz2250652-gdbpy_gil.patch -Patch37: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch -Patch38: gdb-ftbs-swapped-calloc-args.patch -Patch39: gdb-rhbz2261580-intrusive_list-assertion-fix.patch -Patch40: gdb-sync-coffread-with-elfread.patch -Patch41: gdb-merge-debug-symbol-lookup.patch -Patch42: gdb-refactor-find-and-add-separate-symbol-file.patch -Patch43: gdb-add-missing-debug-ext-lang-hook.patch -Patch44: gdb-add-missing-debug-info-python-hook.patch -Patch45: gdb-remove-use-of-py-isascii -Patch46: gdb-remove-path-in-test-name.patch -Patch47: gdb-do-not-import-py-curses-ascii-module.patch -Patch48: gdb-reformat-missing-debug-py-file.patch -Patch49: gdb-handle-no-python-gdb-module.patch -Patch50: gdb-add-rpm-suggestion-script.patch -Patch51: gdb-rhbz2277160-apx-disasm.patch +Patch28: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch30: gdb-rhbz2232086-refactor-selftest-support.patch +Patch31: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch +Patch32: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch +Patch33: gdb-rhbz-2232086-generate-gdb-index-consistently.patch +Patch34: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch +Patch35: gdb-rhbz2250652-gdbpy_gil.patch +Patch36: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch +Patch37: gdb-ftbs-swapped-calloc-args.patch +Patch38: gdb-rhbz2261580-intrusive_list-assertion-fix.patch +Patch39: gdb-sync-coffread-with-elfread.patch +Patch40: gdb-merge-debug-symbol-lookup.patch +Patch41: gdb-refactor-find-and-add-separate-symbol-file.patch +Patch42: gdb-add-missing-debug-ext-lang-hook.patch +Patch43: gdb-add-missing-debug-info-python-hook.patch +Patch44: gdb-remove-use-of-py-isascii +Patch45: gdb-remove-path-in-test-name.patch +Patch46: gdb-do-not-import-py-curses-ascii-module.patch +Patch47: gdb-reformat-missing-debug-py-file.patch +Patch48: gdb-handle-no-python-gdb-module.patch +Patch49: gdb-add-rpm-suggestion-script.patch +Patch50: gdb-rhbz2277160-apx-disasm.patch #Fedora Packages end # Fedora patches fixup @@ -723,7 +722,7 @@ find -name "*.info*"|xargs rm -f %patch -P 26 -p1 %patch -P 27 -p1 %patch -P 28 -p1 -%patch -P 29 -p1 +%patch -P 30 -p1 %patch -P 31 -p1 %patch -P 32 -p1 %patch -P 33 -p1 @@ -744,7 +743,6 @@ find -name "*.info*"|xargs rm -f %patch -P 48 -p1 %patch -P 49 -p1 %patch -P 50 -p1 -%patch -P 51 -p1 #Fedora patching end %patch -P 1003 -p1 From 621499e68d815843f755ceefae38bef993032640648805edc52581e51a71b3c1 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 24 Jan 2025 15:02:13 +0000 Subject: [PATCH 13/34] - Update to fedora rawhide @ 1672291. - Patches updated: * gdb-6.6-buildid-locate-rpm-suse.patch * gdb-add-rpm-suggestion-script.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=418 --- gdb-6.6-buildid-locate-rpm-suse.patch | 66 +++++------ gdb-add-rpm-suggestion-script.patch | 159 +++++++++++++------------- gdb.changes | 8 ++ 3 files changed, 123 insertions(+), 110 deletions(-) diff --git a/gdb-6.6-buildid-locate-rpm-suse.patch b/gdb-6.6-buildid-locate-rpm-suse.patch index fdf7a7f..0599b60 100644 --- a/gdb-6.6-buildid-locate-rpm-suse.patch +++ b/gdb-6.6-buildid-locate-rpm-suse.patch @@ -1,43 +1,43 @@ diff --git a/gdb/python/lib/gdb/command/rpm-suggestions.py b/gdb/python/lib/gdb/command/rpm-suggestions.py -index 293b1638617..463684c1462 100644 +index f52b822c111..da80363ebd2 100644 --- a/gdb/python/lib/gdb/command/rpm-suggestions.py +++ b/gdb/python/lib/gdb/command/rpm-suggestions.py -@@ -28,6 +28,8 @@ __missing_rpms = {} - # the prompt is shown. - __suggest_rpms = {} +@@ -33,6 +33,8 @@ else: + # the prompt is shown. + __suggest_rpms = {} -+__package_to_debug_package = {} ++ __package_to_debug_package = {} + - # Lookup RPMs that might provide the debug information for FILENAME, - # which is a string containing the path to an object file GDB could -@@ -43,6 +45,7 @@ def find_suggestions(filename): - for h in mi: - # Build the debuginfo package name. - obj = h.format("%{name}-debuginfo-%{version}-%{release}.%{arch}") -+ debug_rpm_name = str(obj) + # Lookup RPMs that might provide the debug information for FILENAME, + # which is a string containing the path to an object file GDB could +@@ -48,6 +50,7 @@ else: + for h in mi: + # Build the debuginfo package name. + obj = h.format("%{name}-debuginfo-%{version}-%{release}.%{arch}") ++ debug_rpm_name = str(obj) - # Check to see if the package is installed. - mi2 = ts.dbMatch(rpm.RPMDBI_LABEL, str(obj)) -@@ -52,6 +55,7 @@ def find_suggestions(filename): - # Now build the name of the package FILENAME came from. - obj = h.format("%{name}-%{version}-%{release}.%{arch}") - rpm_name = str(obj) -+ __package_to_debug_package[rpm_name] = debug_rpm_name - if not rpm_name in __missing_rpms: - __suggest_rpms[rpm_name] = True - __missing_rpms[rpm_name] = True -@@ -83,10 +87,12 @@ class RPMSuggestionHandler(gdb.missing_debug.MissingDebugHandler): - # suggests this to the user. - def before_prompt(): - global __suggest_rpms -+ global __package_to_debug_package + # Check to see if the package is installed. + mi2 = ts.dbMatch(rpm.RPMDBI_LABEL, str(obj)) +@@ -57,6 +60,7 @@ else: + # Now build the name of the package FILENAME came from. + obj = h.format("%{name}-%{version}-%{release}.%{arch}") + rpm_name = str(obj) ++ __package_to_debug_package[rpm_name] = debug_rpm_name + if not rpm_name in __missing_rpms: + __suggest_rpms[rpm_name] = True + __missing_rpms[rpm_name] = True +@@ -88,10 +92,12 @@ else: + # suggests this to the user. + def before_prompt(): + global __suggest_rpms ++ global __package_to_debug_package - if len(__suggest_rpms) > 0: - for p in __suggest_rpms.keys(): -- print("Missing debuginfo, try: dnf debuginfo-install " + p) -+ dp = __package_to_debug_package[p] -+ print("Missing separate debuginfos, use: zypper install " + dp) - __suggest_rpms = {} + if len(__suggest_rpms) > 0: + for p in __suggest_rpms.keys(): +- print("Missing debuginfo, try: dnf debuginfo-install " + p) ++ dp = __package_to_debug_package[p] ++ print("Missing separate debuginfos, use: zypper install " + dp) + __suggest_rpms = {} diff --git a/gdb-add-rpm-suggestion-script.patch b/gdb-add-rpm-suggestion-script.patch index 9ee42c2..1cbf352 100644 --- a/gdb-add-rpm-suggestion-script.patch +++ b/gdb-add-rpm-suggestion-script.patch @@ -26,7 +26,7 @@ diff --git a/gdb/python/lib/gdb/command/rpm-suggestions.py b/gdb/python/lib/gdb/ new file mode 100644 --- /dev/null +++ b/gdb/python/lib/gdb/command/rpm-suggestions.py -@@ -0,0 +1,111 @@ +@@ -0,0 +1,116 @@ +# Copyright 2023 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -44,100 +44,105 @@ new file mode 100644 + +import gdb +import gdb.missing_debug -+import rpm ++try: ++ import rpm ++except ModuleNotFoundError: ++ print( ++ "Unable to load 'rpm' module. Please install the python3-rpm package." ++ ) ++else: ++ # Track all the RPMs suggested during a single debug session so we ++ # don't suggest the same RPM twice. This is only cleared when the ++ # main executable is changed. ++ __missing_rpms = {} + -+# Track all the RPMs suggested during a single debug session so we -+# don't suggest the same RPM twice. This is only cleared when the -+# main executable is changed. -+__missing_rpms = {} -+ -+# Track any missing RPMs that have been discovered since the last time -+# the prompt was displayed. RPMs in here are also present in the -+# __MISSING_RPMS dictionary, but this dictionary is cleared each time -+# the prompt is shown. -+__suggest_rpms = {} ++ # Track any missing RPMs that have been discovered since the last time ++ # the prompt was displayed. RPMs in here are also present in the ++ # __MISSING_RPMS dictionary, but this dictionary is cleared each time ++ # the prompt is shown. ++ __suggest_rpms = {} + + -+# Lookup RPMs that might provide the debug information for FILENAME, -+# which is a string containing the path to an object file GDB could -+# not find any debug information for. -+# -+# If a possible RPM is found then this is added to the globals -+# __MISSING_RPMS and __SUGGEST_RPMS, which are used elsewhere in this -+# script. -+def find_suggestions(filename): -+ ts = rpm.TransactionSet() ++ # Lookup RPMs that might provide the debug information for FILENAME, ++ # which is a string containing the path to an object file GDB could ++ # not find any debug information for. ++ # ++ # If a possible RPM is found then this is added to the globals ++ # __MISSING_RPMS and __SUGGEST_RPMS, which are used elsewhere in this ++ # script. ++ def find_suggestions(filename): ++ ts = rpm.TransactionSet() + -+ mi = ts.dbMatch(rpm.RPMDBI_BASENAMES, filename) -+ for h in mi: -+ # Build the debuginfo package name. -+ obj = h.format("%{name}-debuginfo-%{version}-%{release}.%{arch}") ++ mi = ts.dbMatch(rpm.RPMDBI_BASENAMES, filename) ++ for h in mi: ++ # Build the debuginfo package name. ++ obj = h.format("%{name}-debuginfo-%{version}-%{release}.%{arch}") + -+ # Check to see if the package is installed. -+ mi2 = ts.dbMatch(rpm.RPMDBI_LABEL, str(obj)) -+ if len(mi2) > 0: -+ continue ++ # Check to see if the package is installed. ++ mi2 = ts.dbMatch(rpm.RPMDBI_LABEL, str(obj)) ++ if len(mi2) > 0: ++ continue + -+ # Now build the name of the package FILENAME came from. -+ obj = h.format("%{name}-%{version}-%{release}.%{arch}") -+ rpm_name = str(obj) -+ if not rpm_name in __missing_rpms: -+ __suggest_rpms[rpm_name] = True -+ __missing_rpms[rpm_name] = True ++ # Now build the name of the package FILENAME came from. ++ obj = h.format("%{name}-%{version}-%{release}.%{arch}") ++ rpm_name = str(obj) ++ if not rpm_name in __missing_rpms: ++ __suggest_rpms[rpm_name] = True ++ __missing_rpms[rpm_name] = True + + -+# A missing debug handler class. Just forwards the name of the -+# objfile for which we are missing debug information to -+# find_suggestions. -+class RPMSuggestionHandler(gdb.missing_debug.MissingDebugHandler): -+ def __init__(self): -+ super().__init__("rpm-suggestions") ++ # A missing debug handler class. Just forwards the name of the ++ # objfile for which we are missing debug information to ++ # find_suggestions. ++ class RPMSuggestionHandler(gdb.missing_debug.MissingDebugHandler): ++ def __init__(self): ++ super().__init__("rpm-suggestions") + -+ def __call__(self, objfile): -+ # Traditionally the 'build-id-verbose' parameter is what -+ # controlled all RPM suggestion. Maybe once all the RPM -+ # suggestion is performed via Python extensions then we might -+ # consider renaming this parameter to something else, but for -+ # now, for backward compatibility, I've retained this name. -+ if gdb.parameter("build-id-verbose") > 0: -+ find_suggestions(objfile.filename) -+ return False -+ return None ++ def __call__(self, objfile): ++ # Traditionally the 'build-id-verbose' parameter is what ++ # controlled all RPM suggestion. Maybe once all the RPM ++ # suggestion is performed via Python extensions then we might ++ # consider renaming this parameter to something else, but for ++ # now, for backward compatibility, I've retained this name. ++ if gdb.parameter("build-id-verbose") > 0: ++ find_suggestions(objfile.filename) ++ return False ++ return None + + -+# Called before GDB displays its prompt. If the global __SUGGEST_RPMS -+# dictionary is not empty, then this hook prints treats the keys of -+# this dictionary as strings which are the names of RPMs. This hook -+# formats each RPM name into a suggested debuginfo-install command and -+# suggests this to the user. -+def before_prompt(): -+ global __suggest_rpms ++ # Called before GDB displays its prompt. If the global __SUGGEST_RPMS ++ # dictionary is not empty, then this hook prints treats the keys of ++ # this dictionary as strings which are the names of RPMs. This hook ++ # formats each RPM name into a suggested debuginfo-install command and ++ # suggests this to the user. ++ def before_prompt(): ++ global __suggest_rpms + -+ if len(__suggest_rpms) > 0: -+ for p in __suggest_rpms.keys(): -+ print("Missing debuginfo, try: dnf debuginfo-install " + p) -+ __suggest_rpms = {} ++ if len(__suggest_rpms) > 0: ++ for p in __suggest_rpms.keys(): ++ print("Missing debuginfo, try: dnf debuginfo-install " + p) ++ __suggest_rpms = {} + + -+# Called when the executable within a progrm space is changed. Clear -+# the lists of RPM suggestions. We only clear the previous suggestion -+# list when the executable really changes. If the user simply -+# recompiles the executable, then we don't both clearing this list. -+def executable_changed_handler(event): -+ global __missing_rpms -+ global __suggest_rpms ++ # Called when the executable within a progrm space is changed. Clear ++ # the lists of RPM suggestions. We only clear the previous suggestion ++ # list when the executable really changes. If the user simply ++ # recompiles the executable, then we don't both clearing this list. ++ def executable_changed_handler(event): ++ global __missing_rpms ++ global __suggest_rpms + -+ if not event.reload: -+ __missing_rpms = {} -+ __suggest_rpms = {} ++ if not event.reload: ++ __missing_rpms = {} ++ __suggest_rpms = {} + + -+# Attach to the required GDB events. -+gdb.events.executable_changed.connect(executable_changed_handler) -+gdb.events.before_prompt.connect(before_prompt) ++ # Attach to the required GDB events. ++ gdb.events.executable_changed.connect(executable_changed_handler) ++ gdb.events.before_prompt.connect(before_prompt) + -+# Register the missing debug handler with GDB. -+gdb.missing_debug.register_handler(None, RPMSuggestionHandler()) ++ # Register the missing debug handler with GDB. ++ gdb.missing_debug.register_handler(None, RPMSuggestionHandler()) diff --git a/gdb/testsuite/gdb.python/py-missing-debug.py b/gdb/testsuite/gdb.python/py-missing-debug.py --- a/gdb/testsuite/gdb.python/py-missing-debug.py +++ b/gdb/testsuite/gdb.python/py-missing-debug.py diff --git a/gdb.changes b/gdb.changes index 364f027..03633d6 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Jan 24 15:00:56 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ 1672291. +- Patches updated: + * gdb-6.6-buildid-locate-rpm-suse.patch + * gdb-add-rpm-suggestion-script.patch + ------------------------------------------------------------------- Fri Jan 24 13:37:51 UTC 2025 - Tom de Vries From 2752d6e99bc78bbec26d9a8b613f648de22fbff54ddd361434a7c8c1c2487e1a Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 24 Jan 2025 15:06:18 +0000 Subject: [PATCH 14/34] - Update to fedora rawhide @ 485076c. - Patches updated: * gdb-add-rpm-suggestion-script.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=419 --- gdb-add-rpm-suggestion-script.patch | 6 ++++-- gdb.changes | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gdb-add-rpm-suggestion-script.patch b/gdb-add-rpm-suggestion-script.patch index 1cbf352..0666bce 100644 --- a/gdb-add-rpm-suggestion-script.patch +++ b/gdb-add-rpm-suggestion-script.patch @@ -26,7 +26,7 @@ diff --git a/gdb/python/lib/gdb/command/rpm-suggestions.py b/gdb/python/lib/gdb/ new file mode 100644 --- /dev/null +++ b/gdb/python/lib/gdb/command/rpm-suggestions.py -@@ -0,0 +1,116 @@ +@@ -0,0 +1,118 @@ +# Copyright 2023 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -42,13 +42,15 @@ new file mode 100644 +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + ++import sys +import gdb +import gdb.missing_debug +try: + import rpm +except ModuleNotFoundError: + print( -+ "Unable to load 'rpm' module. Please install the python3-rpm package." ++ "Unable to load 'rpm' module. Please install the python3-rpm package.", ++ file=sys.stderr + ) +else: + # Track all the RPMs suggested during a single debug session so we diff --git a/gdb.changes b/gdb.changes index 03633d6..61681f8 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Jan 24 15:05:16 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ 485076c. +- Patches updated: + * gdb-add-rpm-suggestion-script.patch + ------------------------------------------------------------------- Fri Jan 24 15:00:56 UTC 2025 - Tom de Vries From c06669a60d7d2a0a36cf7e7164f241a9f2dccae357e0d477c76f9e7a563d30c0 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 24 Jan 2025 15:08:57 +0000 Subject: [PATCH 15/34] - Update to fedora rawhide @ a247406. - Patches dropped: * gdb-core-open-vdso-warning.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=420 --- gdb-core-open-vdso-warning.patch | 58 --------------------------- gdb.changes | 7 ++++ gdb.spec | 68 ++++++++++++++++---------------- 3 files changed, 40 insertions(+), 93 deletions(-) delete mode 100644 gdb-core-open-vdso-warning.patch diff --git a/gdb-core-open-vdso-warning.patch b/gdb-core-open-vdso-warning.patch deleted file mode 100644 index cc9910a..0000000 --- a/gdb-core-open-vdso-warning.patch +++ /dev/null @@ -1,58 +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-core-open-vdso-warning.patch - -;; Fix GNU/Linux core open: Can't read pathname for load map: Input/output error. -;; Fix regression of undisplayed missing shared libraries caused by a fix for. -;;=fedoratest: It should be in glibc: libc-alpha: <20091004161706.GA27450@.*> - -http://sourceware.org/ml/gdb-patches/2009-10/msg00142.html -Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map: Input/output error. - -[ New patch variant. ] - -commit 7d760051ffb8a23cdc51342d4e6243fbc462f73f -Author: Ulrich Weigand -Date: Wed Sep 25 11:52:50 2013 +0000 - -diff --git a/gdb/testsuite/gdb.base/solib-symbol.exp b/gdb/testsuite/gdb.base/solib-symbol.exp ---- a/gdb/testsuite/gdb.base/solib-symbol.exp -+++ b/gdb/testsuite/gdb.base/solib-symbol.exp -@@ -27,6 +27,7 @@ set testfile "solib-symbol-main" - set srcfile ${srcdir}/${subdir}/${testfile}.c - set binfile [standard_output_file ${testfile}] - set bin_flags [list debug shlib=${binfile_lib}] -+set executable ${testfile} - - if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != "" - || [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } { -@@ -61,4 +62,28 @@ gdb_test "br foo2" \ - "Breakpoint.*: foo2. .2 locations..*" \ - "foo2 in mdlib" - -+# Test GDB warns for shared libraris which have not been found. -+ -+gdb_test "info sharedlibrary" "/${libname}.*" -+ -+clean_restart ${executable} -+gdb_breakpoint "main" -+gdb_run_cmd -+set test "no warning for missing libraries" -+gdb_test_multiple "" $test { -+ -re "warning: Could not load shared library symbols for \[0-9\]+ libraries,.*\r\n$gdb_prompt $" { -+ fail $test -+ } -+ -re "Breakpoint \[0-9\]+, main .*\r\n$gdb_prompt $" { -+ pass $test -+ } -+} -+ -+clean_restart ${executable} -+gdb_test_no_output "set solib-absolute-prefix /doESnotEXIST" -+gdb_breakpoint "main" -+gdb_run_cmd -+gdb_test "" "warning: Could not load shared library symbols for \[0-9\]+ libraries,.*\r\nBreakpoint \[0-9\]+, main .*" \ -+ "warning for missing libraries" -+ - gdb_exit diff --git a/gdb.changes b/gdb.changes index 61681f8..7a1f3c2 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Jan 24 15:07:38 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ a247406. +- Patches dropped: + * gdb-core-open-vdso-warning.patch + ------------------------------------------------------------------- Fri Jan 24 15:05:16 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 9a9ccb8..9f246a2 100644 --- a/gdb.spec +++ b/gdb.spec @@ -182,38 +182,37 @@ Patch11: gdb-6.5-gcore-buffer-limit-test.patch Patch12: gdb-6.3-mapping-zero-inode-test.patch Patch13: gdb-6.5-section-num-fixup-test.patch Patch15: gdb-simultaneous-step-resume-breakpoint-test.patch -Patch16: gdb-core-open-vdso-warning.patch -Patch17: gdb-archer-next-over-throw-cxx-exec.patch -Patch18: gdb-test-bt-cfi-without-die.patch -Patch19: gdb-test-dw2-aranges.patch -Patch20: gdb-glibc-strstr-workaround.patch -Patch21: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch22: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch -Patch23: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch -Patch26: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -Patch27: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -Patch28: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch30: gdb-rhbz2232086-refactor-selftest-support.patch -Patch31: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch -Patch32: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch -Patch33: gdb-rhbz-2232086-generate-gdb-index-consistently.patch -Patch34: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch -Patch35: gdb-rhbz2250652-gdbpy_gil.patch -Patch36: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch -Patch37: gdb-ftbs-swapped-calloc-args.patch -Patch38: gdb-rhbz2261580-intrusive_list-assertion-fix.patch -Patch39: gdb-sync-coffread-with-elfread.patch -Patch40: gdb-merge-debug-symbol-lookup.patch -Patch41: gdb-refactor-find-and-add-separate-symbol-file.patch -Patch42: gdb-add-missing-debug-ext-lang-hook.patch -Patch43: gdb-add-missing-debug-info-python-hook.patch -Patch44: gdb-remove-use-of-py-isascii -Patch45: gdb-remove-path-in-test-name.patch -Patch46: gdb-do-not-import-py-curses-ascii-module.patch -Patch47: gdb-reformat-missing-debug-py-file.patch -Patch48: gdb-handle-no-python-gdb-module.patch -Patch49: gdb-add-rpm-suggestion-script.patch -Patch50: gdb-rhbz2277160-apx-disasm.patch +Patch16: gdb-archer-next-over-throw-cxx-exec.patch +Patch17: gdb-test-bt-cfi-without-die.patch +Patch18: gdb-test-dw2-aranges.patch +Patch19: gdb-glibc-strstr-workaround.patch +Patch20: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch21: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +Patch22: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +Patch25: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch26: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch27: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch29: gdb-rhbz2232086-refactor-selftest-support.patch +Patch30: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch +Patch31: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch +Patch32: gdb-rhbz-2232086-generate-gdb-index-consistently.patch +Patch33: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch +Patch34: gdb-rhbz2250652-gdbpy_gil.patch +Patch35: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch +Patch36: gdb-ftbs-swapped-calloc-args.patch +Patch37: gdb-rhbz2261580-intrusive_list-assertion-fix.patch +Patch38: gdb-sync-coffread-with-elfread.patch +Patch39: gdb-merge-debug-symbol-lookup.patch +Patch40: gdb-refactor-find-and-add-separate-symbol-file.patch +Patch41: gdb-add-missing-debug-ext-lang-hook.patch +Patch42: gdb-add-missing-debug-info-python-hook.patch +Patch43: gdb-remove-use-of-py-isascii +Patch44: gdb-remove-path-in-test-name.patch +Patch45: gdb-do-not-import-py-curses-ascii-module.patch +Patch46: gdb-reformat-missing-debug-py-file.patch +Patch47: gdb-handle-no-python-gdb-module.patch +Patch48: gdb-add-rpm-suggestion-script.patch +Patch49: gdb-rhbz2277160-apx-disasm.patch #Fedora Packages end # Fedora patches fixup @@ -718,10 +717,10 @@ find -name "*.info*"|xargs rm -f %patch -P 20 -p1 %patch -P 21 -p1 %patch -P 22 -p1 -%patch -P 23 -p1 +%patch -P 25 -p1 %patch -P 26 -p1 %patch -P 27 -p1 -%patch -P 28 -p1 +%patch -P 29 -p1 %patch -P 30 -p1 %patch -P 31 -p1 %patch -P 32 -p1 @@ -742,7 +741,6 @@ find -name "*.info*"|xargs rm -f %patch -P 47 -p1 %patch -P 48 -p1 %patch -P 49 -p1 -%patch -P 50 -p1 #Fedora patching end %patch -P 1003 -p1 From 7206b8cb49971ab2e43d0bcbbf0952e6fb6ddfd55c11e868c90779055e542255 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 24 Jan 2025 15:11:09 +0000 Subject: [PATCH 16/34] - Update to fedora rawhide @ 199e8a4. - Patches dropped: * fixup-gdb-glibc-strstr-workaround.patch * gdb-glibc-strstr-workaround.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=421 --- fixup-gdb-glibc-strstr-workaround.patch | 19 ---- gdb-glibc-strstr-workaround.patch | 130 ------------------------ gdb.changes | 8 ++ gdb.spec | 62 ++++++----- 4 files changed, 37 insertions(+), 182 deletions(-) delete mode 100644 fixup-gdb-glibc-strstr-workaround.patch delete mode 100644 gdb-glibc-strstr-workaround.patch diff --git a/fixup-gdb-glibc-strstr-workaround.patch b/fixup-gdb-glibc-strstr-workaround.patch deleted file mode 100644 index b0037e0..0000000 --- a/fixup-gdb-glibc-strstr-workaround.patch +++ /dev/null @@ -1,19 +0,0 @@ -fixup-gdb-glibc-strstr-workaround.patch - ---- - gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp -index 889f8c6f584..052bd84d420 100644 ---- a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp -+++ b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp -@@ -68,7 +68,7 @@ gdb_test_multiple $test $test { - set addr $expect_out(1,string) - pass "$test (fixed glibc)" - } -- -re " = {char \\*\\(const char \\*, const char \\*\\)} 0x\[0-9a-f\]+ \r\n$gdb_prompt $" { -+ -re " = {char \\*\\(const char \\*, const char \\*\\)} 0x\[0-9a-f\]+ <(__GI_)?strstr>\r\n$gdb_prompt $" { - untested "$test (gnu-ifunc not in use by glibc)" - return 0 - } diff --git a/gdb-glibc-strstr-workaround.patch b/gdb-glibc-strstr-workaround.patch deleted file mode 100644 index 3863324..0000000 --- a/gdb-glibc-strstr-workaround.patch +++ /dev/null @@ -1,130 +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-glibc-strstr-workaround.patch - -;; Workaround PR libc/14166 for inferior calls of strstr. -;;=fedoratest: Compatibility with RHELs (unchecked which ones). - -diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp -@@ -0,0 +1,117 @@ -+# Copyright (C) 2012 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# Workaround for: -+# invalid IFUNC DW_AT_linkage_name: memmove strstr time -+# http://sourceware.org/bugzilla/show_bug.cgi?id=14166 -+ -+require allow_shlib_tests -+ -+set testfile "gnu-ifunc-strstr-workaround" -+set executable ${testfile} -+set srcfile start.c -+set binfile [standard_output_file ${executable}] -+ -+if [prepare_for_testing ${testfile}.exp $executable $srcfile] { -+ return -1 -+} -+ -+if ![runto_main] { -+ return 0 -+} -+ -+set test "ptype atoi" -+gdb_test_multiple $test $test { -+ -re "type = int \\(const char \\*\\)\r\n$gdb_prompt $" { -+ pass $test -+ } -+ -re "type = int \\(\\)\r\n$gdb_prompt $" { -+ untested "$test (no DWARF)" -+ return 0 -+ } -+ -re "type = \\(\\)\r\n$gdb_prompt $" { -+ untested "$test (no DWARF)" -+ return 0 -+ } -+} -+ -+set addr "" -+set test "print strstr" -+gdb_test_multiple $test $test { -+ -re " = {} (0x\[0-9a-f\]+) \r\n$gdb_prompt $" { -+ set addr $expect_out(1,string) -+ pass $test -+ } -+ -re " = {} (0x\[0-9a-f\]+) <__strstr>\r\n$gdb_prompt $" { -+ set addr $expect_out(1,string) -+ pass "$test (GDB workaround)" -+ } -+ -re " = {} (0x\[0-9a-f\]+) <__libc_strstr>\r\n$gdb_prompt $" { -+ set addr $expect_out(1,string) -+ pass "$test (fixed glibc)" -+ } -+ -re " = {} (0x\[0-9a-f\]+) <__libc_strstr_ifunc>\r\n$gdb_prompt $" { -+ set addr $expect_out(1,string) -+ pass "$test (fixed glibc)" -+ } -+ -re " = {char \\*\\(const char \\*, const char \\*\\)} 0x\[0-9a-f\]+ \r\n$gdb_prompt $" { -+ untested "$test (gnu-ifunc not in use by glibc)" -+ return 0 -+ } -+} -+ -+set test "info sym" -+gdb_test_multiple "info sym $addr" $test { -+ -re "strstr in section \\.text of /lib\[^/\]*/libc.so.6\r\n$gdb_prompt $" { -+ pass $test -+ } -+ -re " = {char \\*\\(const char \\*, const char \\*\\)} 0x\[0-9a-f\]+ \r\n$gdb_prompt $" { -+ # unexpected -+ xfail "$test (not in libc.so.6)" -+ return 0 -+ } -+} -+ -+set test "info addr strstr" -+gdb_test_multiple $test $test { -+ -re "Symbol \"strstr\" is a function at address $addr\\.\r\n$gdb_prompt $" { -+ fail "$test (DWARF for strstr)" -+ } -+ -re "Symbol \"strstr\" is at $addr in a file compiled without debugging\\.\r\n$gdb_prompt $" { -+ pass "$test" -+ } -+} -+ -+set test "print strstr second time" -+gdb_test_multiple "print strstr" $test { -+ -re " = {} $addr \r\n$gdb_prompt $" { -+ pass $test -+ } -+ -re " = {} $addr <__strstr>\r\n$gdb_prompt $" { -+ pass "$test (GDB workaround)" -+ } -+ -re " = {} $addr <__libc_strstr>\r\n$gdb_prompt $" { -+ pass "$test (fixed glibc)" -+ } -+ -re " = {} $addr <__libc_strstr_ifunc>\r\n$gdb_prompt $" { -+ pass "$test (fixed glibc)" -+ } -+ -re " = {void \\*\\(void\\)} 0x\[0-9a-f\]+ \r\n$gdb_prompt $" { -+ fail $test -+ } -+} -+ -+gdb_test {print (char *)strstr("abc","b")} { = 0x[0-9a-f]+ "bc"} -+gdb_test {print (char *)strstr("def","e")} { = 0x[0-9a-f]+ "ef"} diff --git a/gdb.changes b/gdb.changes index 7a1f3c2..261e86d 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Jan 24 15:10:23 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ 199e8a4. +- Patches dropped: + * fixup-gdb-glibc-strstr-workaround.patch + * gdb-glibc-strstr-workaround.patch + ------------------------------------------------------------------- Fri Jan 24 15:07:38 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 9f246a2..0453d23 100644 --- a/gdb.spec +++ b/gdb.spec @@ -185,41 +185,39 @@ Patch15: gdb-simultaneous-step-resume-breakpoint-test.patch Patch16: gdb-archer-next-over-throw-cxx-exec.patch Patch17: gdb-test-bt-cfi-without-die.patch Patch18: gdb-test-dw2-aranges.patch -Patch19: gdb-glibc-strstr-workaround.patch -Patch20: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch21: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch -Patch22: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch -Patch25: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -Patch26: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -Patch27: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch29: gdb-rhbz2232086-refactor-selftest-support.patch -Patch30: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch -Patch31: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch -Patch32: gdb-rhbz-2232086-generate-gdb-index-consistently.patch -Patch33: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch -Patch34: gdb-rhbz2250652-gdbpy_gil.patch -Patch35: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch -Patch36: gdb-ftbs-swapped-calloc-args.patch -Patch37: gdb-rhbz2261580-intrusive_list-assertion-fix.patch -Patch38: gdb-sync-coffread-with-elfread.patch -Patch39: gdb-merge-debug-symbol-lookup.patch -Patch40: gdb-refactor-find-and-add-separate-symbol-file.patch -Patch41: gdb-add-missing-debug-ext-lang-hook.patch -Patch42: gdb-add-missing-debug-info-python-hook.patch -Patch43: gdb-remove-use-of-py-isascii -Patch44: gdb-remove-path-in-test-name.patch -Patch45: gdb-do-not-import-py-curses-ascii-module.patch -Patch46: gdb-reformat-missing-debug-py-file.patch -Patch47: gdb-handle-no-python-gdb-module.patch -Patch48: gdb-add-rpm-suggestion-script.patch -Patch49: gdb-rhbz2277160-apx-disasm.patch +Patch19: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch20: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +Patch21: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +Patch24: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch25: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch26: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch28: gdb-rhbz2232086-refactor-selftest-support.patch +Patch29: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch +Patch30: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch +Patch31: gdb-rhbz-2232086-generate-gdb-index-consistently.patch +Patch32: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch +Patch33: gdb-rhbz2250652-gdbpy_gil.patch +Patch34: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch +Patch35: gdb-ftbs-swapped-calloc-args.patch +Patch36: gdb-rhbz2261580-intrusive_list-assertion-fix.patch +Patch37: gdb-sync-coffread-with-elfread.patch +Patch38: gdb-merge-debug-symbol-lookup.patch +Patch39: gdb-refactor-find-and-add-separate-symbol-file.patch +Patch40: gdb-add-missing-debug-ext-lang-hook.patch +Patch41: gdb-add-missing-debug-info-python-hook.patch +Patch42: gdb-remove-use-of-py-isascii +Patch43: gdb-remove-path-in-test-name.patch +Patch44: gdb-do-not-import-py-curses-ascii-module.patch +Patch45: gdb-reformat-missing-debug-py-file.patch +Patch46: gdb-handle-no-python-gdb-module.patch +Patch47: gdb-add-rpm-suggestion-script.patch +Patch48: gdb-rhbz2277160-apx-disasm.patch #Fedora Packages end # Fedora patches fixup # These need a number with at least four digits, otherwise patchlist.pl removes # them when upgrading. -Patch1003: fixup-gdb-glibc-strstr-workaround.patch Patch1004: fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch Patch1005: fixup-gdb-test-bt-cfi-without-die.patch Patch1007: fixup-gdb-test-dw2-aranges.patch @@ -716,10 +714,10 @@ find -name "*.info*"|xargs rm -f %patch -P 19 -p1 %patch -P 20 -p1 %patch -P 21 -p1 -%patch -P 22 -p1 +%patch -P 24 -p1 %patch -P 25 -p1 %patch -P 26 -p1 -%patch -P 27 -p1 +%patch -P 28 -p1 %patch -P 29 -p1 %patch -P 30 -p1 %patch -P 31 -p1 @@ -740,10 +738,8 @@ find -name "*.info*"|xargs rm -f %patch -P 46 -p1 %patch -P 47 -p1 %patch -P 48 -p1 -%patch -P 49 -p1 #Fedora patching end -%patch -P 1003 -p1 %patch -P 1004 -p1 %patch -P 1005 -p1 %patch -P 1007 -p1 From e8574fe2352c7d1ba3e75fb4e021129ec9c7c88e4f069e73c4bcc9186f2e1f05 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 24 Jan 2025 15:14:07 +0000 Subject: [PATCH 17/34] - Update to fedora rawhide @ 62add57. - Patches updated: * gdb-add-rpm-suggestion-script.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=422 --- gdb-add-rpm-suggestion-script.patch | 26 +++++++++++++++++++++----- gdb.changes | 6 ++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/gdb-add-rpm-suggestion-script.patch b/gdb-add-rpm-suggestion-script.patch index 0666bce..2ab3af4 100644 --- a/gdb-add-rpm-suggestion-script.patch +++ b/gdb-add-rpm-suggestion-script.patch @@ -26,7 +26,7 @@ diff --git a/gdb/python/lib/gdb/command/rpm-suggestions.py b/gdb/python/lib/gdb/ new file mode 100644 --- /dev/null +++ b/gdb/python/lib/gdb/command/rpm-suggestions.py -@@ -0,0 +1,118 @@ +@@ -0,0 +1,134 @@ +# Copyright 2023 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -48,10 +48,26 @@ new file mode 100644 +try: + import rpm +except ModuleNotFoundError: -+ print( -+ "Unable to load 'rpm' module. Please install the python3-rpm package.", -+ file=sys.stderr -+ ) ++ # The "RPM suggestions" mechanism will not work without the (python) ++ # rpm module. Inform the user of this, but wait to do so until ++ # just prior to printing the GDB prompt. If we do it right away, ++ # the message typically appears before the version and copyright ++ # info, which is easily missed by many users. Additionally, it ++ # seems that several other packages which parse GDB version info ++ # are confused by an early error message regarding a missing ++ # python3-rpm package, so waiting to print the error allows those ++ # applications to work as they used to. ++ def before_prompt(): ++ print( ++ ("\nUnable to load the Python 'rpm' module. Lack of this module disables\n" ++ "the RPM suggestions mechanism which recommends shell commands for\n" ++ "installing missing debuginfo packages. To enable this functionality,\n" ++ "please install the python3-rpm package."), ++ file=sys.stderr ++ ) ++ gdb.events.before_prompt.disconnect(before_prompt) ++ ++ gdb.events.before_prompt.connect(before_prompt) +else: + # Track all the RPMs suggested during a single debug session so we + # don't suggest the same RPM twice. This is only cleared when the diff --git a/gdb.changes b/gdb.changes index 261e86d..626b52b 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Jan 24 15:13:30 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ 62add57. +- Patches updated: + * gdb-add-rpm-suggestion-script.patch +------------------------------------------------------------------- Fri Jan 24 15:10:23 UTC 2025 - Tom de Vries - Update to fedora rawhide @ 199e8a4. From 3e2697bebc14b104f0aaec40e0e1929074b4e8ae4ca6f42475d21ef5266312e4 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 24 Jan 2025 15:17:18 +0000 Subject: [PATCH 18/34] - Update to fedora rawhide @ a455470. - Patches added: * gdb-rhel2295897-pre-read-DWZ-file-in-DWARF-reader.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=423 --- ...97-pre-read-DWZ-file-in-DWARF-reader.patch | 149 ++++++++++++++++++ gdb.changes | 6 + gdb.spec | 2 + 3 files changed, 157 insertions(+) create mode 100644 gdb-rhel2295897-pre-read-DWZ-file-in-DWARF-reader.patch diff --git a/gdb-rhel2295897-pre-read-DWZ-file-in-DWARF-reader.patch b/gdb-rhel2295897-pre-read-DWZ-file-in-DWARF-reader.patch new file mode 100644 index 0000000..9a3feb5 --- /dev/null +++ b/gdb-rhel2295897-pre-read-DWZ-file-in-DWARF-reader.patch @@ -0,0 +1,149 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Tom Tromey +Date: Mon, 23 Oct 2023 16:44:53 -0600 +Subject: gdb-rhel2295897-pre-read-DWZ-file-in-DWARF-reader.patch + +;; backport of upstream commit 91874afabcd +;; This (somehow) solves a double-free when reading minimal symbols + +Pre-read DWZ file in DWARF reader + +While working on background reading of DWARF, I came across the +DWZ-reading code. This code can query the user (via the debuginfod +support) -- something that cannot be done off the main thread. + +Looking into it, I realized that this code can be run much earlier, +avoiding this problem. Digging a bit deeper, I also found a +discrepancy here between how the DWARF reader works in "readnow" mode +as compared to the normal modes. + +This patch cleans this up by trying to read the DWZ file earlier, and +also by having the DWARF reader convert any exception here into a +warning. This unifies the various cases, but also makes it so that +errors do not prevent gdb from continuing on to the extent possible. + +Regression tested on x86-64 Fedora 38. + +diff --git a/gdb/dwarf2/dwz.c b/gdb/dwarf2/dwz.c +--- a/gdb/dwarf2/dwz.c ++++ b/gdb/dwarf2/dwz.c +@@ -29,6 +29,7 @@ + #include "gdbcore.h" + #include "gdbsupport/pathstuff.h" + #include "gdbsupport/scoped_fd.h" ++#include "run-on-main-thread.h" + + const char * + dwz_file::read_string (struct objfile *objfile, LONGEST str_offset) +@@ -196,8 +197,20 @@ dwarf2_get_dwz_file (dwarf2_per_bfd *per_bfd, bool require) + size_t buildid_len; + bfd_byte *buildid; + +- if (per_bfd->dwz_file != NULL) +- return per_bfd->dwz_file.get (); ++ if (per_bfd->dwz_file.has_value ()) ++ { ++ dwz_file *result = per_bfd->dwz_file->get (); ++ if (require && result == nullptr) ++ error (_("could not read '.gnu_debugaltlink' section")); ++ return result; ++ } ++ ++ /* This may query the user via the debuginfod support, so it may ++ only be run in the main thread. */ ++ gdb_assert (is_main_thread ()); ++ ++ /* Set this early, so that on error it remains NULL. */ ++ per_bfd->dwz_file.emplace (nullptr); + + bfd_set_error (bfd_error_no_error); + gdb::unique_xmalloc_ptr data +@@ -283,5 +296,5 @@ dwarf2_get_dwz_file (dwarf2_per_bfd *per_bfd, bool require) + + gdb_bfd_record_inclusion (per_bfd->obfd, result->dwz_bfd.get ()); + per_bfd->dwz_file = std::move (result); +- return per_bfd->dwz_file.get (); ++ return per_bfd->dwz_file->get (); + } +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -3387,6 +3387,17 @@ dwarf2_initialize_objfile (struct objfile *objfile) + + dwarf_read_debug_printf ("called"); + ++ /* Try to fetch any potential dwz file early, while still on the ++ main thread. */ ++ try ++ { ++ dwarf2_get_dwz_file (per_bfd); ++ } ++ catch (const gdb_exception_error &err) ++ { ++ warning (_("%s"), err.what ()); ++ } ++ + /* If we're about to read full symbols, don't bother with the + indices. In this case we also don't care if some other debug + format is making psymtabs, because they are all about to be +@@ -5294,16 +5305,7 @@ create_all_units (dwarf2_per_objfile *per_objfile) + &per_objfile->per_bfd->abbrev, 0, + types_htab, rcuh_kind::TYPE); + +- dwz_file *dwz; +- try +- { +- dwz = dwarf2_get_dwz_file (per_objfile->per_bfd); +- } +- catch (const gdb_exception_error &) +- { +- per_objfile->per_bfd->all_units.clear (); +- throw; +- } ++ dwz_file *dwz = dwarf2_get_dwz_file (per_objfile->per_bfd); + if (dwz != NULL) + { + /* Pre-read the sections we'll need to construct an index. */ +diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h +--- a/gdb/dwarf2/read.h ++++ b/gdb/dwarf2/read.h +@@ -520,7 +520,7 @@ struct dwarf2_per_bfd + + /* The shared '.dwz' file, if one exists. This is used when the + original data was compressed using 'dwz -m'. */ +- std::unique_ptr dwz_file; ++ gdb::optional> dwz_file; + + /* Whether copy relocations are supported by this object format. */ + bool can_copy; +diff --git a/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp b/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp +--- a/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp ++++ b/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp +@@ -142,13 +142,6 @@ proc do_test {} { + + gdb_load ${::binfile}-${::testname} + +- if { $::testname == "mismatch" && [readnow] } { +- # Main is found in the minimal symbols. When using readnow, a +- # failure to read the dwarf also causes the minimal symbols to be +- # unavailable. +- # Setup a kfail for "FAIL: gdb_breakpoint: set breakpoint at main". +- setup_kfail "symtab/26797" *-*-* +- } + if {![runto_main]} { + return + } +diff --git a/gdb/testsuite/gdb.dwarf2/no-gnu-debuglink.exp b/gdb/testsuite/gdb.dwarf2/no-gnu-debuglink.exp +--- a/gdb/testsuite/gdb.dwarf2/no-gnu-debuglink.exp ++++ b/gdb/testsuite/gdb.dwarf2/no-gnu-debuglink.exp +@@ -37,8 +37,8 @@ if { [build_executable $testfile.exp $testfile [list $srcfile $asm_file]] } { + + clean_restart + +-set msg "\r\ncould not find '\.gnu_debugaltlink' file for \[^\r\n\]*" ++set msg "\r\nwarning: could not find '\.gnu_debugaltlink' file for \[^\r\n\]*" + gdb_test "file $binfile" "$msg" "file command" + + set question "Load new symbol table from .*\? .y or n. " +-gdb_test "file $binfile" "$msg" "file command, again" $question "y" ++gdb_test "file $binfile" "" "file command, again" $question "y" diff --git a/gdb.changes b/gdb.changes index 626b52b..fe71078 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Jan 24 15:15:38 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ a455470. +- Patches added: + * gdb-rhel2295897-pre-read-DWZ-file-in-DWARF-reader.patch +------------------------------------------------------------------- Fri Jan 24 15:13:30 UTC 2025 - Tom de Vries - Update to fedora rawhide @ 62add57. diff --git a/gdb.spec b/gdb.spec index 0453d23..619f90e 100644 --- a/gdb.spec +++ b/gdb.spec @@ -212,6 +212,7 @@ Patch45: gdb-reformat-missing-debug-py-file.patch Patch46: gdb-handle-no-python-gdb-module.patch Patch47: gdb-add-rpm-suggestion-script.patch Patch48: gdb-rhbz2277160-apx-disasm.patch +Patch49: gdb-rhel2295897-pre-read-DWZ-file-in-DWARF-reader.patch #Fedora Packages end # Fedora patches fixup @@ -738,6 +739,7 @@ find -name "*.info*"|xargs rm -f %patch -P 46 -p1 %patch -P 47 -p1 %patch -P 48 -p1 +%patch -P 49 -p1 #Fedora patching end %patch -P 1004 -p1 From 4506b789a5eee1dce37617f46d0e4b1726ae04ced996360b49bac5da2233e22d Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Sat, 25 Jan 2025 10:55:04 +0000 Subject: [PATCH 19/34] - Patches added: * gdb-testsuite-record-less-in-gdb.reverse-time-revers.patch * gdb-cli-print-at_hwcap3-and-at_hwcap4.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=424 --- gdb-cli-print-at_hwcap3-and-at_hwcap4.patch | 41 +++++++++ ...cord-less-in-gdb.reverse-time-revers.patch | 92 +++++++++++++++++++ gdb.changes | 7 ++ gdb.spec | 8 ++ 4 files changed, 148 insertions(+) create mode 100644 gdb-cli-print-at_hwcap3-and-at_hwcap4.patch create mode 100644 gdb-testsuite-record-less-in-gdb.reverse-time-revers.patch diff --git a/gdb-cli-print-at_hwcap3-and-at_hwcap4.patch b/gdb-cli-print-at_hwcap3-and-at_hwcap4.patch new file mode 100644 index 0000000..81e2fa7 --- /dev/null +++ b/gdb-cli-print-at_hwcap3-and-at_hwcap4.patch @@ -0,0 +1,41 @@ +From 442c996a4de355459eeabd280649ddb282d7de41 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sat, 25 Jan 2025 10:08:53 +0100 +Subject: [PATCH 2/2] [gdb/cli] Print AT_HWCAP3 and AT_HWCAP4 + +PR cli/32590 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32590 +--- + gdb/auxv.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/gdb/auxv.c b/gdb/auxv.c +index 8cda0b687b4..bb4c7ea70a0 100644 +--- a/gdb/auxv.c ++++ b/gdb/auxv.c +@@ -453,6 +453,13 @@ fprint_auxv_entry (struct ui_file *file, const char *name, + } + } + ++#ifndef AT_HWCAP3 ++#define AT_HWCAP3 29 ++#endif ++#ifndef AT_HWCAP4 ++#define AT_HWCAP4 30 ++#endif ++ + /* The default implementation of gdbarch_print_auxv_entry. */ + + void +@@ -495,6 +502,8 @@ default_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file, + AUXV_FORMAT_STR); + TAG (AT_RANDOM, _("Address of 16 random bytes"), AUXV_FORMAT_HEX); + TAG (AT_HWCAP2, _("Extension of AT_HWCAP"), AUXV_FORMAT_HEX); ++ TAG (AT_HWCAP3, _("Extension of AT_HWCAP"), AUXV_FORMAT_HEX); ++ TAG (AT_HWCAP4, _("Extension of AT_HWCAP"), AUXV_FORMAT_HEX); + TAG (AT_RSEQ_FEATURE_SIZE, _("rseq supported feature size"), + AUXV_FORMAT_DEC); + TAG (AT_RSEQ_ALIGN, _("rseq allocation alignment"), +-- +2.43.0 + diff --git a/gdb-testsuite-record-less-in-gdb.reverse-time-revers.patch b/gdb-testsuite-record-less-in-gdb.reverse-time-revers.patch new file mode 100644 index 0000000..1061ee6 --- /dev/null +++ b/gdb-testsuite-record-less-in-gdb.reverse-time-revers.patch @@ -0,0 +1,92 @@ +From fc88d3c31d277ad466ae961b585fbb2fac982d3e Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 24 Jan 2025 16:37:36 +0100 +Subject: [PATCH 1/2] [gdb/testsuite] Record less in + gdb.reverse/time-reverse.exp + +While stepping through gdb.reverse/time-reverse.exp I realized that we're +recording the instructions for resolving the PLT entries for functions time +and syscall, while that's not really the focus of the test-case. + +Limit the scope of the test, by calling the functions once before starting +to record. + +Also call "info record" after recording to make it clear how many +instructions were recorded. + +On x86_64-linux, before this patch (but with info record added), we have: +... +$ grep "Log contains" gdb.log +Log contains 750 instructions. +Log contains 1218 instructions. +... +and with this patch we have: +... +$ grep "Log contains" gdb.log +Log contains 24 instructions. +Log contains 19 instructions. +... + +Tested on x86_64-linux. + +Approved-By: Guinevere Larsen +--- + gdb/testsuite/gdb.reverse/time-reverse.c | 12 ++++++++++++ + gdb/testsuite/gdb.reverse/time-reverse.exp | 7 +++---- + 2 files changed, 15 insertions(+), 4 deletions(-) + +diff --git a/gdb/testsuite/gdb.reverse/time-reverse.c b/gdb/testsuite/gdb.reverse/time-reverse.c +index c22ecd849d8..0ed52244a30 100644 +--- a/gdb/testsuite/gdb.reverse/time-reverse.c ++++ b/gdb/testsuite/gdb.reverse/time-reverse.c +@@ -41,8 +41,20 @@ time_t time_global = -1; + int + main (void) + { ++ /* Call once before recording to resolve the PLT, if any. This reduces the ++ amount of instructions that is recorded. */ ++ my_time (&time_global); ++ ++ /* Reset back to initial value. */ ++ time_global = -1; ++ ++ /* Start recording here. */ + marker1 (); ++ + my_time (&time_global); ++ ++ /* Stop recording here. */ + marker2 (); ++ + return 0; + } +diff --git a/gdb/testsuite/gdb.reverse/time-reverse.exp b/gdb/testsuite/gdb.reverse/time-reverse.exp +index 91f9911c33a..b02245c6c77 100644 +--- a/gdb/testsuite/gdb.reverse/time-reverse.exp ++++ b/gdb/testsuite/gdb.reverse/time-reverse.exp +@@ -38,7 +38,7 @@ proc test {mode} { + return + } + +- runto_main ++ runto marker1 + + if [supports_process_record] { + # Activate process record/replay +@@ -51,9 +51,8 @@ proc test {mode} { + + gdb_continue_to_breakpoint "marker2" ".*$::srcfile:.*" + +- gdb_test "break marker1" \ +- "Breakpoint $::decimal at $::hex: file .*$::srcfile, line $::decimal.*" \ +- "set breakpoint at marker1" ++ # Show how many instructions we've recorded. ++ gdb_test "info record" "Active record target: .*" + + gdb_test "reverse-continue" ".*$::srcfile:$::decimal.*" "reverse to marker1" + + +base-commit: 8764f9e601b4ef996d9b1d8eab16f8cfec3561c4 +-- +2.43.0 + diff --git a/gdb.changes b/gdb.changes index fe71078..c425e12 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sat Jan 25 09:24:00 UTC 2025 - Tom de Vries + +- Patches added: + * gdb-testsuite-record-less-in-gdb.reverse-time-revers.patch + * gdb-cli-print-at_hwcap3-and-at_hwcap4.patch + ------------------------------------------------------------------- Fri Jan 24 15:15:38 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 619f90e..41866d1 100644 --- a/gdb.spec +++ b/gdb.spec @@ -255,6 +255,8 @@ Patch1504: fix-gdb.mi-new-ui-mi-sync.exp.patch # FAIL: gdb.base/step-over-syscall.exp: fork: displaced=off: \ # pc after stepi matches insn addr after syscall Patch1505: gdb-testsuite-fix-gdb.base-step-over-syscall.exp-with-m32-amd-case.patch +# https://sourceware.org/bugzilla/show_bug.cgi?id=32590 +Patch1506: gdb-cli-print-at_hwcap3-and-at_hwcap4.patch # Backports from current release branch (GDB 14). @@ -348,6 +350,10 @@ Patch2093: gdb-tdep-s390-add-arch15-record-replay-support.patch Patch2094: gdb-testsuite-avoid-intermittent-failures-on-a-debug.patch Patch2095: gdb-python-avoid-depending-on-the-curses-library.patch +# Backports from master, available in GDB 17. + +Patch2096: gdb-testsuite-record-less-in-gdb.reverse-time-revers.patch + # # Backport from gdb-patches @@ -759,6 +765,7 @@ find -name "*.info*"|xargs rm -f %patch -P 1503 -p1 %patch -P 1504 -p1 %patch -P 1505 -p1 +%patch -P 1506 -p1 %patch -P 2000 -p1 %patch -P 2001 -p1 @@ -843,6 +850,7 @@ find -name "*.info*"|xargs rm -f %patch -P 2093 -p1 %patch -P 2094 -p1 %patch -P 2095 -p1 +%patch -P 2096 -p1 %patch -P 2100 -p1 %patch -P 2101 -p1 From f103997c76de5d93da68bede2d82a727d9feefc83ba07230bd39650fc2d7a1b7 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Wed, 29 Jan 2025 07:03:03 +0000 Subject: [PATCH 20/34] - Update to fedora rawhide @ a8e0b3d (gdb 15.1). - Use gcc-9 for SLE-12 (default gcc 4.8.5 doesn't support C++17). - Maintenance script qa-local.sh: * Update version to 15.1. - Maintenance script qa.sh: * Add kfails due to gcc 4.8.5 DW_TAG_lexical_block oddity. * Extend PR24845 kfails. * Add PR31721 and PR32608 kfails. - Patches added: * gdb-guile-use-scm_debug_typing_strictness-0.patch * gdb-doc-fix-gdb.unwinder-docs.patch * gdb-doc-fix-qisaddresstagged-anchor.patch * gdb-doc-fix-standard-replies-xref.patch * gdb-testsuite-fix-gdb_py_module_available-for-python.patch * gdb-testsuite-fix-another-regexp-in-gdb.threads-step.patch * gdb-testsuite-fix-timeouts-in-gdb.threads-step-over-.patch - Patches updated: * gdb-6.3-gstack-20050411.patch * gdb-6.6-buildid-locate-solib-missing-ids.patch * gdb-6.6-buildid-locate.patch * gdb-add-rpm-suggestion-script.patch * gdb-gcore-bash.patch * gdb-python-avoid-depending-on-the-curses-library.patch * gdb-python-finishbreakpoint-update.patch - Patches dropped: * gdb-add-missing-debug-ext-lang-hook.patch * gdb-add-missing-debug-info-python-hook.patch * gdb-do-not-import-py-curses-ascii-module.patch * gdb-ftbs-swapped-calloc-args.patch * gdb-handle-no-python-gdb-module.patch * gdb-merge-debug-symbol-lookup.patch * gdb-refactor-find-and-add-separate-symbol-file.patch * gdb-reformat-missing-debug-py-file.patch * gdb-remove-path-in-test-name.patch * gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch * gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch * gdb-rhbz-2232086-generate-gdb-index-consistently.patch * gdb-rhbz-2232086-reduce-size-of-gdb-index.patch * gdb-rhbz2232086-refactor-selftest-support.patch * gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch * gdb-rhbz2250652-gdbpy_gil.patch * gdb-rhbz2261580-intrusive_list-assertion-fix.patch * gdb-rhbz2277160-apx-disasm.patch * gdb-rhel2295897-pre-read-DWZ-file-in-DWARF-reader.patch * gdb-sync-coffread-with-elfread.patch * gdb-remove-use-of-py-isascii * change-gdb.base-examine-backwards.exp-for-aix.patch * fix-regression-on-aarch64-linux-gdbserver.patch * fix-the-gdb.ada-inline-section-gc.exp-test.patch * fixup-powerpc-and-aarch64-fix-reverse-stepping-failu.patch * gdb-arm-fix-epilogue-frame-id.patch * gdb-arm-remove-thumb-bit-in-arm_adjust_breakpoint_ad.patch * gdb-arm-remove-tpidruro-register-from-non-freebsd-ta.patch * gdb-build-fix-gdbserver-linux-aarch64-low.cc-build.patch * gdb-exp-fix-cast-handling-for-indirection.patch * gdb-exp-fix-printing-of-out-of-bounds-struct-members.patch * gdb-exp-redo-cast-handling-for-indirection.patch * gdb-fix-heap-use-after-free-in-select_event_lwp.patch * gdb-fix-segfault-in-for_each_block-part-1.patch * gdb-fix-segfault-in-for_each_block-part-2.patch * gdb-python-fix-gdb.python-py-disasm.exp-on-arm-linux.patch * gdb-python-make-gdb.unwindinfo.add_saved_register-mo-fixup.patch * gdb-python-make-gdb.unwindinfo.add_saved_register-mo.patch * gdb-remote-fix-abort-on-remote_close_error.patch * gdb-s390-add-arch14-record-replay-support.patch * gdb-symtab-add-producer_is_gas.patch * gdb-symtab-don-t-defer-backward-refs-inter-cu-intra-.patch * gdb-symtab-factor-out-m_deferred_entries-usage.patch * gdb-symtab-factor-out-m_die_range_map-usage.patch * gdb-symtab-fix-dw_tag_inlined_subroutine-entries-in-.patch * gdb-symtab-handle-nullptr-parent-in-parent_map-set_p.patch * gdb-symtab-keep-track-of-all-parents-for-cooked-inde.patch * gdb-symtab-keep-track-of-processed-dies-in-shard.patch * gdb-symtab-refactor-condition-in-scan_attributes.patch * gdb-symtab-resolve-deferred-entries-inter-shard-case.patch * gdb-symtab-resolve-deferred-entries-intra-shard-case.patch * gdb-symtab-work-around-gas-pr28629.patch * gdb-symtab-work-around-pr-gas-29517-dwarf2-case.patch * gdb-symtab-work-around-pr-gas-29517.patch * gdb-symtab-workaround-pr-gas-31115.patch * gdb-tdep-fix-catching-syscall-execve-exit-for-arm.patch * gdb-tdep-fix-gdb.base-watch-bitfields.exp-on-aarch64.patch * gdb-tdep-fix-gdb.base-watchpoint-running-on-arm-ppc6.patch * gdb-tdep-fix-gdb.base-watchpoint-unaligned.exp-on-aa.patch * gdb-tdep-fix-nr-array-elements-in-ppc64_aggregate_ca.patch * gdb-tdep-fix-reverse-execution-of-ldr-immediate-t4.patch * gdb-testsuite-add-gdb.dwarf2-backward-spec-inter-cu..patch * gdb-testsuite-add-gdb.dwarf2-forward-spec-inter-cu.e.patch * gdb-testsuite-add-missing-include-in-gdb.base-ctf-pt.patch * gdb-testsuite-add-missing-include-in-gdb.base-rtld-s.patch * gdb-testsuite-add-missing-includes-in-gdb.trace-coll.patch * gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch * gdb-testsuite-add-pr-gdb-26967-kfail-in-two-more-tes.patch * gdb-testsuite-call-ldd-version-in-gdb.testsuite-dump.patch * gdb-testsuite-factor-out-proc-get_portnum.patch * gdb-testsuite-factor-out-proc-lock_dir.patch * gdb-testsuite-factor-out-proc-with_lock.patch * gdb-testsuite-fix-gdb.ada-verylong.exp-on-32-bit-tar.patch * gdb-testsuite-fix-gdb.base-eh_return.exp.patch * gdb-testsuite-fix-gdb.base-ending-run.exp-on-manjaro.patch * gdb-testsuite-fix-gdb.base-list-no-debug.exp-on-debi.patch * gdb-testsuite-fix-gdb.cp-namespace.exp-with-read1.patch * gdb-testsuite-fix-gdb.dwarf2-dw2-gas-workaround.exp.patch * gdb-testsuite-fix-gdb.mi-mi-dprintf.exp-with-read1.patch * gdb-testsuite-fix-gdbserver-pid-in-gdb.server-server.patch * gdb-testsuite-fix-gdb.server-server-connect.exp-for-.patch * gdb-testsuite-fix-license-text-in-gdb.reverse-map-to.patch * gdb-testsuite-fix-missing-return-type-in-gdb.linespe.patch * gdb-testsuite-fix-regexp-in-vgdb_start.patch * gdb-testsuite-fix-spurious-fails-with-examine-backwa.patch * gdb-testsuite-fix-test-case-gdb.threads-attach-stopp.patch * gdb-testsuite-fix-test-in-gdb.python-py-finish-break.patch * gdb-testsuite-fix-typo-in-gdb.base-catch-syscall.exp.patch * gdb-testsuite-fix-valgrind-tests-on-debian.patch * gdb-testsuite-further-handle-long-filenames-in-gdb.b.patch * gdb-testsuite-handle-core-without-build-id-in-gdb.ba.patch * gdb-testsuite-handle-pac-marker.patch * gdb-testsuite-make-gdb.base-solib-search.exp-more-ro.patch * gdb-testsuite-make-portnum-a-persistent-global.patch * gdb-testsuite-move-gpu-parallel.lock-to-cache-dir.patch * gdb-testsuite-remove-spurious-in-save_vars.patch * gdb-testsuite-reset-errcnt-and-warncnt-in-default_gd.patch * gdb-testsuite-simplify-gdb.server-server-kill-python.patch * gdb-testsuite-use-find_gnatmake-instead-of-gdb_find_.patch * gdb-testsuite-use-more-progbits-for-arm.patch * gdb-testsuite-use-unique-portnum-in-parallel-testing-check-slash-slash-case.patch * gdb-testsuite-use-unique-portnum-in-parallel-testing.patch * gdb-tui-allow-command-window-of-1-or-2-lines.patch * gdb-tui-fix-resizing-of-terminal-to-1-or-2-lines.patch * gdb-tui-fix-wmaybe-uninitialized-in-tui_find_disasse.patch * make-pascal_language-print_type-handle-varstring-nul.patch * powerpc-and-aarch64-fix-reverse-stepping-failure.patch * powerpc-fix-test-gdb.ada-finish-large.exp.patch * riscv-lrsc.patch * rs6000-unwind-on-each-instruction-fix.patch * s390-provide-ibm-z16-arch14-instruction-descriptions.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=425 --- ...b.base-examine-backwards.exp-for-aix.patch | 53 - ...egression-on-aarch64-linux-gdbserver.patch | 366 - ...e-gdb.ada-inline-section-gc.exp-test.patch | 80 - ...d-aarch64-fix-reverse-stepping-failu.patch | 70 - gdb-14.2.tar.bz2 | 3 - gdb-15.1.tar.bz2 | 3 + gdb-6.3-gstack-20050411.patch | 22 +- ...6.6-buildid-locate-solib-missing-ids.patch | 125 +- gdb-6.6-buildid-locate.patch | 136 +- gdb-add-missing-debug-ext-lang-hook.patch | 314 - gdb-add-missing-debug-info-python-hook.patch | 1556 ---- gdb-add-rpm-suggestion-script.patch | 8 +- gdb-arm-fix-epilogue-frame-id.patch | 47 - ...humb-bit-in-arm_adjust_breakpoint_ad.patch | 77 - ...pidruro-register-from-non-freebsd-ta.patch | 219 - ...gdbserver-linux-aarch64-low.cc-build.patch | 41 - ...do-not-import-py-curses-ascii-module.patch | 64 - gdb-doc-fix-gdb.unwinder-docs.patch | 61 + gdb-doc-fix-qisaddresstagged-anchor.patch | 41 + gdb-doc-fix-standard-replies-xref.patch | 44 + ...xp-fix-cast-handling-for-indirection.patch | 150 - ...ting-of-out-of-bounds-struct-members.patch | 365 - ...p-redo-cast-handling-for-indirection.patch | 86 - ...p-use-after-free-in-select_event_lwp.patch | 144 - ...ix-segfault-in-for_each_block-part-1.patch | 636 -- ...ix-segfault-in-for_each_block-part-2.patch | 168 - gdb-ftbs-swapped-calloc-args.patch | 42 - gdb-gcore-bash.patch | 2 +- ...le-use-scm_debug_typing_strictness-0.patch | 68 + gdb-handle-no-python-gdb-module.patch | 30 - gdb-merge-debug-symbol-lookup.patch | 265 - ...void-depending-on-the-curses-library.patch | 26 +- gdb-python-finishbreakpoint-update.patch | 28 +- ...db.python-py-disasm.exp-on-arm-linux.patch | 125 - ...windinfo.add_saved_register-mo-fixup.patch | 70 - ...gdb.unwindinfo.add_saved_register-mo.patch | 61 - ...or-find-and-add-separate-symbol-file.patch | 190 - gdb-reformat-missing-debug-py-file.patch | 38 - ...mote-fix-abort-on-remote_close_error.patch | 229 - gdb-remove-path-in-test-name.patch | 29 - gdb-remove-use-of-py-isascii | 46 - gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch | 264 - ...-generate-dwarf-5-index-consistently.patch | 101 - ...2086-generate-gdb-index-consistently.patch | 230 - ...hbz-2232086-reduce-size-of-gdb-index.patch | 222 - ...hbz2232086-refactor-selftest-support.patch | 77 - ...hbz2250652-avoid-PyOS_ReadlineTState.patch | 48 - gdb-rhbz2250652-gdbpy_gil.patch | 81 - ...2261580-intrusive_list-assertion-fix.patch | 55 - gdb-rhbz2277160-apx-disasm.patch | 7834 ----------------- ...97-pre-read-DWZ-file-in-DWARF-reader.patch | 149 - ...390-add-arch14-record-replay-support.patch | 50 - gdb-symtab-add-producer_is_gas.patch | 125 - ...-defer-backward-refs-inter-cu-intra-.patch | 74 - ...-factor-out-m_deferred_entries-usage.patch | 76 - ...tab-factor-out-m_die_range_map-usage.patch | 151 - ...w_tag_inlined_subroutine-entries-in-.patch | 112 - ...e-nullptr-parent-in-parent_map-set_p.patch | 37 - ...track-of-all-parents-for-cooked-inde.patch | 38 - ...eep-track-of-processed-dies-in-shard.patch | 126 - ...efactor-condition-in-scan_attributes.patch | 70 - ...ve-deferred-entries-inter-shard-case.patch | 500 -- ...ve-deferred-entries-intra-shard-case.patch | 120 - gdb-symtab-work-around-gas-pr28629.patch | 278 - ...work-around-pr-gas-29517-dwarf2-case.patch | 137 - gdb-symtab-work-around-pr-gas-29517.patch | 256 - gdb-symtab-workaround-pr-gas-31115.patch | 122 - gdb-sync-coffread-with-elfread.patch | 47 - ...catching-syscall-execve-exit-for-arm.patch | 130 - ....base-watch-bitfields.exp-on-aarch64.patch | 349 - ....base-watchpoint-running-on-arm-ppc6.patch | 76 - ....base-watchpoint-unaligned.exp-on-aa.patch | 262 - ...array-elements-in-ppc64_aggregate_ca.patch | 86 - ...everse-execution-of-ldr-immediate-t4.patch | 80 - ...d-gdb.dwarf2-backward-spec-inter-cu..patch | 128 - ...d-gdb.dwarf2-forward-spec-inter-cu.e.patch | 128 - ...d-missing-include-in-gdb.base-ctf-pt.patch | 51 - ...d-missing-include-in-gdb.base-rtld-s.patch | 47 - ...d-missing-includes-in-gdb.trace-coll.patch | 60 - ...d-missing-no-prompt-anchor-in-gdb.ba.patch | 45 - ...d-pr-gdb-26967-kfail-in-two-more-tes.patch | 167 - ...ll-ldd-version-in-gdb.testsuite-dump.patch | 39 - ...estsuite-factor-out-proc-get_portnum.patch | 98 - gdb-testsuite-factor-out-proc-lock_dir.patch | 63 - gdb-testsuite-factor-out-proc-with_lock.patch | 160 - ...x-another-regexp-in-gdb.threads-step.patch | 40 + ...x-gdb.ada-verylong.exp-on-32-bit-tar.patch | 84 - ...testsuite-fix-gdb.base-eh_return.exp.patch | 80 - ...x-gdb.base-ending-run.exp-on-manjaro.patch | 58 - ...x-gdb.base-list-no-debug.exp-on-debi.patch | 103 - ...-fix-gdb.cp-namespace.exp-with-read1.patch | 57 - ...ix-gdb.dwarf2-dw2-gas-workaround.exp.patch | 41 - ...fix-gdb.mi-mi-dprintf.exp-with-read1.patch | 72 - ...x-gdb.server-server-connect.exp-for-.patch | 74 - ...x-gdb_py_module_available-for-python.patch | 39 + ...x-gdbserver-pid-in-gdb.server-server.patch | 117 - ...x-license-text-in-gdb.reverse-map-to.patch | 49 - ...x-missing-return-type-in-gdb.linespe.patch | 40 - gdb-testsuite-fix-regexp-in-vgdb_start.patch | 66 - ...x-spurious-fails-with-examine-backwa.patch | 221 - ...x-test-case-gdb.threads-attach-stopp.patch | 65 - ...x-test-in-gdb.python-py-finish-break.patch | 67 - ...x-timeouts-in-gdb.threads-step-over-.patch | 103 + ...x-typo-in-gdb.base-catch-syscall.exp.patch | 52 - ...stsuite-fix-valgrind-tests-on-debian.patch | 54 - ...rther-handle-long-filenames-in-gdb.b.patch | 49 - ...ndle-core-without-build-id-in-gdb.ba.patch | 66 - gdb-testsuite-handle-pac-marker.patch | 213 - ...ke-gdb.base-solib-search.exp-more-ro.patch | 93 - ...ite-make-portnum-a-persistent-global.patch | 68 - ...-move-gpu-parallel.lock-to-cache-dir.patch | 42 - ...stsuite-remove-spurious-in-save_vars.patch | 53 - ...set-errcnt-and-warncnt-in-default_gd.patch | 68 - ...mplify-gdb.server-server-kill-python.patch | 65 - ...e-find_gnatmake-instead-of-gdb_find_.patch | 139 - gdb-testsuite-use-more-progbits-for-arm.patch | 858 -- ...allel-testing-check-slash-slash-case.patch | 95 - ...e-unique-portnum-in-parallel-testing.patch | 102 - ...allow-command-window-of-1-or-2-lines.patch | 80 - ...resizing-of-terminal-to-1-or-2-lines.patch | 147 - ...be-uninitialized-in-tui_find_disasse.patch | 57 - gdb.changes | 140 + gdb.spec | 291 +- ...uage-print_type-handle-varstring-nul.patch | 43 - ...aarch64-fix-reverse-stepping-failure.patch | 478 - ...pc-fix-test-gdb.ada-finish-large.exp.patch | 49 - qa-local.sh | 2 +- qa.sh | 15 +- riscv-lrsc.patch | 380 - rs6000-unwind-on-each-instruction-fix.patch | 97 - ...-z16-arch14-instruction-descriptions.patch | 103 - 131 files changed, 787 insertions(+), 23965 deletions(-) delete mode 100644 change-gdb.base-examine-backwards.exp-for-aix.patch delete mode 100644 fix-regression-on-aarch64-linux-gdbserver.patch delete mode 100644 fix-the-gdb.ada-inline-section-gc.exp-test.patch delete mode 100644 fixup-powerpc-and-aarch64-fix-reverse-stepping-failu.patch delete mode 100644 gdb-14.2.tar.bz2 create mode 100644 gdb-15.1.tar.bz2 delete mode 100644 gdb-add-missing-debug-ext-lang-hook.patch delete mode 100644 gdb-add-missing-debug-info-python-hook.patch delete mode 100644 gdb-arm-fix-epilogue-frame-id.patch delete mode 100644 gdb-arm-remove-thumb-bit-in-arm_adjust_breakpoint_ad.patch delete mode 100644 gdb-arm-remove-tpidruro-register-from-non-freebsd-ta.patch delete mode 100644 gdb-build-fix-gdbserver-linux-aarch64-low.cc-build.patch delete mode 100644 gdb-do-not-import-py-curses-ascii-module.patch create mode 100644 gdb-doc-fix-gdb.unwinder-docs.patch create mode 100644 gdb-doc-fix-qisaddresstagged-anchor.patch create mode 100644 gdb-doc-fix-standard-replies-xref.patch delete mode 100644 gdb-exp-fix-cast-handling-for-indirection.patch delete mode 100644 gdb-exp-fix-printing-of-out-of-bounds-struct-members.patch delete mode 100644 gdb-exp-redo-cast-handling-for-indirection.patch delete mode 100644 gdb-fix-heap-use-after-free-in-select_event_lwp.patch delete mode 100644 gdb-fix-segfault-in-for_each_block-part-1.patch delete mode 100644 gdb-fix-segfault-in-for_each_block-part-2.patch delete mode 100644 gdb-ftbs-swapped-calloc-args.patch create mode 100644 gdb-guile-use-scm_debug_typing_strictness-0.patch delete mode 100644 gdb-handle-no-python-gdb-module.patch delete mode 100644 gdb-merge-debug-symbol-lookup.patch delete mode 100644 gdb-python-fix-gdb.python-py-disasm.exp-on-arm-linux.patch delete mode 100644 gdb-python-make-gdb.unwindinfo.add_saved_register-mo-fixup.patch delete mode 100644 gdb-python-make-gdb.unwindinfo.add_saved_register-mo.patch delete mode 100644 gdb-refactor-find-and-add-separate-symbol-file.patch delete mode 100644 gdb-reformat-missing-debug-py-file.patch delete mode 100644 gdb-remote-fix-abort-on-remote_close_error.patch delete mode 100644 gdb-remove-path-in-test-name.patch delete mode 100644 gdb-remove-use-of-py-isascii delete mode 100644 gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch delete mode 100644 gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch delete mode 100644 gdb-rhbz-2232086-generate-gdb-index-consistently.patch delete mode 100644 gdb-rhbz-2232086-reduce-size-of-gdb-index.patch delete mode 100644 gdb-rhbz2232086-refactor-selftest-support.patch delete mode 100644 gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch delete mode 100644 gdb-rhbz2250652-gdbpy_gil.patch delete mode 100644 gdb-rhbz2261580-intrusive_list-assertion-fix.patch delete mode 100644 gdb-rhbz2277160-apx-disasm.patch delete mode 100644 gdb-rhel2295897-pre-read-DWZ-file-in-DWARF-reader.patch delete mode 100644 gdb-s390-add-arch14-record-replay-support.patch delete mode 100644 gdb-symtab-add-producer_is_gas.patch delete mode 100644 gdb-symtab-don-t-defer-backward-refs-inter-cu-intra-.patch delete mode 100644 gdb-symtab-factor-out-m_deferred_entries-usage.patch delete mode 100644 gdb-symtab-factor-out-m_die_range_map-usage.patch delete mode 100644 gdb-symtab-fix-dw_tag_inlined_subroutine-entries-in-.patch delete mode 100644 gdb-symtab-handle-nullptr-parent-in-parent_map-set_p.patch delete mode 100644 gdb-symtab-keep-track-of-all-parents-for-cooked-inde.patch delete mode 100644 gdb-symtab-keep-track-of-processed-dies-in-shard.patch delete mode 100644 gdb-symtab-refactor-condition-in-scan_attributes.patch delete mode 100644 gdb-symtab-resolve-deferred-entries-inter-shard-case.patch delete mode 100644 gdb-symtab-resolve-deferred-entries-intra-shard-case.patch delete mode 100644 gdb-symtab-work-around-gas-pr28629.patch delete mode 100644 gdb-symtab-work-around-pr-gas-29517-dwarf2-case.patch delete mode 100644 gdb-symtab-work-around-pr-gas-29517.patch delete mode 100644 gdb-symtab-workaround-pr-gas-31115.patch delete mode 100644 gdb-sync-coffread-with-elfread.patch delete mode 100644 gdb-tdep-fix-catching-syscall-execve-exit-for-arm.patch delete mode 100644 gdb-tdep-fix-gdb.base-watch-bitfields.exp-on-aarch64.patch delete mode 100644 gdb-tdep-fix-gdb.base-watchpoint-running-on-arm-ppc6.patch delete mode 100644 gdb-tdep-fix-gdb.base-watchpoint-unaligned.exp-on-aa.patch delete mode 100644 gdb-tdep-fix-nr-array-elements-in-ppc64_aggregate_ca.patch delete mode 100644 gdb-tdep-fix-reverse-execution-of-ldr-immediate-t4.patch delete mode 100644 gdb-testsuite-add-gdb.dwarf2-backward-spec-inter-cu..patch delete mode 100644 gdb-testsuite-add-gdb.dwarf2-forward-spec-inter-cu.e.patch delete mode 100644 gdb-testsuite-add-missing-include-in-gdb.base-ctf-pt.patch delete mode 100644 gdb-testsuite-add-missing-include-in-gdb.base-rtld-s.patch delete mode 100644 gdb-testsuite-add-missing-includes-in-gdb.trace-coll.patch delete mode 100644 gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch delete mode 100644 gdb-testsuite-add-pr-gdb-26967-kfail-in-two-more-tes.patch delete mode 100644 gdb-testsuite-call-ldd-version-in-gdb.testsuite-dump.patch delete mode 100644 gdb-testsuite-factor-out-proc-get_portnum.patch delete mode 100644 gdb-testsuite-factor-out-proc-lock_dir.patch delete mode 100644 gdb-testsuite-factor-out-proc-with_lock.patch create mode 100644 gdb-testsuite-fix-another-regexp-in-gdb.threads-step.patch delete mode 100644 gdb-testsuite-fix-gdb.ada-verylong.exp-on-32-bit-tar.patch delete mode 100644 gdb-testsuite-fix-gdb.base-eh_return.exp.patch delete mode 100644 gdb-testsuite-fix-gdb.base-ending-run.exp-on-manjaro.patch delete mode 100644 gdb-testsuite-fix-gdb.base-list-no-debug.exp-on-debi.patch delete mode 100644 gdb-testsuite-fix-gdb.cp-namespace.exp-with-read1.patch delete mode 100644 gdb-testsuite-fix-gdb.dwarf2-dw2-gas-workaround.exp.patch delete mode 100644 gdb-testsuite-fix-gdb.mi-mi-dprintf.exp-with-read1.patch delete mode 100644 gdb-testsuite-fix-gdb.server-server-connect.exp-for-.patch create mode 100644 gdb-testsuite-fix-gdb_py_module_available-for-python.patch delete mode 100644 gdb-testsuite-fix-gdbserver-pid-in-gdb.server-server.patch delete mode 100644 gdb-testsuite-fix-license-text-in-gdb.reverse-map-to.patch delete mode 100644 gdb-testsuite-fix-missing-return-type-in-gdb.linespe.patch delete mode 100644 gdb-testsuite-fix-regexp-in-vgdb_start.patch delete mode 100644 gdb-testsuite-fix-spurious-fails-with-examine-backwa.patch delete mode 100644 gdb-testsuite-fix-test-case-gdb.threads-attach-stopp.patch delete mode 100644 gdb-testsuite-fix-test-in-gdb.python-py-finish-break.patch create mode 100644 gdb-testsuite-fix-timeouts-in-gdb.threads-step-over-.patch delete mode 100644 gdb-testsuite-fix-typo-in-gdb.base-catch-syscall.exp.patch delete mode 100644 gdb-testsuite-fix-valgrind-tests-on-debian.patch delete mode 100644 gdb-testsuite-further-handle-long-filenames-in-gdb.b.patch delete mode 100644 gdb-testsuite-handle-core-without-build-id-in-gdb.ba.patch delete mode 100644 gdb-testsuite-handle-pac-marker.patch delete mode 100644 gdb-testsuite-make-gdb.base-solib-search.exp-more-ro.patch delete mode 100644 gdb-testsuite-make-portnum-a-persistent-global.patch delete mode 100644 gdb-testsuite-move-gpu-parallel.lock-to-cache-dir.patch delete mode 100644 gdb-testsuite-remove-spurious-in-save_vars.patch delete mode 100644 gdb-testsuite-reset-errcnt-and-warncnt-in-default_gd.patch delete mode 100644 gdb-testsuite-simplify-gdb.server-server-kill-python.patch delete mode 100644 gdb-testsuite-use-find_gnatmake-instead-of-gdb_find_.patch delete mode 100644 gdb-testsuite-use-more-progbits-for-arm.patch delete mode 100644 gdb-testsuite-use-unique-portnum-in-parallel-testing-check-slash-slash-case.patch delete mode 100644 gdb-testsuite-use-unique-portnum-in-parallel-testing.patch delete mode 100644 gdb-tui-allow-command-window-of-1-or-2-lines.patch delete mode 100644 gdb-tui-fix-resizing-of-terminal-to-1-or-2-lines.patch delete mode 100644 gdb-tui-fix-wmaybe-uninitialized-in-tui_find_disasse.patch delete mode 100644 make-pascal_language-print_type-handle-varstring-nul.patch delete mode 100644 powerpc-and-aarch64-fix-reverse-stepping-failure.patch delete mode 100644 powerpc-fix-test-gdb.ada-finish-large.exp.patch delete mode 100644 riscv-lrsc.patch delete mode 100644 rs6000-unwind-on-each-instruction-fix.patch delete mode 100644 s390-provide-ibm-z16-arch14-instruction-descriptions.patch diff --git a/change-gdb.base-examine-backwards.exp-for-aix.patch b/change-gdb.base-examine-backwards.exp-for-aix.patch deleted file mode 100644 index 56d1ff4..0000000 --- a/change-gdb.base-examine-backwards.exp-for-aix.patch +++ /dev/null @@ -1,53 +0,0 @@ -From acc7b542a08819bec4aae767de547c531a7ab62e Mon Sep 17 00:00:00 2001 -From: Aditya Vidyadhar Kamath -Date: Mon, 6 Nov 2023 07:26:24 -0600 -Subject: [PATCH 03/48] Change gdb.base/examine-backwards.exp for AIX. - -In AIX unused or constant variables are collected as garbage by the linker and in the dwarf dump -an address with all f's in hexadecimal are assigned. Hence the testcase fails with many failures stating -it cannot access memory. - -This patch is a small change to get it working in AIX as well. ---- - gdb/testsuite/gdb.base/examine-backward.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/gdb/testsuite/gdb.base/examine-backward.c b/gdb/testsuite/gdb.base/examine-backward.c -index e30b58fb005..354c2e2f323 100644 ---- a/gdb/testsuite/gdb.base/examine-backward.c -+++ b/gdb/testsuite/gdb.base/examine-backward.c -@@ -36,11 +36,11 @@ literals. The content of each array is the same as followings: - TestStrings, to avoid showing garbage when we look for strings - backwards from TestStrings. */ - --const unsigned char Barrier[] = { -+unsigned char Barrier[] = { - 0x00, - }; - --const unsigned char TestStrings[] = { -+unsigned char TestStrings[] = { - 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, - 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, - 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, -@@ -54,7 +54,7 @@ const unsigned char TestStrings[] = { - 0x00 - }; - --const short TestStringsH[] = { -+short TestStringsH[] = { - 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, - 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, - 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, -@@ -67,7 +67,7 @@ const short TestStringsH[] = { - 0x0000 - }; - --const int TestStringsW[] = { -+int TestStringsW[] = { - 0x00000041, 0x00000042, 0x00000043, 0x00000044, - 0x00000045, 0x00000046, 0x00000047, 0x00000048, - 0x00000049, 0x0000004a, 0x0000004b, 0x0000004c, --- -2.35.3 - diff --git a/fix-regression-on-aarch64-linux-gdbserver.patch b/fix-regression-on-aarch64-linux-gdbserver.patch deleted file mode 100644 index 2599a44..0000000 --- a/fix-regression-on-aarch64-linux-gdbserver.patch +++ /dev/null @@ -1,366 +0,0 @@ -From 2a7e48ca27f4c080151ce9da5a29239aa5d3b66f Mon Sep 17 00:00:00 2001 -From: Tom Tromey -Date: Fri, 19 Apr 2024 07:54:19 -0600 -Subject: [PATCH 15/48] Fix regression on aarch64-linux gdbserver - -Commit 9a03f218 ("Fix gdb.base/watchpoint-unaligned.exp on aarch64") -fixed a watchpoint bug in gdb -- but did not touch the corresponding -code in gdbserver. - -This patch moves the gdb code into gdb/nat, so that it can be shared -with gdbserver, and then changes gdbserver to use it, fixing the bug. - -This is yet another case where having a single back end would prevent -bugs. - -I tested this using the AdaCore internal gdb testsuite. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29423 -Approved-By: Luis Machado ---- - gdb/aarch64-nat.c | 115 --------------------------------- - gdb/aarch64-nat.h | 8 --- - gdb/nat/aarch64-hw-point.c | 115 +++++++++++++++++++++++++++++++++ - gdb/nat/aarch64-hw-point.h | 8 +++ - gdbserver/linux-aarch64-low.cc | 38 +---------- - 5 files changed, 126 insertions(+), 158 deletions(-) - -diff --git a/gdb/aarch64-nat.c b/gdb/aarch64-nat.c -index a173e4e18d5..97e3048568a 100644 ---- a/gdb/aarch64-nat.c -+++ b/gdb/aarch64-nat.c -@@ -225,121 +225,6 @@ aarch64_remove_watchpoint (CORE_ADDR addr, int len, enum target_hw_bp_type type, - return ret; - } - --/* See aarch64-nat.h. */ -- --bool --aarch64_stopped_data_address (const struct aarch64_debug_reg_state *state, -- CORE_ADDR addr_trap, CORE_ADDR *addr_p) --{ -- bool found = false; -- for (int phase = 0; phase <= 1; ++phase) -- for (int i = aarch64_num_wp_regs - 1; i >= 0; --i) -- { -- if (!(state->dr_ref_count_wp[i] -- && DR_CONTROL_ENABLED (state->dr_ctrl_wp[i]))) -- { -- /* Watchpoint disabled. */ -- continue; -- } -- -- const enum target_hw_bp_type type -- = aarch64_watchpoint_type (state->dr_ctrl_wp[i]); -- if (type == hw_execute) -- { -- /* Watchpoint disabled. */ -- continue; -- } -- -- if (phase == 0) -- { -- /* Phase 0: No hw_write. */ -- if (type == hw_write) -- continue; -- } -- else -- { -- /* Phase 1: Only hw_write. */ -- if (type != hw_write) -- continue; -- } -- -- const unsigned int offset -- = aarch64_watchpoint_offset (state->dr_ctrl_wp[i]); -- const unsigned int len -- = aarch64_watchpoint_length (state->dr_ctrl_wp[i]); -- const CORE_ADDR addr_watch = state->dr_addr_wp[i] + offset; -- const CORE_ADDR addr_watch_aligned -- = align_down (state->dr_addr_wp[i], AARCH64_HWP_MAX_LEN_PER_REG); -- const CORE_ADDR addr_orig = state->dr_addr_orig_wp[i]; -- -- /* ADDR_TRAP reports the first address of the memory range -- accessed by the CPU, regardless of what was the memory -- range watched. Thus, a large CPU access that straddles -- the ADDR_WATCH..ADDR_WATCH+LEN range may result in an -- ADDR_TRAP that is lower than the -- ADDR_WATCH..ADDR_WATCH+LEN range. E.g.: -- -- addr: | 4 | 5 | 6 | 7 | 8 | -- |---- range watched ----| -- |----------- range accessed ------------| -- -- In this case, ADDR_TRAP will be 4. -- -- The access size also can be larger than that of the watchpoint -- itself. For instance, the access size of an stp instruction is 16. -- So, if we use stp to store to address p, and set a watchpoint on -- address p + 8, the reported ADDR_TRAP can be p + 8 (observed on -- RK3399 SOC). But it also can be p (observed on M1 SOC). Checking -- for this situation introduces the possibility of false positives, -- so we only do this for hw_write watchpoints. */ -- const CORE_ADDR max_access_size = type == hw_write ? 16 : 8; -- const CORE_ADDR addr_watch_base = addr_watch_aligned - -- (max_access_size - AARCH64_HWP_MAX_LEN_PER_REG); -- if (!(addr_trap >= addr_watch_base -- && addr_trap < addr_watch + len)) -- { -- /* Not a match. */ -- continue; -- } -- -- /* To match a watchpoint known to GDB core, we must never -- report *ADDR_P outside of any ADDR_WATCH..ADDR_WATCH+LEN -- range. ADDR_WATCH <= ADDR_TRAP < ADDR_ORIG is a false -- positive on kernels older than 4.10. See PR -- external/20207. */ -- if (addr_p != nullptr) -- *addr_p = addr_orig; -- -- if (phase == 0) -- { -- /* Phase 0: Return first match. */ -- return true; -- } -- -- /* Phase 1. */ -- if (addr_p == nullptr) -- { -- /* First match, and we don't need to report an address. No need -- to look for other matches. */ -- return true; -- } -- -- if (!found) -- { -- /* First match, and we need to report an address. Look for other -- matches. */ -- found = true; -- continue; -- } -- -- /* More than one match, and we need to return an address. No need to -- look for further matches. */ -- return false; -- } -- -- return found; --} -- - /* Define AArch64 maintenance commands. */ - - static void -diff --git a/gdb/aarch64-nat.h b/gdb/aarch64-nat.h -index fee6bda2577..f95a9d745e5 100644 ---- a/gdb/aarch64-nat.h -+++ b/gdb/aarch64-nat.h -@@ -45,14 +45,6 @@ struct aarch64_debug_reg_state *aarch64_get_debug_reg_state (pid_t pid); - - void aarch64_remove_debug_reg_state (pid_t pid); - --/* Helper for the "stopped_data_address" target method. Returns TRUE -- if a hardware watchpoint trap at ADDR_TRAP matches a set -- watchpoint. The address of the matched watchpoint is returned in -- *ADDR_P. */ -- --bool aarch64_stopped_data_address (const struct aarch64_debug_reg_state *state, -- CORE_ADDR addr_trap, CORE_ADDR *addr_p); -- - /* Helper functions used by aarch64_nat_target below. See their - definitions. */ - -diff --git a/gdb/nat/aarch64-hw-point.c b/gdb/nat/aarch64-hw-point.c -index 3b8cdcba23b..9eb78923e86 100644 ---- a/gdb/nat/aarch64-hw-point.c -+++ b/gdb/nat/aarch64-hw-point.c -@@ -647,3 +647,118 @@ aarch64_region_ok_for_watchpoint (CORE_ADDR addr, int len) - the checking is costly. */ - return 1; - } -+ -+/* See nat/aarch64-hw-point.h. */ -+ -+bool -+aarch64_stopped_data_address (const struct aarch64_debug_reg_state *state, -+ CORE_ADDR addr_trap, CORE_ADDR *addr_p) -+{ -+ bool found = false; -+ for (int phase = 0; phase <= 1; ++phase) -+ for (int i = aarch64_num_wp_regs - 1; i >= 0; --i) -+ { -+ if (!(state->dr_ref_count_wp[i] -+ && DR_CONTROL_ENABLED (state->dr_ctrl_wp[i]))) -+ { -+ /* Watchpoint disabled. */ -+ continue; -+ } -+ -+ const enum target_hw_bp_type type -+ = aarch64_watchpoint_type (state->dr_ctrl_wp[i]); -+ if (type == hw_execute) -+ { -+ /* Watchpoint disabled. */ -+ continue; -+ } -+ -+ if (phase == 0) -+ { -+ /* Phase 0: No hw_write. */ -+ if (type == hw_write) -+ continue; -+ } -+ else -+ { -+ /* Phase 1: Only hw_write. */ -+ if (type != hw_write) -+ continue; -+ } -+ -+ const unsigned int offset -+ = aarch64_watchpoint_offset (state->dr_ctrl_wp[i]); -+ const unsigned int len -+ = aarch64_watchpoint_length (state->dr_ctrl_wp[i]); -+ const CORE_ADDR addr_watch = state->dr_addr_wp[i] + offset; -+ const CORE_ADDR addr_watch_aligned -+ = align_down (state->dr_addr_wp[i], AARCH64_HWP_MAX_LEN_PER_REG); -+ const CORE_ADDR addr_orig = state->dr_addr_orig_wp[i]; -+ -+ /* ADDR_TRAP reports the first address of the memory range -+ accessed by the CPU, regardless of what was the memory -+ range watched. Thus, a large CPU access that straddles -+ the ADDR_WATCH..ADDR_WATCH+LEN range may result in an -+ ADDR_TRAP that is lower than the -+ ADDR_WATCH..ADDR_WATCH+LEN range. E.g.: -+ -+ addr: | 4 | 5 | 6 | 7 | 8 | -+ |---- range watched ----| -+ |----------- range accessed ------------| -+ -+ In this case, ADDR_TRAP will be 4. -+ -+ The access size also can be larger than that of the watchpoint -+ itself. For instance, the access size of an stp instruction is 16. -+ So, if we use stp to store to address p, and set a watchpoint on -+ address p + 8, the reported ADDR_TRAP can be p + 8 (observed on -+ RK3399 SOC). But it also can be p (observed on M1 SOC). Checking -+ for this situation introduces the possibility of false positives, -+ so we only do this for hw_write watchpoints. */ -+ const CORE_ADDR max_access_size = type == hw_write ? 16 : 8; -+ const CORE_ADDR addr_watch_base = addr_watch_aligned - -+ (max_access_size - AARCH64_HWP_MAX_LEN_PER_REG); -+ if (!(addr_trap >= addr_watch_base -+ && addr_trap < addr_watch + len)) -+ { -+ /* Not a match. */ -+ continue; -+ } -+ -+ /* To match a watchpoint known to GDB core, we must never -+ report *ADDR_P outside of any ADDR_WATCH..ADDR_WATCH+LEN -+ range. ADDR_WATCH <= ADDR_TRAP < ADDR_ORIG is a false -+ positive on kernels older than 4.10. See PR -+ external/20207. */ -+ if (addr_p != nullptr) -+ *addr_p = addr_orig; -+ -+ if (phase == 0) -+ { -+ /* Phase 0: Return first match. */ -+ return true; -+ } -+ -+ /* Phase 1. */ -+ if (addr_p == nullptr) -+ { -+ /* First match, and we don't need to report an address. No need -+ to look for other matches. */ -+ return true; -+ } -+ -+ if (!found) -+ { -+ /* First match, and we need to report an address. Look for other -+ matches. */ -+ found = true; -+ continue; -+ } -+ -+ /* More than one match, and we need to return an address. No need to -+ look for further matches. */ -+ return false; -+ } -+ -+ return found; -+} -diff --git a/gdb/nat/aarch64-hw-point.h b/gdb/nat/aarch64-hw-point.h -index 71ae2864927..2386cf60f90 100644 ---- a/gdb/nat/aarch64-hw-point.h -+++ b/gdb/nat/aarch64-hw-point.h -@@ -110,6 +110,14 @@ unsigned int aarch64_watchpoint_offset (unsigned int ctrl); - unsigned int aarch64_watchpoint_length (unsigned int ctrl); - enum target_hw_bp_type aarch64_watchpoint_type (unsigned int ctrl); - -+/* Helper for the "stopped_data_address" target method. Returns TRUE -+ if a hardware watchpoint trap at ADDR_TRAP matches a set -+ watchpoint. The address of the matched watchpoint is returned in -+ *ADDR_P. */ -+ -+bool aarch64_stopped_data_address (const struct aarch64_debug_reg_state *state, -+ CORE_ADDR addr_trap, CORE_ADDR *addr_p); -+ - int aarch64_handle_breakpoint (enum target_hw_bp_type type, CORE_ADDR addr, - int len, int is_insert, ptid_t ptid, - struct aarch64_debug_reg_state *state); -diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc -index fcbe7bb64d7..14346b89822 100644 ---- a/gdbserver/linux-aarch64-low.cc -+++ b/gdbserver/linux-aarch64-low.cc -@@ -577,41 +577,9 @@ aarch64_target::low_stopped_data_address () - - /* Check if the address matches any watched address. */ - state = aarch64_get_debug_reg_state (pid_of (current_thread)); -- for (i = aarch64_num_wp_regs - 1; i >= 0; --i) -- { -- const unsigned int offset -- = aarch64_watchpoint_offset (state->dr_ctrl_wp[i]); -- const unsigned int len = aarch64_watchpoint_length (state->dr_ctrl_wp[i]); -- const CORE_ADDR addr_watch = state->dr_addr_wp[i] + offset; -- const CORE_ADDR addr_watch_aligned = align_down (state->dr_addr_wp[i], 8); -- const CORE_ADDR addr_orig = state->dr_addr_orig_wp[i]; -- -- if (state->dr_ref_count_wp[i] -- && DR_CONTROL_ENABLED (state->dr_ctrl_wp[i]) -- && addr_trap >= addr_watch_aligned -- && addr_trap < addr_watch + len) -- { -- /* ADDR_TRAP reports the first address of the memory range -- accessed by the CPU, regardless of what was the memory -- range watched. Thus, a large CPU access that straddles -- the ADDR_WATCH..ADDR_WATCH+LEN range may result in an -- ADDR_TRAP that is lower than the -- ADDR_WATCH..ADDR_WATCH+LEN range. E.g.: -- -- addr: | 4 | 5 | 6 | 7 | 8 | -- |---- range watched ----| -- |----------- range accessed ------------| -- -- In this case, ADDR_TRAP will be 4. -- -- To match a watchpoint known to GDB core, we must never -- report *ADDR_P outside of any ADDR_WATCH..ADDR_WATCH+LEN -- range. ADDR_WATCH <= ADDR_TRAP < ADDR_ORIG is a false -- positive on kernels older than 4.10. See PR -- external/20207. */ -- return addr_orig; -- } -- } -+ CORE_ADDR result; -+ if (aarch64_stopped_data_address (state, addr_trap, &result)) -+ return result; - - return (CORE_ADDR) 0; - } --- -2.35.3 - diff --git a/fix-the-gdb.ada-inline-section-gc.exp-test.patch b/fix-the-gdb.ada-inline-section-gc.exp-test.patch deleted file mode 100644 index e72835c..0000000 --- a/fix-the-gdb.ada-inline-section-gc.exp-test.patch +++ /dev/null @@ -1,80 +0,0 @@ -From c21fd9f7d5911fce0c17af7094d8861d1195dfda Mon Sep 17 00:00:00 2001 -From: Carl Love -Date: Mon, 13 Nov 2023 14:14:08 -0500 -Subject: [PATCH 01/48] Fix the gdb.ada/inline-section-gc.exp test - -The original intention of the test appears to be checking to make sure -setting a breakpoint in an inlined function didn't set multiple -breakpoints where one of them was at address 0. - -The gdb.ada/inline-section-gc.exp test may pass or fail depending on the -version of gnat. Per the discussion on IRC, the ada inlining appears to -have some target dependencies. In this test there are two functions, -callee and caller. Function calee is inlined into caller. The test sets -a breakpoint in function callee. The reported location where the -breakpoint is set may be at the requested location in callee or the -location in caller after callee has been inlined. The test needs to -accept either location as correct provided the breakpoint address is not -zero. - -This patch checks to see if the reported breakpoint is in function callee -or function caller and fails if the breakpoint address is 0x0. The line -number where the breakpoint is set will match the requested line if the -breakpoint location is reported is callee.adb. If the breakpoint is -reported in caller.adb, the line number in caller is the breakpoint -location in callee where it is inlined into caller. - -This patch fixes the single regression failure for the test on PowerPC. -It does not introduce any failures on X86-64. ---- - gdb/testsuite/gdb.ada/inline-section-gc.exp | 21 ++++++++++++++++--- - .../gdb.ada/inline-section-gc/caller.adb | 3 ++- - 2 files changed, 20 insertions(+), 4 deletions(-) - -diff --git a/gdb/testsuite/gdb.ada/inline-section-gc.exp b/gdb/testsuite/gdb.ada/inline-section-gc.exp -index b707335eb04..4f8b8c95395 100644 ---- a/gdb/testsuite/gdb.ada/inline-section-gc.exp -+++ b/gdb/testsuite/gdb.ada/inline-section-gc.exp -@@ -34,8 +34,23 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $options] != ""} { - - clean_restart ${testfile} - --set bp_location [gdb_get_line_number "BREAK" ${testdir}/callee.adb] -+ -+# Depending on the version of gnat, the location of the set breakpoint may -+# be reported as being at the requested location in file callee.adb or in -+# file caller.adb where the callee function was inlined. Either way, only -+# one breakpoint should be reported and its address should not be at 0x0. -+set bp_location1 [gdb_get_line_number "BREAK" ${testdir}/callee.adb] -+set bp_location2 [gdb_get_line_number "CALLEE_LOC" ${testdir}/caller.adb] -+set test "break callee.adb:$bp_location1" -+set message "Breakpoint set" -+ - # The bug here was that gdb would set a breakpoint with two locations, - # one of them at 0x0. --gdb_test "break callee.adb:$bp_location" \ -- "Breakpoint $decimal at $hex: file .*callee.adb, line $bp_location." -+gdb_test_multiple $test $message { -+ -re "Breakpoint $decimal at $hex: file .*callee.adb, line $bp_location1." { -+ pass $test -+ } -+ -re "Breakpoint $decimal at $hex: file .*caller.adb, line $bp_location2." { -+ pass $test -+ } -+} -diff --git a/gdb/testsuite/gdb.ada/inline-section-gc/caller.adb b/gdb/testsuite/gdb.ada/inline-section-gc/caller.adb -index 66eb2d9a910..161f3e85542 100644 ---- a/gdb/testsuite/gdb.ada/inline-section-gc/caller.adb -+++ b/gdb/testsuite/gdb.ada/inline-section-gc/caller.adb -@@ -18,4 +18,5 @@ with Callee; - procedure Caller is - begin - Callee; --end Caller; -+end Caller; -- CALLEE_LOC, this is where the inlined callee breakpoint -+ -- is located. - -base-commit: 582fc35843fdf71b82d645d83d2903e2546cc21a --- -2.35.3 - diff --git a/fixup-powerpc-and-aarch64-fix-reverse-stepping-failu.patch b/fixup-powerpc-and-aarch64-fix-reverse-stepping-failu.patch deleted file mode 100644 index 5be4f5e..0000000 --- a/fixup-powerpc-and-aarch64-fix-reverse-stepping-failu.patch +++ /dev/null @@ -1,70 +0,0 @@ -From d60b57fe1a98094a7e4f19481193b2b5a9bb1e57 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 2 May 2024 12:02:50 +0200 -Subject: [PATCH 079/147] fixup PowerPC and aarch64: Fix reverse stepping - failure - ---- - gdb/infrun.c | 2 +- - gdb/symtab.c | 3 +-- - gdb/symtab.h | 3 +-- - 3 files changed, 3 insertions(+), 5 deletions(-) - -diff --git a/gdb/infrun.c b/gdb/infrun.c -index 069ef144a76..7be98cfc252 100644 ---- a/gdb/infrun.c -+++ b/gdb/infrun.c -@@ -6897,7 +6897,7 @@ update_line_range_start (CORE_ADDR pc, struct execution_control_state *ecs) - Given the PC, check the line table and return the PC that corresponds - to the line table entry for the source line that PC is in. */ - CORE_ADDR start_line_pc = ecs->event_thread->control.step_range_start; -- std::optional real_range_start; -+ gdb::optional real_range_start; - - /* Call find_line_range_start to get the smallest address in the - linetable for multiple Line X entries in the line table. */ -diff --git a/gdb/symtab.c b/gdb/symtab.c -index ef63ec93c5a..9a47796e5e0 100644 ---- a/gdb/symtab.c -+++ b/gdb/symtab.c -@@ -73,7 +73,6 @@ - #include "gdbsupport/gdb_string_view.h" - #include "gdbsupport/pathstuff.h" - #include "gdbsupport/common-utils.h" --#include - - /* Forward declarations for local functions. */ - -@@ -3328,7 +3327,7 @@ sal_line_symtab_matches_p (const symtab_and_line &sal1, - - /* See symtah.h. */ - --std::optional -+gdb::optional - find_line_range_start (CORE_ADDR pc) - { - struct symtab_and_line current_sal = find_pc_line (pc, 0); -diff --git a/gdb/symtab.h b/gdb/symtab.h -index e17d15c595b..6a611d42880 100644 ---- a/gdb/symtab.h -+++ b/gdb/symtab.h -@@ -38,7 +38,6 @@ - #include "gdb-demangle.h" - #include "split-name.h" - #include "frame.h" --#include - - /* Opaque declarations. */ - struct ui_file; -@@ -2377,7 +2376,7 @@ extern struct symtab_and_line find_pc_sect_line (CORE_ADDR, - the starting PC of line X, and the ranges are contiguous. - */ - --extern std::optional find_line_range_start (CORE_ADDR pc); -+extern gdb::optional find_line_range_start (CORE_ADDR pc); - - /* Wrapper around find_pc_line to just return the symtab. */ - --- -2.35.3 - diff --git a/gdb-14.2.tar.bz2 b/gdb-14.2.tar.bz2 deleted file mode 100644 index 793e37f..0000000 --- a/gdb-14.2.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8b47e772a5ab32185263ef36fc3c185df01e90deb63198d7deba550685864fa9 -size 32117643 diff --git a/gdb-15.1.tar.bz2 b/gdb-15.1.tar.bz2 new file mode 100644 index 0000000..172cb96 --- /dev/null +++ b/gdb-15.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21b05dad63d20bebec2c89505c40402f1bee509b732b2521bbb9723c2334d1d7 +size 32257814 diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch index 1925d2a..667aef1 100644 --- a/gdb-6.3-gstack-20050411.patch +++ b/gdb-6.3-gstack-20050411.patch @@ -16,7 +16,7 @@ Subject: gdb-6.3-gstack-20050411.patch diff --git a/gdb/Makefile.in b/gdb/Makefile.in --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -2035,7 +2035,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force +@@ -2071,7 +2071,7 @@ info install-info clean-info dvi install-dvi pdf install-pdf html install-html: install: all @$(MAKE) $(FLAGS_TO_PASS) install-only @@ -25,7 +25,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e "$$t"` ; \ if test "x$$transformed_name" = x; then \ -@@ -2085,7 +2085,25 @@ install-guile: +@@ -2121,7 +2121,25 @@ install-guile: install-python: $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb @@ -52,7 +52,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e $$t` ; \ if test "x$$transformed_name" = x; then \ -@@ -2116,6 +2134,18 @@ uninstall: force $(CONFIG_UNINSTALL) +@@ -2152,6 +2170,28 @@ uninstall: force $(CONFIG_UNINSTALL) rm -f $(DESTDIR)$(bindir)/$$transformed_name @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do @@ -68,9 +68,19 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in + rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \ + $(DESTDIR)$(man1dir)/$$transformed_name.1 + - # The C++ name parser can be built standalone for testing. - test-cp-name-parser.o: cp-name-parser.c - $(COMPILE) -DTEST_CPNAMES cp-name-parser.c ++# The C++ name parser can be built standalone for testing. ++test-cp-name-parser.o: cp-name-parser.c ++ $(COMPILE) -DTEST_CPNAMES cp-name-parser.c ++ $(POSTCOMPILE) ++ ++test-cp-name-parser$(EXEEXT): test-cp-name-parser.o $(LIBIBERTY) ++ $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_LDFLAGS) \ ++ -o test-cp-name-parser$(EXEEXT) test-cp-name-parser.o \ ++ $(LIBIBERTY) ++ + # We do this by grepping through sources. If that turns out to be too slow, + # maybe we could just require every .o file to have an initialization routine + # of a given name (top.o -> _initialize_top, etc.). diff --git a/gdb/gstack.sh b/gdb/gstack.sh new file mode 100644 --- /dev/null diff --git a/gdb-6.6-buildid-locate-solib-missing-ids.patch b/gdb-6.6-buildid-locate-solib-missing-ids.patch index 3ccdb9a..c2b126e 100644 --- a/gdb-6.6-buildid-locate-solib-missing-ids.patch +++ b/gdb-6.6-buildid-locate-solib-missing-ids.patch @@ -14,62 +14,87 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1339862 diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c -@@ -1320,14 +1320,28 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, +@@ -347,11 +347,13 @@ lm_addr_check (const solib &so, bfd *abfd) + + struct svr4_so + { +- svr4_so (const char *name, lm_info_svr4_up lm_info) +- : name (name), lm_info (std::move (lm_info)) ++ svr4_so (const char *name, lm_info_svr4_up lm_info, const char *orig_name = nullptr) ++ : name (name), original_name (orig_name == nullptr ? name : orig_name), ++ lm_info (std::move (lm_info)) + {} + + std::string name; ++ std::string original_name; + lm_info_svr4_up lm_info; + }; + +@@ -1002,6 +1004,7 @@ so_list_from_svr4_sos (const std::vector &sos) + + newobj->so_name = so.name; + newobj->so_original_name = so.name; ++ newobj->so_original_name = so.original_name; + newobj->lm_info = std::make_unique (*so.lm_info); + + dst.push_back (*newobj); +@@ -1263,11 +1266,28 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, + continue; } - { -- struct bfd_build_id *build_id; -+ struct bfd_build_id *build_id = NULL; ++ /* Preserve original name since name may be changed below. */ ++ gdb::unique_xmalloc_ptr original_name = make_unique_xstrdup (name.get ()); + { +- struct bfd_build_id *build_id; ++ struct bfd_build_id *build_id = nullptr; - strncpy (newobj->so_original_name, buffer.get (), SO_NAME_MAX_PATH_SIZE - 1); - newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; - /* May get overwritten below. */ - strcpy (newobj->so_name, newobj->so_original_name); - -- build_id = build_id_addr_get (((lm_info_svr4 *) newobj->lm_info)->l_ld); -+ /* In the case the main executable was found according to its build-id -+ (from a core file) prevent loading a different build of a library -+ with accidentally the same SO_NAME. +- build_id = build_id_addr_get (li->l_ld); +- if (build_id != NULL) ++ /* In the case the main executable was found according to its build-id ++ (from a core file) prevent loading a different build of a library ++ with accidentally the same SO_NAME. + -+ It suppresses bogus backtraces (and prints "??" there instead) if -+ the on-disk files no longer match the running program version. ++ It suppresses bogus backtraces (and prints "??" there instead) if ++ the on-disk files no longer match the running program version. ++ If the main executable was not loaded according to its build-id do ++ not do any build-id checking of the libraries. There may be missing ++ build-ids dumped in the core file and we would map all the libraries ++ to the only existing file loaded that time - the executable. */ ++ if (current_program_space->symfile_object_file != NULL ++ && (current_program_space->symfile_object_file->flags ++ & OBJF_BUILD_ID_CORE_LOADED) != 0) ++ build_id = build_id_addr_get (li->l_ld); + -+ If the main executable was not loaded according to its build-id do -+ not do any build-id checking of the libraries. There may be missing -+ build-ids dumped in the core file and we would map all the libraries -+ to the only existing file loaded that time - the executable. */ -+ if (current_program_space->symfile_object_file != NULL -+ && (current_program_space->symfile_object_file->flags -+ & OBJF_BUILD_ID_CORE_LOADED) != 0) -+ build_id = build_id_addr_get (li->l_ld); - if (build_id != NULL) - { - char *name, *build_id_filename; -@@ -1342,23 +1356,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, - xfree (name); - } - else -- { -- debug_print_missing (newobj->so_name, build_id_filename); -- -- /* In the case the main executable was found according to -- its build-id (from a core file) prevent loading -- a different build of a library with accidentally the -- same SO_NAME. -- -- It suppresses bogus backtraces (and prints "??" there -- instead) if the on-disk files no longer match the -- running program version. */ -- -- if (current_program_space->symfile_object_file != NULL -- && (current_program_space->symfile_object_file->flags -- & OBJF_BUILD_ID_CORE_LOADED) != 0) -- newobj->so_name[0] = 0; -- } -+ debug_print_missing (newobj->so_name, build_id_filename); ++ ++ if (build_id != nullptr) + { + char *bid_name, *build_id_filename; - xfree (build_id_filename); - xfree (build_id); +@@ -1280,23 +1300,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, + xfree (bid_name); + } + else +- { +- debug_print_missing (name.get (), build_id_filename); +- +- /* In the case the main executable was found according to +- its build-id (from a core file) prevent loading +- a different build of a library with accidentally the +- same SO_NAME. +- +- It suppresses bogus backtraces (and prints "??" there +- instead) if the on-disk files no longer match the +- running program version. */ +- +- if (current_program_space->symfile_object_file != NULL +- && (current_program_space->symfile_object_file->flags +- & OBJF_BUILD_ID_CORE_LOADED) != 0) +- name = make_unique_xstrdup (""); +- } ++ debug_print_missing (name.get (), build_id_filename); + + xfree (build_id_filename); + xfree (build_id); diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c new file mode 100644 --- /dev/null diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index 08b3c39..58b3939 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -9,7 +9,7 @@ Subject: gdb-6.6-buildid-locate.patch diff --git a/gdb/build-id.c b/gdb/build-id.c --- a/gdb/build-id.c +++ b/gdb/build-id.c -@@ -24,9 +24,67 @@ +@@ -23,9 +23,67 @@ #include "gdbsupport/gdb_vecs.h" #include "symfile.h" #include "objfiles.h" @@ -20,8 +20,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c +#include "elf/internal.h" #include "filenames.h" +#include "gdb_bfd.h" -+#include "gdbcmd.h" #include "gdbcore.h" ++#include "cli/cli-cmds.h" #include "cli/cli-style.h" +#include "inferior.h" +#include "objfiles.h" @@ -77,7 +77,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c /* See build-id.h. */ -@@ -50,6 +108,348 @@ build_id_bfd_get (bfd *abfd) +@@ -49,6 +107,349 @@ build_id_bfd_get (bfd *abfd) return NULL; } @@ -386,12 +386,13 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + bfd_vma loadbase = 0; + unsigned e_phnum = 0; + -+ if (core_bfd == NULL) ++ if (current_program_space->core_bfd () == NULL) + return NULL; + + build_id_addr = addr; + gdb_assert (build_id_addr_sect == NULL); -+ bfd_map_over_sections (core_bfd, build_id_addr_candidate, NULL); ++ bfd_map_over_sections (current_program_space->core_bfd (), ++ build_id_addr_candidate, NULL); + + /* Sections are sorted in the high-to-low VMAs order. + Stop the search on the first ELF header we find. @@ -400,7 +401,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + for (candidate = build_id_addr_sect; candidate != NULL; + candidate = candidate->next) + { -+ i_phdr = elf_get_phdr (core_bfd, ++ i_phdr = elf_get_phdr (current_program_space->core_bfd (), + bfd_section_vma (candidate->sect), + &e_phnum, &loadbase); + if (i_phdr != NULL) @@ -409,7 +410,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + + if (i_phdr != NULL) + { -+ retval = build_id_phdr_get (core_bfd, loadbase, e_phnum, i_phdr); ++ retval = build_id_phdr_get (current_program_space->core_bfd (), loadbase, e_phnum, i_phdr); + xfree (i_phdr); + } + @@ -426,7 +427,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c /* See build-id.h. */ int -@@ -73,63 +473,166 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) +@@ -73,63 +474,166 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) return retval; } @@ -488,7 +489,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c - /* lrealpath() is expensive even for the usually non-existent files. */ - gdb::unique_xmalloc_ptr filename_holder; - const char *filename = nullptr; -- if (startswith (link, TARGET_SYSROOT_PREFIX)) +- if (is_target_filename (link)) - filename = link.c_str (); - else if (access (link.c_str (), F_OK) == 0) + for (unsigned seqno = 0;; seqno++) @@ -627,7 +628,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c } /* Common code for finding BFDs of a given build-id. This function -@@ -138,7 +641,7 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len, +@@ -138,7 +642,7 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len, static gdb_bfd_ref_ptr build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, @@ -636,7 +637,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c { /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will cause "/.build-id/..." lookups. */ -@@ -161,16 +664,17 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, +@@ -161,16 +665,17 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, if (size > 0) { size--; @@ -657,7 +658,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c if (debug_bfd != NULL) return debug_bfd; -@@ -181,7 +685,7 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, +@@ -181,7 +686,7 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, if (!gdb_sysroot.empty ()) { link = gdb_sysroot + link; @@ -666,7 +667,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c if (debug_bfd != NULL) return debug_bfd; } -@@ -190,20 +694,178 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, +@@ -190,20 +695,178 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, return {}; } @@ -848,7 +849,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c } /* See build-id.h. */ -@@ -224,6 +886,7 @@ find_separate_debug_file_by_buildid (struct objfile *objfile, +@@ -224,6 +887,7 @@ find_separate_debug_file_by_buildid (struct objfile *objfile, gdb_bfd_ref_ptr abfd (build_id_to_debug_bfd (build_id->size, build_id->data)); @@ -856,7 +857,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c /* Prevent looping on a stripped .debug file. */ if (abfd != NULL && filename_cmp (bfd_get_filename (abfd.get ()), -@@ -243,3 +906,22 @@ find_separate_debug_file_by_buildid (struct objfile *objfile, +@@ -243,3 +907,22 @@ find_separate_debug_file_by_buildid (struct objfile *objfile, return std::string (); } @@ -903,18 +904,17 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h diff --git a/gdb/corelow.c b/gdb/corelow.c --- a/gdb/corelow.c +++ b/gdb/corelow.c -@@ -22,6 +22,10 @@ +@@ -21,6 +21,9 @@ #include #include #include "frame.h" +#include "auxv.h" +#include "build-id.h" +#include "elf/common.h" -+#include "gdbcmd.h" #include "inferior.h" #include "infrun.h" #include "symtab.h" -@@ -380,6 +384,8 @@ add_to_thread_list (asection *asect, asection *reg_sect, inferior *inf) +@@ -383,6 +386,8 @@ add_to_thread_list (asection *asect, asection *reg_sect, inferior *inf) switch_to_thread (thr); /* Yes, make it current. */ } @@ -923,7 +923,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c /* Issue a message saying we have no core to debug, if FROM_TTY. */ static void -@@ -567,8 +573,10 @@ locate_exec_from_corefile_build_id (bfd *abfd, int from_tty) +@@ -570,8 +575,10 @@ locate_exec_from_corefile_build_id (bfd *abfd, int from_tty) if (build_id == nullptr) return; @@ -935,7 +935,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c if (execbfd == nullptr) { -@@ -596,7 +604,12 @@ locate_exec_from_corefile_build_id (bfd *abfd, int from_tty) +@@ -599,7 +606,12 @@ locate_exec_from_corefile_build_id (bfd *abfd, int from_tty) exec_file_attach (bfd_get_filename (execbfd.get ()), from_tty); symbol_file_add_main (bfd_get_filename (execbfd.get ()), symfile_add_flag (from_tty ? SYMFILE_VERBOSE : 0)); @@ -948,7 +948,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c } /* See gdbcore.h. */ -@@ -1506,4 +1519,11 @@ _initialize_corelow () +@@ -1524,4 +1536,11 @@ _initialize_corelow () maintenance_print_core_file_backed_mappings, _("Print core file's file-backed mappings."), &maintenanceprintlist); @@ -963,7 +963,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo -@@ -22296,6 +22296,27 @@ information files. +@@ -22487,6 +22487,27 @@ information files. @end table @@ -994,7 +994,7 @@ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo diff --git a/gdb/objfiles.h b/gdb/objfiles.h --- a/gdb/objfiles.h +++ b/gdb/objfiles.h -@@ -884,6 +884,10 @@ struct objfile +@@ -877,6 +877,10 @@ struct objfile bool object_format_has_copy_relocs = false; }; @@ -1016,61 +1016,53 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c #include -@@ -1318,9 +1319,51 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, +@@ -1262,6 +1263,46 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, continue; } -- strncpy (newobj->so_name, buffer.get (), SO_NAME_MAX_PATH_SIZE - 1); -- newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; -- strcpy (newobj->so_original_name, newobj->so_name); -+ { -+ struct bfd_build_id *build_id; ++ { ++ struct bfd_build_id *build_id; + -+ strncpy (newobj->so_original_name, buffer.get (), SO_NAME_MAX_PATH_SIZE - 1); -+ newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; -+ /* May get overwritten below. */ -+ strcpy (newobj->so_name, newobj->so_original_name); ++ build_id = build_id_addr_get (li->l_ld); ++ if (build_id != NULL) ++ { ++ char *bid_name, *build_id_filename; + -+ build_id = build_id_addr_get (((lm_info_svr4 *) newobj->lm_info)->l_ld); -+ if (build_id != NULL) -+ { -+ char *name, *build_id_filename; ++ /* Missing the build-id matching separate debug info file ++ would be handled while SO_NAME gets loaded. */ ++ bid_name = build_id_to_filename (build_id, &build_id_filename); ++ if (bid_name != NULL) ++ { ++ name = make_unique_xstrdup (bid_name); ++ xfree (bid_name); ++ } ++ else ++ { ++ debug_print_missing (name.get (), build_id_filename); + -+ /* Missing the build-id matching separate debug info file -+ would be handled while SO_NAME gets loaded. */ -+ name = build_id_to_filename (build_id, &build_id_filename); -+ if (name != NULL) -+ { -+ strncpy (newobj->so_name, name, SO_NAME_MAX_PATH_SIZE - 1); -+ newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; -+ xfree (name); -+ } -+ else -+ { -+ debug_print_missing (newobj->so_name, build_id_filename); ++ /* In the case the main executable was found according to ++ its build-id (from a core file) prevent loading ++ a different build of a library with accidentally the ++ same SO_NAME. + -+ /* In the case the main executable was found according to -+ its build-id (from a core file) prevent loading -+ a different build of a library with accidentally the -+ same SO_NAME. ++ It suppresses bogus backtraces (and prints "??" there ++ instead) if the on-disk files no longer match the ++ running program version. */ + -+ It suppresses bogus backtraces (and prints "??" there -+ instead) if the on-disk files no longer match the -+ running program version. */ ++ if (current_program_space->symfile_object_file != NULL ++ && (current_program_space->symfile_object_file->flags ++ & OBJF_BUILD_ID_CORE_LOADED) != 0) ++ name = make_unique_xstrdup (""); ++ } + -+ if (current_program_space->symfile_object_file != NULL -+ && (current_program_space->symfile_object_file->flags -+ & OBJF_BUILD_ID_CORE_LOADED) != 0) -+ newobj->so_name[0] = 0; -+ } ++ xfree (build_id_filename); ++ xfree (build_id); ++ } ++ } + -+ xfree (build_id_filename); -+ xfree (build_id); -+ } -+ } - /* If this entry has no name, or its name matches the name for the main executable, don't include it in the list. */ + if (*name == '\0' || match_main (name.get ())) diff --git a/gdb/symfile.h b/gdb/symfile.h --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -1139,10 +1131,12 @@ diff --git a/gdb/testsuite/gdb.base/gdbinit-history.exp b/gdb/testsuite/gdb.base diff --git a/gdb/testsuite/gdb.base/new-ui-pending-input.exp b/gdb/testsuite/gdb.base/new-ui-pending-input.exp --- a/gdb/testsuite/gdb.base/new-ui-pending-input.exp +++ b/gdb/testsuite/gdb.base/new-ui-pending-input.exp -@@ -62,6 +62,7 @@ proc test_command_line_new_ui_pending_input {} { +@@ -60,6 +60,9 @@ proc test_command_line_new_ui_pending_input {} { + set bpline [gdb_get_line_number "set breakpoint here"] + set options "" - append options " -iex \"set height 0\"" - append options " -iex \"set width 0\"" ++ append options " -iex \"set height 0\"" ++ append options " -iex \"set width 0\"" + append options " -iex \"set build-id-verbose 0\"" append options " -iex \"new-ui console $extra_tty_name\"" append options " -ex \"b $bpline\"" @@ -1150,7 +1144,7 @@ diff --git a/gdb/testsuite/gdb.base/new-ui-pending-input.exp b/gdb/testsuite/gdb diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp -@@ -226,7 +226,8 @@ if ![info exists INTERNAL_GDBFLAGS] { +@@ -238,7 +238,8 @@ if ![info exists INTERNAL_GDBFLAGS] { "-nx" \ "-q" \ {-iex "set height 0"} \ @@ -1160,7 +1154,7 @@ diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp # If DEBUGINFOD_URLS is set, gdb will try to download sources and # debug info for f.i. system libraries. Prevent this. -@@ -2434,6 +2435,17 @@ proc default_gdb_start { } { +@@ -2493,6 +2494,17 @@ proc default_gdb_start { } { } } diff --git a/gdb-add-missing-debug-ext-lang-hook.patch b/gdb-add-missing-debug-ext-lang-hook.patch deleted file mode 100644 index e4020c1..0000000 --- a/gdb-add-missing-debug-ext-lang-hook.patch +++ /dev/null @@ -1,314 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Andrew Burgess -Date: Fri, 13 Oct 2023 16:48:36 +0100 -Subject: gdb-add-missing-debug-ext-lang-hook.patch - -;; Backport upstream commit 661d98a3331. - -gdb: add an extension language hook for missing debug info - -This commit adds a new extension_language_ops hook which allows an -extension to handle the case where GDB can't find a separate debug -information file for a particular objfile. - -This commit doesn't actually implement the hook for any of GDB's -extension languages, the next commit will do that. This commit just -adds support for the hook to extension-priv.h and extension.[ch], and -then reworks symfile-debug.c to call the hook. - -Right now the hook will always return its default value, which means -GDB should do nothing different. As such, there should be no user -visible changes after this commit. - -I'll give a brief description of what the hook does here so that we -can understand the changes in symfile-debug.c. The next commit adds a -Python implementation for this new hook, and gives a fuller -description of the new functionality. - -Currently, when looking for separate debug information GDB tries three -things, in this order: - - 1. Use the build-id to find the required debug information, - - 2. Check for .gnu_debuglink section and use that to look up the - required debug information, - - 3. Check with debuginfod to see if it can supply the required - information. - -The new extension_language_ops::handle_missing_debuginfo hook is -called if all three steps fail to find any debug information. The -hook has three possible return values: - - a. Nothing, no debug information is found, GDB continues without the - debug information for this objfile. This matches the current - behaviour of GDB, and is the default if nothing is implementing this - new hook, - - b. Install debug information into a location that step #1 or #2 - above would normally check, and then request that GDB repeats steps - #1 and #2 in the hope that GDB will now find the debug information. - If the debug information is still not found then GDB carries on - without the debug information. If the debug information is found - the GDB loads it and carries on, - - c. Return a filename for a file containing the required debug - information. GDB loads the contents of this file and carries on. - -The changes in this commit mostly involve placing the core of -objfile::find_and_add_separate_symbol_file into a loop which allows -for steps #1 and #2 to be repeated. - -We take care to ensure that debuginfod is only queried once, the first -time through. The assumption is that no extension is going to be able -to control the replies from debuginfod, so there's no point making a -second request -- and as these requests go over the network, they -could potentially be slow. - -The warnings that find_and_add_separate_symbol_file collects are -displayed only once assuming that no debug information is found. If -debug information is found, even after the extension has operated, -then the warnings are not shown; remember, these are warnings from GDB -about failure to find any suitable debug information, so it makes -sense to hide these if debug information is found. - -Approved-By: Tom Tromey - -diff --git a/gdb/extension-priv.h b/gdb/extension-priv.h ---- a/gdb/extension-priv.h -+++ b/gdb/extension-priv.h -@@ -279,6 +279,13 @@ struct extension_language_ops - gdb::optional (*print_insn) (struct gdbarch *gdbarch, - CORE_ADDR address, - struct disassemble_info *info); -+ -+ /* Give extension languages a chance to deal with missing debug -+ information. OBJFILE is the file for which GDB was unable to find -+ any debug information. */ -+ ext_lang_missing_debuginfo_result -+ (*handle_missing_debuginfo) (const struct extension_language_defn *, -+ struct objfile *objfile); - }; - - /* State necessary to restore a signal handler to its previous value. */ -diff --git a/gdb/extension.c b/gdb/extension.c ---- a/gdb/extension.c -+++ b/gdb/extension.c -@@ -997,6 +997,25 @@ ext_lang_print_insn (struct gdbarch *gdbarch, CORE_ADDR address, - return {}; - } - -+/* See extension.h. */ -+ -+ext_lang_missing_debuginfo_result -+ext_lang_handle_missing_debuginfo (struct objfile *objfile) -+{ -+ for (const struct extension_language_defn *extlang : extension_languages) -+ { -+ if (extlang->ops == nullptr -+ || extlang->ops->handle_missing_debuginfo == nullptr) -+ continue; -+ ext_lang_missing_debuginfo_result result -+ = extlang->ops->handle_missing_debuginfo (extlang, objfile); -+ if (!result.filename ().empty () || result.try_again ()) -+ return result; -+ } -+ -+ return {}; -+} -+ - /* Called via an observer before gdb prints its prompt. - Iterate over the extension languages giving them a chance to - change the prompt. The first one to change the prompt wins, -diff --git a/gdb/extension.h b/gdb/extension.h ---- a/gdb/extension.h -+++ b/gdb/extension.h -@@ -337,6 +337,68 @@ extern gdb::optional ext_lang_colorize_disasm - extern gdb::optional ext_lang_print_insn - (struct gdbarch *gdbarch, CORE_ADDR address, struct disassemble_info *info); - -+/* When GDB calls into an extension language because an objfile was -+ discovered for which GDB couldn't find any debug information, this -+ structure holds the result that the extension language returns. -+ -+ There are three possible actions that might be returned by an extension; -+ first an extension can return a filename, this is the path to the file -+ containing the required debug information. The second possibility is -+ to return a flag indicating that GDB should check again for the missing -+ debug information, this would imply that the extension has installed -+ the debug information into a location where GDB can be expected to find -+ it. And the third option is for the extension to just return a null -+ result, indication there is nothing the extension can do to provide the -+ missing debug information. */ -+struct ext_lang_missing_debuginfo_result -+{ -+ /* Default result. The extension was unable to provide the missing debug -+ info. */ -+ ext_lang_missing_debuginfo_result () -+ { /* Nothing. */ } -+ -+ /* When TRY_AGAIN is true GDB should try searching again, the extension -+ may have installed the missing debug info into a suitable location. -+ When TRY_AGAIN is false this is equivalent to the default, no -+ argument, constructor. */ -+ ext_lang_missing_debuginfo_result (bool try_again) -+ : m_try_again (try_again) -+ { /* Nothing. */ } -+ -+ /* Look in FILENAME for the missing debug info. */ -+ ext_lang_missing_debuginfo_result (std::string &&filename) -+ : m_filename (std::move (filename)) -+ { /* Nothing. */ } -+ -+ /* The filename where GDB can find the missing debuginfo. This is empty -+ if the extension didn't suggest a file that can be used. */ -+ const std::string & -+ filename () const -+ { -+ return m_filename; -+ } -+ -+ /* Returns true if GDB should look again for the debug information. */ -+ const bool -+ try_again () const -+ { -+ return m_try_again; -+ } -+ -+private: -+ /* The filename where the missing debuginfo can now be found. */ -+ std::string m_filename; -+ -+ /* When true GDB will search again for the debuginfo using its standard -+ techniques. When false GDB will not search again. */ -+ bool m_try_again = false; -+}; -+ -+/* Called when GDB failed to find any debug information for OBJFILE. */ -+ -+extern ext_lang_missing_debuginfo_result ext_lang_handle_missing_debuginfo -+ (struct objfile *objfile); -+ - #if GDB_SELF_TEST - namespace selftests { - extern void (*hook_set_active_ext_lang) (); -diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c ---- a/gdb/symfile-debug.c -+++ b/gdb/symfile-debug.c -@@ -631,38 +631,88 @@ debuginfod_find_and_open_separate_symbol_file (struct objfile * objfile) - bool - objfile::find_and_add_separate_symbol_file (symfile_add_flags symfile_flags) - { -- bool has_dwarf = false; -- -- deferred_warnings warnings; -- -- gdb_bfd_ref_ptr debug_bfd; -- std::string filename; -- -- std::tie (debug_bfd, filename) = simple_find_and_open_separate_symbol_file -- (this, find_separate_debug_file_by_buildid, &warnings); -- -- if (debug_bfd == nullptr) -- std::tie (debug_bfd, filename) -- = simple_find_and_open_separate_symbol_file -- (this, find_separate_debug_file_by_debuglink, &warnings); -+ bool has_dwarf2 = false; -+ -+ /* Usually we only make a single pass when looking for separate debug -+ information. However, it is possible for an extension language hook -+ to request that GDB make a second pass, in which case max_attempts -+ will be updated, and the loop restarted. */ -+ for (unsigned attempt = 0, max_attempts = 1; -+ attempt < max_attempts && !has_dwarf2; -+ ++attempt) -+ { -+ gdb_assert (max_attempts <= 2); -+ -+ deferred_warnings warnings; -+ gdb_bfd_ref_ptr debug_bfd; -+ std::string filename; -+ -+ std::tie (debug_bfd, filename) -+ = simple_find_and_open_separate_symbol_file -+ (this, find_separate_debug_file_by_buildid, &warnings); -+ -+ if (debug_bfd == nullptr) -+ std::tie (debug_bfd, filename) -+ = simple_find_and_open_separate_symbol_file -+ (this, find_separate_debug_file_by_debuglink, &warnings); -+ -+ /* Only try debuginfod on the first attempt. Sure, we could imagine -+ an extension that somehow adds the required debug info to the -+ debuginfod server but, at least for now, we don't support this -+ scenario. Better for the extension to return new debug info -+ directly to GDB. Plus, going to the debuginfod server might be -+ slow, so that's a good argument for only doing this once. */ -+ if (debug_bfd == nullptr && attempt == 0) -+ std::tie (debug_bfd, filename) -+ = debuginfod_find_and_open_separate_symbol_file (this); -+ -+ if (debug_bfd != nullptr) -+ { -+ /* We found a separate debug info symbol file. If this is our -+ first attempt then setting HAS_DWARF2 will cause us to break -+ from the attempt loop. */ -+ symbol_file_add_separate (debug_bfd, filename.c_str (), -+ symfile_flags, this); -+ has_dwarf2 = true; -+ } -+ else if (attempt == 0) -+ { -+ /* Failed to find a separate debug info symbol file. Call out to -+ the extension languages. The user might have registered an -+ extension that can find the debug info for us, or maybe give -+ the user a system specific message that guides them to finding -+ the missing debug info. */ -+ -+ ext_lang_missing_debuginfo_result ext_result -+ = ext_lang_handle_missing_debuginfo (this); -+ if (!ext_result.filename ().empty ()) -+ { -+ /* Extension found a suitable debug file for us. */ -+ debug_bfd -+ = symfile_bfd_open_no_error (ext_result.filename ().c_str ()); - -- if (debug_bfd == nullptr) -- std::tie (debug_bfd, filename) -- = debuginfod_find_and_open_separate_symbol_file (this); -+ if (debug_bfd != nullptr) -+ { -+ symbol_file_add_separate (debug_bfd, -+ ext_result.filename ().c_str (), -+ symfile_flags, this); -+ has_dwarf2 = true; -+ } -+ } -+ else if (ext_result.try_again ()) -+ { -+ max_attempts = 2; -+ continue; -+ } -+ } - -- if (debug_bfd != nullptr) -- { -- symbol_file_add_separate (debug_bfd, filename.c_str (), symfile_flags, -- this); -- has_dwarf = true; -+ /* If we still have not got a separate debug symbol file, then -+ emit any warnings we've collected so far. */ -+ if (!has_dwarf2) -+ warnings.emit (); - } - -- /* If we still have not got a separate debug symbol file, then -- emit any warnings we've collected so far. */ -- if (!has_dwarf) -- warnings.emit (); -- -- return has_dwarf; -+ return has_dwarf2; - } - - diff --git a/gdb-add-missing-debug-info-python-hook.patch b/gdb-add-missing-debug-info-python-hook.patch deleted file mode 100644 index 532aad0..0000000 --- a/gdb-add-missing-debug-info-python-hook.patch +++ /dev/null @@ -1,1556 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Andrew Burgess -Date: Sun, 15 Oct 2023 22:48:42 +0100 -Subject: gdb-add-missing-debug-info-python-hook.patch - -;; Backport upstream commit 8f6c452b5a4. - -gdb: implement missing debug handler hook for Python - -This commit builds on the previous commit, and implements the -extension_language_ops::handle_missing_debuginfo function for Python. -This hook will give user supplied Python code a chance to help find -missing debug information. - -The implementation of the new hook is pretty minimal within GDB's C++ -code; most of the work is out-sourced to a Python implementation which -is modelled heavily on how GDB's Python frame unwinders are -implemented. - -The following new commands are added as commands implemented in -Python, this is similar to how the Python unwinder commands are -implemented: - - info missing-debug-handlers - enable missing-debug-handler LOCUS HANDLER - disable missing-debug-handler LOCUS HANDLER - -To make use of this extension hook a user will create missing debug -information handler objects, and registers these handlers with GDB. -When GDB encounters an objfile that is missing debug information, each -handler is called in turn until one is able to help. Here is a -minimal handler that does nothing useful: - - import gdb - import gdb.missing_debug - - class MyFirstHandler(gdb.missing_debug.MissingDebugHandler): - def __init__(self): - super().__init__("my_first_handler") - - def __call__(self, objfile): - # This handler does nothing useful. - return None - - gdb.missing_debug.register_handler(None, MyFirstHandler()) - -Returning None from the __call__ method tells GDB that this handler -was unable to find the missing debug information, and GDB should ask -any other registered handlers. - -By extending the __call__ method it is possible for the Python -extension to locate the debug information for objfile and return a -value that tells GDB how to use the information that has been located. - -Possible return values from a handler: - - - None: This means the handler couldn't help. GDB will call other - registered handlers to see if they can help instead. - - - False: The handler has done all it can, but the debug information - for the objfile still couldn't be found. GDB will not call - any other handlers, and will continue without the debug - information for objfile. - - - True: The handler has installed the debug information into a - location where GDB would normally expect to find it. GDB - should look again for the debug information. - - - A string: The handler can return a filename, which is the file - containing the missing debug information. GDB will load - this file. - -When a handler returns True, GDB will look again for the debug -information, but only using the standard built-in build-id and -.gnu_debuglink based lookup strategies. It is not possible for an -extension to trigger another debuginfod lookup; the assumption is that -the debuginfod server is remote, and out of the control of extensions -running within GDB. - -Handlers can be registered globally, or per program space. GDB checks -the handlers for the current program space first, and then all of the -global handles. The first handler that returns a value that is not -None, has "handled" the objfile, at which point GDB continues. - -Reviewed-By: Eli Zaretskii -Approved-By: Tom Tromey - -diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in ---- a/gdb/data-directory/Makefile.in -+++ b/gdb/data-directory/Makefile.in -@@ -73,6 +73,7 @@ PYTHON_FILE_LIST = \ - gdb/FrameDecorator.py \ - gdb/FrameIterator.py \ - gdb/frames.py \ -+ gdb/missing_debug.py \ - gdb/printing.py \ - gdb/prompt.py \ - gdb/styling.py \ -@@ -82,6 +83,7 @@ PYTHON_FILE_LIST = \ - gdb/command/__init__.py \ - gdb/command/explore.py \ - gdb/command/frame_filters.py \ -+ gdb/command/missing_debug.py \ - gdb/command/pretty_printers.py \ - gdb/command/prompt.py \ - gdb/command/type_printers.py \ -diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi ---- a/gdb/doc/python.texi -+++ b/gdb/doc/python.texi -@@ -229,6 +229,7 @@ optional arguments while skipping others. Example: - * Connections In Python:: Python representation of connections. - * TUI Windows In Python:: Implementing new TUI windows. - * Disassembly In Python:: Instruction Disassembly In Python -+* Missing Debug Info In Python:: Handle missing debug info from Python. - @end menu - - @node Basic Python -@@ -5191,6 +5192,12 @@ The @code{frame_filters} attribute is a dictionary of frame filter - objects. @xref{Frame Filter API}, for more information. - @end defvar - -+@defvar Progspace.missing_debug_handlers -+The @code{missing_debug_handlers} attribute is a list of the missing -+debug handler objects for this program space. @xref{Missing Debug -+Info In Python}, for more information. -+@end defvar -+ - A program space has the following methods: - - @defun Progspace.block_for_pc (pc) -@@ -7770,6 +7777,139 @@ class NibbleSwapDisassembler(gdb.disassembler.Disassembler): - gdb.disassembler.register_disassembler(NibbleSwapDisassembler()) - @end smallexample - -+@node Missing Debug Info In Python -+@subsubsection Missing Debug Info In Python -+@cindex python, handle missing debug information -+ -+When @value{GDBN} encounters a new objfile (@pxref{Objfiles In -+Python}), e.g.@: the primary executable, or any shared libraries used -+by the inferior, @value{GDBN} will attempt to load the corresponding -+debug information for that objfile. The debug information might be -+found within the objfile itself, or within a separate objfile which -+@value{GDBN} will automatically locate and load. -+ -+Sometimes though, @value{GDBN} might not find any debug information -+for an objfile, in this case the debugging experience will be -+restricted. -+ -+If @value{GDBN} fails to locate any debug information for a particular -+objfile, there is an opportunity for a Python extension to step in. A -+Python extension can potentially locate the missing debug information -+using some platform- or project-specific steps, and inform -+@value{GDBN} of its location. Or a Python extension might provide -+some platform- or project-specific advice to the user about how to -+obtain the missing debug information. -+ -+A missing debug information Python extension consists of a handler -+object which has the @code{name} and @code{enabled} attributes, and -+implements the @code{__call__} method. When @value{GDBN} encounters -+an objfile for which it is unable to find any debug information, it -+invokes the @code{__call__} method. Full details of how handlers are -+written can be found below. -+ -+@subheading The @code{gdb.missing_debug} Module -+ -+@value{GDBN} comes with a @code{gdb.missing_debug} module which -+contains the following class and global function: -+ -+@deftp{class} gdb.missing_debug.MissingDebugHandler -+ -+@code{MissingDebugHandler} is a base class from which user-created -+handlers can derive, though it is not required that handlers derive -+from this class, so long as any user created handler has the -+@code{name} and @code{enabled} attributes, and implements the -+@code{__call__} method. -+ -+@defun MissingDebugHandler.__init__ (name) -+The @var{name} is a string used to reference this missing debug -+handler within some @value{GDBN} commands. Valid names consist of the -+characters @code{[-_a-zA-Z0-9]}, creating a handler with an invalid -+name raises a @code{ValueError} exception. -+@end defun -+ -+@defun MissingDebugHandler.__call__ (objfile) -+Sub-classes must override the @code{__call__} method. The -+@var{objfile} argument will be a @code{gdb.Objfile}, this is the -+objfile for which @value{GDBN} was unable to find any debug -+information. -+ -+The return value from the @code{__call__} method indicates what -+@value{GDBN} should do next. The possible return values are: -+ -+@itemize @bullet -+@item @code{None} -+ -+This indicates that this handler could not help with @var{objfile}, -+@value{GDBN} should call any other registered handlers. -+ -+@item @code{True} -+ -+This indicates that this handler has installed the debug information -+into a location where @value{GDBN} would normally expect to find it -+when looking for separate debug information files (@pxref{Separate -+Debug Files}). @value{GDBN} will repeat the normal lookup process, -+which should now find the separate debug file. -+ -+If @value{GDBN} still doesn't find the separate debug information file -+after this second attempt, then the Python missing debug information -+handlers are not invoked a second time, this prevents a badly behaved -+handler causing @value{GDBN} to get stuck in a loop. @value{GDBN} -+will continue without any debug information for @var{objfile}. -+ -+@item @code{False} -+ -+This indicates that this handler has done everything that it intends -+to do with @var{objfile}, but no separate debug information can be -+found. @value{GDBN} will not call any other registered handlers for -+@var{objfile}. @value{GDBN} will continue without debugging -+information for @var{objfile}. -+ -+@item A string -+ -+The returned string should contain a filename. @value{GDBN} will not -+call any further registered handlers, and will instead load the debug -+information from the file identified by the returned filename. -+@end itemize -+ -+Invoking the @code{__call__} method from this base class will raise a -+@code{NotImplementedError} exception. -+@end defun -+ -+@defvar MissingDebugHandler.name -+A read-only attribute which is a string, the name of this handler -+passed to the @code{__init__} method. -+@end defvar -+ -+@defvar MissingDebugHandler.enabled -+A modifiable attribute containing a boolean; when @code{True}, the -+handler is enabled, and will be used by @value{GDBN}. When -+@code{False}, the handler has been disabled, and will not be used. -+@end defvar -+@end deftp -+ -+@defun gdb.missing_debug.register_handler (locus, handler, replace=@code{False}) -+Register a new missing debug handler with @value{GDBN}. -+ -+@var{handler} is an instance of a sub-class of -+@code{MissingDebugHandler}, or at least an instance of an object that -+has the same attributes and methods as @code{MissingDebugHandler}. -+ -+@var{locus} specifies to which handler list to prepend @var{handler}. -+It can be either a @code{gdb.Progspace} (@pxref{Progspaces In Python}) -+or @code{None}, in which case the handler is registered globally. The -+newly registered @var{handler} will be called before any other handler -+from the same locus. Two handlers in the same locus cannot have the -+same name, an attempt to add a handler with an already existing name -+raises an exception unless @var{replace} is @code{True}, in which case -+the old handler is deleted and the new handler is prepended to the -+selected handler list. -+ -+@value{GDBN} first calls the handlers for the current program space, -+and then the globally registered handlers. As soon as a handler -+returns a value other than @code{None}, no further handlers are called -+for this objfile. -+@end defun -+ - @node Python Auto-loading - @subsection Python Auto-loading - @cindex Python auto-loading -diff --git a/gdb/python/lib/gdb/__init__.py b/gdb/python/lib/gdb/__init__.py ---- a/gdb/python/lib/gdb/__init__.py -+++ b/gdb/python/lib/gdb/__init__.py -@@ -84,6 +84,8 @@ xmethods = [] - frame_filters = {} - # Initial frame unwinders. - frame_unwinders = [] -+# Initial missing debug handlers. -+missing_debug_handlers = [] - - - def _execute_unwinders(pending_frame): -@@ -291,3 +293,42 @@ class Thread(threading.Thread): - # threads. - with blocked_signals(): - super().start() -+ -+ -+def _handle_missing_debuginfo(objfile): -+ """Internal function called from GDB to execute missing debug -+ handlers. -+ -+ Run each of the currently registered, and enabled missing debug -+ handler objects for the current program space and then from the -+ global list. Stop after the first handler that returns a result -+ other than None. -+ -+ Arguments: -+ objfile: A gdb.Objfile for which GDB could not find any debug -+ information. -+ -+ Returns: -+ None: No debug information could be found for objfile. -+ False: A handler has done all it can with objfile, but no -+ debug information could be found. -+ True: Debug information might have been installed by a -+ handler, GDB should check again. -+ A string: This is the filename of a file containing the -+ required debug information. -+ """ -+ pspace = objfile.progspace -+ -+ for handler in pspace.missing_debug_handlers: -+ if handler.enabled: -+ result = handler(objfile) -+ if result is not None: -+ return result -+ -+ for handler in missing_debug_handlers: -+ if handler.enabled: -+ result = handler(objfile) -+ if result is not None: -+ return result -+ -+ return None -diff --git a/gdb/python/lib/gdb/command/missing_debug.py b/gdb/python/lib/gdb/command/missing_debug.py -new file mode 100644 ---- /dev/null -+++ b/gdb/python/lib/gdb/command/missing_debug.py -@@ -0,0 +1,226 @@ -+# Missing debug related commands. -+# -+# Copyright 2023 Free Software Foundation, Inc. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+import gdb -+import re -+ -+ -+def validate_regexp(exp, idstring): -+ """Compile exp into a compiler regular expression object. -+ -+ Arguments: -+ exp: The string to compile into a re.Pattern object. -+ idstring: A string, what exp is a regexp for. -+ -+ Returns: -+ A re.Pattern object representing exp. -+ -+ Raises: -+ SyntaxError: If exp is an invalid regexp. -+ """ -+ try: -+ return re.compile(exp) -+ except SyntaxError: -+ raise SyntaxError("Invalid %s regexp: %s." % (idstring, exp)) -+ -+ -+def parse_missing_debug_command_args(arg): -+ """Internal utility to parse missing debug handler command argv. -+ -+ Arguments: -+ arg: The arguments to the command. The format is: -+ [locus-regexp [name-regexp]] -+ -+ Returns: -+ A 2-tuple of compiled regular expressions. -+ -+ Raises: -+ SyntaxError: an error processing ARG -+ """ -+ argv = gdb.string_to_argv(arg) -+ argc = len(argv) -+ if argc > 2: -+ raise SyntaxError("Too many arguments.") -+ locus_regexp = "" -+ name_regexp = "" -+ if argc >= 1: -+ locus_regexp = argv[0] -+ if argc >= 2: -+ name_regexp = argv[1] -+ return ( -+ validate_regexp(locus_regexp, "locus"), -+ validate_regexp(name_regexp, "handler"), -+ ) -+ -+ -+class InfoMissingDebugHanders(gdb.Command): -+ """GDB command to list missing debug handlers. -+ -+ Usage: info missing-debug-handlers [LOCUS-REGEXP [NAME-REGEXP]] -+ -+ LOCUS-REGEXP is a regular expression matching the location of the -+ handler. If it is omitted, all registered handlers from all -+ loci are listed. A locus can be 'global', 'progspace' to list -+ the handlers from the current progspace, or a regular expression -+ matching filenames of progspaces. -+ -+ NAME-REGEXP is a regular expression to filter missing debug -+ handler names. If this omitted for a specified locus, then all -+ registered handlers in the locus are listed. -+ """ -+ -+ def __init__(self): -+ super().__init__("info missing-debug-handlers", gdb.COMMAND_FILES) -+ -+ def list_handlers(self, title, handlers, name_re): -+ """Lists the missing debug handlers whose name matches regexp. -+ -+ Arguments: -+ title: The line to print before the list. -+ handlers: The list of the missing debug handlers. -+ name_re: handler name filter. -+ """ -+ if not handlers: -+ return -+ print(title) -+ for handler in handlers: -+ if name_re.match(handler.name): -+ print( -+ " %s%s" % (handler.name, "" if handler.enabled else " [disabled]") -+ ) -+ -+ def invoke(self, arg, from_tty): -+ locus_re, name_re = parse_missing_debug_command_args(arg) -+ -+ if locus_re.match("progspace") and locus_re.pattern != "": -+ cp = gdb.current_progspace() -+ self.list_handlers( -+ "Progspace %s:" % cp.filename, cp.missing_debug_handlers, name_re -+ ) -+ -+ for progspace in gdb.progspaces(): -+ filename = progspace.filename or "" -+ if locus_re.match(filename): -+ if filename == "": -+ if progspace == gdb.current_progspace(): -+ msg = "Current Progspace:" -+ else: -+ msg = "Progspace :" -+ else: -+ msg = "Progspace %s:" % filename -+ self.list_handlers( -+ msg, -+ progspace.missing_debug_handlers, -+ name_re, -+ ) -+ -+ # Print global handlers last, as these are invoked last. -+ if locus_re.match("global"): -+ self.list_handlers("Global:", gdb.missing_debug_handlers, name_re) -+ -+ -+def do_enable_handler1(handlers, name_re, flag): -+ """Enable/disable missing debug handlers whose names match given regex. -+ -+ Arguments: -+ handlers: The list of missing debug handlers. -+ name_re: Handler name filter. -+ flag: A boolean indicating if we should enable or disable. -+ -+ Returns: -+ The number of handlers affected. -+ """ -+ total = 0 -+ for handler in handlers: -+ if name_re.match(handler.name) and handler.enabled != flag: -+ handler.enabled = flag -+ total += 1 -+ return total -+ -+ -+def do_enable_handler(arg, flag): -+ """Enable or disable missing debug handlers.""" -+ (locus_re, name_re) = parse_missing_debug_command_args(arg) -+ total = 0 -+ if locus_re.match("global"): -+ total += do_enable_handler1(gdb.missing_debug_handlers, name_re, flag) -+ if locus_re.match("progspace") and locus_re.pattern != "": -+ total += do_enable_handler1( -+ gdb.current_progspace().missing_debug_handlers, name_re, flag -+ ) -+ for progspace in gdb.progspaces(): -+ filename = progspace.filename or "" -+ if locus_re.match(filename): -+ total += do_enable_handler1(progspace.missing_debug_handlers, name_re, flag) -+ print( -+ "%d missing debug handler%s %s" -+ % (total, "" if total == 1 else "s", "enabled" if flag else "disabled") -+ ) -+ -+ -+class EnableMissingDebugHandler(gdb.Command): -+ """GDB command to enable missing debug handlers. -+ -+ Usage: enable missing-debug-handler [LOCUS-REGEXP [NAME-REGEXP]] -+ -+ LOCUS-REGEXP is a regular expression specifying the handlers to -+ enable. It can be 'global', 'progspace' for the current -+ progspace, or the filename for a file associated with a progspace. -+ -+ NAME_REGEXP is a regular expression to filter handler names. If -+ this omitted for a specified locus, then all registered handlers -+ in the locus are affected. -+ """ -+ -+ def __init__(self): -+ super().__init__("enable missing-debug-handler", gdb.COMMAND_FILES) -+ -+ def invoke(self, arg, from_tty): -+ """GDB calls this to perform the command.""" -+ do_enable_handler(arg, True) -+ -+ -+class DisableMissingDebugHandler(gdb.Command): -+ """GDB command to disable missing debug handlers. -+ -+ Usage: disable missing-debug-handler [LOCUS-REGEXP [NAME-REGEXP]] -+ -+ LOCUS-REGEXP is a regular expression specifying the handlers to -+ enable. It can be 'global', 'progspace' for the current -+ progspace, or the filename for a file associated with a progspace. -+ -+ NAME_REGEXP is a regular expression to filter handler names. If -+ this omitted for a specified locus, then all registered handlers -+ in the locus are affected. -+ """ -+ -+ def __init__(self): -+ super().__init__("disable missing-debug-handler", gdb.COMMAND_FILES) -+ -+ def invoke(self, arg, from_tty): -+ """GDB calls this to perform the command.""" -+ do_enable_handler(arg, False) -+ -+ -+def register_missing_debug_handler_commands(): -+ """Installs the missing debug handler commands.""" -+ InfoMissingDebugHanders() -+ EnableMissingDebugHandler() -+ DisableMissingDebugHandler() -+ -+ -+register_missing_debug_handler_commands() -diff --git a/gdb/python/lib/gdb/missing_debug.py b/gdb/python/lib/gdb/missing_debug.py -new file mode 100644 ---- /dev/null -+++ b/gdb/python/lib/gdb/missing_debug.py -@@ -0,0 +1,169 @@ -+# Copyright (C) 2023 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+""" -+MissingDebugHandler base class, and register_handler function. -+""" -+ -+import gdb -+ -+ -+def _validate_name(name): -+ """Validate a missing debug handler name string. -+ -+ If name is valid as a missing debug handler name, then this -+ function does nothing. If name is not valid then an exception is -+ raised. -+ -+ Arguments: -+ name: A string, the name of a missing debug handler. -+ -+ Returns: -+ Nothing. -+ -+ Raises: -+ ValueError: If name is invalid as a missing debug handler -+ name. -+ """ -+ for ch in name: -+ if not ch.isascii() or not (ch.isalnum() or ch in "_-"): -+ raise ValueError("invalid character '%s' in handler name: %s" % (ch, name)) -+ -+ -+class MissingDebugHandler(object): -+ """Base class for missing debug handlers written in Python. -+ -+ A missing debug handler has a single method __call__ along with -+ the read/write attribute enabled, and a read-only attribute name. -+ -+ Attributes: -+ name: Read-only attribute, the name of this handler. -+ enabled: When true this handler is enabled. -+ """ -+ -+ def __init__(self, name): -+ """Constructor. -+ -+ Args: -+ name: An identifying name for this handler. -+ -+ Raises: -+ TypeError: name is not a string. -+ ValueError: name contains invalid characters. -+ """ -+ -+ if not isinstance(name, str): -+ raise TypeError("incorrect type for name: %s" % type(name)) -+ -+ _validate_name(name) -+ -+ self._name = name -+ self._enabled = True -+ -+ @property -+ def name(self): -+ return self._name -+ -+ @property -+ def enabled(self): -+ return self._enabled -+ -+ @enabled.setter -+ def enabled(self, value): -+ if not isinstance(value, bool): -+ raise TypeError("incorrect type for enabled attribute: %s" % type(value)) -+ self._enabled = value -+ -+ def __call__(self, objfile): -+ """GDB handle missing debug information for an objfile. -+ -+ Arguments: -+ objfile: A gdb.Objfile for which GDB could not find any -+ debug information. -+ -+ Returns: -+ True: GDB should try again to locate the debug information -+ for objfile, the handler may have installed the -+ missing information. -+ False: GDB should move on without the debug information -+ for objfile. -+ A string: GDB should load the file at the given path; it -+ contains the debug information for objfile. -+ None: This handler can't help with objfile. GDB should -+ try any other registered handlers. -+ """ -+ raise NotImplementedError("MissingDebugHandler.__call__()") -+ -+ -+def register_handler(locus, handler, replace=False): -+ """Register handler in given locus. -+ -+ The handler is prepended to the locus's missing debug handlers -+ list. The name of handler should be unique (or replace must be -+ True). -+ -+ Arguments: -+ locus: Either a progspace, or None (in which case the unwinder -+ is registered globally). -+ handler: An object of a gdb.MissingDebugHandler subclass. -+ -+ replace: If True, replaces existing handler with the same name -+ within locus. Otherwise, raises RuntimeException if -+ unwinder with the same name already exists. -+ -+ Returns: -+ Nothing. -+ -+ Raises: -+ RuntimeError: The name of handler is not unique. -+ TypeError: Bad locus type. -+ AttributeError: Required attributes of handler are missing. -+ """ -+ -+ if locus is None: -+ if gdb.parameter("verbose"): -+ gdb.write("Registering global %s handler ...\n" % handler.name) -+ locus = gdb -+ elif isinstance(locus, gdb.Progspace): -+ if gdb.parameter("verbose"): -+ gdb.write( -+ "Registering %s handler for %s ...\n" % (handler.name, locus.filename) -+ ) -+ else: -+ raise TypeError("locus should be gdb.Progspace or None") -+ -+ # Some sanity checks on HANDLER. Calling getattr will raise an -+ # exception if the attribute doesn't exist, which is what we want. -+ # These checks are not exhaustive; we don't check the attributes -+ # have the correct types, or the method has the correct signature, -+ # but this should catch some basic mistakes. -+ getattr(handler, "name") -+ getattr(handler, "enabled") -+ call_method = getattr(handler, "__call__") -+ if not callable(call_method): -+ raise AttributeError( -+ "'%s' object's '__call__' attribute is not callable" -+ % type(handler).__name__ -+ ) -+ -+ i = 0 -+ for needle in locus.missing_debug_handlers: -+ if needle.name == handler.name: -+ if replace: -+ del locus.missing_debug_handlers[i] -+ else: -+ raise RuntimeError("Handler %s already exists." % handler.name) -+ i += 1 -+ locus.missing_debug_handlers.insert(0, handler) -diff --git a/gdb/python/py-progspace.c b/gdb/python/py-progspace.c ---- a/gdb/python/py-progspace.c -+++ b/gdb/python/py-progspace.c -@@ -54,6 +54,9 @@ struct pspace_object - - /* The debug method list. */ - PyObject *xmethods; -+ -+ /* The missing debug handler list. */ -+ PyObject *missing_debug_handlers; - }; - - extern PyTypeObject pspace_object_type -@@ -163,6 +166,7 @@ pspy_dealloc (PyObject *self) - Py_XDECREF (ps_self->frame_unwinders); - Py_XDECREF (ps_self->type_printers); - Py_XDECREF (ps_self->xmethods); -+ Py_XDECREF (ps_self->missing_debug_handlers); - Py_TYPE (self)->tp_free (self); - } - -@@ -198,6 +202,10 @@ pspy_initialize (pspace_object *self) - if (self->xmethods == NULL) - return 0; - -+ self->missing_debug_handlers = PyList_New (0); -+ if (self->missing_debug_handlers == nullptr) -+ return 0; -+ - return 1; - } - -@@ -352,6 +360,47 @@ pspy_get_xmethods (PyObject *o, void *ignore) - return self->xmethods; - } - -+/* Return the list of missing debug handlers for this program space. */ -+ -+static PyObject * -+pspy_get_missing_debug_handlers (PyObject *o, void *ignore) -+{ -+ pspace_object *self = (pspace_object *) o; -+ -+ Py_INCREF (self->missing_debug_handlers); -+ return self->missing_debug_handlers; -+} -+ -+/* Set this program space's list of missing debug handlers to HANDLERS. */ -+ -+static int -+pspy_set_missing_debug_handlers (PyObject *o, PyObject *handlers, -+ void *ignore) -+{ -+ pspace_object *self = (pspace_object *) o; -+ -+ if (handlers == nullptr) -+ { -+ PyErr_SetString (PyExc_TypeError, -+ "cannot delete the missing debug handlers list"); -+ return -1; -+ } -+ -+ if (!PyList_Check (handlers)) -+ { -+ PyErr_SetString (PyExc_TypeError, -+ "the missing debug handlers attribute must be a list"); -+ return -1; -+ } -+ -+ /* Take care in case the LHS and RHS are related somehow. */ -+ gdbpy_ref<> tmp (self->missing_debug_handlers); -+ Py_INCREF (handlers); -+ self->missing_debug_handlers = handlers; -+ -+ return 0; -+} -+ - /* Set the 'type_printers' attribute. */ - - static int -@@ -744,6 +793,8 @@ static gdb_PyGetSetDef pspace_getset[] = - "Type printers.", NULL }, - { "xmethods", pspy_get_xmethods, NULL, - "Debug methods.", NULL }, -+ { "missing_debug_handlers", pspy_get_missing_debug_handlers, -+ pspy_set_missing_debug_handlers, "Missing debug handlers.", NULL }, - { NULL } - }; - -diff --git a/gdb/python/python.c b/gdb/python/python.c ---- a/gdb/python/python.c -+++ b/gdb/python/python.c -@@ -124,7 +124,9 @@ static enum ext_lang_rc gdbpy_before_prompt_hook - static gdb::optional gdbpy_colorize - (const std::string &filename, const std::string &contents); - static gdb::optional gdbpy_colorize_disasm -- (const std::string &content, gdbarch *gdbarch); -+(const std::string &content, gdbarch *gdbarch); -+static ext_lang_missing_debuginfo_result gdbpy_handle_missing_debuginfo -+ (const struct extension_language_defn *extlang, struct objfile *objfile); - - /* The interface between gdb proper and loading of python scripts. */ - -@@ -170,6 +172,8 @@ static const struct extension_language_ops python_extension_ops = - gdbpy_colorize_disasm, - - gdbpy_print_insn, -+ -+ gdbpy_handle_missing_debuginfo - }; - - #endif /* HAVE_PYTHON */ -@@ -1661,6 +1665,83 @@ gdbpy_get_current_objfile (PyObject *unused1, PyObject *unused2) - return objfile_to_objfile_object (gdbpy_current_objfile).release (); - } - -+/* Implement the 'handle_missing_debuginfo' hook for Python. GDB has -+ failed to find any debug information for OBJFILE. The extension has a -+ chance to record this, or even install the required debug information. -+ See the description of ext_lang_missing_debuginfo_result in -+ extension-priv.h for details of the return value. */ -+ -+static ext_lang_missing_debuginfo_result -+gdbpy_handle_missing_debuginfo (const struct extension_language_defn *extlang, -+ struct objfile *objfile) -+{ -+ /* Early exit if Python is not initialised. */ -+ if (!gdb_python_initialized) -+ return {}; -+ -+ struct gdbarch *gdbarch = objfile->arch (); -+ -+ gdbpy_enter enter_py (gdbarch); -+ -+ /* Convert OBJFILE into the corresponding Python object. */ -+ gdbpy_ref<> pyo_objfile = objfile_to_objfile_object (objfile); -+ if (pyo_objfile == nullptr) -+ { -+ gdbpy_print_stack (); -+ return {}; -+ } -+ -+ /* Lookup the helper function within the GDB module. */ -+ gdbpy_ref<> pyo_handler -+ (PyObject_GetAttrString (gdb_python_module, "_handle_missing_debuginfo")); -+ if (pyo_handler == nullptr) -+ { -+ gdbpy_print_stack (); -+ return {}; -+ } -+ -+ /* Call the function, passing in the Python objfile object. */ -+ gdbpy_ref<> pyo_execute_ret -+ (PyObject_CallFunctionObjArgs (pyo_handler.get (), pyo_objfile.get (), -+ nullptr)); -+ if (pyo_execute_ret == nullptr) -+ { -+ /* If the handler is cancelled due to a Ctrl-C, then propagate -+ the Ctrl-C as a GDB exception instead of swallowing it. */ -+ gdbpy_print_stack_or_quit (); -+ return {}; -+ } -+ -+ /* Parse the result, and convert it back to the C++ object. */ -+ if (pyo_execute_ret == Py_None) -+ return {}; -+ -+ if (PyBool_Check (pyo_execute_ret.get ())) -+ { -+ bool try_again = PyObject_IsTrue (pyo_execute_ret.get ()); -+ return ext_lang_missing_debuginfo_result (try_again); -+ } -+ -+ if (!gdbpy_is_string (pyo_execute_ret.get ())) -+ { -+ PyErr_SetString (PyExc_ValueError, -+ "return value from _handle_missing_debuginfo should " -+ "be None, a Bool, or a String"); -+ gdbpy_print_stack (); -+ return {}; -+ } -+ -+ gdb::unique_xmalloc_ptr filename -+ = python_string_to_host_string (pyo_execute_ret.get ()); -+ if (filename == nullptr) -+ { -+ gdbpy_print_stack (); -+ return {}; -+ } -+ -+ return ext_lang_missing_debuginfo_result (std::string (filename.get ())); -+} -+ - /* Compute the list of active python type printers and store them in - EXT_PRINTERS->py_type_printers. The product of this function is used by - gdbpy_apply_type_printers, and freed by gdbpy_free_type_printers. -diff --git a/gdb/testsuite/gdb.python/py-missing-debug.c b/gdb/testsuite/gdb.python/py-missing-debug.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.python/py-missing-debug.c -@@ -0,0 +1,22 @@ -+/* This test program is part of GDB, the GNU debugger. -+ -+ Copyright 2023 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+int -+main () -+{ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.python/py-missing-debug.exp b/gdb/testsuite/gdb.python/py-missing-debug.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.python/py-missing-debug.exp -@@ -0,0 +1,473 @@ -+# Copyright (C) 2023 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+load_lib gdb-python.exp -+ -+require allow_python_tests -+ -+standard_testfile -+ -+if {[build_executable "failed to prepare" ${testfile} ${srcfile}]} { -+ return -1 -+} -+ -+# Remove debug information from BINFILE and place it into -+# BINFILE.debug. -+if {[gdb_gnu_strip_debug $binfile]} { -+ unsupported "cannot produce separate debug info files" -+ return -1 -+} -+ -+set remote_python_file \ -+ [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py] -+ -+set debug_filename ${binfile}.debug -+set hidden_filename ${binfile}.hidden -+ -+# Start GDB. -+clean_restart -+ -+# Some initial sanity checks; initially, we can find the debug information -+# (this will use the .gnu_debuglink), then after we move the debug -+# information, reload the executable, now the debug can't be found. -+with_test_prefix "initial checks" { -+ # Load BINFILE, we should find the separate debug information. -+ gdb_file_cmd $binfile -+ gdb_assert {$gdb_file_cmd_debug_info == "debug"} \ -+ "debug info is found" -+ -+ # Rename the debug information file, re-load BINFILE, GDB should fail -+ # to find the debug information -+ remote_exec build "mv $debug_filename $hidden_filename" -+ gdb_file_cmd $binfile -+ gdb_assert {$gdb_file_cmd_debug_info == "nodebug"} \ -+ "debug info no longer found" -+} -+ -+# Load the Python script into GDB. -+gdb_test "source $remote_python_file" "^Success" \ -+ "source python script" -+ -+# Setup the separate debug info directory. This isn't actually needed until -+# some of the later tests, but might as well get this done now. -+set debug_directory [standard_output_file "debug-dir"] -+remote_exec build "mkdir -p $debug_directory" -+gdb_test_no_output "set debug-file-directory $debug_directory" \ -+ "set debug-file-directory" -+ -+# Initially the missing debug handler we install is in a mode where it -+# returns None, indicating that it can't help locate the debug information. -+# Check this works as expected. -+with_test_prefix "handler returning None" { -+ gdb_test_no_output \ -+ "python gdb.missing_debug.register_handler(None, handler_obj)" \ -+ "register the initial handler" -+ -+ gdb_file_cmd $binfile -+ gdb_assert {$gdb_file_cmd_debug_info == "nodebug"} \ -+ "debug info not found" -+ -+ # Check the handler was only called once. -+ gdb_test "python print(handler_obj.call_count)" "^1" \ -+ "check handler was only called once" -+} -+ -+# Now configure the handler to move the debug file back to the -+# .gnu_debuglink location and then return True, this will cause GDB to -+# recheck, at which point it should find the debug info. -+with_test_prefix "handler in gnu_debuglink mode" { -+ gdb_test_no_output "python handler_obj.set_mode(Mode.RETURN_TRUE, \ -+ \"$hidden_filename\", \ -+ \"$debug_filename\")" \ -+ "confirgure handler" -+ gdb_file_cmd $binfile -+ gdb_assert {$gdb_file_cmd_debug_info == "debug"} "debug info found" -+ -+ # Check the handler was only called once. -+ gdb_test "python print(handler_obj.call_count)" "^1" \ -+ "check handler was only called once" -+} -+ -+# Setup a directory structure based on the build-id of BINFILE, but don't -+# move the debug information into place just yet. -+# -+# Instead, configure the handler to move the debug info into the build-id -+# directory. -+# -+# Reload BINFILE, at which point the handler will move the debug info into -+# the build-id directory and return True, GDB will then recheck for the -+# debug information, and should find it. -+with_test_prefix "handler in build-id mode" { -+ # Move the debug file out of the way once more. -+ remote_exec build "mv $debug_filename $hidden_filename" -+ -+ # Create the build-id based directory in which the debug information -+ # will be placed. -+ set build_id_filename \ -+ $debug_directory/[build_id_debug_filename_get $binfile] -+ remote_exec build "mkdir -p [file dirname $build_id_filename]" -+ -+ # Configure the handler to move the debug info into the build-id dir. -+ gdb_test_no_output "python handler_obj.set_mode(Mode.RETURN_TRUE, \ -+ \"$hidden_filename\", \ -+ \"$build_id_filename\")" \ -+ "confirgure handler" -+ -+ # Reload the binary and check the debug information is found. -+ gdb_file_cmd $binfile -+ gdb_assert {$gdb_file_cmd_debug_info == "debug"} "debug info found" -+ -+ # Check the handler was only called once. -+ gdb_test "python print(handler_obj.call_count)" "^1" \ -+ "check handler was only called once" -+} -+ -+# Move the debug information back to a hidden location and configure the -+# handler to return the filename of the hidden debug info location. GDB -+# should immediately use this file as the debug information. -+with_test_prefix "handler returning a string" { -+ remote_exec build "mv $build_id_filename $hidden_filename" -+ -+ # Configure the handler return a filename string. -+ gdb_test_no_output "python handler_obj.set_mode(Mode.RETURN_STRING, \ -+ \"$hidden_filename\")" \ -+ "confirgure handler" -+ -+ # Reload the binary and check the debug information is found. -+ gdb_file_cmd $binfile -+ gdb_assert {$gdb_file_cmd_debug_info == "debug"} "debug info found" -+ -+ # Check the handler was only called once. -+ gdb_test "python print(handler_obj.call_count)" "^1" \ -+ "check handler was only called once" -+} -+ -+# Register another global handler, this one raises an exception. Reload the -+# debug information, the bad handler should be invoked first, which raises -+# an excetption, at which point GDB should skip further Python handlers. -+with_test_prefix "handler raises an exception" { -+ gdb_test_no_output \ -+ "python gdb.missing_debug.register_handler(None, rhandler)" -+ -+ foreach_with_prefix exception_type {gdb.GdbError TypeError} { -+ gdb_test_no_output \ -+ "python rhandler.exception_type = $exception_type" -+ -+ gdb_file_cmd $binfile -+ gdb_assert {$gdb_file_cmd_debug_info == "nodebug"} \ -+ "debug info not found" -+ -+ set re [string_to_regexp \ -+ "Python Exception : message"] -+ gdb_assert {[regexp $re $gdb_file_cmd_msg]} \ -+ "check for exception in file command output" -+ -+ # Our original handler is still registered, but should not have been -+ # called again (as the exception occurs first). -+ gdb_test "python print(handler_obj.call_count)" "^1" \ -+ "check good handler hasn't been called again" -+ } -+} -+ -+gdb_test "info missing-debug-handlers" \ -+ [multi_line \ -+ "Global:" \ -+ " exception_handler" \ -+ " handler"] \ -+ "check both handlers are visible" -+ -+# Re-start GDB. -+clean_restart -+ -+# Load the Python script into GDB. -+gdb_test "source $remote_python_file" "^Success" \ -+ "source python script for bad handler name checks" -+ -+# Attempt to register a missing-debug-handler with NAME. The expectation is -+# that this should fail as NAME contains some invalid characters. -+proc check_bad_name {name} { -+ set name_re [string_to_regexp $name] -+ set re \ -+ [multi_line \ -+ "ValueError: invalid character '.' in handler name: $name_re" \ -+ "Error while executing Python code\\."] -+ -+ gdb_test "python register(\"$name\")" $re \ -+ "check that '$name' is not accepted" -+} -+ -+# We don't attempt to be exhaustive here, just check a few random examples -+# of invalid names. -+check_bad_name "!! Bad Name" -+check_bad_name "Bad Name" -+check_bad_name "(Bad Name)" -+check_bad_name "Bad \[Name\]" -+check_bad_name "Bad,Name" -+check_bad_name "Bad;Name" -+ -+# Check that there are no handlers registered. -+gdb_test_no_output "info missing-debug-handlers" \ -+ "check no handlers are registered" -+ -+# Check we can use the enable/disable commands where there are no handlers -+# registered. -+gdb_test "enable missing-debug-handler foo" \ -+ "^0 missing debug handlers enabled" -+gdb_test "disable missing-debug-handler foo" \ -+ "^0 missing debug handlers disabled" -+ -+# Grab the current program space object, used for registering handler later. -+gdb_test_no_output "python pspace = gdb.selected_inferior().progspace" -+ -+# Now register some handlers. -+foreach hspec {{\"Foo\" None} -+ {\"-bar\" None} -+ {\"baz-\" pspace} -+ {\"abc-def\" pspace}} { -+ lassign $hspec name locus -+ gdb_test "python register($name, $locus)" -+} -+ -+with_test_prefix "all handlers enabled" { -+ gdb_test "info missing-debug-handlers" \ -+ [multi_line \ -+ "Current Progspace:" \ -+ " abc-def" \ -+ " baz-" \ -+ "Global:" \ -+ " -bar" \ -+ " Foo"] -+ -+ gdb_file_cmd $binfile -+ gdb_test "python print(handler_call_log)" \ -+ [string_to_regexp {['abc-def', 'baz-', '-bar', 'Foo']}] -+ gdb_test_no_output "python handler_call_log = \[\]" \ -+ "reset call log" -+} -+ -+with_test_prefix "disable 'baz-'" { -+ gdb_test "disable missing-debug-handler progspace baz-" \ -+ "^1 missing debug handler disabled" -+ -+ gdb_test "info missing-debug-handlers" \ -+ [multi_line \ -+ "Progspace \[^\r\n\]+:" \ -+ " abc-def" \ -+ " baz- \\\[disabled\\\]" \ -+ "Global:" \ -+ " -bar" \ -+ " Foo"] -+ -+ gdb_file_cmd $binfile -+ gdb_test "python print(handler_call_log)" \ -+ [string_to_regexp {['abc-def', '-bar', 'Foo']}] -+ gdb_test_no_output "python handler_call_log = \[\]" \ -+ "reset call log" -+} -+ -+with_test_prefix "disable 'Foo'" { -+ gdb_test "disable missing-debug-handler .* Foo" \ -+ "^1 missing debug handler disabled" -+ -+ gdb_test "info missing-debug-handlers" \ -+ [multi_line \ -+ "Progspace \[^\r\n\]+:" \ -+ " abc-def" \ -+ " baz- \\\[disabled\\\]" \ -+ "Global:" \ -+ " -bar" \ -+ " Foo \\\[disabled\\\]"] -+ -+ gdb_file_cmd $binfile -+ gdb_test "python print(handler_call_log)" \ -+ [string_to_regexp {['abc-def', '-bar']}] -+ gdb_test_no_output "python handler_call_log = \[\]" \ -+ "reset call log" -+} -+ -+with_test_prefix "disable everything" { -+ gdb_test "disable missing-debug-handler .* .*" \ -+ "^2 missing debug handlers disabled" -+ -+ gdb_test "info missing-debug-handlers" \ -+ [multi_line \ -+ "Progspace \[^\r\n\]+:" \ -+ " abc-def \\\[disabled\\\]" \ -+ " baz- \\\[disabled\\\]" \ -+ "Global:" \ -+ " -bar \\\[disabled\\\]" \ -+ " Foo \\\[disabled\\\]"] -+ -+ gdb_file_cmd $binfile -+ gdb_test "python print(handler_call_log)" \ -+ [string_to_regexp {[]}] -+ gdb_test_no_output "python handler_call_log = \[\]" \ -+ "reset call log" -+} -+ -+with_test_prefix "enable 'abc-def'" { -+ set re [string_to_regexp $binfile] -+ -+ gdb_test "enable missing-debug-handler \"$re\" abc-def" \ -+ "^1 missing debug handler enabled" -+ -+ gdb_test "info missing-debug-handlers" \ -+ [multi_line \ -+ "Progspace \[^\r\n\]+:" \ -+ " abc-def" \ -+ " baz- \\\[disabled\\\]" \ -+ "Global:" \ -+ " -bar \\\[disabled\\\]" \ -+ " Foo \\\[disabled\\\]"] -+ -+ gdb_file_cmd $binfile -+ gdb_test "python print(handler_call_log)" \ -+ [string_to_regexp {['abc-def']}] -+ gdb_test_no_output "python handler_call_log = \[\]" \ -+ "reset call log" -+} -+ -+with_test_prefix "enable global handlers" { -+ set re [string_to_regexp $binfile] -+ -+ gdb_test "enable missing-debug-handler global" \ -+ "^2 missing debug handlers enabled" -+ -+ gdb_test "info missing-debug-handlers" \ -+ [multi_line \ -+ "Progspace \[^\r\n\]+:" \ -+ " abc-def" \ -+ " baz- \\\[disabled\\\]" \ -+ "Global:" \ -+ " -bar" \ -+ " Foo"] -+ -+ gdb_file_cmd $binfile -+ gdb_test "python print(handler_call_log)" \ -+ [string_to_regexp {['abc-def', '-bar', 'Foo']}] -+ gdb_test_no_output "python handler_call_log = \[\]" \ -+ "reset call log" -+} -+ -+# Add handler_obj to the global handler list, and configure it to -+# return False. We should call all of the program space specific -+# handlers (which return None), and then call handler_obj from the -+# global list, which returns False, at which point we shouldn't call -+# anyone else. -+with_test_prefix "return False handler in progspace list" { -+ gdb_test "enable missing-debug-handler progspace" \ -+ "^1 missing debug handler enabled" -+ -+ gdb_test_no_output \ -+ "python gdb.missing_debug.register_handler(None, handler_obj)" \ -+ "register the initial handler" -+ -+ gdb_test "info missing-debug-handlers" \ -+ [multi_line \ -+ "Progspace \[^\r\n\]+:" \ -+ " abc-def" \ -+ " baz-" \ -+ "Global:" \ -+ " handler" \ -+ " -bar" \ -+ " Foo"] -+ -+ gdb_test_no_output "python handler_obj.set_mode(Mode.RETURN_FALSE)" \ -+ "confirgure handler" -+ -+ gdb_file_cmd $binfile -+ gdb_test "python print(handler_call_log)" \ -+ [string_to_regexp {['abc-def', 'baz-', 'handler']}] -+ gdb_test_no_output "python handler_call_log = \[\]" \ -+ "reset call log" -+} -+ -+# Now add handler_obj to the current program space's handler list. We -+# use the same handler object here, that's fine. We should only see a -+# call to the first handler object in the call log. -+with_test_prefix "return False handler in global list" { -+ gdb_test_no_output \ -+ "python gdb.missing_debug.register_handler(pspace, handler_obj)" \ -+ "register the initial handler" -+ -+ gdb_test "info missing-debug-handlers" \ -+ [multi_line \ -+ "Progspace \[^\r\n\]+:" \ -+ " handler" \ -+ " abc-def" \ -+ " baz-" \ -+ "Global:" \ -+ " handler" \ -+ " -bar" \ -+ " Foo"] -+ -+ gdb_file_cmd $binfile -+ gdb_test "python print(handler_call_log)" \ -+ [string_to_regexp {['handler']}] -+ gdb_test_no_output "python handler_call_log = \[\]" \ -+ "reset call log" -+} -+ -+with_test_prefix "check handler replacement" { -+ # First, check we can have the same name appear in both program -+ # space and global lists without giving an error. -+ gdb_test_no_output "python register(\"Foo\", pspace)" -+ -+ gdb_test "info missing-debug-handlers" \ -+ [multi_line \ -+ "Progspace \[^\r\n\]+:" \ -+ " Foo" \ -+ " handler" \ -+ " abc-def" \ -+ " baz-" \ -+ "Global:" \ -+ " handler" \ -+ " -bar" \ -+ " Foo"] -+ -+ # Now check that we get an error if we try to add a handler with -+ # the same name. -+ gdb_test "python gdb.missing_debug.register_handler(pspace, log_handler(\"Foo\"))" \ -+ [multi_line \ -+ "RuntimeError: Handler Foo already exists\\." \ -+ "Error while executing Python code\\."] -+ -+ gdb_test "python gdb.missing_debug.register_handler(handler=log_handler(\"Foo\"), locus=pspace)" \ -+ [multi_line \ -+ "RuntimeError: Handler Foo already exists\\." \ -+ "Error while executing Python code\\."] -+ -+ # And now try again, but this time with 'replace=True', we -+ # shouldn't get an error in this case. -+ gdb_test_no_output \ -+ "python gdb.missing_debug.register_handler(pspace, log_handler(\"Foo\"), replace=True)" -+ -+ gdb_test_no_output \ -+ "python gdb.missing_debug.register_handler(handler=log_handler(\"Foo\"), locus=None, replace=True)" -+ -+ # Now disable a handler and check we still need to use 'replace=True'. -+ gdb_test "disable missing-debug-handler progspace Foo" \ -+ "^1 missing debug handler disabled" -+ -+ gdb_test "python gdb.missing_debug.register_handler(pspace, log_handler(\"Foo\"))" \ -+ [multi_line \ -+ "RuntimeError: Handler Foo already exists\\." \ -+ "Error while executing Python code\\."] \ -+ "still get an error when handler is disabled" -+ -+ gdb_test_no_output \ -+ "python gdb.missing_debug.register_handler(pspace, log_handler(\"Foo\"), replace=True)" \ -+ "can replace a disabled handler" -+} -diff --git a/gdb/testsuite/gdb.python/py-missing-debug.py b/gdb/testsuite/gdb.python/py-missing-debug.py -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.python/py-missing-debug.py -@@ -0,0 +1,120 @@ -+# Copyright (C) 2023 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+import gdb -+from gdb.missing_debug import MissingDebugHandler -+from enum import Enum -+import os -+ -+# A global log that is filled in by instances of the LOG_HANDLER class -+# when they are called. -+handler_call_log = [] -+ -+ -+class Mode(Enum): -+ RETURN_NONE = 0 -+ RETURN_TRUE = 1 -+ RETURN_FALSE = 2 -+ RETURN_STRING = 3 -+ -+ -+class handler(MissingDebugHandler): -+ def __init__(self): -+ super().__init__("handler") -+ self._call_count = 0 -+ self._mode = Mode.RETURN_NONE -+ -+ def __call__(self, objfile): -+ global handler_call_log -+ handler_call_log.append(self.name) -+ self._call_count += 1 -+ if self._mode == Mode.RETURN_NONE: -+ return None -+ -+ if self._mode == Mode.RETURN_TRUE: -+ os.rename(self._src, self._dest) -+ return True -+ -+ if self._mode == Mode.RETURN_FALSE: -+ return False -+ -+ if self._mode == Mode.RETURN_STRING: -+ return self._dest -+ -+ assert False -+ -+ @property -+ def call_count(self): -+ """Return a count, the number of calls to __call__ since the last -+ call to set_mode. -+ """ -+ return self._call_count -+ -+ def set_mode(self, mode, *args): -+ self._call_count = 0 -+ self._mode = mode -+ -+ if mode == Mode.RETURN_NONE: -+ assert len(args) == 0 -+ return -+ -+ if mode == Mode.RETURN_TRUE: -+ assert len(args) == 2 -+ self._src = args[0] -+ self._dest = args[1] -+ return -+ -+ if mode == Mode.RETURN_FALSE: -+ assert len(args) == 0 -+ return -+ -+ if mode == Mode.RETURN_STRING: -+ assert len(args) == 1 -+ self._dest = args[0] -+ return -+ -+ assert False -+ -+ -+class exception_handler(MissingDebugHandler): -+ def __init__(self): -+ super().__init__("exception_handler") -+ self.exception_type = None -+ -+ def __call__(self, objfile): -+ global handler_call_log -+ handler_call_log.append(self.name) -+ assert self.exception_type is not None -+ raise self.exception_type("message") -+ -+ -+class log_handler(MissingDebugHandler): -+ def __call__(self, objfile): -+ global handler_call_log -+ handler_call_log.append(self.name) -+ return None -+ -+ -+# A basic helper function, this keeps lines shorter in the TCL script. -+def register(name, locus=None): -+ gdb.missing_debug.register_handler(locus, log_handler(name)) -+ -+ -+# Create instances of the handlers, but don't install any. We install -+# these as needed from the TCL script. -+rhandler = exception_handler() -+handler_obj = handler() -+ -+print("Success") diff --git a/gdb-add-rpm-suggestion-script.patch b/gdb-add-rpm-suggestion-script.patch index 2ab3af4..0ef8f35 100644 --- a/gdb-add-rpm-suggestion-script.patch +++ b/gdb-add-rpm-suggestion-script.patch @@ -14,7 +14,7 @@ suggests debuginfo RPMs to install. diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in --- a/gdb/data-directory/Makefile.in +++ b/gdb/data-directory/Makefile.in -@@ -86,6 +86,7 @@ PYTHON_FILE_LIST = \ +@@ -89,6 +89,7 @@ PYTHON_FILE_LIST = \ gdb/command/missing_debug.py \ gdb/command/pretty_printers.py \ gdb/command/prompt.py \ @@ -164,9 +164,9 @@ new file mode 100644 diff --git a/gdb/testsuite/gdb.python/py-missing-debug.py b/gdb/testsuite/gdb.python/py-missing-debug.py --- a/gdb/testsuite/gdb.python/py-missing-debug.py +++ b/gdb/testsuite/gdb.python/py-missing-debug.py -@@ -18,6 +18,13 @@ from gdb.missing_debug import MissingDebugHandler - from enum import Enum - import os +@@ -19,6 +19,13 @@ from enum import Enum + import gdb + from gdb.missing_debug import MissingDebugHandler +# This is a RHEL/Fedora work around: There's already a +# missing-debug-info handler registered for these versions of GDB. diff --git a/gdb-arm-fix-epilogue-frame-id.patch b/gdb-arm-fix-epilogue-frame-id.patch deleted file mode 100644 index 8b9abe9..0000000 --- a/gdb-arm-fix-epilogue-frame-id.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 40b2857e42b477832ca7fc2771b6cde910e22f05 Mon Sep 17 00:00:00 2001 -From: Thiago Jung Bauermann -Date: Tue, 23 Jan 2024 14:11:33 -0300 -Subject: [PATCH 4/7] gdb/arm: Fix epilogue frame id - -arm_epilogue_frame_this_id has a comment saying that it fall backs to using -the current PC if the function start address can't be identified, but it -actually uses only the PC to make the frame id. - -This patch makes the code match the comment. Another hint that it's what -is intended is that arm_prologue_this_id, a function almost identical to -it, does that. - -The problem was found by code inspection. It fixes the following testsuite -failures: - -FAIL: gdb.base/unwind-on-each-insn.exp: foo: instruction 9: check frame-id matches -FAIL: gdb.reverse/solib-reverse.exp: reverse-next third shr1 -FAIL: gdb.reverse/solib-reverse.exp: reverse-next second shr1 -FAIL: gdb.reverse/solib-reverse.exp: reverse-next first shr1 -FAIL: gdb.reverse/solib-reverse.exp: reverse-next generic -FAIL: gdb.reverse/solib-reverse.exp: reverse-step into solib function one -FAIL: gdb.reverse/solib-reverse.exp: reverse-step within solib function one -FAIL: gdb.reverse/solib-reverse.exp: reverse-step into solib function two -FAIL: gdb.reverse/solib-reverse.exp: reverse-step within solib function two - -Tested on arm-linux-gnueabi-hf. ---- - gdb/arm-tdep.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c -index 3b1682a2aea..21dad198dc7 100644 ---- a/gdb/arm-tdep.c -+++ b/gdb/arm-tdep.c -@@ -3252,7 +3252,7 @@ arm_epilogue_frame_this_id (frame_info_ptr this_frame, - - arm_gdbarch_tdep *tdep - = gdbarch_tdep (get_frame_arch (this_frame)); -- *this_id = frame_id_build (arm_cache_get_prev_sp_value (cache, tdep), pc); -+ *this_id = frame_id_build (arm_cache_get_prev_sp_value (cache, tdep), func); - } - - /* Implementation of function hook 'prev_register' in --- -2.35.3 - diff --git a/gdb-arm-remove-thumb-bit-in-arm_adjust_breakpoint_ad.patch b/gdb-arm-remove-thumb-bit-in-arm_adjust_breakpoint_ad.patch deleted file mode 100644 index f6620c7..0000000 --- a/gdb-arm-remove-thumb-bit-in-arm_adjust_breakpoint_ad.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 51a5415b3313470cb62fda7ad6762fc1c41c8cbd Mon Sep 17 00:00:00 2001 -From: Simon Marchi -Date: Tue, 7 Nov 2023 11:11:18 -0500 -Subject: [PATCH] gdb/arm: remove thumb bit in arm_adjust_breakpoint_address - -When compiling gdb with -fsanitize=address on ARM, I get a crash in test -gdb.arch/arm-disp-step.exp, reproduced easily with: - - $ ./gdb -nx -q --data-directory=data-directory testsuite/outputs/gdb.arch/arm-disp-step/arm-disp-step -ex "break *test_call_end" - Reading symbols from testsuite/outputs/gdb.arch/arm-disp-step/arm-disp-step... - ================================================================= - ==23295==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xb4a14fd1 at pc 0x01a48871 bp 0xbeab8490 sp 0xbeab8494 - -Since it doesn't require running the program, it can be reproduced locally on a -dev machine other than ARM, after acquiring the test binary. - -The length of the allocate buffer `buf` is 1, and we try to extract an -integer of size 2 from it. The length of 1 comes from the subtraction -`bpaddr - boundary`. Normally, on ARM, all instructions are aligned on -a multiple of 2, so it's weird for this subtraction to result in 1. In -this case, boundary comes from the result of find_pc_partial_function -returning 0x549: - - (gdb) p/x bpaddr - $2 = 0x54a - (gdb) p/x boundary - $3 = 0x549 - (gdb) p/x bpaddr - boundary - $4 = 0x1 - -0x549 is the address of the test_call_subr label, 0x548, with the thumb -bit enabled. Before doing some math with the address, I think we need -to strip the thumb bit, like is done elsewhere (for instance for bpaddr -earlier in the same function). - -I wonder if find_pc_partial_function should do that itself, in order to -return an address that is suitable for arithmetic. In any case, that -would be a change with a broad impact, so for now just fix the issue -locally. - -After the patch: - - $ ./gdb -nx -q --data-directory=data-directory testsuite/outputs/gdb.arch/arm-disp-step/arm-disp-step -ex "break *test_call_end" - Reading symbols from testsuite/outputs/gdb.arch/arm-disp-step/arm-disp-step... - Breakpoint 1 at 0x54a: file /home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.arch/arm-disp-step.S, line 103. - -Change-Id: I74fc458dbea0d2c1e1f5eadd90755188df089288 -Approved-By: Luis Machado ---- - gdb/arm-tdep.c | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c -index 21dad198dc7..e61342f3ccb 100644 ---- a/gdb/arm-tdep.c -+++ b/gdb/arm-tdep.c -@@ -5340,9 +5340,12 @@ arm_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr) - - bpaddr = gdbarch_addr_bits_remove (gdbarch, bpaddr); - -- if (find_pc_partial_function (bpaddr, NULL, &func_start, NULL) -- && func_start > boundary) -- boundary = func_start; -+ if (find_pc_partial_function (bpaddr, NULL, &func_start, NULL)) -+ { -+ func_start = gdbarch_addr_bits_remove (gdbarch, func_start); -+ if (func_start > boundary) -+ boundary = func_start; -+ } - - /* Search for a candidate IT instruction. We have to do some fancy - footwork to distinguish a real IT instruction from the second - -base-commit: eafca1ce3d589c731927e5481199db715bcbeff3 --- -2.35.3 - diff --git a/gdb-arm-remove-tpidruro-register-from-non-freebsd-ta.patch b/gdb-arm-remove-tpidruro-register-from-non-freebsd-ta.patch deleted file mode 100644 index 554c88f..0000000 --- a/gdb-arm-remove-tpidruro-register-from-non-freebsd-ta.patch +++ /dev/null @@ -1,219 +0,0 @@ -From 7973eaf11e33ddd405830b9bd29495991db5901d Mon Sep 17 00:00:00 2001 -From: Thiago Jung Bauermann -Date: Mon, 26 Feb 2024 19:11:45 -0300 -Subject: [PATCH 2/7] gdb/arm: Remove tpidruro register from non-FreeBSD target - descriptions - -Commit 92d48a1e4eac ("Add an arm-tls feature which includes the tpidruro -register from CP15.") introduced the org.gnu.gdb.arm.tls feature, which -adds the tpidruro register, and unconditionally enabled it in -aarch32_create_target_description. - -In Linux, the tpidruro register isn't available via ptrace in the 32-bit -kernel but it is available for an aarch32 program running under an arm64 -kernel via the ptrace compat interface. This isn't currently implemented -however, which causes GDB on arm-linux with 64-bit kernel to list the -register but show it as unavailable, as reported by Tom de Vries: - - $ gdb -q -batch a.out -ex start -ex 'p $tpidruro' - Temporary breakpoint 1 at 0x512 - - Temporary breakpoint 1, 0xaaaaa512 in main () - $1 = - -Simon Marchi then clarified: - -> The only time we should be seeing some "unavailable" registers or memory -> is in the context of tracepoints, for things that are not collected. -> Seeing an unavailable register here is a sign that something is not -> right. - -Therefore, disable the TLS feature in aarch32 target descriptions for Linux -and NetBSD targets (the latter also doesn't seem to support accessing -tpidruro either, based on a quick look at arm-netbsd-nat.c). - -This patch fixes the following tests: - -Running gdb.base/inline-frame-cycle-unwind.exp ... -FAIL: gdb.base/inline-frame-cycle-unwind.exp: cycle at level 3: backtrace when the unwind is broken at frame 3 -FAIL: gdb.base/inline-frame-cycle-unwind.exp: cycle at level 5: backtrace when the unwind is broken at frame 5 -FAIL: gdb.base/inline-frame-cycle-unwind.exp: cycle at level 1: backtrace when the unwind is broken at frame 1 - -Tested with Ubuntu 22.04.3 on armv8l-linux-gnueabihf in native, -native-gdbserver and native-extended-gdbserver targets with no regressions. - -PR tdep/31418 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31418 - -Approved-By: John Baldwin ---- - gdb/aarch32-tdep.c | 15 ++++++++++----- - gdb/aarch32-tdep.h | 2 +- - gdb/aarch64-linux-nat.c | 2 +- - gdb/arch/aarch32.c | 5 +++-- - gdb/arch/aarch32.h | 2 +- - gdb/arm-fbsd-tdep.c | 2 +- - gdb/arm-linux-nat.c | 2 +- - gdb/arm-linux-tdep.c | 2 +- - gdb/arm-netbsd-nat.c | 2 +- - gdbserver/linux-aarch32-tdesc.cc | 2 +- - 10 files changed, 21 insertions(+), 15 deletions(-) - -diff --git a/gdb/aarch32-tdep.c b/gdb/aarch32-tdep.c -index bfa88a96522..395328936e4 100644 ---- a/gdb/aarch32-tdep.c -+++ b/gdb/aarch32-tdep.c -@@ -22,15 +22,20 @@ - #include "gdbsupport/common-regcache.h" - #include "arch/aarch32.h" - --static struct target_desc *tdesc_aarch32; -+static struct target_desc *tdesc_aarch32_list[2]; - - /* See aarch32-tdep.h. */ - - const target_desc * --aarch32_read_description () -+aarch32_read_description (bool tls) - { -- if (tdesc_aarch32 == nullptr) -- tdesc_aarch32 = aarch32_create_target_description (); -+ struct target_desc *tdesc = tdesc_aarch32_list[tls]; - -- return tdesc_aarch32; -+ if (tdesc == nullptr) -+ { -+ tdesc = aarch32_create_target_description (tls); -+ tdesc_aarch32_list[tls] = tdesc; -+ } -+ -+ return tdesc; - } -diff --git a/gdb/aarch32-tdep.h b/gdb/aarch32-tdep.h -index bee4d4e9fc0..efc93351298 100644 ---- a/gdb/aarch32-tdep.h -+++ b/gdb/aarch32-tdep.h -@@ -22,6 +22,6 @@ struct target_desc; - - /* Get the AArch32 target description. */ - --const target_desc *aarch32_read_description (); -+const target_desc *aarch32_read_description (bool tls); - - #endif /* aarch32-tdep.h. */ -diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c -index 768748a20db..c680d6de0c9 100644 ---- a/gdb/aarch64-linux-nat.c -+++ b/gdb/aarch64-linux-nat.c -@@ -887,7 +887,7 @@ aarch64_linux_nat_target::read_description () - - ret = ptrace (PTRACE_GETREGSET, tid, NT_ARM_VFP, &iovec); - if (ret == 0) -- return aarch32_read_description (); -+ return aarch32_read_description (false); - - CORE_ADDR hwcap = linux_get_hwcap (); - CORE_ADDR hwcap2 = linux_get_hwcap2 (); -diff --git a/gdb/arch/aarch32.c b/gdb/arch/aarch32.c -index 5be2cc0156e..b7510ee41e9 100644 ---- a/gdb/arch/aarch32.c -+++ b/gdb/arch/aarch32.c -@@ -25,7 +25,7 @@ - /* See aarch32.h. */ - - target_desc * --aarch32_create_target_description () -+aarch32_create_target_description (bool tls) - { - target_desc_up tdesc = allocate_target_description (); - -@@ -39,7 +39,8 @@ aarch32_create_target_description () - /* Create a vfpv3 feature, then a blank NEON feature. */ - regnum = create_feature_arm_arm_vfpv3 (tdesc.get (), regnum); - tdesc_create_feature (tdesc.get (), "org.gnu.gdb.arm.neon"); -- regnum = create_feature_arm_arm_tls (tdesc.get (), regnum); -+ if (tls) -+ regnum = create_feature_arm_arm_tls (tdesc.get (), regnum); - - return tdesc.release (); - } -diff --git a/gdb/arch/aarch32.h b/gdb/arch/aarch32.h -index 6b24ae94335..e06e260e370 100644 ---- a/gdb/arch/aarch32.h -+++ b/gdb/arch/aarch32.h -@@ -22,6 +22,6 @@ - - /* Create the AArch32 target description. */ - --target_desc *aarch32_create_target_description (); -+target_desc *aarch32_create_target_description (bool tls); - - #endif /* aarch32.h. */ -diff --git a/gdb/arm-fbsd-tdep.c b/gdb/arm-fbsd-tdep.c -index b46fa91d0a0..a4cea77f388 100644 ---- a/gdb/arm-fbsd-tdep.c -+++ b/gdb/arm-fbsd-tdep.c -@@ -228,7 +228,7 @@ arm_fbsd_read_description_auxv (const gdb::optional &auxv, - if (arm_hwcap & HWCAP_VFP) - { - if (arm_hwcap & HWCAP_NEON) -- return aarch32_read_description (); -+ return aarch32_read_description (tls); - else if ((arm_hwcap & (HWCAP_VFPv3 | HWCAP_VFPD32)) - == (HWCAP_VFPv3 | HWCAP_VFPD32)) - return arm_read_description (ARM_FP_TYPE_VFPV3, tls); -diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c -index 70c6bc684fa..07af23d3881 100644 ---- a/gdb/arm-linux-nat.c -+++ b/gdb/arm-linux-nat.c -@@ -568,7 +568,7 @@ arm_linux_nat_target::read_description () - /* NEON implies VFPv3-D32 or no-VFP unit. Say that we only support - Neon with VFPv3-D32. */ - if (arm_hwcap & HWCAP_NEON) -- return aarch32_read_description (); -+ return aarch32_read_description (false); - else if ((arm_hwcap & (HWCAP_VFPv3 | HWCAP_VFPv3D16)) == HWCAP_VFPv3) - return arm_read_description (ARM_FP_TYPE_VFPV3, false); - -diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c -index dfa816990ff..33748731cfd 100644 ---- a/gdb/arm-linux-tdep.c -+++ b/gdb/arm-linux-tdep.c -@@ -740,7 +740,7 @@ arm_linux_core_read_description (struct gdbarch *gdbarch, - /* NEON implies VFPv3-D32 or no-VFP unit. Say that we only support - Neon with VFPv3-D32. */ - if (arm_hwcap & HWCAP_NEON) -- return aarch32_read_description (); -+ return aarch32_read_description (false); - else if ((arm_hwcap & (HWCAP_VFPv3 | HWCAP_VFPv3D16)) == HWCAP_VFPv3) - return arm_read_description (ARM_FP_TYPE_VFPV3, false); - -diff --git a/gdb/arm-netbsd-nat.c b/gdb/arm-netbsd-nat.c -index d83714a46c3..018964b010d 100644 ---- a/gdb/arm-netbsd-nat.c -+++ b/gdb/arm-netbsd-nat.c -@@ -350,7 +350,7 @@ arm_netbsd_nat_target::read_description () - - len = sizeof(flag); - if (sysctlbyname("machdep.neon_present", &flag, &len, NULL, 0) == 0 && flag) -- return aarch32_read_description (); -+ return aarch32_read_description (false); - - return arm_read_description (ARM_FP_TYPE_VFPV3, false); - } -diff --git a/gdbserver/linux-aarch32-tdesc.cc b/gdbserver/linux-aarch32-tdesc.cc -index e1380fa2a40..443f91e3585 100644 ---- a/gdbserver/linux-aarch32-tdesc.cc -+++ b/gdbserver/linux-aarch32-tdesc.cc -@@ -32,7 +32,7 @@ aarch32_linux_read_description () - { - if (tdesc_aarch32 == nullptr) - { -- tdesc_aarch32 = aarch32_create_target_description (); -+ tdesc_aarch32 = aarch32_create_target_description (false); - - static const char *expedite_regs[] = { "r11", "sp", "pc", 0 }; - init_target_desc (tdesc_aarch32, expedite_regs); --- -2.35.3 - diff --git a/gdb-build-fix-gdbserver-linux-aarch64-low.cc-build.patch b/gdb-build-fix-gdbserver-linux-aarch64-low.cc-build.patch deleted file mode 100644 index 8edcbe7..0000000 --- a/gdb-build-fix-gdbserver-linux-aarch64-low.cc-build.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 0397481ff25b76d43b123f3d51828982ceb92834 Mon Sep 17 00:00:00 2001 -From: Mark Wielaard -Date: Fri, 3 May 2024 15:17:42 +0200 -Subject: [PATCH] [gdb/build] Fix gdbserver/linux-aarch64-low.cc build - -Commit 0ee25f97d21e ("Fix regression on aarch64-linux gdbserver") -removed the last use of i in gdbserver/linux-aarch64-low.cc -(aarch64_target::low_stopped_data_address). Breaking the build on -aarch64 with: - -gdbserver/linux-aarch64-low.cc: In member function ?virtual CORE_ADDR aarch64_target::low_stopped_data_address()?: -gdbserver/linux-aarch64-low.cc:557:12: error: unused variable ?i? [-Werror=unused-variable] - 557 | int pid, i; - | ^ -cc1plus: all warnings being treated as errors - -Fix this by removing the variable i completely. - -Fixes: 0ee25f97d21e ("Fix regression on aarch64-linux gdbserver") ---- - gdbserver/linux-aarch64-low.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc -index 14346b89822..ce0029b885f 100644 ---- a/gdbserver/linux-aarch64-low.cc -+++ b/gdbserver/linux-aarch64-low.cc -@@ -555,7 +555,7 @@ CORE_ADDR - aarch64_target::low_stopped_data_address () - { - siginfo_t siginfo; -- int pid, i; -+ int pid; - struct aarch64_debug_reg_state *state; - - pid = lwpid_of (current_thread); - -base-commit: b33811a85ff53af77cdad995ad8cb50431c8c362 --- -2.35.3 - diff --git a/gdb-do-not-import-py-curses-ascii-module.patch b/gdb-do-not-import-py-curses-ascii-module.patch deleted file mode 100644 index bbfbae9..0000000 --- a/gdb-do-not-import-py-curses-ascii-module.patch +++ /dev/null @@ -1,64 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Wed, 22 Nov 2023 19:02:34 +0100 -Subject: gdb-do-not-import-py-curses-ascii-module.patch - -;; Backport upstream commit e8c3dafa5f5. - -[gdb/python] Don't import curses.ascii module unless necessary - -I ran into a failure in test-case gdb.python/py-missing-debug.exp with python -3.6, which was fixed by commit 7db795bc67a ("gdb/python: remove use of -str.isascii()"). - -However, I subsequently ran into a failure with python 3.11: -... -(gdb) PASS: $exp: initial checks: debug info no longer found -source py-missing-debug.py^M -Traceback (most recent call last):^M - File "py-missing-debug.py", line 17, in ^M - from gdb.missing_debug import MissingDebugHandler^M - File "missing_debug.py", line 21, in ^M - from curses.ascii import isascii, isalnum^M - File "/usr/lib64/python3.11/_import_failed/curses.py", line 16, in ^M - raise ImportError(f"""Module '{failed_name}' is not installed.^M -ImportError: Module 'curses' is not installed.^M -Use:^M - sudo zypper install python311-curses^M -to install it.^M -(gdb) FAIL: $exp: source python script -... - -Apparently I have the curses module installed for 3.6, but not 3.11. - -I could just install it, but the test-case worked fine with 3.11 before commit -7db795bc67a. - -Fix this by only using the curses module when necessary, for python <= 3.7. - -Tested on x86_64-linux, with both python 3.6 and 3.11. - -diff --git a/gdb/python/lib/gdb/missing_debug.py b/gdb/python/lib/gdb/missing_debug.py ---- a/gdb/python/lib/gdb/missing_debug.py -+++ b/gdb/python/lib/gdb/missing_debug.py -@@ -18,8 +18,18 @@ MissingDebugHandler base class, and register_handler function. - """ - - import gdb --from curses.ascii import isascii, isalnum -- -+import sys -+if sys.version_info >= (3, 7): -+ # Functions str.isascii() and str.isalnum are available starting Python -+ # 3.7. -+ def isascii(ch): -+ return ch.isascii() -+ def isalnum(ch): -+ return ch.isalnum() -+else: -+ # Fall back to curses.ascii.isascii() and curses.ascii.isalnum() for -+ # earlier versions. -+ from curses.ascii import isascii, isalnum - - def _validate_name(name): - """Validate a missing debug handler name string. diff --git a/gdb-doc-fix-gdb.unwinder-docs.patch b/gdb-doc-fix-gdb.unwinder-docs.patch new file mode 100644 index 0000000..b0f878e --- /dev/null +++ b/gdb-doc-fix-gdb.unwinder-docs.patch @@ -0,0 +1,61 @@ +From b57066d1eaafab3100a8d7d788feba5802c409b7 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 27 Jan 2025 10:33:28 +0100 +Subject: [PATCH] [gdb/doc] Fix gdb.unwinder docs + +When building gdb with an older makeinfo (4.13), I run into: +... +gdb/doc/python.texi:3015: warning: `(' follows defined name \ + `gdb.unwinder.Unwinder.__init__' instead of whitespace. +gdb/doc/python.texi:3041: warning: `(' follows defined name \ + `gdb.unwinder.FrameId.__init__' instead of whitespace. +... + +The warnings are related to these two lines: +... +@defun gdb.unwinder.Unwinder.__init__(name) + ... +@defun gdb.unwinder.FrameId.__init__(sp, pc, special = @code{None}) +... + +Indeed, when checking the command and variable index, we can see that it +contains an incorrect entry: +... + gdb.unwinder.FrameId.__init__(sp,: Unwinding Frames in Python +... + +Fix this by adding a space before the left parenthesis. + +Tested by rebuilding the documentation and checking the command and variable +index. +--- + gdb/doc/python.texi | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi +index e49cc580b1b..58904298c71 100644 +--- a/gdb/doc/python.texi ++++ b/gdb/doc/python.texi +@@ -3011,7 +3011,7 @@ unwinders can derive, though it is not required that unwinders derive + from this class, so long as any user created unwinder has the required + @code{name} and @code{enabled} attributes. + +-@defun gdb.unwinder.Unwinder.__init__(name) ++@defun gdb.unwinder.Unwinder.__init__ (name) + The @var{name} is a string used to reference this unwinder within some + @value{GDBN} commands (@pxref{Managing Registered Unwinders}). + @end defun +@@ -3037,7 +3037,7 @@ most cases this class will be sufficient. + + @code{gdb.unwinder.FrameId} has the following method: + +-@defun gdb.unwinder.FrameId.__init__(sp, pc, special = @code{None}) ++@defun gdb.unwinder.FrameId.__init__ (sp, pc, special = @code{None}) + The @var{sp} and @var{pc} arguments are required and should be either + a @code{gdb.Value} object, or an integer. + + +base-commit: fe0e6edbcb65ab5eca50c1a0ad8ddc9844f8ea98 +-- +2.43.0 + diff --git a/gdb-doc-fix-qisaddresstagged-anchor.patch b/gdb-doc-fix-qisaddresstagged-anchor.patch new file mode 100644 index 0000000..e97af24 --- /dev/null +++ b/gdb-doc-fix-qisaddresstagged-anchor.patch @@ -0,0 +1,41 @@ +From c23182d85ad9b5b6a45ba74993de55eac00a71bc Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 27 Jan 2025 11:22:12 +0100 +Subject: [PATCH] [gdb/doc] Fix qIsAddressTagged anchor + +When building gdb with an older makeinfo (4.13), I run into: +... +gdb/doc/gdb.texinfo:44159: @anchor expected braces. +gdb/doc/gdb.texinfo:44159: ` {qIsAddressTagged} +... + +This is related to this line: +... +@anchor {qIsAddressTagged} +... + +Fix this by removing the space before the left brace. + +Tested by rebuilding the documentation. +--- + gdb/doc/gdb.texinfo | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo +index 6b08838862c..97508863776 100644 +--- a/gdb/doc/gdb.texinfo ++++ b/gdb/doc/gdb.texinfo +@@ -44156,7 +44156,7 @@ tags found in the requested memory range. + @cindex check if a given address is in a memory tagged region + @cindex @samp{qIsAddressTagged} packet + @item qIsAddressTagged:@var{address} +-@anchor {qIsAddressTagged} ++@anchor{qIsAddressTagged} + Check if address @var{address} is in a memory tagged region; if it is, it's + said to be @dfn{tagged}. The target is responsible for checking it, as this + is architecture-specific. + +base-commit: 3e2d8d7edd244dd5a82588c3e7145c47c7b539ab +-- +2.43.0 + diff --git a/gdb-doc-fix-standard-replies-xref.patch b/gdb-doc-fix-standard-replies-xref.patch new file mode 100644 index 0000000..39e16df --- /dev/null +++ b/gdb-doc-fix-standard-replies-xref.patch @@ -0,0 +1,44 @@ +From 2004e74e0e28ed0b762d98380972b1e6984b9c46 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 28 Jan 2025 08:01:46 +0100 +Subject: [PATCH] [gdb/doc] Fix "Standard Replies" xref + +When building gdb with an older makeinfo (4.13), I run into: +... +gdb/doc/gdb.texinfo:42613: warning: `.' or `,' must follow @xref, not `f'. +... + +This is related to this line: +... +@xref{Standard Replies} for standard error responses, and how to +respond indicating a command is not supported. +... + +Fix this by adding a comma. + +Tested by rebuilding the docs. + +Reviewed-By: Eli Zaretskii +Co-Authored-By: Eli Zaretskii +--- + gdb/doc/gdb.texinfo | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo +index e5d562c00b4..0bfe6be6126 100644 +--- a/gdb/doc/gdb.texinfo ++++ b/gdb/doc/gdb.texinfo +@@ -42610,7 +42610,7 @@ seven repeats (@samp{$}) can be expanded using a repeat count of only + five (@samp{"}). For example, @samp{00000000} can be encoded as + @samp{0*"00}. + +-@xref{Standard Replies} for standard error responses, and how to ++@xref{Standard Replies}, for standard error responses, and how to + respond indicating a command is not supported. + + In describing packets (commands and responses), each description has a + +base-commit: 7992b582e5a55bf2fd64f2f94b854d335c36c6a5 +-- +2.43.0 + diff --git a/gdb-exp-fix-cast-handling-for-indirection.patch b/gdb-exp-fix-cast-handling-for-indirection.patch deleted file mode 100644 index e174e2d..0000000 --- a/gdb-exp-fix-cast-handling-for-indirection.patch +++ /dev/null @@ -1,150 +0,0 @@ -From b96d3adafdb636898913710ec40ee86647665ae8 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Fri, 3 May 2024 09:37:19 +0200 -Subject: [PATCH 24/48] [gdb/exp] Fix cast handling for indirection - -Consider a test-case compiled without debug info, containing: -... -char a = 'a'; - -char * -a_loc (void) -{ - return &a; -} -... - -We get: -... -(gdb) p (char)*a_loc () -Cannot access memory at address 0x10 -... - -There's a bug in unop_ind_base_operation::evaluate that evaluates -"(char)*a_loc ()" the same as: -... -(gdb) p (char)*(char)a_loc () -Cannot access memory at address 0x10 -... - -Fix this by instead doing: -... -(gdb) p (char)*a_loc () -'a_loc' has unknown return type; cast the call to its declared return type -... - -Tested on x86_64-linux. - -PR exp/31693 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31693 ---- - gdb/expop.h | 5 +-- - gdb/testsuite/gdb.base/cast-indirection.c | 31 ++++++++++++++++ - gdb/testsuite/gdb.base/cast-indirection.exp | 41 +++++++++++++++++++++ - 3 files changed, 74 insertions(+), 3 deletions(-) - create mode 100644 gdb/testsuite/gdb.base/cast-indirection.c - create mode 100644 gdb/testsuite/gdb.base/cast-indirection.exp - -diff --git a/gdb/expop.h b/gdb/expop.h -index 25769d5b810..25d50fe00d0 100644 ---- a/gdb/expop.h -+++ b/gdb/expop.h -@@ -1513,9 +1513,8 @@ class unop_ind_base_operation - struct expression *exp, - enum noside noside) override - { -- if (expect_type != nullptr && expect_type->code () == TYPE_CODE_PTR) -- expect_type = check_typedef (expect_type)->target_type (); -- value *val = std::get<0> (m_storage)->evaluate (expect_type, exp, noside); -+ value *val -+ = std::get<0> (m_storage)->evaluate (nullptr, exp, noside); - return eval_op_ind (expect_type, exp, noside, val); - } - -diff --git a/gdb/testsuite/gdb.base/cast-indirection.c b/gdb/testsuite/gdb.base/cast-indirection.c -new file mode 100644 -index 00000000000..d59c66ead35 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/cast-indirection.c -@@ -0,0 +1,31 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2024 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+char a = 'a'; -+ -+char * -+a_loc (void) -+{ -+ return &a; -+} -+ -+int -+main (void) -+{ -+ int res = *a_loc () == 'a'; -+ return !res; -+} -diff --git a/gdb/testsuite/gdb.base/cast-indirection.exp b/gdb/testsuite/gdb.base/cast-indirection.exp -new file mode 100644 -index 00000000000..f1fe4302d27 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/cast-indirection.exp -@@ -0,0 +1,41 @@ -+# Copyright (C) 2024 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# Check that "p (char)*a_loc ()" is handled as "p (char)*(char *)a_loc ()". -+ -+standard_testfile -+ -+if { [prepare_for_testing "failed to prepare" $testfile $srcfile \ -+ {nodebug}] == -1} { -+ return -1 -+} -+ -+if ![runto_main] { -+ return -1 -+} -+ -+gdb_test "p a_loc ()" \ -+ "'a_loc' has unknown return type; cast the call to its declared return type" -+ -+gdb_test "p *a_loc ()" \ -+ "'a_loc' has unknown return type; cast the call to its declared return type" -+ -+gdb_test "p *(char *)a_loc ()" " = 97 'a'" -+ -+gdb_test "p (char)*(char *)a_loc ()" " = 97 'a'" -+ -+# Regression test for PR31693. -+gdb_test "p (char)*a_loc ()" \ -+ "'a_loc' has unknown return type; cast the call to its declared return type" --- -2.35.3 - diff --git a/gdb-exp-fix-printing-of-out-of-bounds-struct-members.patch b/gdb-exp-fix-printing-of-out-of-bounds-struct-members.patch deleted file mode 100644 index d036c43..0000000 --- a/gdb-exp-fix-printing-of-out-of-bounds-struct-members.patch +++ /dev/null @@ -1,365 +0,0 @@ -From 86e379aa22ba5e77ba0c6fa26588c5fd1d9e6abe Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Mon, 19 Feb 2024 09:59:15 +0100 -Subject: [PATCH 13/48] [gdb/exp] Fix printing of out of bounds struct members - -When building gdb with -O0 -fsanitize=address, and running test-case -gdb.ada/uninitialized_vars.exp, I run into: -... -(gdb) info locals -a = 0 -z = (a => 1, b => false, c => 2.0) -================================================================= -==66372==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000097f58 at pc 0xffff52c0da1c bp 0xffffc90a1d40 sp 0xffffc90a1d80 -READ of size 4 at 0x602000097f58 thread T0 - #0 0xffff52c0da18 in memmove (/lib64/libasan.so.8+0x6da18) - #1 0xbcab24 in unsigned char* std::__copy_move_backward::__copy_move_b(unsigned char const*, unsigned char const*, unsigned char*) /usr/include/c++/13/bits/stl_algobase.h:748 - #2 0xbc9bf4 in unsigned char* std::__copy_move_backward_a2(unsigned char const*, unsigned char const*, unsigned char*) /usr/include/c++/13/bits/stl_algobase.h:769 - #3 0xbc898c in unsigned char* std::__copy_move_backward_a1(unsigned char const*, unsigned char const*, unsigned char*) /usr/include/c++/13/bits/stl_algobase.h:778 - #4 0xbc715c in unsigned char* std::__copy_move_backward_a(unsigned char const*, unsigned char const*, unsigned char*) /usr/include/c++/13/bits/stl_algobase.h:807 - #5 0xbc4e6c in unsigned char* std::copy_backward(unsigned char const*, unsigned char const*, unsigned char*) /usr/include/c++/13/bits/stl_algobase.h:867 - #6 0xbc2934 in void gdb::copy(gdb::array_view, gdb::array_view) gdb/../gdbsupport/array-view.h:223 - #7 0x20e0100 in value::contents_copy_raw(value*, long, long, long) gdb/value.c:1239 - #8 0x20e9830 in value::primitive_field(long, int, type*) gdb/value.c:3078 - #9 0x20e98f8 in value_field(value*, int) gdb/value.c:3095 - #10 0xcafd64 in print_field_values gdb/ada-valprint.c:658 - #11 0xcb0fa0 in ada_val_print_struct_union gdb/ada-valprint.c:857 - #12 0xcb1bb4 in ada_value_print_inner(value*, ui_file*, int, value_print_options const*) gdb/ada-valprint.c:1042 - #13 0xc66e04 in ada_language::value_print_inner(value*, ui_file*, int, value_print_options const*) const (/home/vries/gdb/build/gdb/gdb+0xc66e04) - #14 0x20ca1e8 in common_val_print(value*, ui_file*, int, value_print_options const*, language_defn const*) gdb/valprint.c:1092 - #15 0x20caabc in common_val_print_checked(value*, ui_file*, int, value_print_options const*, language_defn const*) gdb/valprint.c:1184 - #16 0x196c524 in print_variable_and_value(char const*, symbol*, frame_info_ptr, ui_file*, int) gdb/printcmd.c:2355 - #17 0x1d99ca0 in print_variable_and_value_data::operator()(char const*, symbol*) gdb/stack.c:2308 - #18 0x1dabca0 in gdb::function_view::bind(print_variable_and_value_data&)::{lambda(gdb::fv_detail::erased_callable, char const*, symbol*)#1}::operator()(gdb::fv_detail::erased_callable, char const*, symbol*) const gdb/../gdbsupport/function-view.h:305 - #19 0x1dabd14 in gdb::function_view::bind(print_variable_and_value_data&)::{lambda(gdb::fv_detail::erased_callable, char const*, symbol*)#1}::_FUN(gdb::fv_detail::erased_callable, char const*, symbol*) gdb/../gdbsupport/function-view.h:299 - #20 0x1dab34c in gdb::function_view::operator()(char const*, symbol*) const gdb/../gdbsupport/function-view.h:289 - #21 0x1d9963c in iterate_over_block_locals gdb/stack.c:2240 - #22 0x1d99790 in iterate_over_block_local_vars(block const*, gdb::function_view) gdb/stack.c:2259 - #23 0x1d9a598 in print_frame_local_vars gdb/stack.c:2380 - #24 0x1d9afac in info_locals_command(char const*, int) gdb/stack.c:2458 - #25 0xfd7b30 in do_simple_func gdb/cli/cli-decode.c:95 - #26 0xfe5a2c in cmd_func(cmd_list_element*, char const*, int) gdb/cli/cli-decode.c:2735 - #27 0x1f03790 in execute_command(char const*, int) gdb/top.c:575 - #28 0x1384080 in command_handler(char const*) gdb/event-top.c:566 - #29 0x1384e2c in command_line_handler(std::unique_ptr >&&) gdb/event-top.c:802 - #30 0x1f731e4 in tui_command_line_handler gdb/tui/tui-interp.c:104 - #31 0x1382a58 in gdb_rl_callback_handler gdb/event-top.c:259 - #32 0x21dbb80 in rl_callback_read_char readline/readline/callback.c:290 - #33 0x1382510 in gdb_rl_callback_read_char_wrapper_noexcept gdb/event-top.c:195 - #34 0x138277c in gdb_rl_callback_read_char_wrapper gdb/event-top.c:234 - #35 0x1fe9b40 in stdin_event_handler gdb/ui.c:155 - #36 0x35ff1bc in handle_file_event gdbsupport/event-loop.cc:573 - #37 0x35ff9d8 in gdb_wait_for_event gdbsupport/event-loop.cc:694 - #38 0x35fd284 in gdb_do_one_event(int) gdbsupport/event-loop.cc:264 - #39 0x1768080 in start_event_loop gdb/main.c:408 - #40 0x17684c4 in captured_command_loop gdb/main.c:472 - #41 0x176cfc8 in captured_main gdb/main.c:1342 - #42 0x176d088 in gdb_main(captured_main_args*) gdb/main.c:1361 - #43 0xb73edc in main gdb/gdb.c:39 - #44 0xffff519b09d8 in __libc_start_call_main (/lib64/libc.so.6+0x309d8) - #45 0xffff519b0aac in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x30aac) - #46 0xb73c2c in _start (/home/vries/gdb/build/gdb/gdb+0xb73c2c) - -0x602000097f58 is located 0 bytes after 8-byte region [0x602000097f50,0x602000097f58) -allocated by thread T0 here: - #0 0xffff52c65218 in calloc (/lib64/libasan.so.8+0xc5218) - #1 0xcbc278 in xcalloc gdb/alloc.c:97 - #2 0x35f21e8 in xzalloc(unsigned long) gdbsupport/common-utils.cc:29 - #3 0x20de270 in value::allocate_contents(bool) gdb/value.c:937 - #4 0x20edc08 in value::fetch_lazy() gdb/value.c:4033 - #5 0x20dadc0 in value::entirely_covered_by_range_vector(std::vector > const&) gdb/value.c:229 - #6 0xcb2298 in value::entirely_optimized_out() gdb/value.h:560 - #7 0x20ca6fc in value_check_printable gdb/valprint.c:1133 - #8 0x20caa8c in common_val_print_checked(value*, ui_file*, int, value_print_options const*, language_defn const*) gdb/valprint.c:1182 - #9 0x196c524 in print_variable_and_value(char const*, symbol*, frame_info_ptr, ui_file*, int) gdb/printcmd.c:2355 - #10 0x1d99ca0 in print_variable_and_value_data::operator()(char const*, symbol*) gdb/stack.c:2308 - #11 0x1dabca0 in gdb::function_view::bind(print_variable_and_value_data&)::{lambda(gdb::fv_detail::erased_callable, char const*, symbol*)#1}::operator()(gdb::fv_detail::erased_callable, char const*, symbol*) const gdb/../gdbsupport/function-view.h:305 - #12 0x1dabd14 in gdb::function_view::bind(print_variable_and_value_data&)::{lambda(gdb::fv_detail::erased_callable, char const*, symbol*)#1}::_FUN(gdb::fv_detail::erased_callable, char const*, symbol*) gdb/../gdbsupport/function-view.h:299 - #13 0x1dab34c in gdb::function_view::operator()(char const*, symbol*) const gdb/../gdbsupport/function-view.h:289 - #14 0x1d9963c in iterate_over_block_locals gdb/stack.c:2240 - #15 0x1d99790 in iterate_over_block_local_vars(block const*, gdb::function_view) gdb/stack.c:2259 - #16 0x1d9a598 in print_frame_local_vars gdb/stack.c:2380 - #17 0x1d9afac in info_locals_command(char const*, int) gdb/stack.c:2458 - #18 0xfd7b30 in do_simple_func gdb/cli/cli-decode.c:95 - #19 0xfe5a2c in cmd_func(cmd_list_element*, char const*, int) gdb/cli/cli-decode.c:2735 - #20 0x1f03790 in execute_command(char const*, int) gdb/top.c:575 - #21 0x1384080 in command_handler(char const*) gdb/event-top.c:566 - #22 0x1384e2c in command_line_handler(std::unique_ptr >&&) gdb/event-top.c:802 - #23 0x1f731e4 in tui_command_line_handler gdb/tui/tui-interp.c:104 - #24 0x1382a58 in gdb_rl_callback_handler gdb/event-top.c:259 - #25 0x21dbb80 in rl_callback_read_char readline/readline/callback.c:290 - #26 0x1382510 in gdb_rl_callback_read_char_wrapper_noexcept gdb/event-top.c:195 - #27 0x138277c in gdb_rl_callback_read_char_wrapper gdb/event-top.c:234 - #28 0x1fe9b40 in stdin_event_handler gdb/ui.c:155 - #29 0x35ff1bc in handle_file_event gdbsupport/event-loop.cc:573 - -SUMMARY: AddressSanitizer: heap-buffer-overflow (/lib64/libasan.so.8+0x6da18) in memmove -... - -The error happens when trying to print either variable y or y2: -... - type Variable_Record (A : Boolean := True) is record - case A is - when True => - B : Integer; - when False => - C : Float; - D : Integer; - end case; - end record; - Y : Variable_Record := (A => True, B => 1); - Y2 : Variable_Record := (A => False, C => 1.0, D => 2); -... -when the variables are uninitialized. - -The error happens only when printing the entire variable: -... -(gdb) p y.a -$2 = 216 -(gdb) p y.b -There is no member named b. -(gdb) p y.c -$3 = 9.18340949e-41 -(gdb) p y.d -$4 = 1 -(gdb) p y - -... - -The error happens as follows: -- field a functions as discriminant, choosing either the b, or c+d variant. -- when y.a happens to be set to 216, as above, gdb interprets this as the - variable having the c+d variant (which is why trying to print y.b fails). -- when printing y, gdb allocates a value, copies the bytes into it from the - target, and then prints the value. -- gdb allocates the value using the type size, which is 8. It's 8 because - that's what the DW_AT_byte_size indicates. Note that for valid values of a, - it gives correct results: if a is 0 (c+d variant), size is 12, if a is 1 - (b variant), size is 8. -- gdb tries to print field d, which is at an 8 byte offset, and that results - in a out-of-bounds access for the allocated 8-byte value. - -Fix this by handling this case in value::contents_copy_raw, such that we have: -... -(gdb) p y -$1 = (a => 24, c => 9.18340949e-41, - d => ) -... - -An alternative (additional) fix could be this: in compute_variant_fields_inner -gdb reads the discriminant y.a to decide which variant is active. It would be -nice to detect that the value (y.a == 24) is not a valid Boolean, and give up -on choosing a variant altoghether. However, the situation regarding the -internal type CODE_TYPE_BOOL is currently ambiguous (see PR31282) and it's not -possible to reliably decide what valid values are. - -The test-case source file gdb.ada/uninitialized-variable-record/parse.adb is -a reduced version of gdb.ada/uninitialized_vars/parse.adb, so it copies the -copyright years. - -Note that the test-case needs gcc-12 or newer, it's unsupported for older gcc -versions. [ So, it would be nice to rewrite it into a dwarf assembly -test-case. ] - -The test-case loops over all languages. This is inherited from an earlier -attempt to fix this, which had language-specific fixes (in print_field_values, -cp_print_value_fields, pascal_object_print_value_fields and -f_language::value_print_inner). I've left this in, but I suppose it's not -strictly necessary anymore. - -Tested on x86_64-linux. - -PR exp/31258 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31258 ---- - .../gdb.ada/uninitialized-variable-record.exp | 122 ++++++++++++++++++ - .../uninitialized-variable-record/parse.adb | 33 +++++ - gdb/value.c | 3 + - 3 files changed, 158 insertions(+) - create mode 100644 gdb/testsuite/gdb.ada/uninitialized-variable-record.exp - create mode 100644 gdb/testsuite/gdb.ada/uninitialized-variable-record/parse.adb - -diff --git a/gdb/testsuite/gdb.ada/uninitialized-variable-record.exp b/gdb/testsuite/gdb.ada/uninitialized-variable-record.exp -new file mode 100644 -index 00000000000..7fc72395edf ---- /dev/null -+++ b/gdb/testsuite/gdb.ada/uninitialized-variable-record.exp -@@ -0,0 +1,122 @@ -+# Copyright 2024 Free Software Foundation, Inc. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+load_lib "ada.exp" -+ -+require allow_ada_tests -+ -+standard_ada_testfile parse -+ -+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != "" } { -+ return -1 -+} -+ -+clean_restart ${testfile} -+ -+set bp_location [gdb_get_line_number "START" ${testdir}/parse.adb] -+runto "parse.adb:$bp_location" -+ -+# Check that we have the expected value for variable y2. -+ -+gdb_test "p y2" [string_to_regexp " = (a => false, c => 1.0, d => 2)"] -+ -+# Shorthand. -+ -+proc set_lang { lang } { -+ gdb_test_multiple "set language $lang" "" { -+ -re -wrap "" { -+ } -+ } -+} -+ -+# Calculate the offset of y2.d. -+ -+set re_cast [string_to_regexp "(access integer)"] -+gdb_test_multiple "print &y2.d - &y2" "" { -+ -re -wrap " = $re_cast ($hex)" { -+ set offset_d $expect_out(1,string) -+ pass $gdb_test_name -+ } -+} -+ -+# Try to find a interesting discriminator value, such that at the same time: -+# - the d field is part of the variable, and -+# - the type size is too small to contain d. -+ -+set interesting_discriminator -1 -+set_lang c -+for { set i 0 } { $i < 256 } { incr i } { -+ with_test_prefix $i { -+ -+ # Patch in the discriminator value. -+ gdb_test_multiple "set var *(unsigned char *)(&y2.a)=$i" "" { -+ -re -wrap "" { -+ } -+ } -+ -+ # Check that we have the variant with fields c+d instead of b. -+ set have_b 0 -+ gdb_test_multiple "with language ada -- print y2.b" "" { -+ -re -wrap " = $decimal" { -+ set have_b 1 -+ } -+ -re -wrap "" { -+ } -+ } -+ if { $have_b } { -+ # This is the variant with field b. -+ continue -+ } -+ -+ set size 0 -+ gdb_test_multiple "print sizeof (y2)" "" { -+ -re -wrap " = (.*)" { -+ set size $expect_out(1,string) -+ } -+ } -+ -+ if { ! $size } { -+ continue -+ } -+ -+ if { [expr $size > $offset_d] } { -+ # Field d fits in the size. -+ continue -+ } -+ -+ set interesting_discriminator $i -+ break -+ } -+} -+ -+require {expr $interesting_discriminator != -1} -+ -+foreach lang [gdb_supported_languages] { -+ with_test_prefix $lang { -+ set_lang $lang -+ -+ gdb_test_multiple "print y2" "" { -+ -re -wrap ", d => $decimal.*" { -+ fail $gdb_test_name -+ } -+ -re -wrap ", d = $decimal.*" { -+ fail $gdb_test_name -+ } -+ -re -wrap "" { -+ pass $gdb_test_name -+ } -+ } -+ } -+} -diff --git a/gdb/testsuite/gdb.ada/uninitialized-variable-record/parse.adb b/gdb/testsuite/gdb.ada/uninitialized-variable-record/parse.adb -new file mode 100644 -index 00000000000..f00c75ca2dc ---- /dev/null -+++ b/gdb/testsuite/gdb.ada/uninitialized-variable-record/parse.adb -@@ -0,0 +1,33 @@ -+-- Copyright 2009-2024 Free Software Foundation, Inc. -+-- -+-- This program is free software; you can redistribute it and/or modify -+-- it under the terms of the GNU General Public License as published by -+-- the Free Software Foundation; either version 3 of the License, or -+-- (at your option) any later version. -+-- -+-- This program is distributed in the hope that it will be useful, -+-- but WITHOUT ANY WARRANTY; without even the implied warranty of -+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+-- GNU General Public License for more details. -+-- -+-- You should have received a copy of the GNU General Public License -+-- along with this program. If not, see . -+ -+-- Based on gdb.ada/uninitialized_vars/parse.adb. -+ -+procedure Parse is -+ -+ type Variable_Record (A : Boolean := True) is record -+ case A is -+ when True => -+ B : Integer; -+ when False => -+ C : Float; -+ D : Integer; -+ end case; -+ end record; -+ Y2 : Variable_Record := (A => False, C => 1.0, D => 2); -+ -+begin -+ null; -- START -+end Parse; -diff --git a/gdb/value.c b/gdb/value.c -index 1cc32625629..56ae9db6603 100644 ---- a/gdb/value.c -+++ b/gdb/value.c -@@ -1188,6 +1188,9 @@ value::contents_copy_raw (struct value *dst, LONGEST dst_offset, - gdb_assert (!dst->bits_any_optimized_out (TARGET_CHAR_BIT * dst_offset, - TARGET_CHAR_BIT * length)); - -+ if ((src_offset + copy_length) * unit_size > enclosing_type ()-> length ()) -+ error (_("access outside bounds of object")); -+ - /* Copy the data. */ - gdb::array_view dst_contents - = dst->contents_all_raw ().slice (dst_offset * unit_size, --- -2.35.3 - diff --git a/gdb-exp-redo-cast-handling-for-indirection.patch b/gdb-exp-redo-cast-handling-for-indirection.patch deleted file mode 100644 index 3000d9b..0000000 --- a/gdb-exp-redo-cast-handling-for-indirection.patch +++ /dev/null @@ -1,86 +0,0 @@ -From a6800d9c8145f25001dd39afc3571e3350573e81 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Mon, 6 May 2024 14:23:25 +0200 -Subject: [PATCH] [gdb/exp] Redo cast handling for indirection - -In commit ed8fd0a342f ("[gdb/exp] Fix cast handling for indirection"), I -introduced the behaviour that even though we have: -... -(gdb) p *a_loc () -'a_loc' has unknown return type; cast the call to its declared return type -... -we get: -... -(gdb) p (char)*a_loc () -$1 = 97 'a' -... - -In other words, the unknown return type of a_loc is inferred from the cast, -effectually evaluating: -... -(gdb) p (char)*(char *)a_loc () -... - -This is convient for the case that errno is defined as: -... - #define errno (*__errno_location ()) -... -and the return type of __errno_location is unknown but the macro definition is -known, such that we can use: -... -(gdb) p (int)errno -... -instead of -... -(gdb) p *(int *)__errno_location () -... - -However, as Pedro has pointed out in post-commit review [1], this makes it -harder to reason about the semantics of an expression. - -For instance, this: -... -(gdb) p (long long)*a_loc ()" -... -would be evaluated without debug info as: -... -(gdb) p (long long)*(long long *)a_loc ()" -... -but with debug info as: -... -(gdb) p (long long)*(char *)a_loc ()" -... - -Fix this by instead simply erroring out for this case: -... -(gdb) p (char)*a_loc () -'a_loc' has unknown return type; cast the call to its declared return type -... - -Tested on x86_64-linux. - -Approved-By: Pedro Alves - -[1] https://sourceware.org/pipermail/gdb-patches/2024-May/208821.html ---- - gdb/testsuite/gdb.base/cast-indirection.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.base/cast-indirection.exp b/gdb/testsuite/gdb.base/cast-indirection.exp -index f1fe4302d27..7b9b5a5d677 100644 ---- a/gdb/testsuite/gdb.base/cast-indirection.exp -+++ b/gdb/testsuite/gdb.base/cast-indirection.exp -@@ -13,7 +13,7 @@ - # You should have received a copy of the GNU General Public License - # along with this program. If not, see . - --# Check that "p (char)*a_loc ()" is handled as "p (char)*(char *)a_loc ()". -+# Check that "p (char)*a_loc ()" is handled correctly. - - standard_testfile - - -base-commit: fc73000faa1798573090994167b7e2d451c211db --- -2.35.3 - diff --git a/gdb-fix-heap-use-after-free-in-select_event_lwp.patch b/gdb-fix-heap-use-after-free-in-select_event_lwp.patch deleted file mode 100644 index b362a6e..0000000 --- a/gdb-fix-heap-use-after-free-in-select_event_lwp.patch +++ /dev/null @@ -1,144 +0,0 @@ -From 350172ea215c7074601e8424ff636563612f91e8 Mon Sep 17 00:00:00 2001 -From: Pedro Alves -Date: Wed, 21 Feb 2024 16:23:55 +0000 -Subject: [PATCH 14/48] [gdb] Fix heap-use-after-free in select_event_lwp - -PR gdb/31259 reveals one scenario where we run into a -heap-use-after-free reported by thread sanitizer, while running -gdb.base/vfork-follow-parent.exp. - -The heap-use-after-free happens during the following scenario: - - - linux_nat_wait_1 is about to return an event for T2. It stops all - other threads, and while doing so, stop_wait_callback -> wait_lwp - sees T1 exit, and decides to leave the exit event pending. It - should have set the lp->stopped flag too, but does not -- this is - the bug. - - - The event for T2 is reported, is processed by infrun, and we're - back at linux_nat_wait_1. - - - linux_nat_wait_1 selects LWP T1 with the pending exit status to - report. - - - it sets variable lp to point to the corresponding lwp_info. - - - it calls stop_callback and stop_wait_callback for all threads - (because !target_is_non_stop_p ()). - - - it calls select_event_lwp to maybe pick another thread than T1, to - prevent starvation. - -The problem is the following: - - - while calling stop_wait_callback for all threads, it also does this - for T1. While doing so, the corresponding lwp_info is deleted - (callstack stop_wait_callback -> wait_lwp -> exit_lwp -> - delete_lwp), leaving variable lp as a dangling pointer. - - - variable lp is passed to select_event_lwp, which derefences it, - which causes the heap-use-after-free. - -Note that the comment here mentions "all other LWP's": -... - /* Now stop all other LWP's ... */ - iterate_over_lwps (minus_one_ptid, stop_callback); - /* ... and wait until all of them have reported back that - they're no longer running. */ - iterate_over_lwps (minus_one_ptid, stop_wait_callback); -... - -The reason the comments say "all other LWP's", and doesn't bother -filtering out LP is that lp->stopped should be true at this point, and -the callbacks (both stop_callback and stop_wait_callback) check that -flag, and do nothing if set. I.e., they skip already-stopped threads, -so they should skip LP. - -In this particular scenario, though, we missed setting the stopped -flag right in the first step described above, so LP was iterated over -incorrectly. - -The fix is to make wait_lwp set the lp->stopped flag when it decides -to leave the exit event pending. However, going a bit further, -gdbserver has a mark_lwp_dead function to centralize setting up -various lwp flags such that the rest of the code doesn't mishandle -them, and it seems like a good idea to do a similar thing in gdb as -well. That is what this patch does. - -PR gdb/31259 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31259 -Co-Authored-By: Tom de Vries -Change-Id: I4a6169976f89bf714c478cbb2b7d4c32365e62a9 ---- - gdb/linux-nat.c | 34 +++++++++++++++++++++++++--------- - 1 file changed, 25 insertions(+), 9 deletions(-) - -diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c -index 7e36ced6292..ed445c5e5bb 100644 ---- a/gdb/linux-nat.c -+++ b/gdb/linux-nat.c -@@ -2029,6 +2029,27 @@ wait_for_signal () - } - } - -+/* Mark LWP dead, with STATUS as exit status pending to report -+ later. */ -+ -+static void -+mark_lwp_dead (lwp_info *lp, int status) -+{ -+ /* Store the exit status lp->waitstatus, because lp->status would be -+ ambiguous (W_EXITCODE(0,0) == 0). */ -+ lp->waitstatus = host_status_to_waitstatus (status); -+ -+ /* If we're processing LP's status, there should be no other event -+ already recorded as pending. */ -+ gdb_assert (lp->status == 0); -+ -+ /* Dead LWPs aren't expected to report a pending sigstop. */ -+ lp->signalled = 0; -+ -+ /* Prevent trying to stop it. */ -+ lp->stopped = 1; -+} -+ - /* Wait for LP to stop. Returns the wait status, or 0 if the LWP has - exited. */ - -@@ -2114,9 +2135,8 @@ wait_lwp (struct lwp_info *lp) - - /* If this is the leader exiting, it means the whole - process is gone. Store the status to report to the -- core. Store it in lp->waitstatus, because lp->status -- would be ambiguous (W_EXITCODE(0,0) == 0). */ -- lp->waitstatus = host_status_to_waitstatus (status); -+ core. */ -+ mark_lwp_dead (lp, status); - return 0; - } - -@@ -2908,12 +2928,7 @@ linux_nat_filter_event (int lwpid, int status) - linux_nat_debug_printf ("LWP %ld exited (resumed=%d)", - lp->ptid.lwp (), lp->resumed); - -- /* Dead LWP's aren't expected to reported a pending sigstop. */ -- lp->signalled = 0; -- -- /* Store the pending event in the waitstatus, because -- W_EXITCODE(0,0) == 0. */ -- lp->waitstatus = host_status_to_waitstatus (status); -+ mark_lwp_dead (lp, status); - return; - } - -@@ -3248,6 +3263,7 @@ linux_nat_wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus, - } - - gdb_assert (lp); -+ gdb_assert (lp->stopped); - - status = lp->status; - lp->status = 0; --- -2.35.3 - diff --git a/gdb-fix-segfault-in-for_each_block-part-1.patch b/gdb-fix-segfault-in-for_each_block-part-1.patch deleted file mode 100644 index 8dad7a1..0000000 --- a/gdb-fix-segfault-in-for_each_block-part-1.patch +++ /dev/null @@ -1,636 +0,0 @@ -From 1d02ba0f4adcba2595a67e88fb1ba6d35c7f8e5b Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Tue, 7 May 2024 11:33:57 +0200 -Subject: [PATCH] [gdb] Fix segfault in for_each_block, part 1 - -When running test-case gdb.base/vfork-follow-parent.exp on powerpc64 (likewise -on s390x), I run into: -... -(gdb) PASS: gdb.base/vfork-follow-parent.exp: \ - exec_file=vfork-follow-parent-exit: target-non-stop=on: non-stop=off: \ - resolution_method=schedule-multiple: print unblock_parent = 1 -continue^M -Continuing.^M -Reading symbols from vfork-follow-parent-exit...^M -^M -^M -Fatal signal: Segmentation fault^M ------ Backtrace -----^M -0x1027d3e7 gdb_internal_backtrace_1^M - src/gdb/bt-utils.c:122^M -0x1027d54f _Z22gdb_internal_backtracev^M - src/gdb/bt-utils.c:168^M -0x1057643f handle_fatal_signal^M - src/gdb/event-top.c:889^M -0x10576677 handle_sigsegv^M - src/gdb/event-top.c:962^M -0x3fffa7610477 ???^M -0x103f2144 for_each_block^M - src/gdb/dcache.c:199^M -0x103f235b _Z17dcache_invalidateP13dcache_struct^M - src/gdb/dcache.c:251^M -0x10bde8c7 _Z24target_dcache_invalidatev^M - src/gdb/target-dcache.c:50^M -... -or similar. - -The root cause for the segmentation fault is that linux_is_uclinux gives an -incorrect result: it should always return false, given that we're running on a -regular linux system, but instead it returns first true, then false. - -In more detail, the segmentation fault happens as follows: -- a program space with an address space is created -- a second program space is about to be created. maybe_new_address_space - is called, and because linux_is_uclinux returns true, maybe_new_address_space - returns false, and no new address space is created -- a second program space with the same address space is created -- a program space is deleted. Because linux_is_uclinux now returns false, - gdbarch_has_shared_address_space (current_inferior ()->arch ()) returns - false, and the address space is deleted -- when gdb uses the address space of the remaining program space, we run into - the segfault, because the address space is deleted. - -Hardcoding linux_is_uclinux to false makes the test-case pass. - -We leave addressing the root cause for the following commit in this series. - -For now, prevent the segmentation fault by making the address space a refcounted -object. - -This was already suggested here [1]: -... -A better solution might be to have the address spaces be reference counted -... - -Tested on top of trunk on x86_64-linux and ppc64le-linux. -Tested on top of gdb-14-branch on ppc64-linux. - -Co-Authored-By: Simon Marchi - -PR gdb/30547 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30547 - -[1] https://sourceware.org/pipermail/gdb-patches/2023-October/202928.html ---- - gdb/breakpoint.c | 29 ++++++++------- - gdb/inferior.c | 8 ++--- - gdb/inferior.h | 2 +- - gdb/infrun.c | 18 +++++----- - gdb/linux-nat.c | 2 +- - gdb/process-stratum-target.c | 2 +- - gdb/progspace.c | 22 +++++------- - gdb/progspace.h | 64 +++++++++++++++++++++------------- - gdb/record-btrace.c | 2 +- - gdb/regcache.c | 2 +- - gdb/scoped-mock-context.h | 2 +- - gdb/target-dcache.c | 11 +++--- - gdbsupport/refcounted-object.h | 17 +++++++++ - 13 files changed, 102 insertions(+), 79 deletions(-) - -diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c -index 01f187ca4fe..a22bdb091cd 100644 ---- a/gdb/breakpoint.c -+++ b/gdb/breakpoint.c -@@ -1723,7 +1723,7 @@ one_breakpoint_xfer_memory (gdb_byte *readbuf, gdb_byte *writebuf, - int bptoffset = 0; - - if (!breakpoint_address_match (target_info->placed_address_space, 0, -- current_program_space->aspace, 0)) -+ current_program_space->aspace.get (), 0)) - { - /* The breakpoint is inserted in a different address space. */ - return; -@@ -2409,7 +2409,7 @@ should_be_inserted (struct bp_location *bl) - a breakpoint. */ - if ((bl->loc_type == bp_loc_software_breakpoint - || bl->loc_type == bp_loc_hardware_breakpoint) -- && stepping_past_instruction_at (bl->pspace->aspace, -+ && stepping_past_instruction_at (bl->pspace->aspace.get (), - bl->address) - /* The single-step breakpoint may be inserted at the location - we're trying to step if the instruction branches to itself. -@@ -2847,7 +2847,7 @@ insert_bp_location (struct bp_location *bl, - read the breakpoint instead of returning the data saved in - the breakpoint location's shadow contents. */ - bl->target_info.reqstd_address = bl->address; -- bl->target_info.placed_address_space = bl->pspace->aspace; -+ bl->target_info.placed_address_space = bl->pspace->aspace.get (); - bl->target_info.length = bl->length; - - /* When working with target-side conditions, we must pass all the conditions -@@ -4429,7 +4429,7 @@ bp_location_inserted_here_p (const struct bp_location *bl, - const address_space *aspace, CORE_ADDR pc) - { - if (bl->inserted -- && breakpoint_address_match (bl->pspace->aspace, bl->address, -+ && breakpoint_address_match (bl->pspace->aspace.get (), bl->address, - aspace, pc)) - { - /* An unmapped overlay can't be a match. */ -@@ -4508,7 +4508,7 @@ hardware_watchpoint_inserted_in_range (const address_space *aspace, - continue; - - for (bp_location &loc : bpt.locations ()) -- if (loc.pspace->aspace == aspace && loc.inserted) -+ if (loc.pspace->aspace.get () == aspace && loc.inserted) - { - CORE_ADDR l, h; - -@@ -7330,10 +7330,10 @@ breakpoint_location_address_match (struct bp_location *bl, - const address_space *aspace, - CORE_ADDR addr) - { -- return (breakpoint_address_match (bl->pspace->aspace, bl->address, -+ return (breakpoint_address_match (bl->pspace->aspace.get (), bl->address, - aspace, addr) - || (bl->length -- && breakpoint_address_match_range (bl->pspace->aspace, -+ && breakpoint_address_match_range (bl->pspace->aspace.get (), - bl->address, bl->length, - aspace, addr))); - } -@@ -7350,7 +7350,7 @@ breakpoint_location_address_range_overlap (struct bp_location *bl, - CORE_ADDR addr, int len) - { - if (gdbarch_has_global_breakpoints (target_gdbarch ()) -- || bl->pspace->aspace == aspace) -+ || bl->pspace->aspace.get () == aspace) - { - int bl_len = bl->length != 0 ? bl->length : 1; - -@@ -7407,8 +7407,10 @@ breakpoint_locations_match (const struct bp_location *loc1, - /* We compare bp_location.length in order to cover ranged - breakpoints. Keep this in sync with - bp_location_is_less_than. */ -- return (breakpoint_address_match (loc1->pspace->aspace, loc1->address, -- loc2->pspace->aspace, loc2->address) -+ return (breakpoint_address_match (loc1->pspace->aspace.get (), -+ loc1->address, -+ loc2->pspace->aspace.get (), -+ loc2->address) - && (loc1->loc_type == loc2->loc_type || sw_hw_bps_match) - && loc1->length == loc2->length); - } -@@ -9568,8 +9570,9 @@ ranged_breakpoint::breakpoint_hit (const struct bp_location *bl, - || ws.sig () != GDB_SIGNAL_TRAP) - return 0; - -- return breakpoint_address_match_range (bl->pspace->aspace, bl->address, -- bl->length, aspace, bp_addr); -+ return breakpoint_address_match_range (bl->pspace->aspace.get (), -+ bl->address, bl->length, aspace, -+ bp_addr); - } - - /* Implement the "resources_needed" method for ranged breakpoints. */ -@@ -12018,7 +12021,7 @@ code_breakpoint::breakpoint_hit (const struct bp_location *bl, - || ws.sig () != GDB_SIGNAL_TRAP) - return 0; - -- if (!breakpoint_address_match (bl->pspace->aspace, bl->address, -+ if (!breakpoint_address_match (bl->pspace->aspace.get (), bl->address, - aspace, bp_addr)) - return 0; - -diff --git a/gdb/inferior.c b/gdb/inferior.c -index 550bbd2827c..461f4fc076a 100644 ---- a/gdb/inferior.c -+++ b/gdb/inferior.c -@@ -831,15 +831,13 @@ remove_inferior_command (const char *args, int from_tty) - struct inferior * - add_inferior_with_spaces (void) - { -- struct address_space *aspace; - struct program_space *pspace; - struct inferior *inf; - - /* If all inferiors share an address space on this system, this - doesn't really return a new address space; otherwise, it - really does. */ -- aspace = maybe_new_address_space (); -- pspace = new program_space (aspace); -+ pspace = new program_space (maybe_new_address_space ()); - inf = add_inferior (0); - inf->pspace = pspace; - inf->aspace = pspace->aspace; -@@ -1002,15 +1000,13 @@ clone_inferior_command (const char *args, int from_tty) - - for (i = 0; i < copies; ++i) - { -- struct address_space *aspace; - struct program_space *pspace; - struct inferior *inf; - - /* If all inferiors share an address space on this system, this - doesn't really return a new address space; otherwise, it - really does. */ -- aspace = maybe_new_address_space (); -- pspace = new program_space (aspace); -+ pspace = new program_space (maybe_new_address_space ()); - inf = add_inferior (0); - inf->pspace = pspace; - inf->aspace = pspace->aspace; -diff --git a/gdb/inferior.h b/gdb/inferior.h -index 29c90d15efa..4139791740f 100644 ---- a/gdb/inferior.h -+++ b/gdb/inferior.h -@@ -577,7 +577,7 @@ class inferior : public refcounted_object, - bool removable = false; - - /* The address space bound to this inferior. */ -- struct address_space *aspace = NULL; -+ address_space_ref_ptr aspace; - - /* The program space bound to this inferior. */ - struct program_space *pspace = NULL; -diff --git a/gdb/infrun.c b/gdb/infrun.c -index 7be98cfc252..3854c66bf6c 100644 ---- a/gdb/infrun.c -+++ b/gdb/infrun.c -@@ -531,8 +531,8 @@ holding the child stopped. Try \"set detach-on-fork\" or \ - } - else - { -- child_inf->aspace = new address_space (); -- child_inf->pspace = new program_space (child_inf->aspace); -+ child_inf->pspace = new program_space (new_address_space ()); -+ child_inf->aspace = child_inf->pspace->aspace; - child_inf->removable = true; - clone_program_space (child_inf->pspace, parent_inf->pspace); - } -@@ -610,8 +610,8 @@ holding the child stopped. Try \"set detach-on-fork\" or \ - - child_inf->aspace = parent_inf->aspace; - child_inf->pspace = parent_inf->pspace; -- parent_inf->aspace = new address_space (); -- parent_inf->pspace = new program_space (parent_inf->aspace); -+ parent_inf->pspace = new program_space (new_address_space ()); -+ parent_inf->aspace = parent_inf->pspace->aspace; - clone_program_space (parent_inf->pspace, child_inf->pspace); - - /* The parent inferior is still the current one, so keep things -@@ -620,8 +620,8 @@ holding the child stopped. Try \"set detach-on-fork\" or \ - } - else - { -- child_inf->aspace = new address_space (); -- child_inf->pspace = new program_space (child_inf->aspace); -+ child_inf->pspace = new program_space (new_address_space ()); -+ child_inf->aspace = child_inf->pspace->aspace; - child_inf->removable = true; - child_inf->symfile_flags = SYMFILE_NO_READ; - clone_program_space (child_inf->pspace, parent_inf->pspace); -@@ -1031,7 +1031,6 @@ handle_vfork_child_exec_or_exit (int exec) - if (vfork_parent->pending_detach) - { - struct program_space *pspace; -- struct address_space *aspace; - - /* follow-fork child, detach-on-fork on. */ - -@@ -1056,9 +1055,8 @@ handle_vfork_child_exec_or_exit (int exec) - of" a hack. */ - - pspace = inf->pspace; -- aspace = inf->aspace; -- inf->aspace = nullptr; - inf->pspace = nullptr; -+ address_space_ref_ptr aspace = std::move (inf->aspace); - - if (print_inferior_events) - { -@@ -5906,7 +5904,7 @@ handle_inferior_event (struct execution_control_state *ecs) - = get_thread_arch_aspace_regcache (parent_inf, - ecs->ws.child_ptid (), - gdbarch, -- parent_inf->aspace); -+ parent_inf->aspace.get ()); - /* Read PC value of parent process. */ - parent_pc = regcache_read_pc (regcache); - -diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c -index ed445c5e5bb..c8991cc3da4 100644 ---- a/gdb/linux-nat.c -+++ b/gdb/linux-nat.c -@@ -4365,7 +4365,7 @@ linux_nat_target::thread_address_space (ptid_t ptid) - - inf = find_inferior_pid (this, pid); - gdb_assert (inf != NULL); -- return inf->aspace; -+ return inf->aspace.get (); - } - - /* Return the cached value of the processor core for thread PTID. */ -diff --git a/gdb/process-stratum-target.c b/gdb/process-stratum-target.c -index 5c031203e89..4bcca4f39c2 100644 ---- a/gdb/process-stratum-target.c -+++ b/gdb/process-stratum-target.c -@@ -37,7 +37,7 @@ process_stratum_target::thread_address_space (ptid_t ptid) - "address space of thread %s\n"), - target_pid_to_str (ptid).c_str ()); - -- return inf->aspace; -+ return inf->aspace.get (); - } - - struct gdbarch * -diff --git a/gdb/progspace.c b/gdb/progspace.c -index 1dbcd5875dd..b4d25ba6196 100644 ---- a/gdb/progspace.c -+++ b/gdb/progspace.c -@@ -55,8 +55,8 @@ address_space::address_space () - return a pointer to an existing address space, in case inferiors - share an address space on this target system. */ - --struct address_space * --maybe_new_address_space (void) -+address_space_ref_ptr -+maybe_new_address_space () - { - int shared_aspace = gdbarch_has_shared_address_space (target_gdbarch ()); - -@@ -66,7 +66,7 @@ maybe_new_address_space (void) - return program_spaces[0]->aspace; - } - -- return new address_space (); -+ return new_address_space (); - } - - /* Start counting over from scratch. */ -@@ -94,9 +94,9 @@ remove_program_space (program_space *pspace) - - /* See progspace.h. */ - --program_space::program_space (address_space *aspace_) -+program_space::program_space (address_space_ref_ptr aspace_) - : num (++last_program_space_num), -- aspace (aspace_) -+ aspace (std::move (aspace_)) - { - program_spaces.push_back (this); - gdb::observers::new_program_space.notify (this); -@@ -121,8 +121,6 @@ program_space::~program_space () - /* Defer breakpoint re-set because we don't want to create new - locations for this pspace which we're tearing down. */ - clear_symtab_users (SYMFILE_DEFER_BP_RESET); -- if (!gdbarch_has_shared_address_space (target_gdbarch ())) -- delete this->aspace; - } - - /* See progspace.h. */ -@@ -408,18 +406,14 @@ update_address_spaces (void) - - if (shared_aspace) - { -- struct address_space *aspace = new address_space (); -+ address_space_ref_ptr aspace = new_address_space (); - -- delete current_program_space->aspace; - for (struct program_space *pspace : program_spaces) - pspace->aspace = aspace; - } - else - for (struct program_space *pspace : program_spaces) -- { -- delete pspace->aspace; -- pspace->aspace = new address_space (); -- } -+ pspace->aspace = new_address_space (); - - for (inferior *inf : all_inferiors ()) - if (gdbarch_has_global_solist (target_gdbarch ())) -@@ -456,5 +450,5 @@ initialize_progspace (void) - modules have done that. Do this before - initialize_current_architecture, because that accesses the ebfd - of current_program_space. */ -- current_program_space = new program_space (new address_space ()); -+ current_program_space = new program_space (new_address_space ()); - } -diff --git a/gdb/progspace.h b/gdb/progspace.h -index ee12d89c173..12f113f6d9c 100644 ---- a/gdb/progspace.h -+++ b/gdb/progspace.h -@@ -28,6 +28,8 @@ - #include "solist.h" - #include "gdbsupport/next-iterator.h" - #include "gdbsupport/safe-iterator.h" -+#include "gdbsupport/refcounted-object.h" -+#include "gdbsupport/gdb_ref_ptr.h" - #include - #include - -@@ -42,6 +44,40 @@ struct so_list; - - typedef std::list> objfile_list; - -+/* An address space. It is used for comparing if -+ pspaces/inferior/threads see the same address space and for -+ associating caches to each address space. */ -+struct address_space : public refcounted_object -+{ -+ /* Create a new address space object, and add it to the list. */ -+ address_space (); -+ DISABLE_COPY_AND_ASSIGN (address_space); -+ -+ /* Returns the integer address space id of this address space. */ -+ int num () const -+ { -+ return m_num; -+ } -+ -+ /* Per aspace data-pointers required by other GDB modules. */ -+ registry registry_fields; -+ -+private: -+ int m_num; -+}; -+ -+using address_space_ref_ptr -+ = gdb::ref_ptr>; -+ -+/* Create a new address space. */ -+ -+static inline address_space_ref_ptr -+new_address_space () -+{ -+ return address_space_ref_ptr::new_reference (new address_space); -+} -+ - /* An iterator that wraps an iterator over std::unique_ptr, - and dereferences the returned object. This is useful for iterating - over a list of shared pointers and returning raw pointers -- which -@@ -191,7 +227,7 @@ struct program_space - { - /* Constructs a new empty program space, binds it to ASPACE, and - adds it to the program space list. */ -- explicit program_space (address_space *aspace); -+ explicit program_space (address_space_ref_ptr aspace); - - /* Releases a program space, and all its contents (shared libraries, - objfiles, and any other references to the program space in other -@@ -336,7 +372,7 @@ struct program_space - are global, then this field is ignored (we don't currently - support inferiors sharing a program space if the target doesn't - make breakpoints global). */ -- struct address_space *aspace = NULL; -+ address_space_ref_ptr aspace; - - /* True if this program space's section offsets don't yet represent - the final offsets of the "live" address space (that is, the -@@ -383,28 +419,6 @@ struct program_space - target_section_table m_target_sections; - }; - --/* An address space. It is used for comparing if -- pspaces/inferior/threads see the same address space and for -- associating caches to each address space. */ --struct address_space --{ -- /* Create a new address space object, and add it to the list. */ -- address_space (); -- DISABLE_COPY_AND_ASSIGN (address_space); -- -- /* Returns the integer address space id of this address space. */ -- int num () const -- { -- return m_num; -- } -- -- /* Per aspace data-pointers required by other GDB modules. */ -- registry registry_fields; -- --private: -- int m_num; --}; -- - /* The list of all program spaces. There's always at least one. */ - extern std::vectorprogram_spaces; - -@@ -447,7 +461,7 @@ class scoped_restore_current_program_space - /* Maybe create a new address space object, and add it to the list, or - return a pointer to an existing address space, in case inferiors - share an address space. */ --extern struct address_space *maybe_new_address_space (void); -+extern address_space_ref_ptr maybe_new_address_space (); - - /* Update all program spaces matching to address spaces. The user may - have created several program spaces, and loaded executables into -diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c -index 97447d3e8f8..a4d6c1b5bf2 100644 ---- a/gdb/record-btrace.c -+++ b/gdb/record-btrace.c -@@ -2321,7 +2321,7 @@ record_btrace_replay_at_breakpoint (struct thread_info *tp) - if (insn == NULL) - return 0; - -- return record_check_stopped_by_breakpoint (tp->inf->aspace, insn->pc, -+ return record_check_stopped_by_breakpoint (tp->inf->aspace.get (), insn->pc, - &btinfo->stop_reason); - } - -diff --git a/gdb/regcache.c b/gdb/regcache.c -index 91b20b7a2a2..a78fe0a80e7 100644 ---- a/gdb/regcache.c -+++ b/gdb/regcache.c -@@ -1628,7 +1628,7 @@ get_thread_arch_aspace_regcache_and_check (inferior *inf_for_target_calls, - the current inferior's gdbarch. Also use the current inferior's address - space. */ - gdbarch *arch = inf_for_target_calls->gdbarch; -- address_space *aspace = inf_for_target_calls->aspace; -+ address_space *aspace = inf_for_target_calls->aspace.get (); - regcache *regcache = get_thread_arch_aspace_regcache (inf_for_target_calls, - ptid, arch, aspace); - -diff --git a/gdb/scoped-mock-context.h b/gdb/scoped-mock-context.h -index 9ad7ebf5f0c..5f25dc7ed6b 100644 ---- a/gdb/scoped-mock-context.h -+++ b/gdb/scoped-mock-context.h -@@ -38,7 +38,7 @@ struct scoped_mock_context - - Target mock_target; - ptid_t mock_ptid {1, 1}; -- program_space mock_pspace {new address_space ()}; -+ program_space mock_pspace {new_address_space ()}; - inferior mock_inferior {mock_ptid.pid ()}; - thread_info mock_thread {&mock_inferior, mock_ptid}; - -diff --git a/gdb/target-dcache.c b/gdb/target-dcache.c -index 13c2888e7ea..b1b772ab76e 100644 ---- a/gdb/target-dcache.c -+++ b/gdb/target-dcache.c -@@ -33,7 +33,7 @@ int - target_dcache_init_p (void) - { - DCACHE *dcache -- = target_dcache_aspace_key.get (current_program_space->aspace); -+ = target_dcache_aspace_key.get (current_program_space->aspace.get ()); - - return (dcache != NULL); - } -@@ -44,7 +44,7 @@ void - target_dcache_invalidate (void) - { - DCACHE *dcache -- = target_dcache_aspace_key.get (current_program_space->aspace); -+ = target_dcache_aspace_key.get (current_program_space->aspace.get ()); - - if (dcache != NULL) - dcache_invalidate (dcache); -@@ -56,7 +56,7 @@ target_dcache_invalidate (void) - DCACHE * - target_dcache_get (void) - { -- return target_dcache_aspace_key.get (current_program_space->aspace); -+ return target_dcache_aspace_key.get (current_program_space->aspace.get ()); - } - - /* Return the target dcache. If it is not initialized yet, initialize -@@ -66,12 +66,13 @@ DCACHE * - target_dcache_get_or_init (void) - { - DCACHE *dcache -- = target_dcache_aspace_key.get (current_program_space->aspace); -+ = target_dcache_aspace_key.get (current_program_space->aspace.get ()); - - if (dcache == NULL) - { - dcache = dcache_init (); -- target_dcache_aspace_key.set (current_program_space->aspace, dcache); -+ target_dcache_aspace_key.set (current_program_space->aspace.get (), -+ dcache); - } - - return dcache; -diff --git a/gdbsupport/refcounted-object.h b/gdbsupport/refcounted-object.h -index d8fdb950043..294fd873df1 100644 ---- a/gdbsupport/refcounted-object.h -+++ b/gdbsupport/refcounted-object.h -@@ -67,4 +67,21 @@ struct refcounted_object_ref_policy - } - }; - -+/* A policy class to interface gdb::ref_ptr with a refcounted_object, that -+ deletes the object once the refcount reaches 0.. */ -+ -+template -+struct refcounted_object_delete_ref_policy -+{ -+ static void incref (T *obj) -+ { obj->incref (); } -+ -+ static void decref (T *obj) -+ { -+ obj->decref (); -+ if (obj->refcount () == 0) -+ delete obj; -+ } -+}; -+ - #endif /* COMMON_REFCOUNTED_OBJECT_H */ - -base-commit: 0bb6f49bb9ad577667075550ca2ad4cb49931078 --- -2.35.3 - diff --git a/gdb-fix-segfault-in-for_each_block-part-2.patch b/gdb-fix-segfault-in-for_each_block-part-2.patch deleted file mode 100644 index 00df214..0000000 --- a/gdb-fix-segfault-in-for_each_block-part-2.patch +++ /dev/null @@ -1,168 +0,0 @@ -From 3490f51a80a10d46dc1885ba672d9390a8221170 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 2 Nov 2023 14:51:02 +0100 -Subject: [PATCH] Fix segfault in for_each_block, part 2 - -The previous commit describes PR gdb/30547, a segfault when running test-case -gdb.base/vfork-follow-parent.exp on powerpc64 (likewise on s390x). - -The root cause for the segmentation fault is that linux_is_uclinux gives an -incorrect result: it returns true instead of false. - -So, why does linux_is_uclinux: -... -int -linux_is_uclinux (void) -{ - CORE_ADDR dummy; - - return (target_auxv_search (AT_NULL, &dummy) > 0 - && target_auxv_search (AT_PAGESZ, &dummy) == 0); -... -return true? - -This is because ppc_linux_target_wordsize returns 4 instead of 8, causing -ppc_linux_nat_target::auxv_parse to misinterpret the auxv vector. - -So, why does ppc_linux_target_wordsize: -... -int -ppc_linux_target_wordsize (int tid) -{ - int wordsize = 4; - - /* Check for 64-bit inferior process. This is the case when the host is - 64-bit, and in addition the top bit of the MSR register is set. */ - long msr; - - errno = 0; - msr = (long) ptrace (PTRACE_PEEKUSER, tid, PT_MSR * 8, 0); - if (errno == 0 && ppc64_64bit_inferior_p (msr)) - wordsize = 8; - - return wordsize; -} -... -return 4? - -Specifically, we get this result because because tid == 0, so we get -errno == ESRCH. - -The tid == 0 is caused by the switch_to_no_thread in -handle_vfork_child_exec_or_exit: -... - /* Switch to no-thread while running clone_program_space, so - that clone_program_space doesn't want to read the - selected frame of a dead process. */ - scoped_restore_current_thread restore_thread; - switch_to_no_thread (); - - inf->pspace = new program_space (maybe_new_address_space ()); -... -but moving the maybe_new_address_space call to before that gives us the -same result. The tid is no longer 0, but we still get ESRCH because the -thread has exited. - -Fix this in handle_vfork_child_exec_or_exit by doing the -maybe_new_address_space call in the context of the vfork parent. - -Tested on top of trunk on x86_64-linux and ppc64le-linux. -Tested on top of gdb-14-branch on ppc64-linux. - -Co-Authored-By: Simon Marchi - -PR gdb/30547 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30547 ---- - gdb/infrun.c | 16 +++++++++++----- - gdb/nat/ppc-linux.c | 2 ++ - gdb/ppc-linux-nat.c | 2 ++ - gdb/s390-linux-nat.c | 5 ++++- - 4 files changed, 19 insertions(+), 6 deletions(-) - -diff --git a/gdb/infrun.c b/gdb/infrun.c -index 3854c66bf6c..d259e81df84 100644 ---- a/gdb/infrun.c -+++ b/gdb/infrun.c -@@ -1105,13 +1105,19 @@ handle_vfork_child_exec_or_exit (int exec) - go ahead and create a new one for this exiting - inferior. */ - -- /* Switch to no-thread while running clone_program_space, so -- that clone_program_space doesn't want to read the -- selected frame of a dead process. */ - scoped_restore_current_thread restore_thread; -- switch_to_no_thread (); - -- inf->pspace = new program_space (maybe_new_address_space ()); -+ /* Temporarily switch to the vfork parent, to facilitate ptrace -+ calls done during maybe_new_address_space. */ -+ switch_to_thread (any_live_thread_of_inferior (vfork_parent)); -+ address_space_ref_ptr aspace = maybe_new_address_space (); -+ -+ /* Switch back to the vfork child inferior. Switch to no-thread -+ while running clone_program_space, so that clone_program_space -+ doesn't want to read the selected frame of a dead process. */ -+ switch_to_inferior_no_thread (inf); -+ -+ inf->pspace = new program_space (std::move (aspace)); - inf->aspace = inf->pspace->aspace; - set_current_program_space (inf->pspace); - inf->removable = true; -diff --git a/gdb/nat/ppc-linux.c b/gdb/nat/ppc-linux.c -index 0957d1b58a7..74549754806 100644 ---- a/gdb/nat/ppc-linux.c -+++ b/gdb/nat/ppc-linux.c -@@ -78,6 +78,8 @@ ppc64_64bit_inferior_p (long msr) - int - ppc_linux_target_wordsize (int tid) - { -+ gdb_assert (tid != 0); -+ - int wordsize = 4; - - /* Check for 64-bit inferior process. This is the case when the host is -diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c -index d14aba694e5..817505ea73e 100644 ---- a/gdb/ppc-linux-nat.c -+++ b/gdb/ppc-linux-nat.c -@@ -1914,6 +1914,8 @@ ppc_linux_nat_target::auxv_parse (const gdb_byte **readptr, - const gdb_byte *endptr, CORE_ADDR *typep, - CORE_ADDR *valp) - { -+ gdb_assert (inferior_ptid != null_ptid); -+ - int tid = inferior_ptid.lwp (); - if (tid == 0) - tid = inferior_ptid.pid (); -diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c -index 8f54e9f6322..54167f49480 100644 ---- a/gdb/s390-linux-nat.c -+++ b/gdb/s390-linux-nat.c -@@ -949,10 +949,12 @@ s390_target_wordsize (void) - /* Check for 64-bit inferior process. This is the case when the host is - 64-bit, and in addition bit 32 of the PSW mask is set. */ - #ifdef __s390x__ -+ int tid = s390_inferior_tid (); -+ gdb_assert (tid != 0); - long pswm; - - errno = 0; -- pswm = (long) ptrace (PTRACE_PEEKUSER, s390_inferior_tid (), PT_PSWMASK, 0); -+ pswm = (long) ptrace (PTRACE_PEEKUSER, tid, PT_PSWMASK, 0); - if (errno == 0 && (pswm & 0x100000000ul) != 0) - wordsize = 8; - #endif -@@ -965,6 +967,7 @@ s390_linux_nat_target::auxv_parse (const gdb_byte **readptr, - const gdb_byte *endptr, CORE_ADDR *typep, - CORE_ADDR *valp) - { -+ gdb_assert (inferior_ptid != null_ptid); - int sizeof_auxv_field = s390_target_wordsize (); - enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ()); - const gdb_byte *ptr = *readptr; - -base-commit: 1d02ba0f4adcba2595a67e88fb1ba6d35c7f8e5b --- -2.35.3 - diff --git a/gdb-ftbs-swapped-calloc-args.patch b/gdb-ftbs-swapped-calloc-args.patch deleted file mode 100644 index 30d4a4a..0000000 --- a/gdb-ftbs-swapped-calloc-args.patch +++ /dev/null @@ -1,42 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Kevin Buettner -Date: Wed, 17 Jan 2024 12:53:53 -0700 -Subject: gdb-ftbs-swapped-calloc-args.patch - -Backport upstream commit 54195469c18ec9873cc5ba6907f768509473fa9b -which fixes a build problem in which arguments to calloc were swapped. - -[opcodes] ARC + PPC: Fix -Walloc-size warnings - -Recently, -Walloc-size warnings started to kick in. Fix these two -calloc() calls to match the intended usage pattern. - -opcodes/ChangeLog: - - * arc-dis.c (init_arc_disasm_info): Fix calloc() call. - * ppc-dis.c (powerpc_init_dialect): Ditto. - -diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c ---- a/opcodes/arc-dis.c -+++ b/opcodes/arc-dis.c -@@ -147,7 +147,7 @@ static bool - init_arc_disasm_info (struct disassemble_info *info) - { - struct arc_disassemble_info *arc_infop -- = calloc (sizeof (*arc_infop), 1); -+ = calloc (1, sizeof (*arc_infop)); - - if (arc_infop == NULL) - return false; -diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c ---- a/opcodes/ppc-dis.c -+++ b/opcodes/ppc-dis.c -@@ -348,7 +348,7 @@ powerpc_init_dialect (struct disassemble_info *info) - { - ppc_cpu_t dialect = 0; - ppc_cpu_t sticky = 0; -- struct dis_private *priv = calloc (sizeof (*priv), 1); -+ struct dis_private *priv = calloc (1, sizeof (*priv)); - - if (priv == NULL) - return; diff --git a/gdb-gcore-bash.patch b/gdb-gcore-bash.patch index 724b5ea..b2b14fd 100644 --- a/gdb-gcore-bash.patch +++ b/gdb-gcore-bash.patch @@ -6,5 +6,5 @@ index b9770ea415..3149f6e1fe 100644 -#!/usr/bin/env bash +#!/bin/bash - # Copyright (C) 2003-2023 Free Software Foundation, Inc. + # Copyright (C) 2003-2024 Free Software Foundation, Inc. diff --git a/gdb-guile-use-scm_debug_typing_strictness-0.patch b/gdb-guile-use-scm_debug_typing_strictness-0.patch new file mode 100644 index 0000000..ba84612 --- /dev/null +++ b/gdb-guile-use-scm_debug_typing_strictness-0.patch @@ -0,0 +1,68 @@ +From fe0e6edbcb65ab5eca50c1a0ad8ddc9844f8ea98 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 27 Jan 2025 09:23:18 +0100 +Subject: [PATCH] [gdb/guile] Use SCM_DEBUG_TYPING_STRICTNESS 0 + +I build gdb with libguile v2.0.9, and ran into: +... +In file included from /usr/include/guile/2.0/libguile.h:56, + from ../../gdb/guile/guile-internal.h:30, + from ../../gdb/guile/scm-arch.c:26: +/usr/include/guile/2.0/libguile/inline.h: In function 'int scm_is_pair(SCM)': +/usr/include/guile/2.0/libguile/tags.h:97:53: error: \ + operation on '*0' may be undefined [-Werror=sequence-point] + # define SCM_UNPACK(x) ((scm_t_bits) (0? (*(SCM*)0=(x)): x)) + ~~~~~~~~~^~~~~ +... + +Fix this by using SCM_DEBUG_TYPING_STRICTNESS 0. + +We were already using this for c++20 due to a Werror=volatile in SCM_UNPACK +when using libguile v2.0.10. + +Tested on x86_64-linux. +--- + gdb/guile/guile-internal.h | 22 +++++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) + +diff --git a/gdb/guile/guile-internal.h b/gdb/guile/guile-internal.h +index be16fee0dd2..6665bfc7813 100644 +--- a/gdb/guile/guile-internal.h ++++ b/gdb/guile/guile-internal.h +@@ -27,10 +27,30 @@ + #include "hashtab.h" + #include "extension-priv.h" + #include "symtab.h" +-#include "libguile.h" + #include "objfiles.h" + #include "top.h" + ++/* For libguile v2.0.9 and SCM_DEBUG_TYPING_STRICTNESS == 1, SCM_UNPACK(x) is ++ defined as: ++ ++ ((scm_t_bits) (0? (*(SCM*)0=(x)): x)) ++ ++ and for v2.0.10 it's defined as: ++ ++ ((scm_t_bits) (0? (*(volatile SCM *)0=(x)): x)) ++ ++ The volatile was added to avoid a clang warning. ++ ++ The latter form causes a Werror=volatile with C++20. ++ This was reported upstream ( ++ https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65333 ). ++ ++ The former form causes a Werror=sequence-point with gcc 7-14. ++ ++ Work around these problem by using SCM_DEBUG_TYPING_STRICTNESS == 0. */ ++#define SCM_DEBUG_TYPING_STRICTNESS 0 ++#include "libguile.h" ++ + struct block; + struct frame_info; + struct objfile; + +base-commit: 94df6741bbabaa9a51960446b2af4c0bed01b54b +-- +2.43.0 + diff --git a/gdb-handle-no-python-gdb-module.patch b/gdb-handle-no-python-gdb-module.patch deleted file mode 100644 index 788f984..0000000 --- a/gdb-handle-no-python-gdb-module.patch +++ /dev/null @@ -1,30 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Tom Tromey -Date: Wed, 15 Nov 2023 06:48:55 -0700 -Subject: gdb-handle-no-python-gdb-module.patch - -;; Backport upstream commit 7d21600b31fe. - -Check gdb_python_module in gdbpy_handle_missing_debuginfo - -If you run gdb in the build tree without --data-directory, on a -program that does not have debug info, it will crash, because -gdbpy_handle_missing_debuginfo unconditionally uses gdb_python_module. - -Other code in gdb using gdb_python_module checks it first and it -seemes harmless to do the same thing here. (gdb_python_initialized -does not cover this case so that python can be partially initialized -and still somewhat work.) - -diff --git a/gdb/python/python.c b/gdb/python/python.c ---- a/gdb/python/python.c -+++ b/gdb/python/python.c -@@ -1676,7 +1676,7 @@ gdbpy_handle_missing_debuginfo (const struct extension_language_defn *extlang, - struct objfile *objfile) - { - /* Early exit if Python is not initialised. */ -- if (!gdb_python_initialized) -+ if (!gdb_python_initialized || gdb_python_module == nullptr) - return {}; - - struct gdbarch *gdbarch = objfile->arch (); diff --git a/gdb-merge-debug-symbol-lookup.patch b/gdb-merge-debug-symbol-lookup.patch deleted file mode 100644 index 0968ba0..0000000 --- a/gdb-merge-debug-symbol-lookup.patch +++ /dev/null @@ -1,265 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Andrew Burgess -Date: Fri, 13 Oct 2023 09:50:33 +0100 -Subject: gdb-merge-debug-symbol-lookup.patch - -;; Backport upstream commit 27807da5849. - -gdb: merge debug symbol file lookup code from coffread & elfread paths - -This commit merges the code that looks for and loads the separate -debug symbol files from coffread.c and elfread.c. The factored out -code is moved into a new objfile::find_and_add_separate_symbol_file() -method. - -For the elfread.c path there should be no user visible changes after -this commit. - -For the coffread.c path GDB will now attempt to perform a debuginfod -lookup for the missing debug information, assuming that GDB can find a -build-id in the COFF file. - -I don't know if COFF files can include a build-id, but I the existing -coffread.c code already includes a call to -find_separate_debug_file_by_build-id, so I know that it is at least OK -for GDB to ask a COFF file for a build-id. If the COFF file doesn't -include a build-id then the debuginfod lookup code will not trigger -and the new code is harmless. - -If the COFF file does include a build-id, then we're going to end up -asking debuginfod for the debug file. As build-ids should be unique, -this should be harmless, even if debuginfod doesn't contain any -suitable debug data, it just costs us one debuginfod lookup, so I'm -not too worried about this for now. - -As with the previous commit, I've done some minimal testing using the -mingw toolchain on a Linux machine, GDB seems to still access the -split debug information just fine. - -Approved-By: Tom Tromey - -diff --git a/gdb/coffread.c b/gdb/coffread.c ---- a/gdb/coffread.c -+++ b/gdb/coffread.c -@@ -40,8 +40,6 @@ - - #include "coff-pe-read.h" - --#include "build-id.h" -- - /* The objfile we are currently reading. */ - - static struct objfile *coffread_objfile; -@@ -729,26 +727,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) - && objfile->separate_debug_objfile == NULL - && objfile->separate_debug_objfile_backlink == NULL) - { -- deferred_warnings warnings; -- std::string debugfile -- = find_separate_debug_file_by_buildid (objfile, &warnings); -- -- if (debugfile.empty ()) -- debugfile -- = find_separate_debug_file_by_debuglink (objfile, &warnings); -- -- if (!debugfile.empty ()) -- { -- gdb_bfd_ref_ptr debug_bfd (symfile_bfd_open (debugfile.c_str ())); -- -- symbol_file_add_separate (debug_bfd, debugfile.c_str (), -- symfile_flags, objfile); -- } -- /* If all the methods to collect the debuginfo failed, print any -- warnings that were collected, this is a no-op if there are no -- warnings. */ -- if (debugfile.empty ()) -- warnings.emit (); -+ if (objfile->find_and_add_separate_symbol_file (symfile_flags)) -+ gdb_assert (objfile->separate_debug_objfile != nullptr); - } - } - -diff --git a/gdb/elfread.c b/gdb/elfread.c ---- a/gdb/elfread.c -+++ b/gdb/elfread.c -@@ -41,14 +41,12 @@ - #include "regcache.h" - #include "bcache.h" - #include "gdb_bfd.h" --#include "build-id.h" - #include "location.h" - #include "auxv.h" - #include "mdebugread.h" - #include "ctfread.h" - #include "gdbsupport/gdb_string_view.h" - #include "gdbsupport/scoped_fd.h" --#include "debuginfod-support.h" - #include "dwarf2/public.h" - #include "cli/cli-cmds.h" - -@@ -1218,59 +1216,10 @@ elf_symfile_read_dwarf2 (struct objfile *objfile, - && objfile->separate_debug_objfile == NULL - && objfile->separate_debug_objfile_backlink == NULL) - { -- deferred_warnings warnings; -- -- std::string debugfile -- = find_separate_debug_file_by_buildid (objfile, &warnings); -- -- if (debugfile.empty ()) -- debugfile = find_separate_debug_file_by_debuglink (objfile, &warnings); -- -- if (!debugfile.empty ()) -- { -- gdb_bfd_ref_ptr debug_bfd -- (symfile_bfd_open_no_error (debugfile.c_str ())); -- -- if (debug_bfd != nullptr) -- symbol_file_add_separate (debug_bfd, debugfile.c_str (), -- symfile_flags, objfile); -- } -+ if (objfile->find_and_add_separate_symbol_file (symfile_flags)) -+ gdb_assert (objfile->separate_debug_objfile != nullptr); - else -- { -- has_dwarf2 = false; -- const struct bfd_build_id *build_id -- = build_id_bfd_get (objfile->obfd.get ()); -- const char *filename = bfd_get_filename (objfile->obfd.get ()); -- -- if (build_id != nullptr) -- { -- gdb::unique_xmalloc_ptr symfile_path; -- scoped_fd fd (debuginfod_debuginfo_query (build_id->data, -- build_id->size, -- filename, -- &symfile_path)); -- -- if (fd.get () >= 0) -- { -- /* File successfully retrieved from server. */ -- gdb_bfd_ref_ptr debug_bfd -- (symfile_bfd_open_no_error (symfile_path.get ())); -- -- if (debug_bfd != nullptr -- && build_id_verify (debug_bfd.get (), build_id->size, -- build_id->data)) -- { -- symbol_file_add_separate (debug_bfd, symfile_path.get (), -- symfile_flags, objfile); -- has_dwarf2 = true; -- } -- } -- } -- } -- /* If all the methods to collect the debuginfo failed, print the -- warnings, this is a no-op if there are no warnings. */ -- if (debugfile.empty () && !has_dwarf2) -- warnings.emit (); -+ has_dwarf2 = false; - } - - return has_dwarf2; -diff --git a/gdb/objfiles.h b/gdb/objfiles.h ---- a/gdb/objfiles.h -+++ b/gdb/objfiles.h -@@ -513,6 +513,16 @@ struct objfile - - bool has_partial_symbols (); - -+ /* Look for a separate debug symbol file for this objfile, make use of -+ build-id, debug-link, and debuginfod as necessary. If a suitable -+ separate debug symbol file is found then it is loaded using a call to -+ symbol_file_add_separate (SYMFILE_FLAGS is passed through unmodified -+ to this call) and this function returns true. If no suitable separate -+ debug symbol file is found and loaded then this function returns -+ false. */ -+ -+ bool find_and_add_separate_symbol_file (symfile_add_flags symfile_flags); -+ - /* Return true if this objfile has any unexpanded symbols. A return - value of false indicates either, that this objfile has all its - symbols fully expanded (i.e. fully read in), or that this objfile has -diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c ---- a/gdb/symfile-debug.c -+++ b/gdb/symfile-debug.c -@@ -35,6 +35,8 @@ - #include "block.h" - #include "filenames.h" - #include "cli/cli-style.h" -+#include "build-id.h" -+#include "debuginfod-support.h" - - /* We need to save a pointer to the real symbol functions. - Plus, the debug versions are malloc'd because we have to NULL out the -@@ -558,6 +560,70 @@ objfile::require_partial_symbols (bool verbose) - } - } - -+/* See objfiles.h. */ -+ -+bool -+objfile::find_and_add_separate_symbol_file (symfile_add_flags symfile_flags) -+{ -+ bool has_dwarf2 = true; -+ -+ deferred_warnings warnings; -+ -+ std::string debugfile -+ = find_separate_debug_file_by_buildid (this, &warnings); -+ -+ if (debugfile.empty ()) -+ debugfile = find_separate_debug_file_by_debuglink (this, &warnings); -+ -+ if (!debugfile.empty ()) -+ { -+ gdb_bfd_ref_ptr debug_bfd -+ (symfile_bfd_open_no_error (debugfile.c_str ())); -+ -+ if (debug_bfd != nullptr) -+ symbol_file_add_separate (debug_bfd, debugfile.c_str (), -+ symfile_flags, this); -+ } -+ else -+ { -+ has_dwarf2 = false; -+ const struct bfd_build_id *build_id -+ = build_id_bfd_get (this->obfd.get ()); -+ const char *filename = bfd_get_filename (this->obfd.get ()); -+ -+ if (build_id != nullptr) -+ { -+ gdb::unique_xmalloc_ptr symfile_path; -+ scoped_fd fd (debuginfod_debuginfo_query (build_id->data, -+ build_id->size, -+ filename, -+ &symfile_path)); -+ -+ if (fd.get () >= 0) -+ { -+ /* File successfully retrieved from server. */ -+ gdb_bfd_ref_ptr debug_bfd -+ (symfile_bfd_open_no_error (symfile_path.get ())); -+ -+ if (debug_bfd != nullptr -+ && build_id_verify (debug_bfd.get (), build_id->size, -+ build_id->data)) -+ { -+ symbol_file_add_separate (debug_bfd, symfile_path.get (), -+ symfile_flags, this); -+ has_dwarf2 = true; -+ } -+ } -+ } -+ } -+ /* If all the methods to collect the debuginfo failed, print the -+ warnings, this is a no-op if there are no warnings. */ -+ if (debugfile.empty () && !has_dwarf2) -+ warnings.emit (); -+ -+ return has_dwarf2; -+} -+ - - /* Debugging version of struct sym_probe_fns. */ - diff --git a/gdb-python-avoid-depending-on-the-curses-library.patch b/gdb-python-avoid-depending-on-the-curses-library.patch index 4a73ba1..5f545a1 100644 --- a/gdb-python-avoid-depending-on-the-curses-library.patch +++ b/gdb-python-avoid-depending-on-the-curses-library.patch @@ -1,4 +1,4 @@ -From ed298cb88f0345d32a412c481898d867677726b8 Mon Sep 17 00:00:00 2001 +From a4ebf1e476b56777474584b653485bf3dc7068cc Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Mon, 9 Sep 2024 17:33:54 +0100 Subject: [PATCH] gdb/python: avoid depending on the curses library @@ -45,16 +45,16 @@ Approved-By: Tom de Vries 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/gdb/python/lib/gdb/missing_debug.py b/gdb/python/lib/gdb/missing_debug.py -index 7a768e5e05b..be6aacb1f41 100644 +index 4256947ff77..cdeea30256d 100644 --- a/gdb/python/lib/gdb/missing_debug.py +++ b/gdb/python/lib/gdb/missing_debug.py -@@ -30,9 +30,33 @@ if sys.version_info >= (3, 7): +@@ -32,9 +32,33 @@ if sys.version_info >= (3, 7): return ch.isalnum() else: - # Fall back to curses.ascii.isascii() and curses.ascii.isalnum() for - # earlier versions. -- from curses.ascii import isascii, isalnum +- from curses.ascii import isalnum, isascii + # Older version of Python doesn't have str.isascii() and + # str.isalnum() so provide our own. + # @@ -86,7 +86,23 @@ index 7a768e5e05b..be6aacb1f41 100644 def _validate_name(name): -base-commit: cdf77e047eba662880a85ca55489a96c83c34cfb +base-commit: b3f9f8454fe3f83754b130dd7aa26b62d4311bde +prerequisite-patch-id: 77507b16457eeed54f9c51f9d3899c91bc6739ca +prerequisite-patch-id: aec1fa16069ec9c14b671130354a5006b1739a34 +prerequisite-patch-id: a02aede530a3b3d0c64cd96ef7c2181e2886c3c5 +prerequisite-patch-id: 720d8081d37ae4b658b7e82ec96a39a82fdc8015 +prerequisite-patch-id: de6a537726187fa4b145246307af23449ae8fd3b +prerequisite-patch-id: 4c8aa2b7f59cde2aa886b3a8e134b58f58ed92de +prerequisite-patch-id: 913a84de7152200996b8bc6c6d241f95b4206294 +prerequisite-patch-id: af18dce2bc2a8c529dfd4b67c4514d4a94fe1f28 +prerequisite-patch-id: 07d1b82048ab34b0a037cf1c0ba1cb25bf7ec6eb +prerequisite-patch-id: f7311861f758921d385103bcae9d72ccfb12db4d +prerequisite-patch-id: 15dbe4af0de7b6c098c38a8c767d7166033e03c1 +prerequisite-patch-id: d27daff5cb15b862e7b48a41389b219040702c9d +prerequisite-patch-id: 581089bf2af1e30e5e1e00d01df5b164cb5794cf +prerequisite-patch-id: d2419f88c98cd8c7be804fd246eeb38d18dd0bda +prerequisite-patch-id: b1806f9e902e5ceb32f31438cb059843461d78eb +prerequisite-patch-id: c73d4526570e04107c3278cb8b5142d4a6665374 -- 2.43.0 diff --git a/gdb-python-finishbreakpoint-update.patch b/gdb-python-finishbreakpoint-update.patch index 0638499..8132b3d 100644 --- a/gdb-python-finishbreakpoint-update.patch +++ b/gdb-python-finishbreakpoint-update.patch @@ -1,7 +1,7 @@ -From adfcabe4cc43766996a61bdf08ce1e9db7f18dcc Mon Sep 17 00:00:00 2001 +From 086a725aa02b1195f63b2df4c2a2b4516788b2c6 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 18 Apr 2024 14:27:04 +0200 -Subject: [PATCH] gdb-python-finishbreakpoint-update +Subject: [PATCH 42/46] gdb-python-finishbreakpoint-update [gdb/python] FinishBreakPoint update @@ -337,10 +337,10 @@ and running the test-cases: 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c -index db7d2e6a8e5..01f187ca4fe 100644 +index 5653842ce76..6e10914a316 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -14683,6 +14683,10 @@ breakpoint_free_objfile (struct objfile *objfile) +@@ -14693,6 +14693,10 @@ breakpoint_free_objfile (struct objfile *objfile) static struct cmd_list_element *enablebreaklist = NULL; @@ -351,7 +351,7 @@ index db7d2e6a8e5..01f187ca4fe 100644 /* See breakpoint.h. */ cmd_list_element *commands_cmd_element = nullptr; -@@ -15243,8 +15247,14 @@ This is useful for formatted output in user-defined commands.")); +@@ -15255,8 +15259,14 @@ This is useful for formatted output in user-defined commands.")); gdb::observers::about_to_proceed.attach (breakpoint_about_to_proceed, "breakpoint"); @@ -367,10 +367,10 @@ index db7d2e6a8e5..01f187ca4fe 100644 "breakpoint"); } diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi -index 99670cca025..ba414b4e2c3 100644 +index 86ccc140c6d..e49cc580b1b 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi -@@ -6648,7 +6648,7 @@ is not writable. +@@ -6882,7 +6882,7 @@ is not writable. @tindex gdb.FinishBreakpoint A finish breakpoint is a temporary breakpoint set at the return address of @@ -379,7 +379,7 @@ index 99670cca025..ba414b4e2c3 100644 extends @code{gdb.Breakpoint}. The underlying breakpoint will be disabled and deleted when the execution will run out of the breakpoint scope (i.e.@: @code{Breakpoint.stop} or @code{FinishBreakpoint.out_of_scope} triggered). -@@ -6667,7 +6667,9 @@ details about this argument. +@@ -6901,7 +6901,9 @@ details about this argument. In some circumstances (e.g.@: @code{longjmp}, C@t{++} exceptions, @value{GDBN} @code{return} command, @dots{}), a function may not properly terminate, and thus never hit the finish breakpoint. When @value{GDBN} notices such a @@ -391,7 +391,7 @@ index 99670cca025..ba414b4e2c3 100644 You may want to sub-class @code{gdb.FinishBreakpoint} and override this method: diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c -index 42a7e0706d2..fa7ec43fbb4 100644 +index c74a2473a81..957d4ebc142 100644 --- a/gdb/python/py-finishbreakpoint.c +++ b/gdb/python/py-finishbreakpoint.c @@ -433,6 +433,24 @@ bpfinishpy_handle_exit (struct inferior *inf) @@ -402,9 +402,9 @@ index 42a7e0706d2..fa7ec43fbb4 100644 + scope notifications. */ + +static void -+bpfinishpy_handle_thread_exit (struct thread_info *tp, gdb::optional, bool) ++bpfinishpy_handle_thread_exit (struct thread_info *tp, std::optional, bool) +{ -+ gdbpy_enter enter_py (target_gdbarch (), current_language); ++ gdbpy_enter enter_py (target_thread_architecture (tp->ptid), current_language); + + for (breakpoint &bp : all_breakpoints_safe ()) + { @@ -429,7 +429,7 @@ index 42a7e0706d2..fa7ec43fbb4 100644 return 0; } diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp b/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp -index 66587b8b9a0..31479a05e6f 100644 +index b837bb3a108..7d99aad2fd2 100644 --- a/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp +++ b/gdb/testsuite/gdb.python/py-finish-breakpoint2.exp @@ -87,6 +87,7 @@ if { $need_continue } { @@ -440,8 +440,6 @@ index 66587b8b9a0..31479a05e6f 100644 gdb_test "python ExceptionFinishBreakpoint(gdb.newest_frame())" \ "init ExceptionFinishBreakpoint" "set FinishBP after the exception again" - -base-commit: 6de9111c512de99fd8cb3ea89f9890b1d72f6ef0 -- -2.35.3 +2.43.0 diff --git a/gdb-python-fix-gdb.python-py-disasm.exp-on-arm-linux.patch b/gdb-python-fix-gdb.python-py-disasm.exp-on-arm-linux.patch deleted file mode 100644 index a8e39f6..0000000 --- a/gdb-python-fix-gdb.python-py-disasm.exp-on-arm-linux.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 4c7dab250c3581e691c2da87395e80244074d8bf Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Mon, 10 Jun 2024 17:53:30 +0200 -Subject: [PATCH] [gdb/python] Fix gdb.python/py-disasm.exp on arm-linux - -After fixing test-case gdb.python/py-disasm.exp to recognize the arm nop: -... - nop {0} -... -we run into: -... -disassemble test^M -Dump of assembler code for function test:^M - 0x004004d8 <+0>: push {r11} @ (str r11, [sp, #-4]!)^M - 0x004004dc <+4>: add r11, sp, #0^M - 0x004004e0 <+8>: nop {0}^M -=> 0x004004e4 <+12>: Python Exception : Buffer \ - returned from read_memory is sized 0 instead of the expected 4^M -^M -unknown disassembler error (error = -1)^M -(gdb) FAIL: $exp: global_disassembler=ShowInfoRepr: disassemble test -... - -This is caused by this code in gdbpy_disassembler::read_memory_func: -... - gdbpy_ref<> result_obj (PyObject_CallMethod ((PyObject *) obj, - "read_memory", - "KL", len, offset)); -... -where len has type "unsigned int", while "K" means "unsigned long long" [1]. - -Fix this by using "I" instead, meaning "unsigned int". - -Also, offset has type LONGEST, which is typedef'ed to int64_t, while "L" means -"long long". - -Fix this by using type gdb_py_longest for offset, in combination with format -character "GDB_PY_LL_ARG". Likewise in disasmpy_info_read_memory. - -Tested on arm-linux. - -Reviewed-By: Alexandra Petlanova Hajkova -Approved-By: Tom Tromey - -PR python/31845 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31845 - -[1] https://docs.python.org/3/c-api/arg.html - -(cherry picked from commit 4cd214dce4579f86a85a96c882e0fc8c4d94601c) ---- - gdb/python/py-disasm.c | 12 +++++++----- - gdb/testsuite/gdb.python/py-disasm.exp | 2 +- - gdb/testsuite/gdb.python/py-disasm.py | 2 +- - 3 files changed, 9 insertions(+), 7 deletions(-) - -diff --git a/gdb/python/py-disasm.c b/gdb/python/py-disasm.c -index 6f0fed137e6..b2e95b3cba6 100644 ---- a/gdb/python/py-disasm.c -+++ b/gdb/python/py-disasm.c -@@ -668,12 +668,13 @@ disasmpy_info_read_memory (PyObject *self, PyObject *args, PyObject *kw) - disasm_info_object *obj = (disasm_info_object *) self; - DISASMPY_DISASM_INFO_REQUIRE_VALID (obj); - -- LONGEST length, offset = 0; -+ gdb_py_longest length, offset = 0; - gdb::unique_xmalloc_ptr buffer; - static const char *keywords[] = { "length", "offset", nullptr }; - -- if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "L|L", keywords, -- &length, &offset)) -+ if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, -+ GDB_PY_LL_ARG "|" GDB_PY_LL_ARG, -+ keywords, &length, &offset)) - return nullptr; - - /* The apparent address from which we are reading memory. Note that in -@@ -850,13 +851,14 @@ gdbpy_disassembler::read_memory_func (bfd_vma memaddr, gdb_byte *buff, - /* The DisassembleInfo.read_memory method expects an offset from the - address stored within the DisassembleInfo object; calculate that - offset here. */ -- LONGEST offset = (LONGEST) memaddr - (LONGEST) obj->address; -+ gdb_py_longest offset -+ = (gdb_py_longest) memaddr - (gdb_py_longest) obj->address; - - /* Now call the DisassembleInfo.read_memory method. This might have been - overridden by the user. */ - gdbpy_ref<> result_obj (PyObject_CallMethod ((PyObject *) obj, - "read_memory", -- "KL", len, offset)); -+ "I" GDB_PY_LL_ARG, len, offset)); - - /* Handle any exceptions. */ - if (result_obj == nullptr) -diff --git a/gdb/testsuite/gdb.python/py-disasm.exp b/gdb/testsuite/gdb.python/py-disasm.exp -index f2f9225168a..9d0f6ec1d01 100644 ---- a/gdb/testsuite/gdb.python/py-disasm.exp -+++ b/gdb/testsuite/gdb.python/py-disasm.exp -@@ -65,7 +65,7 @@ proc py_remove_all_disassemblers {} { - # - # Each different disassembler tests some different feature of the - # Python disassembler API. --set nop "(nop|nop\t0)" -+set nop "(nop|nop\t0|[string_to_regexp nop\t{0}])" - set unknown_error_pattern "unknown disassembler error \\(error = -1\\)" - set addr_pattern "\r\n=> ${curr_pc_pattern} <\[^>\]+>:\\s+" - set base_pattern "${addr_pattern}${nop}" -diff --git a/gdb/testsuite/gdb.python/py-disasm.py b/gdb/testsuite/gdb.python/py-disasm.py -index 67ba6756ea9..6a39b0764e6 100644 ---- a/gdb/testsuite/gdb.python/py-disasm.py -+++ b/gdb/testsuite/gdb.python/py-disasm.py -@@ -46,7 +46,7 @@ def check_building_disassemble_result(): - - - def is_nop(s): -- return s == "nop" or s == "nop\t0" -+ return s == "nop" or s == "nop\t0" or s == "nop\t{0}" - - - # Remove all currently registered disassemblers. - -base-commit: 22383ac8031b0e626e8ecd62e4378266065d067c --- -2.35.3 - diff --git a/gdb-python-make-gdb.unwindinfo.add_saved_register-mo-fixup.patch b/gdb-python-make-gdb.unwindinfo.add_saved_register-mo-fixup.patch deleted file mode 100644 index 757228c..0000000 --- a/gdb-python-make-gdb.unwindinfo.add_saved_register-mo-fixup.patch +++ /dev/null @@ -1,70 +0,0 @@ -From fc73000faa1798573090994167b7e2d451c211db Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Fri, 10 May 2024 08:46:21 +0200 -Subject: [PATCH] [gdb/python] Make gdb.UnwindInfo.add_saved_register more - robust (fixup) - -In commit 2236c5e384d ("[gdb/python] Make gdb.UnwindInfo.add_saved_register -more robust") I added this code in unwind_infopy_add_saved_register: -... - if (value->optimized_out () || !value->entirely_available ()) -... -which may throw c++ exceptions. - -This needs to be caught and transformed into a python exception. - -Fix this by using GDB_PY_HANDLE_EXCEPTION. - -Tested on x86_64-linux. - -Approved-By: Tom Tromey - -Fixes: 2236c5e384d ("[gdb/python] Make gdb.UnwindInfo.add_saved_register more robust") -(cherry picked from commit 408bc9c5fc757bd4b8adb1c3d54ecd672beaedb7) ---- - gdb/python/py-unwind.c | 26 +++++++++++++++++--------- - 1 file changed, 17 insertions(+), 9 deletions(-) - -diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c -index 471eb851674..e57c8c1adcf 100644 ---- a/gdb/python/py-unwind.c -+++ b/gdb/python/py-unwind.c -@@ -354,16 +354,24 @@ unwind_infopy_add_saved_register (PyObject *self, PyObject *args, PyObject *kw) - return nullptr; - } - -- if (value->optimized_out () || !value->entirely_available ()) -+ -+ try -+ { -+ if (value->optimized_out () || !value->entirely_available ()) -+ { -+ /* If we allow this value to be registered here, pyuw_sniffer is going -+ to run into an exception when trying to access its contents. -+ Throwing an exception here just puts a burden on the user to -+ implement the same checks on the user side. We could return False -+ here and True otherwise, but again that might require changes in -+ user code. So, handle this with minimal impact for the user, while -+ improving robustness: silently ignore the register/value pair. */ -+ Py_RETURN_NONE; -+ } -+ } -+ catch (const gdb_exception &except) - { -- /* If we allow this value to be registered here, pyuw_sniffer is going -- to run into an exception when trying to access its contents. -- Throwing an exception here just puts a burden on the user to -- implement the same checks on the user side. We could return False -- here and True otherwise, but again that might require changes in user -- code. So, handle this with minimal impact for the user, while -- improving robustness: silently ignore the register/value pair. */ -- Py_RETURN_NONE; -+ GDB_PY_HANDLE_EXCEPTION (except); - } - - gdbpy_ref<> new_value = gdbpy_ref<>::new_reference (pyo_reg_value); - -base-commit: a6f598be3d0477c5c59bd490573a5d457949658e --- -2.35.3 - diff --git a/gdb-python-make-gdb.unwindinfo.add_saved_register-mo.patch b/gdb-python-make-gdb.unwindinfo.add_saved_register-mo.patch deleted file mode 100644 index 19ed99f..0000000 --- a/gdb-python-make-gdb.unwindinfo.add_saved_register-mo.patch +++ /dev/null @@ -1,61 +0,0 @@ -From eafca1ce3d589c731927e5481199db715bcbeff3 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Sat, 2 Mar 2024 09:35:22 +0100 -Subject: [PATCH 2/2] [gdb/python] Make gdb.UnwindInfo.add_saved_register more - robust - -On arm-linux, until commit bbb12eb9c84 ("gdb/arm: Remove tpidruro register -from non-FreeBSD target descriptions") I ran into: -... -FAIL: gdb.base/inline-frame-cycle-unwind.exp: cycle at level 5: \ - backtrace when the unwind is broken at frame 5 -... - -What happens is the following: -- the TestUnwinder from inline-frame-cycle-unwind.py calls - gdb.UnwindInfo.add_saved_register with reg == tpidruro and value - "", -- pyuw_sniffer calls value->contents ().data () to access the value of the - register, which throws an UNAVAILABLE_ERROR, -- this causes the TestUnwinder unwinder to fail, after which another unwinder - succeeds and returns the correct frame, and -- the test-case fails because it's counting on the TestUnwinder to succeed and - return an incorrect frame. - -Fix this by checking for !value::entirely_available as well as -valued::optimized_out in unwind_infopy_add_saved_register. - -Tested on x86_64-linux and arm-linux. - -PR python/31437 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31437 ---- - gdb/python/py-unwind.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c -index 1856e41e2a1..471eb851674 100644 ---- a/gdb/python/py-unwind.c -+++ b/gdb/python/py-unwind.c -@@ -354,6 +354,18 @@ unwind_infopy_add_saved_register (PyObject *self, PyObject *args, PyObject *kw) - return nullptr; - } - -+ if (value->optimized_out () || !value->entirely_available ()) -+ { -+ /* If we allow this value to be registered here, pyuw_sniffer is going -+ to run into an exception when trying to access its contents. -+ Throwing an exception here just puts a burden on the user to -+ implement the same checks on the user side. We could return False -+ here and True otherwise, but again that might require changes in user -+ code. So, handle this with minimal impact for the user, while -+ improving robustness: silently ignore the register/value pair. */ -+ Py_RETURN_NONE; -+ } -+ - gdbpy_ref<> new_value = gdbpy_ref<>::new_reference (pyo_reg_value); - bool found = false; - for (saved_reg ® : *unwind_info->saved_regs) --- -2.35.3 - diff --git a/gdb-refactor-find-and-add-separate-symbol-file.patch b/gdb-refactor-find-and-add-separate-symbol-file.patch deleted file mode 100644 index 7a4b534..0000000 --- a/gdb-refactor-find-and-add-separate-symbol-file.patch +++ /dev/null @@ -1,190 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Andrew Burgess -Date: Fri, 13 Oct 2023 16:17:20 +0100 -Subject: gdb-refactor-find-and-add-separate-symbol-file.patch - -;; Backport upstream commit 6234ba17598. - -gdb: refactor objfile::find_and_add_separate_symbol_file - -This is purely a refactoring commit. - -This commit splits objfile::find_and_add_separate_symbol_file into -some separate helper functions. My hope is that the steps for looking -up separate debug information are now clearer. - -In a later commit I'm going to extend -objfile::find_and_add_separate_symbol_file, with some additional -logic, so starting with a simpler function will make the following -changes easier. - -When reading objfile::find_and_add_separate_symbol_file after this -commit, you might be tempted to think that removing the `has_dwarf` -local variable would be a good additional cleanup. After the next -commit though it makes more sense to retain this local, so I've left -this in place for now. - -There should be no user visible changes after this commit. - -Approved-By: Tom Tromey - -diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c ---- a/gdb/symfile-debug.c -+++ b/gdb/symfile-debug.c -@@ -560,68 +560,109 @@ objfile::require_partial_symbols (bool verbose) - } - } - -+/* Call LOOKUP_FUNC to find the filename of a file containing the separate -+ debug information matching OBJFILE. If LOOKUP_FUNC does return a -+ filename then open this file and return a std::pair containing the -+ gdb_bfd_ref_ptr of the open file and the filename returned by -+ LOOKUP_FUNC, otherwise this function returns an empty pair; the first -+ item will be nullptr, and the second will be an empty string. -+ -+ Any warnings generated by this function, or by calling LOOKUP_FUNC are -+ placed into WARNINGS, these warnings are only displayed to the user if -+ GDB is unable to find the separate debug information via any route. */ -+static std::pair -+simple_find_and_open_separate_symbol_file -+ (struct objfile *objfile, -+ std::string (*lookup_func) (struct objfile *, deferred_warnings *), -+ deferred_warnings *warnings) -+{ -+ std::string filename = lookup_func (objfile, warnings); -+ -+ if (!filename.empty ()) -+ { -+ gdb_bfd_ref_ptr symfile_bfd -+ = symfile_bfd_open_no_error (filename.c_str ()); -+ if (symfile_bfd != nullptr) -+ return { symfile_bfd, filename }; -+ } -+ -+ return {}; -+} -+ -+/* Lookup separate debug information for OBJFILE via debuginfod. If -+ successful the debug information will be have been downloaded into the -+ debuginfod cache and this function will return a std::pair containing a -+ gdb_bfd_ref_ptr of the open debug information file and the filename for -+ the file within the debuginfod cache. If no debug information could be -+ found then this function returns an empty pair; the first item will be -+ nullptr, and the second will be an empty string. */ -+ -+static std::pair -+debuginfod_find_and_open_separate_symbol_file (struct objfile * objfile) -+{ -+ const struct bfd_build_id *build_id -+ = build_id_bfd_get (objfile->obfd.get ()); -+ const char *filename = bfd_get_filename (objfile->obfd.get ()); -+ -+ if (build_id != nullptr) -+ { -+ gdb::unique_xmalloc_ptr symfile_path; -+ scoped_fd fd (debuginfod_debuginfo_query (build_id->data, build_id->size, -+ filename, &symfile_path)); -+ -+ if (fd.get () >= 0) -+ { -+ /* File successfully retrieved from server. */ -+ gdb_bfd_ref_ptr debug_bfd -+ (symfile_bfd_open_no_error (symfile_path.get ())); -+ -+ if (debug_bfd != nullptr -+ && build_id_verify (debug_bfd.get (), -+ build_id->size, build_id->data)) -+ return { debug_bfd, std::string (symfile_path.get ()) }; -+ } -+ } -+ -+ return {}; -+} -+ - /* See objfiles.h. */ - - bool - objfile::find_and_add_separate_symbol_file (symfile_add_flags symfile_flags) - { -- bool has_dwarf2 = true; -+ bool has_dwarf = false; - - deferred_warnings warnings; - -- std::string debugfile -- = find_separate_debug_file_by_buildid (this, &warnings); -- -- if (debugfile.empty ()) -- debugfile = find_separate_debug_file_by_debuglink (this, &warnings); -+ gdb_bfd_ref_ptr debug_bfd; -+ std::string filename; - -- if (!debugfile.empty ()) -- { -- gdb_bfd_ref_ptr debug_bfd -- (symfile_bfd_open_no_error (debugfile.c_str ())); -+ std::tie (debug_bfd, filename) = simple_find_and_open_separate_symbol_file -+ (this, find_separate_debug_file_by_buildid, &warnings); - -- if (debug_bfd != nullptr) -- symbol_file_add_separate (debug_bfd, debugfile.c_str (), -- symfile_flags, this); -- } -- else -- { -- has_dwarf2 = false; -- const struct bfd_build_id *build_id -- = build_id_bfd_get (this->obfd.get ()); -- const char *filename = bfd_get_filename (this->obfd.get ()); -- -- if (build_id != nullptr) -- { -- gdb::unique_xmalloc_ptr symfile_path; -- scoped_fd fd (debuginfod_debuginfo_query (build_id->data, -- build_id->size, -- filename, -- &symfile_path)); -+ if (debug_bfd == nullptr) -+ std::tie (debug_bfd, filename) -+ = simple_find_and_open_separate_symbol_file -+ (this, find_separate_debug_file_by_debuglink, &warnings); - -- if (fd.get () >= 0) -- { -- /* File successfully retrieved from server. */ -- gdb_bfd_ref_ptr debug_bfd -- (symfile_bfd_open_no_error (symfile_path.get ())); -+ if (debug_bfd == nullptr) -+ std::tie (debug_bfd, filename) -+ = debuginfod_find_and_open_separate_symbol_file (this); - -- if (debug_bfd != nullptr -- && build_id_verify (debug_bfd.get (), build_id->size, -- build_id->data)) -- { -- symbol_file_add_separate (debug_bfd, symfile_path.get (), -- symfile_flags, this); -- has_dwarf2 = true; -- } -- } -- } -+ if (debug_bfd != nullptr) -+ { -+ symbol_file_add_separate (debug_bfd, filename.c_str (), symfile_flags, -+ this); -+ has_dwarf = true; - } -- /* If all the methods to collect the debuginfo failed, print the -- warnings, this is a no-op if there are no warnings. */ -- if (debugfile.empty () && !has_dwarf2) -+ -+ /* If we still have not got a separate debug symbol file, then -+ emit any warnings we've collected so far. */ -+ if (!has_dwarf) - warnings.emit (); - -- return has_dwarf2; -+ return has_dwarf; - } - - diff --git a/gdb-reformat-missing-debug-py-file.patch b/gdb-reformat-missing-debug-py-file.patch deleted file mode 100644 index 56c4863..0000000 --- a/gdb-reformat-missing-debug-py-file.patch +++ /dev/null @@ -1,38 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 23 Nov 2023 07:37:19 +0100 -Subject: gdb-reformat-missing-debug-py-file.patch - -;; Backport upstream commit dd5516bf98f. - -[gdb/python] Reformat missing_debug.py using black - -Reformat gdb/python/lib/gdb/missing_debug.py with black after commit -e8c3dafa5f5 ("[gdb/python] Don't import curses.ascii module unless necessary"). - -diff --git a/gdb/python/lib/gdb/missing_debug.py b/gdb/python/lib/gdb/missing_debug.py ---- a/gdb/python/lib/gdb/missing_debug.py -+++ b/gdb/python/lib/gdb/missing_debug.py -@@ -19,18 +19,22 @@ MissingDebugHandler base class, and register_handler function. - - import gdb - import sys -+ - if sys.version_info >= (3, 7): - # Functions str.isascii() and str.isalnum are available starting Python - # 3.7. - def isascii(ch): - return ch.isascii() -+ - def isalnum(ch): - return ch.isalnum() -+ - else: - # Fall back to curses.ascii.isascii() and curses.ascii.isalnum() for - # earlier versions. - from curses.ascii import isascii, isalnum - -+ - def _validate_name(name): - """Validate a missing debug handler name string. - diff --git a/gdb-remote-fix-abort-on-remote_close_error.patch b/gdb-remote-fix-abort-on-remote_close_error.patch deleted file mode 100644 index d6a9a46..0000000 --- a/gdb-remote-fix-abort-on-remote_close_error.patch +++ /dev/null @@ -1,229 +0,0 @@ -From 0ad71e3088f345101085a1f72e81a000a100db18 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Sat, 27 Apr 2024 17:48:22 +0200 -Subject: [PATCH 25/48] [gdb/remote] Fix abort on REMOTE_CLOSE_ERROR - -When running test-case gdb.server/connect-with-no-symbol-file.exp on -aarch64-linux (specifically, an opensuse leap 15.5 container on a -fedora asahi 39 system), I run into: -... -(gdb) detach^M -Detaching from program: target:connect-with-no-symbol-file, process 185104^M -Ending remote debugging.^M -terminate called after throwing an instance of 'gdb_exception_error'^M -... - -The detailed backtrace of the corefile is: -... - (gdb) bt - #0 0x0000ffff75504f54 in raise () from /lib64/libpthread.so.0 - #1 0x00000000007a86b4 in handle_fatal_signal (sig=6) - at gdb/event-top.c:926 - #2 - #3 0x0000ffff74b977b4 in raise () from /lib64/libc.so.6 - #4 0x0000ffff74b98c18 in abort () from /lib64/libc.so.6 - #5 0x0000ffff74ea26f4 in __gnu_cxx::__verbose_terminate_handler() () - from /usr/lib64/libstdc++.so.6 - #6 0x0000ffff74ea011c in ?? () from /usr/lib64/libstdc++.so.6 - #7 0x0000ffff74ea0180 in std::terminate() () from /usr/lib64/libstdc++.so.6 - #8 0x0000ffff74ea0464 in __cxa_throw () from /usr/lib64/libstdc++.so.6 - #9 0x0000000001548870 in throw_it (reason=RETURN_ERROR, - error=TARGET_CLOSE_ERROR, fmt=0x16c7810 "Remote connection closed", ap=...) - at gdbsupport/common-exceptions.cc:203 - #10 0x0000000001548920 in throw_verror (error=TARGET_CLOSE_ERROR, - fmt=0x16c7810 "Remote connection closed", ap=...) - at gdbsupport/common-exceptions.cc:211 - #11 0x0000000001548a00 in throw_error (error=TARGET_CLOSE_ERROR, - fmt=0x16c7810 "Remote connection closed") - at gdbsupport/common-exceptions.cc:226 - #12 0x0000000000ac8f2c in remote_target::readchar (this=0x233d3d90, timeout=2) - at gdb/remote.c:9856 - #13 0x0000000000ac9f04 in remote_target::getpkt (this=0x233d3d90, - buf=0x233d40a8, forever=false, is_notif=0x0) at gdb/remote.c:10326 - #14 0x0000000000acf3d0 in remote_target::remote_hostio_send_command - (this=0x233d3d90, command_bytes=13, which_packet=17, - remote_errno=0xfffff1a3cf38, attachment=0xfffff1a3ce88, - attachment_len=0xfffff1a3ce90) at gdb/remote.c:12567 - #15 0x0000000000ad03bc in remote_target::fileio_fstat (this=0x233d3d90, fd=3, - st=0xfffff1a3d020, remote_errno=0xfffff1a3cf38) - at gdb/remote.c:12979 - #16 0x0000000000c39878 in target_fileio_fstat (fd=0, sb=0xfffff1a3d020, - target_errno=0xfffff1a3cf38) at gdb/target.c:3315 - #17 0x00000000007eee5c in target_fileio_stream::stat (this=0x233d4400, - abfd=0x2323fc40, sb=0xfffff1a3d020) at gdb/gdb_bfd.c:467 - #18 0x00000000007f012c in ::operator()(bfd *, - void *, stat *) const (__closure=0x0, abfd=0x2323fc40, stream=0x233d4400, - sb=0xfffff1a3d020) at gdb/gdb_bfd.c:955 - #19 0x00000000007f015c in ::_FUN(bfd *, void *, - stat *) () at gdb/gdb_bfd.c:956 - #20 0x0000000000f9b838 in opncls_bstat (abfd=0x2323fc40, sb=0xfffff1a3d020) - at bfd/opncls.c:665 - #21 0x0000000000f90adc in bfd_stat (abfd=0x2323fc40, statbuf=0xfffff1a3d020) - at bfd/bfdio.c:431 - #22 0x000000000065fe20 in reopen_exec_file () at gdb/corefile.c:52 - #23 0x0000000000c3a3e8 in generic_mourn_inferior () - at gdb/target.c:3642 - #24 0x0000000000abf3f0 in remote_unpush_target (target=0x233d3d90) - at gdb/remote.c:6067 - #25 0x0000000000aca8b0 in remote_target::mourn_inferior (this=0x233d3d90) - at gdb/remote.c:10587 - #26 0x0000000000c387cc in target_mourn_inferior ( - ptid=) - at gdb/target.c:2738 - #27 0x0000000000abfff0 in remote_target::remote_detach_1 (this=0x233d3d90, - inf=0x22fce540, from_tty=1) at gdb/remote.c:6421 - #28 0x0000000000ac0094 in remote_target::detach (this=0x233d3d90, - inf=0x22fce540, from_tty=1) at gdb/remote.c:6436 - #29 0x0000000000c37c3c in target_detach (inf=0x22fce540, from_tty=1) - at gdb/target.c:2526 - #30 0x0000000000860424 in detach_command (args=0x0, from_tty=1) - at gdb/infcmd.c:2817 - #31 0x000000000060b594 in do_simple_func (args=0x0, from_tty=1, c=0x231431a0) - at gdb/cli/cli-decode.c:94 - #32 0x00000000006108c8 in cmd_func (cmd=0x231431a0, args=0x0, from_tty=1) - at gdb/cli/cli-decode.c:2741 - #33 0x0000000000c65a94 in execute_command (p=0x232e52f6 "", from_tty=1) - at gdb/top.c:570 - #34 0x00000000007a7d2c in command_handler (command=0x232e52f0 "") - at gdb/event-top.c:566 - #35 0x00000000007a8290 in command_line_handler (rl=...) - at gdb/event-top.c:802 - #36 0x0000000000c9092c in tui_command_line_handler (rl=...) - at gdb/tui/tui-interp.c:103 - #37 0x00000000007a750c in gdb_rl_callback_handler (rl=0x23385330 "detach") - at gdb/event-top.c:258 - #38 0x0000000000d910f4 in rl_callback_read_char () - at readline/readline/callback.c:290 - #39 0x00000000007a7338 in gdb_rl_callback_read_char_wrapper_noexcept () - at gdb/event-top.c:194 - #40 0x00000000007a73f0 in gdb_rl_callback_read_char_wrapper - (client_data=0x22fbf640) at gdb/event-top.c:233 - #41 0x0000000000cbee1c in stdin_event_handler (error=0, client_data=0x22fbf640) - at gdb/ui.c:154 - #42 0x000000000154ed60 in handle_file_event (file_ptr=0x232be730, ready_mask=1) - at gdbsupport/event-loop.cc:572 - #43 0x000000000154f21c in gdb_wait_for_event (block=1) - at gdbsupport/event-loop.cc:693 - #44 0x000000000154dec4 in gdb_do_one_event (mstimeout=-1) - at gdbsupport/event-loop.cc:263 - #45 0x0000000000910f98 in start_event_loop () at gdb/main.c:400 - #46 0x0000000000911130 in captured_command_loop () at gdb/main.c:464 - #47 0x0000000000912b5c in captured_main (data=0xfffff1a3db58) - at gdb/main.c:1338 - #48 0x0000000000912bf4 in gdb_main (args=0xfffff1a3db58) - at gdb/main.c:1357 - #49 0x00000000004170f4 in main (argc=10, argv=0xfffff1a3dcc8) - at gdb/gdb.c:38 - (gdb) -... - -The abort happens because a c++ exception escapes to c code, specifically -opncls_bstat in bfd/opncls.c. Compiling with -fexceptions works around this. - -Fix this by catching the exception just before it escapes, in stat_trampoline -and likewise in few similar spot. - -Add a new template catch_exceptions to do so in a consistent way. - -Tested on aarch64-linux. - -Approved-by: Pedro Alves - -PR remote/31577 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31577 ---- - gdb/gdb_bfd.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++--- - 1 file changed, 56 insertions(+), 3 deletions(-) - -diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c -index 217753cf914..3c34cc5693f 100644 ---- a/gdb/gdb_bfd.c -+++ b/gdb/gdb_bfd.c -@@ -887,6 +887,29 @@ gdb_bfd_openw (const char *filename, const char *target) - return gdb_bfd_ref_ptr::new_reference (result); - } - -+/* Wrap f (args) and handle exceptions by: -+ - returning val, and -+ - calling set_quit_flag or set_force_quit_flag, if needed. */ -+ -+template -+static R -+catch_exceptions (F &&f, Args&&... args) -+{ -+ try -+ { -+ return f (std::forward (args)...); -+ } -+ catch (const gdb_exception &ex) -+ { -+ if (ex.reason == RETURN_QUIT) -+ set_quit_flag (); -+ else if (ex.reason == RETURN_FORCED_QUIT) -+ set_force_quit_flag (); -+ } -+ -+ return val; -+} -+ - /* See gdb_bfd.h. */ - - gdb_bfd_ref_ptr -@@ -896,21 +919,51 @@ gdb_bfd_openr_iovec (const char *filename, const char *target, - auto do_open = [] (bfd *nbfd, void *closure) -> void * - { - auto real_opener = static_cast (closure); -- return (*real_opener) (nbfd); -+ /* Prevent exceptions from escaping to C code and triggering an abort. */ -+ auto res = catch_exceptions ([&] -+ { -+ return (*real_opener) (nbfd); -+ }); -+ if (res == nullptr) -+ { -+ errno = EIO; -+ bfd_set_error (bfd_error_system_call); -+ } -+ return res; - }; - - auto read_trampoline = [] (bfd *nbfd, void *stream, void *buf, - file_ptr nbytes, file_ptr offset) -> file_ptr - { - gdb_bfd_iovec_base *obj = static_cast (stream); -- return obj->read (nbfd, buf, nbytes, offset); -+ /* Prevent exceptions from escaping to C code and triggering an abort. */ -+ auto res = catch_exceptions ([&] -+ { -+ return obj->read (nbfd, buf, nbytes, offset); -+ }); -+ if (res == -1) -+ { -+ errno = EIO; -+ bfd_set_error (bfd_error_system_call); -+ } -+ return res; - }; - - auto stat_trampoline = [] (struct bfd *abfd, void *stream, - struct stat *sb) -> int - { - gdb_bfd_iovec_base *obj = static_cast (stream); -- return obj->stat (abfd, sb); -+ /* Prevent exceptions from escaping to C code and triggering an abort. */ -+ auto res = catch_exceptions ([&] -+ { -+ return obj->stat (abfd, sb); -+ }); -+ if (res == -1) -+ { -+ errno = EIO; -+ bfd_set_error (bfd_error_system_call); -+ } -+ return res; - }; - - auto close_trampoline = [] (struct bfd *nbfd, void *stream) -> int --- -2.35.3 - diff --git a/gdb-remove-path-in-test-name.patch b/gdb-remove-path-in-test-name.patch deleted file mode 100644 index a7d4a8b..0000000 --- a/gdb-remove-path-in-test-name.patch +++ /dev/null @@ -1,29 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Tom Tromey -Date: Tue, 14 Nov 2023 11:47:27 -0700 -Subject: gdb-remove-path-in-test-name.patch - -;; Backport upstream commit 1146d27749f. - -Remove path name from test case - -'runtest' complains about a path in a test name, from the new test -case py-missing-debug.exp. - -This patch fixes the problem by providing an explicit test name to -gdb_test. I chose something very basic because the block in question -is already wrapped in with_test_prefix. - -diff --git a/gdb/testsuite/gdb.python/py-missing-debug.exp b/gdb/testsuite/gdb.python/py-missing-debug.exp ---- a/gdb/testsuite/gdb.python/py-missing-debug.exp -+++ b/gdb/testsuite/gdb.python/py-missing-debug.exp -@@ -321,7 +321,8 @@ with_test_prefix "enable 'abc-def'" { - set re [string_to_regexp $binfile] - - gdb_test "enable missing-debug-handler \"$re\" abc-def" \ -- "^1 missing debug handler enabled" -+ "^1 missing debug handler enabled" \ -+ "enable missing-debug-handler" - - gdb_test "info missing-debug-handlers" \ - [multi_line \ diff --git a/gdb-remove-use-of-py-isascii b/gdb-remove-use-of-py-isascii deleted file mode 100644 index 27d5a97..0000000 --- a/gdb-remove-use-of-py-isascii +++ /dev/null @@ -1,46 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Andrew Burgess -Date: Thu, 16 Nov 2023 10:53:34 +0000 -Subject: gdb-remove-use-of-py-isascii - -;; Backport upstream commit 7db795bc67a. - -gdb/python: remove use of str.isascii() - -This commit: - - commit 8f6c452b5a4e50fbb55ff1d13328b392ad1fd416 - Date: Sun Oct 15 22:48:42 2023 +0100 - - gdb: implement missing debug handler hook for Python - -introduced a use of str.isascii(), which was only added in Python 3.7. - -This commit switches to use curses.ascii.isascii(), as this was -available in 3.6. - -The same is true for str.isalnum(), which is replaced with -curses.ascii.isalnum(). - -There should be no user visible changes after this commit. - -diff --git a/gdb/python/lib/gdb/missing_debug.py b/gdb/python/lib/gdb/missing_debug.py ---- a/gdb/python/lib/gdb/missing_debug.py -+++ b/gdb/python/lib/gdb/missing_debug.py -@@ -18,6 +18,7 @@ MissingDebugHandler base class, and register_handler function. - """ - - import gdb -+from curses.ascii import isascii, isalnum - - - def _validate_name(name): -@@ -38,7 +39,7 @@ def _validate_name(name): - name. - """ - for ch in name: -- if not ch.isascii() or not (ch.isalnum() or ch in "_-"): -+ if not isascii(ch) or not (isalnum(ch) or ch in "_-"): - raise ValueError("invalid character '%s' in handler name: %s" % (ch, name)) - - diff --git a/gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch b/gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch deleted file mode 100644 index 0b2e9a1..0000000 --- a/gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch +++ /dev/null @@ -1,264 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Andrew Burgess -Date: Sat, 25 Nov 2023 10:35:37 +0000 -Subject: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch - -;; Back-port upstream commit acc117b57f7 as part of a fix for -;; non-deterministic gdb-index generation (RH BZ 2232086). - -gdb: C++-ify mapped_symtab from dwarf2/index-write.c - -Make static the functions add_index_entry, find_slot, and hash_expand, -member functions of the mapped_symtab class. - -Fold an additional snippet of code from write_gdbindex into -mapped_symtab::minimize, this code relates to minimisation, so this -seems like a good home for it. - -Make the n_elements, data, and m_string_obstack member variables of -mapped_symtab private. Provide a new obstack() member function to -provide access to the obstack when needed, and also add member -functions begin(), end(), cbegin(), and cend() so that the -mapped_symtab class can be treated like a contained and iterated -over. - -I've also taken this opportunity to split out the logic for whether -the hash table (m_data) needs expanding, this is the new function -hash_needs_expanding. This will be useful in a later commit. - -There should be no user visible changes after this commit. - -Approved-By: Tom Tromey - -diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c ---- a/gdb/dwarf2/index-write.c -+++ b/gdb/dwarf2/index-write.c -@@ -187,86 +187,135 @@ struct mapped_symtab - { - mapped_symtab () - { -- data.resize (1024); -+ m_data.resize (1024); - } - -- /* Minimize each entry in the symbol table, removing duplicates. */ -+ /* If there are no elements in the symbol table, then reduce the table -+ size to zero. Otherwise call symtab_index_entry::minimize each entry -+ in the symbol table. */ -+ - void minimize () - { -- for (symtab_index_entry &item : data) -+ if (m_element_count == 0) -+ m_data.resize (0); -+ -+ for (symtab_index_entry &item : m_data) - item.minimize (); - } - -- offset_type n_elements = 0; -- std::vector data; -+ /* Add an entry to SYMTAB. NAME is the name of the symbol. CU_INDEX is -+ the index of the CU in which the symbol appears. IS_STATIC is one if -+ the symbol is static, otherwise zero (global). */ -+ -+ void add_index_entry (const char *name, int is_static, -+ gdb_index_symbol_kind kind, offset_type cu_index); -+ -+ /* Access the obstack. */ -+ struct obstack *obstack () -+ { return &m_string_obstack; } -+ -+private: -+ -+ /* Find a slot in SYMTAB for the symbol NAME. Returns a reference to -+ the slot. -+ -+ Function is used only during write_hash_table so no index format -+ backward compatibility is needed. */ -+ -+ symtab_index_entry &find_slot (const char *name); -+ -+ /* Expand SYMTAB's hash table. */ -+ -+ void hash_expand (); -+ -+ /* Return true if the hash table in data needs to grow. */ -+ -+ bool hash_needs_expanding () const -+ { return 4 * m_element_count / 3 >= m_data.size (); } -+ -+ /* A vector that is used as a hash table. */ -+ std::vector m_data; -+ -+ /* The number of elements stored in the m_data hash. */ -+ offset_type m_element_count = 0; - - /* Temporary storage for names. */ - auto_obstack m_string_obstack; --}; - --/* Find a slot in SYMTAB for the symbol NAME. Returns a reference to -- the slot. -+public: -+ using iterator = decltype (m_data)::iterator; -+ using const_iterator = decltype (m_data)::const_iterator; - -- Function is used only during write_hash_table so no index format backward -- compatibility is needed. */ -+ iterator begin () -+ { return m_data.begin (); } - --static symtab_index_entry & --find_slot (struct mapped_symtab *symtab, const char *name) -+ iterator end () -+ { return m_data.end (); } -+ -+ const_iterator cbegin () -+ { return m_data.cbegin (); } -+ -+ const_iterator cend () -+ { return m_data.cend (); } -+}; -+ -+/* See class definition. */ -+ -+symtab_index_entry & -+mapped_symtab::find_slot (const char *name) - { - offset_type index, step, hash = mapped_index_string_hash (INT_MAX, name); - -- index = hash & (symtab->data.size () - 1); -- step = ((hash * 17) & (symtab->data.size () - 1)) | 1; -+ index = hash & (m_data.size () - 1); -+ step = ((hash * 17) & (m_data.size () - 1)) | 1; - - for (;;) - { -- if (symtab->data[index].name == NULL -- || strcmp (name, symtab->data[index].name) == 0) -- return symtab->data[index]; -- index = (index + step) & (symtab->data.size () - 1); -+ if (m_data[index].name == NULL -+ || strcmp (name, m_data[index].name) == 0) -+ return m_data[index]; -+ index = (index + step) & (m_data.size () - 1); - } - } - --/* Expand SYMTAB's hash table. */ -+/* See class definition. */ - --static void --hash_expand (struct mapped_symtab *symtab) -+void -+mapped_symtab::hash_expand () - { -- auto old_entries = std::move (symtab->data); -+ auto old_entries = std::move (m_data); - -- symtab->data.clear (); -- symtab->data.resize (old_entries.size () * 2); -+ gdb_assert (m_data.size () == 0); -+ m_data.resize (old_entries.size () * 2); - - for (auto &it : old_entries) - if (it.name != NULL) - { -- auto &ref = find_slot (symtab, it.name); -+ auto &ref = this->find_slot (it.name); - ref = std::move (it); - } - } - --/* Add an entry to SYMTAB. NAME is the name of the symbol. -- CU_INDEX is the index of the CU in which the symbol appears. -- IS_STATIC is one if the symbol is static, otherwise zero (global). */ -+/* See class definition. */ - --static void --add_index_entry (struct mapped_symtab *symtab, const char *name, -- int is_static, gdb_index_symbol_kind kind, -- offset_type cu_index) -+void -+mapped_symtab::add_index_entry (const char *name, int is_static, -+ gdb_index_symbol_kind kind, -+ offset_type cu_index) - { -- symtab_index_entry *slot = &find_slot (symtab, name); -+ symtab_index_entry *slot = &this->find_slot (name); - if (slot->name == NULL) - { - /* This is a new element in the hash table. */ -- ++symtab->n_elements; -+ ++this->m_element_count; - - /* We might need to grow the hash table. */ -- if (4 * symtab->n_elements / 3 >= symtab->data.size ()) -+ if (this->hash_needs_expanding ()) - { -- hash_expand (symtab); -+ this->hash_expand (); - - /* This element will have a different slot in the new table. */ -- slot = &find_slot (symtab, name); -+ slot = &this->find_slot (name); - - /* But it should still be a new element in the hash table. */ - gdb_assert (slot->name == nullptr); -@@ -387,7 +436,7 @@ write_hash_table (mapped_symtab *symtab, data_buf &output, data_buf &cpool) - - /* We add all the index vectors to the constant pool first, to - ensure alignment is ok. */ -- for (symtab_index_entry &entry : symtab->data) -+ for (symtab_index_entry &entry : *symtab) - { - if (entry.name == NULL) - continue; -@@ -416,7 +465,7 @@ write_hash_table (mapped_symtab *symtab, data_buf &output, data_buf &cpool) - - /* Now write out the hash table. */ - std::unordered_map str_table; -- for (const auto &entry : symtab->data) -+ for (const auto &entry : *symtab) - { - offset_type str_off, vec_off; - -@@ -1151,7 +1200,7 @@ write_cooked_index (cooked_index *table, - const auto it = cu_index_htab.find (entry->per_cu); - gdb_assert (it != cu_index_htab.cend ()); - -- const char *name = entry->full_name (&symtab->m_string_obstack); -+ const char *name = entry->full_name (symtab->obstack ()); - - if (entry->per_cu->lang () == language_ada) - { -@@ -1159,7 +1208,7 @@ write_cooked_index (cooked_index *table, - gdb, it has to use the encoded name, with any - suffixes stripped. */ - std::string encoded = ada_encode (name, false); -- name = obstack_strdup (&symtab->m_string_obstack, -+ name = obstack_strdup (symtab->obstack (), - encoded.c_str ()); - } - else if (entry->per_cu->lang () == language_cplus -@@ -1191,8 +1240,8 @@ write_cooked_index (cooked_index *table, - else - kind = GDB_INDEX_SYMBOL_KIND_TYPE; - -- add_index_entry (symtab, name, (entry->flags & IS_STATIC) != 0, -- kind, it->second); -+ symtab->add_index_entry (name, (entry->flags & IS_STATIC) != 0, -+ kind, it->second); - } - } - -@@ -1267,8 +1316,6 @@ write_gdbindex (dwarf2_per_bfd *per_bfd, cooked_index *table, - symtab.minimize (); - - data_buf symtab_vec, constant_pool; -- if (symtab.n_elements == 0) -- symtab.data.resize (0); - - write_hash_table (&symtab, symtab_vec, constant_pool); - diff --git a/gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch b/gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch deleted file mode 100644 index 15365e6..0000000 --- a/gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch +++ /dev/null @@ -1,101 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Andrew Burgess -Date: Mon, 27 Nov 2023 13:19:39 +0000 -Subject: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch - -;; Back-port upstream commit 3644f41dc80 as part of a fix for -;; non-deterministic gdb-index generation (RH BZ 2232086). - -gdb: generate dwarf-5 index identically as worker-thread count changes - -Similar to the previous commit, this commit ensures that the dwarf-5 -index files are generated identically as the number of worker-threads -changes. - -Building the dwarf-5 index makes use of a closed hash table, the -bucket_hash local within debug_names::build(). Entries are added to -bucket_hash from m_name_to_value_set, which, in turn, is populated -by calls to debug_names::insert() in write_debug_names. The insert -calls are ordered based on the entries within the cooked_index, and -the ordering within cooked_index depends on the number of worker -threads that GDB is using. - -My proposal is to sort each chain within the bucket_hash closed hash -table prior to using this to build the dwarf-5 index. - -The buckets within bucket_hash will always have the same ordering (for -a given GDB build with a given executable), and by sorting the chains -within each bucket, we can be sure that GDB will see each entry in a -deterministic order. - -I've extended the index creation test to cover this case. - -Approved-By: Tom Tromey - -diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c ---- a/gdb/dwarf2/index-write.c -+++ b/gdb/dwarf2/index-write.c -@@ -452,6 +452,11 @@ class c_str_view - return strcmp (m_cstr, other.m_cstr) == 0; - } - -+ bool operator< (const c_str_view &other) const -+ { -+ return strcmp (m_cstr, other.m_cstr) < 0; -+ } -+ - /* Return the underlying C string. Note, the returned string is - only a reference with lifetime of this object. */ - const char *c_str () const -@@ -771,10 +776,18 @@ class debug_names - } - for (size_t bucket_ix = 0; bucket_ix < bucket_hash.size (); ++bucket_ix) - { -- const std::forward_list &hashitlist -- = bucket_hash[bucket_ix]; -+ std::forward_list &hashitlist = bucket_hash[bucket_ix]; - if (hashitlist.empty ()) - continue; -+ -+ /* Sort the items within each bucket. This ensures that the -+ generated index files will be the same no matter the order in -+ which symbols were added into the index. */ -+ hashitlist.sort ([] (const hash_it_pair &a, const hash_it_pair &b) -+ { -+ return a.it->first < b.it->first; -+ }); -+ - uint32_t &bucket_slot = m_bucket_table[bucket_ix]; - /* The hashes array is indexed starting at 1. */ - store_unsigned_integer (reinterpret_cast (&bucket_slot), -diff --git a/gdb/testsuite/gdb.gdb/index-file.exp b/gdb/testsuite/gdb.gdb/index-file.exp ---- a/gdb/testsuite/gdb.gdb/index-file.exp -+++ b/gdb/testsuite/gdb.gdb/index-file.exp -@@ -47,6 +47,9 @@ remote_exec host "mkdir -p ${dir1}" - with_timeout_factor $timeout_factor { - gdb_test_no_output "save gdb-index $dir1" \ - "create gdb-index file" -+ -+ gdb_test_no_output "save gdb-index -dwarf-5 $dir1" \ -+ "create dwarf-index files" - } - - # Close GDB. -@@ -143,13 +146,16 @@ if { $worker_threads > 1 } { - with_timeout_factor $timeout_factor { - gdb_test_no_output "save gdb-index $dir2" \ - "create second gdb-index file" -+ -+ gdb_test_no_output "save gdb-index -dwarf-5 $dir2" \ -+ "create second dwarf-index files" - } - - # Close GDB. - gdb_exit - - # Now check that the index files are identical. -- foreach suffix { gdb-index } { -+ foreach suffix { gdb-index debug_names debug_str } { - set result \ - [remote_exec host \ - "cmp -s \"$dir1/${index_filename_base}.${suffix}\" \"$dir2/${index_filename_base}.${suffix}\""] diff --git a/gdb-rhbz-2232086-generate-gdb-index-consistently.patch b/gdb-rhbz-2232086-generate-gdb-index-consistently.patch deleted file mode 100644 index 0d78380..0000000 --- a/gdb-rhbz-2232086-generate-gdb-index-consistently.patch +++ /dev/null @@ -1,230 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Andrew Burgess -Date: Fri, 24 Nov 2023 12:04:36 +0000 -Subject: gdb-rhbz-2232086-generate-gdb-index-consistently.patch - -;; Back-port upstream commit aff250145af as part of a fix for -;; non-deterministic gdb-index generation (RH BZ 2232086). - -gdb: generate gdb-index identically regardless of work thread count - -It was observed that changing the number of worker threads that GDB -uses (maintenance set worker-threads NUM) would have an impact on the -layout of the generated gdb-index. - -The cause seems to be how the CU are distributed between threads, and -then symbols that appear in multiple CU can be encountered earlier or -later depending on whether a particular CU moves between threads. - -I certainly found this behaviour was reproducible when generating an -index for GDB itself, like: - - gdb -q -nx -nh -batch \ - -eiex 'maint set worker-threads NUM' \ - -ex 'save gdb-index /tmp/' - -And then setting different values for NUM will change the generated -index. - -Now, the question is: does this matter? - -I would like to suggest that yes, this does matter. At Red Hat we -generate a gdb-index as part of the build process, and we would -ideally like to have reproducible builds: for the same source, -compiled with the same tool-chain, we should get the exact same output -binary. And we do .... except for the index. - -Now we could simply force GDB to only use a single worker thread when -we build the index, but, I don't think the idea of reproducible builds -is that strange, so I think we should ensure that our generated -indexes are always reproducible. - -To achieve this, I propose that we add an extra step when building the -gdb-index file. After constructing the initial symbol hash table -contents, we will pull all the symbols out of the hash, sort them, -then re-insert them in sorted order. This will ensure that the -structure of the generated hash will remain consistent (given the same -set of symbols). - -I've extended the existing index-file test to check that the generated -index doesn't change if we adjust the number of worker threads used. -Given that this test is already rather slow, I've only made one change -to the worker-thread count. Maybe this test should be changed to use -a smaller binary, which is quicker to load, and for which we could -then try many different worker thread counts. - -Approved-By: Tom Tromey - -diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c ---- a/gdb/dwarf2/index-write.c -+++ b/gdb/dwarf2/index-write.c -@@ -210,6 +210,13 @@ struct mapped_symtab - void add_index_entry (const char *name, int is_static, - gdb_index_symbol_kind kind, offset_type cu_index); - -+ /* When entries are originally added into the data hash the order will -+ vary based on the number of worker threads GDB is configured to use. -+ This function will rebuild the hash such that the final layout will be -+ deterministic regardless of the number of worker threads used. */ -+ -+ void sort (); -+ - /* Access the obstack. */ - struct obstack *obstack () - { return &m_string_obstack; } -@@ -296,6 +303,65 @@ mapped_symtab::hash_expand () - } - } - -+/* See mapped_symtab class declaration. */ -+ -+void mapped_symtab::sort () -+{ -+ /* Move contents out of this->data vector. */ -+ std::vector original_data = std::move (m_data); -+ -+ /* Restore the size of m_data, this will avoid having to expand the hash -+ table (and rehash all elements) when we reinsert after sorting. -+ However, we do reset the element count, this allows for some sanity -+ checking asserts during the reinsert phase. */ -+ gdb_assert (m_data.size () == 0); -+ m_data.resize (original_data.size ()); -+ m_element_count = 0; -+ -+ /* Remove empty entries from ORIGINAL_DATA, this makes sorting quicker. */ -+ auto it = std::remove_if (original_data.begin (), original_data.end (), -+ [] (const symtab_index_entry &entry) -> bool -+ { -+ return entry.name == nullptr; -+ }); -+ original_data.erase (it, original_data.end ()); -+ -+ /* Sort the existing contents. */ -+ std::sort (original_data.begin (), original_data.end (), -+ [] (const symtab_index_entry &a, -+ const symtab_index_entry &b) -> bool -+ { -+ /* Return true if A is before B. */ -+ gdb_assert (a.name != nullptr); -+ gdb_assert (b.name != nullptr); -+ -+ return strcmp (a.name, b.name) < 0; -+ }); -+ -+ /* Re-insert each item from the sorted list. */ -+ for (auto &entry : original_data) -+ { -+ /* We know that ORIGINAL_DATA contains no duplicates, this data was -+ taken from a hash table that de-duplicated entries for us, so -+ count this as a new item. -+ -+ As we retained the original size of m_data (see above) then we -+ should never need to grow m_data_ during this re-insertion phase, -+ assert that now. */ -+ ++m_element_count; -+ gdb_assert (!this->hash_needs_expanding ()); -+ -+ /* Lookup a slot. */ -+ symtab_index_entry &slot = this->find_slot (entry.name); -+ -+ /* As discussed above, we should not find duplicates. */ -+ gdb_assert (slot.name == nullptr); -+ -+ /* Move this item into the slot we found. */ -+ slot = std::move (entry); -+ } -+} -+ - /* See class definition. */ - - void -@@ -1311,6 +1377,9 @@ write_gdbindex (dwarf2_per_bfd *per_bfd, cooked_index *table, - for (auto map : table->get_addrmaps ()) - write_address_map (map, addr_vec, cu_index_htab); - -+ /* Ensure symbol hash is built domestically. */ -+ symtab.sort (); -+ - /* Now that we've processed all symbols we can shrink their cu_indices - lists. */ - symtab.minimize (); -diff --git a/gdb/testsuite/gdb.gdb/index-file.exp b/gdb/testsuite/gdb.gdb/index-file.exp ---- a/gdb/testsuite/gdb.gdb/index-file.exp -+++ b/gdb/testsuite/gdb.gdb/index-file.exp -@@ -38,6 +38,9 @@ with_timeout_factor $timeout_factor { - clean_restart $filename - } - -+# Record how many worker threads GDB is using. -+set worker_threads [gdb_get_worker_threads] -+ - # Generate an index file. - set dir1 [standard_output_file "index_1"] - remote_exec host "mkdir -p ${dir1}" -@@ -116,3 +119,41 @@ proc check_symbol_table_usage { filename } { - - set index_filename_base [file tail $filename] - check_symbol_table_usage "$dir1/${index_filename_base}.gdb-index" -+ -+# If GDB is using more than 1 worker thread then reduce the number of -+# worker threads, regenerate the index, and check that we get the same -+# index file back. At one point the layout of the index would vary -+# based on the number of worker threads used. -+if { $worker_threads > 1 } { -+ # Start GDB, but don't load a file yet. -+ clean_restart -+ -+ # Adjust the number of threads to use. -+ set reduced_threads [expr $worker_threads / 2] -+ gdb_test_no_output "maint set worker-threads $reduced_threads" -+ -+ with_timeout_factor $timeout_factor { -+ # Now load the test binary. -+ gdb_file_cmd $filename -+ } -+ -+ # Generate an index file. -+ set dir2 [standard_output_file "index_2"] -+ remote_exec host "mkdir -p ${dir2}" -+ with_timeout_factor $timeout_factor { -+ gdb_test_no_output "save gdb-index $dir2" \ -+ "create second gdb-index file" -+ } -+ -+ # Close GDB. -+ gdb_exit -+ -+ # Now check that the index files are identical. -+ foreach suffix { gdb-index } { -+ set result \ -+ [remote_exec host \ -+ "cmp -s \"$dir1/${index_filename_base}.${suffix}\" \"$dir2/${index_filename_base}.${suffix}\""] -+ gdb_assert { [lindex $result 0] == 0 } \ -+ "$suffix files are identical" -+ } -+} -diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp ---- a/gdb/testsuite/lib/gdb.exp -+++ b/gdb/testsuite/lib/gdb.exp -@@ -10033,6 +10033,21 @@ proc is_target_non_stop { {testname ""} } { - return $is_non_stop - } - -+# Return the number of worker threads that GDB is currently using. -+ -+proc gdb_get_worker_threads { {testname ""} } { -+ set worker_threads "UNKNOWN" -+ gdb_test_multiple "maintenance show worker-threads" $testname { -+ -wrap -re "The number of worker threads GDB can use is unlimited \\(currently ($::decimal)\\)\\." { -+ set worker_threads $expect_out(1,string) -+ } -+ -wrap -re "The number of worker threads GDB can use is ($::decimal)\\." { -+ set worker_threads $expect_out(1,string) -+ } -+ } -+ return $worker_threads -+} -+ - # Check if the compiler emits epilogue information associated - # with the closing brace or with the last statement line. - # diff --git a/gdb-rhbz-2232086-reduce-size-of-gdb-index.patch b/gdb-rhbz-2232086-reduce-size-of-gdb-index.patch deleted file mode 100644 index 41b495e..0000000 --- a/gdb-rhbz-2232086-reduce-size-of-gdb-index.patch +++ /dev/null @@ -1,222 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Andrew Burgess -Date: Fri, 24 Nov 2023 11:50:35 +0000 -Subject: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch - -;; Back-port upstream commit aa19bc1d259 as part of a fix for -;; non-deterministic gdb-index generation (RH BZ 2232086). - -gdb: reduce size of generated gdb-index file - -I noticed in passing that out algorithm for generating the gdb-index -file is incorrect. When building the hash table in add_index_entry we -count every incoming entry rehash when the number of entries gets too -large. However, some of the incoming entries will be duplicates, -which don't actually result in new items being added to the hash -table. - -As a result, we grow the gdb-index hash table far too often. - -With an unmodified GDB, generating a gdb-index for GDB, I see a file -size of 90M, with a hash usage (in the generated index file) of just -2.6%. - -With a patched GDB, generating a gdb-index for the _same_ GDB binary, -I now see a gdb-index file size of 30M, with a hash usage of 41.9%. - -This is a 67% reduction in gdb-index file size. - -Obviously, not every gdb-index file is going to see such big savings, -however, the larger a program, and the more symbols that are -duplicated between compilation units, the more GDB would over count, -and so, over-grow the index. - -The gdb-index hash table we create has a minimum size of 1024, and -then we grow the hash when it is 75% full, doubling the hash table at -that time. Given this, then we expect that either: - - a. The hash table is size 1024, and less than 75% full, or - b. The hash table is between 37.5% and 75% full. - -I've include a test that checks some of these constraints -- I've not -bothered to check the upper limit, and over full hash table isn't -really a problem here, but if the fill percentage is less than 37.5% -then this indicates that we've done something wrong (obviously, I also -check for the 1024 minimum size). - -Approved-By: Tom Tromey - -diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c ---- a/gdb/dwarf2/index-write.c -+++ b/gdb/dwarf2/index-write.c -@@ -254,20 +254,29 @@ add_index_entry (struct mapped_symtab *symtab, const char *name, - int is_static, gdb_index_symbol_kind kind, - offset_type cu_index) - { -- offset_type cu_index_and_attrs; -+ symtab_index_entry *slot = &find_slot (symtab, name); -+ if (slot->name == NULL) -+ { -+ /* This is a new element in the hash table. */ -+ ++symtab->n_elements; - -- ++symtab->n_elements; -- if (4 * symtab->n_elements / 3 >= symtab->data.size ()) -- hash_expand (symtab); -+ /* We might need to grow the hash table. */ -+ if (4 * symtab->n_elements / 3 >= symtab->data.size ()) -+ { -+ hash_expand (symtab); - -- symtab_index_entry &slot = find_slot (symtab, name); -- if (slot.name == NULL) -- { -- slot.name = name; -+ /* This element will have a different slot in the new table. */ -+ slot = &find_slot (symtab, name); -+ -+ /* But it should still be a new element in the hash table. */ -+ gdb_assert (slot->name == nullptr); -+ } -+ -+ slot->name = name; - /* index_offset is set later. */ - } - -- cu_index_and_attrs = 0; -+ offset_type cu_index_and_attrs = 0; - DW2_GDB_INDEX_CU_SET_VALUE (cu_index_and_attrs, cu_index); - DW2_GDB_INDEX_SYMBOL_STATIC_SET_VALUE (cu_index_and_attrs, is_static); - DW2_GDB_INDEX_SYMBOL_KIND_SET_VALUE (cu_index_and_attrs, kind); -@@ -279,7 +288,7 @@ add_index_entry (struct mapped_symtab *symtab, const char *name, - the last entry pushed), but a symbol could have multiple kinds in one CU. - To keep things simple we don't worry about the duplication here and - sort and uniquify the list after we've processed all symbols. */ -- slot.cu_indices.push_back (cu_index_and_attrs); -+ slot->cu_indices.push_back (cu_index_and_attrs); - } - - /* See symtab_index_entry. */ -diff --git a/gdb/testsuite/gdb.gdb/index-file.exp b/gdb/testsuite/gdb.gdb/index-file.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.gdb/index-file.exp -@@ -0,0 +1,118 @@ -+# Copyright 2023 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# Load the GDB executable, and then 'save gdb-index', and make some -+# checks of the generated index file. -+ -+load_lib selftest-support.exp -+ -+# Can't save an index with readnow. -+if {[readnow]} { -+ untested "cannot create an index when readnow is in use" -+ return -1 -+} -+ -+# A multiplier used to ensure slow tasks are less likely to timeout. -+set timeout_factor 20 -+ -+set filename [selftest_prepare] -+if { $filename eq "" } { -+ unsupported "${gdb_test_file_name}.exp" -+ return -1 -+} -+ -+with_timeout_factor $timeout_factor { -+ # Start GDB, load FILENAME. -+ clean_restart $filename -+} -+ -+# Generate an index file. -+set dir1 [standard_output_file "index_1"] -+remote_exec host "mkdir -p ${dir1}" -+with_timeout_factor $timeout_factor { -+ gdb_test_no_output "save gdb-index $dir1" \ -+ "create gdb-index file" -+} -+ -+# Close GDB. -+gdb_exit -+ -+# Validate that the index-file FILENAME has made efficient use of its -+# symbol hash table. Calculate the number of symbols in the hash -+# table and the total hash table size. The hash table starts with -+# 1024 entries, and then doubles each time it is filled to 75%. At -+# 75% filled, doubling the size takes it to 37.5% filled. -+# -+# Thus, the hash table is correctly filled if: -+# 1. Its size is 1024 (i.e. it has not yet had its first doubling), or -+# 2. Its filled percentage is over 37% -+# -+# We could check that it is not over filled, but I don't as that's not -+# really an issue. But we did once have a bug where the table was -+# doubled incorrectly, in which case we'd see a filled percentage of -+# around 2% in some cases, which is a huge waste of disk space. -+proc check_symbol_table_usage { filename } { -+ # Open the file in binary mode and read-only mode. -+ set fp [open $filename rb] -+ -+ # Configure the channel to use binary translation. -+ fconfigure $fp -translation binary -+ -+ # Read the first 8 bytes of the file, which contain the header of -+ # the index section. -+ set header [read $fp [expr 7 * 4]] -+ -+ # Scan the header to get the version, the CU list offset, and the -+ # types CU list offset. -+ binary scan $header iiiiii version \ -+ _ _ _ symbol_table_offset shortcut_offset -+ -+ # The length of the symbol hash table (in entries). -+ set len [expr ($shortcut_offset - $symbol_table_offset) / 8] -+ -+ # Now walk the hash table and count how many entries are in use. -+ set offset $symbol_table_offset -+ set count 0 -+ while { $offset < $shortcut_offset } { -+ seek $fp $offset -+ set entry [read $fp 8] -+ binary scan $entry ii name_ptr flags -+ if { $name_ptr != 0 } { -+ incr count -+ } -+ -+ incr offset 8 -+ } -+ -+ # Close the file. -+ close $fp -+ -+ # Calculate how full the cache is. -+ set pct [expr (100 * double($count)) / $len] -+ -+ # Write our results out to the gdb.log. -+ verbose -log "Hash table size: $len" -+ verbose -log "Hash table entries: $count" -+ verbose -log "Percentage usage: $pct%" -+ -+ # The minimum fill percentage is actually 37.5%, but we give TCL a -+ # little flexibility in case the FP maths give a result a little -+ # off. -+ gdb_assert { $len == 1024 || $pct > 37 } \ -+ "symbol hash table usage" -+} -+ -+set index_filename_base [file tail $filename] -+check_symbol_table_usage "$dir1/${index_filename_base}.gdb-index" diff --git a/gdb-rhbz2232086-refactor-selftest-support.patch b/gdb-rhbz2232086-refactor-selftest-support.patch deleted file mode 100644 index c19ef46..0000000 --- a/gdb-rhbz2232086-refactor-selftest-support.patch +++ /dev/null @@ -1,77 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Andrew Burgess -Date: Fri, 24 Nov 2023 11:10:08 +0000 -Subject: gdb-rhbz2232086-refactor-selftest-support.patch - -;; Back-port upstream commit 1f0fab7ff86 as part of a fix for -;; non-deterministic gdb-index generation (RH BZ 2232086). - -gdb/testsuite: small refactor in selftest-support.exp - -Split out the code that makes a copy of the GDB executable ready for -self testing into a new proc. A later commit in this series wants to -load the GDB executable into GDB (for creating an on-disk debug -index), but doesn't need to make use of the full do_self_tests proc. - -There should be no changes in what is tested after this commit. - -Approved-By: Tom Tromey - -diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp ---- a/gdb/testsuite/lib/selftest-support.exp -+++ b/gdb/testsuite/lib/selftest-support.exp -@@ -92,11 +92,13 @@ proc selftest_setup { executable function } { - return 0 - } - --# A simple way to run some self-tests. -- --proc do_self_tests {function body} { -- global GDB tool -- -+# Prepare for running a self-test by moving the GDB executable to a -+# location where we can use it as the inferior. Return the filename -+# of the new location. -+# -+# If the current testing setup is not suitable for running a -+# self-test, then return an empty string. -+proc selftest_prepare {} { - # Are we testing with a remote board? In that case, the target - # won't have access to the GDB's auxilliary data files - # (data-directory, etc.). It's simpler to just skip. -@@ -120,19 +122,31 @@ proc do_self_tests {function body} { - # Run the test with self. Copy the file executable file in case - # this OS doesn't like to edit its own text space. - -- set GDB_FULLPATH [find_gdb $GDB] -+ set gdb_fullpath [find_gdb $::GDB] - - if {[is_remote host]} { -- set xgdb x$tool -+ set xgdb x$::tool - } else { -- set xgdb [standard_output_file x$tool] -+ set xgdb [standard_output_file x$::tool] - } - - # Remove any old copy lying around. - remote_file host delete $xgdb - -+ set filename [remote_download host $gdb_fullpath $xgdb] -+ -+ return $filename -+} -+ -+# A simple way to run some self-tests. -+ -+proc do_self_tests {function body} { -+ set file [selftest_prepare] -+ if { $file eq "" } { -+ return -+ } -+ - gdb_start -- set file [remote_download host $GDB_FULLPATH $xgdb] - - # When debugging GDB with GDB, some operations can take a relatively long - # time, especially if the build is non-optimized. Bump the timeout for the diff --git a/gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch b/gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch deleted file mode 100644 index 1aa07a6..0000000 --- a/gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch +++ /dev/null @@ -1,48 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Alexandra=20H=C3=A1jkov=C3=A1?= -Date: Mon, 8 Jan 2024 13:24:05 +0100 -Subject: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch - -gdb/python: avoid use of _PyOS_ReadlineTState - -In python/py-gdb-readline.c we make use of _PyOS_ReadlineTState, -however, this variable is no longer public in Python 3.13, and so GDB -no longer builds. - -We are making use of _PyOS_ReadlineTState in order to re-acquire the -Python Global Interpreter Lock (GIL). The _PyOS_ReadlineTState -variable is set in Python's outer readline code prior to calling the -user (GDB) supplied readline callback function, which for us is -gdbpy_readline_wrapper. The gdbpy_readline_wrapper function is called -without the GIL held. - -Instead of using _PyOS_ReadlineTState, I propose that we switch to -calling PyGILState_Ensure() and PyGILState_Release(). These functions -will acquire the GIL based on the current thread. I think this should -be sufficient; I can't imagine why we'd be running -gdbpy_readline_wrapper on one thread on behalf of a different Python -thread.... that would be unexpected I think. - -Approved-By: Tom Tromey - -diff --git a/gdb/python/py-gdb-readline.c b/gdb/python/py-gdb-readline.c ---- a/gdb/python/py-gdb-readline.c -+++ b/gdb/python/py-gdb-readline.c -@@ -56,13 +56,11 @@ gdbpy_readline_wrapper (FILE *sys_stdin, FILE *sys_stdout, - if (except.reason == RETURN_QUIT) - return NULL; - -- /* The thread state is nulled during gdbpy_readline_wrapper, -- with the original value saved in the following undocumented -- variable (see Python's Parser/myreadline.c and -- Modules/readline.c). */ -- PyEval_RestoreThread (_PyOS_ReadlineTState); -+ -+ /* This readline callback is called without the GIL held. */ -+ gdbpy_gil gil; -+ - gdbpy_convert_exception (except); -- PyEval_SaveThread (); - return NULL; - } - diff --git a/gdb-rhbz2250652-gdbpy_gil.patch b/gdb-rhbz2250652-gdbpy_gil.patch deleted file mode 100644 index c51d512..0000000 --- a/gdb-rhbz2250652-gdbpy_gil.patch +++ /dev/null @@ -1,81 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Alexandra=20H=C3=A1jkov=C3=A1?= -Date: Mon, 8 Jan 2024 13:12:15 +0100 -Subject: gdb-rhbz2250652-gdbpy_gil.patch - -gdb: move gdbpy_gil into python-internal.h - -Move gdbpy_gil class into python-internal.h, the next -commit wants to make use of this class from a file other -than python.c. - -Approved-By: Tom Tromey - -diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h ---- a/gdb/python/python-internal.h -+++ b/gdb/python/python-internal.h -@@ -754,6 +754,30 @@ class gdbpy_allow_threads - PyThreadState *m_save; - }; - -+/* A helper class to save and restore the GIL, but without touching -+ the other globals that are handled by gdbpy_enter. */ -+ -+class gdbpy_gil -+{ -+public: -+ -+ gdbpy_gil () -+ : m_state (PyGILState_Ensure ()) -+ { -+ } -+ -+ ~gdbpy_gil () -+ { -+ PyGILState_Release (m_state); -+ } -+ -+ DISABLE_COPY_AND_ASSIGN (gdbpy_gil); -+ -+private: -+ -+ PyGILState_STATE m_state; -+}; -+ - /* Use this after a TRY_EXCEPT to throw the appropriate Python - exception. */ - #define GDB_PY_HANDLE_EXCEPTION(Exception) \ -diff --git a/gdb/python/python.c b/gdb/python/python.c ---- a/gdb/python/python.c -+++ b/gdb/python/python.c -@@ -257,30 +257,6 @@ gdbpy_enter::finalize () - python_gdbarch = target_gdbarch (); - } - --/* A helper class to save and restore the GIL, but without touching -- the other globals that are handled by gdbpy_enter. */ -- --class gdbpy_gil --{ --public: -- -- gdbpy_gil () -- : m_state (PyGILState_Ensure ()) -- { -- } -- -- ~gdbpy_gil () -- { -- PyGILState_Release (m_state); -- } -- -- DISABLE_COPY_AND_ASSIGN (gdbpy_gil); -- --private: -- -- PyGILState_STATE m_state; --}; -- - /* Set the quit flag. */ - - static void diff --git a/gdb-rhbz2261580-intrusive_list-assertion-fix.patch b/gdb-rhbz2261580-intrusive_list-assertion-fix.patch deleted file mode 100644 index 8ec30bc..0000000 --- a/gdb-rhbz2261580-intrusive_list-assertion-fix.patch +++ /dev/null @@ -1,55 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Kevin Buettner -Date: Mon, 29 Jan 2024 14:51:22 -0700 -Subject: gdb-rhbz2261580-intrusive_list-assertion-fix.patch - -;; Backport upstream workaround for GCC 14 problem which cause assertion -;; failures in GDB. - -[gdb/build] Workaround gcc PR113599 - -Since gcc commit d3f48f68227 ("c++: non-dependent .* operand folding -[PR112427]"), with gdb we run into PR gcc/113599 [1], a wrong-code bug, as -reported in PR build/31281. - -Work around this by flipping inherit order: -... --class thread_info : public refcounted_object, -- public intrusive_list_node -+class thread_info : public intrusive_list_node, -+ public refcounted_object -... - -An argument could be made that this isn't necessary, because this occurred in -an unreleased gcc version. - -However, I think it could be useful when bisecting gcc for other problems in -building gdb. Having this workaround means the bisect won't reintroduce the -problem. Furthermore, the workaround is harmless. - -Tested on Fedora rawhide x86_64. - -Approved-By: Tom Tromey - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31281 - -[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113599 - -diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h ---- a/gdb/gdbthread.h -+++ b/gdb/gdbthread.h -@@ -242,10 +242,11 @@ using private_thread_info_up = std::unique_ptr; - strong reference, and is thus not accounted for in the thread's - refcount. - -- The intrusive_list_node base links threads in a per-inferior list. */ -+ The intrusive_list_node base links threads in a per-inferior list. -+ We place it first in the inherit order to work around PR gcc/113599. */ - --class thread_info : public refcounted_object, -- public intrusive_list_node -+class thread_info : public intrusive_list_node, -+ public refcounted_object - { - public: - explicit thread_info (inferior *inf, ptid_t ptid); diff --git a/gdb-rhbz2277160-apx-disasm.patch b/gdb-rhbz2277160-apx-disasm.patch deleted file mode 100644 index dbf8c4b..0000000 --- a/gdb-rhbz2277160-apx-disasm.patch +++ /dev/null @@ -1,7834 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Keith Seitz -Date: Wed, 15 May 2024 09:59:51 -0700 -Subject: gdb-rhbz2277160-apx-disasm.patch - -;; Update x86 disassembler - -Update x86 disassembler with APX improvements by syncing -with gdb-15.1 release candidate. - -Resolves: rhbz#2277160 - -diff --git a/include/opcode/i386.h b/include/opcode/i386.h ---- a/include/opcode/i386.h -+++ b/include/opcode/i386.h -@@ -1,5 +1,5 @@ - /* opcode/i386.h -- Intel 80386 opcode macros -- Copyright (C) 1989-2023 Free Software Foundation, Inc. -+ Copyright (C) 1989-2024 Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler, and GDB, the GNU Debugger. - -@@ -112,9 +112,13 @@ - /* x86-64 extension prefix. */ - #define REX_OPCODE 0x40 - -+#define REX2_OPCODE 0xd5 -+ - /* Non-zero if OPCODE is the rex prefix. */ - #define REX_PREFIX_P(opcode) (((opcode) & 0xf0) == REX_OPCODE) - -+/* M0 in rex2 prefix represents map0 or map1. */ -+#define REX2_M 0x8 - /* Indicates 64 bit operand size. */ - #define REX_W 8 - /* High extension to reg field of modrm byte. */ -diff --git a/opcodes/i386-dis-evex-mod.h b/opcodes/i386-dis-evex-mod.h ---- a/opcodes/i386-dis-evex-mod.h -+++ b/opcodes/i386-dis-evex-mod.h -@@ -1 +1,10 @@ --/* Nothing at present. */ -+ /* MOD_EVEX_MAP4_F8_P1 */ -+ { -+ { "enqcmds", { Gva, M }, 0 }, -+ { VEX_W_TABLE (EVEX_W_MAP4_F8_P1_M_1) }, -+ }, -+ /* MOD_EVEX_MAP4_F8_P3 */ -+ { -+ { "enqcmd", { Gva, M }, 0 }, -+ { VEX_W_TABLE (EVEX_W_MAP4_F8_P3_M_1) }, -+ }, -diff --git a/opcodes/i386-dis-evex-prefix.h b/opcodes/i386-dis-evex-prefix.h ---- a/opcodes/i386-dis-evex-prefix.h -+++ b/opcodes/i386-dis-evex-prefix.h -@@ -338,6 +338,29 @@ - { "vcmpp%XH", { MaskG, Vex, EXxh, EXxEVexS, CMP }, 0 }, - { "vcmps%XH", { MaskG, VexScalar, EXw, EXxEVexS, CMP }, 0 }, - }, -+ /* PREFIX_EVEX_MAP4_F0 */ -+ { -+ { "crc32A", { Gdq, Eb }, 0 }, -+ { "invept", { Gm, Mo }, 0 }, -+ }, -+ /* PREFIX_EVEX_MAP4_F1 */ -+ { -+ { "crc32Q", { Gdq, Ev }, 0 }, -+ { "invvpid", { Gm, Mo }, 0 }, -+ { "crc32Q", { Gdq, Ev }, 0 }, -+ }, -+ /* PREFIX_EVEX_MAP4_F2 */ -+ { -+ { Bad_Opcode }, -+ { "invpcid", { Gm, M }, 0 }, -+ }, -+ /* PREFIX_EVEX_MAP4_F8 */ -+ { -+ { Bad_Opcode }, -+ { MOD_TABLE (MOD_EVEX_MAP4_F8_P_1) }, -+ { "movdir64b", { Gva, M }, 0 }, -+ { MOD_TABLE (MOD_EVEX_MAP4_F8_P_3) }, -+ }, - /* PREFIX_EVEX_MAP5_10 */ - { - { Bad_Opcode }, -diff --git a/opcodes/i386-dis-evex-reg.h b/opcodes/i386-dis-evex-reg.h ---- a/opcodes/i386-dis-evex-reg.h -+++ b/opcodes/i386-dis-evex-reg.h -@@ -49,3 +49,74 @@ - { "vscatterpf0qp%XW", { MVexVSIBQWpX }, PREFIX_DATA }, - { "vscatterpf1qp%XW", { MVexVSIBQWpX }, PREFIX_DATA }, - }, -+ /* REG_EVEX_MAP4_80 */ -+ { -+ { "%NFaddA", { VexGb, Eb, Ib }, NO_PREFIX }, -+ { "%NForA", { VexGb, Eb, Ib }, NO_PREFIX }, -+ { "adcA", { VexGb, Eb, Ib }, NO_PREFIX }, -+ { "sbbA", { VexGb, Eb, Ib }, NO_PREFIX }, -+ { "%NFandA", { VexGb, Eb, Ib }, NO_PREFIX }, -+ { "%NFsubA", { VexGb, Eb, Ib }, NO_PREFIX }, -+ { "%NFxorA", { VexGb, Eb, Ib }, NO_PREFIX }, -+ }, -+ /* REG_EVEX_MAP4_81 */ -+ { -+ { "%NFaddQ", { VexGv, Ev, Iv }, PREFIX_NP_OR_DATA }, -+ { "%NForQ", { VexGv, Ev, Iv }, PREFIX_NP_OR_DATA }, -+ { "adcQ", { VexGv, Ev, Iv }, PREFIX_NP_OR_DATA }, -+ { "sbbQ", { VexGv, Ev, Iv }, PREFIX_NP_OR_DATA }, -+ { "%NFandQ", { VexGv, Ev, Iv }, PREFIX_NP_OR_DATA }, -+ { "%NFsubQ", { VexGv, Ev, Iv }, PREFIX_NP_OR_DATA }, -+ { "%NFxorQ", { VexGv, Ev, Iv }, PREFIX_NP_OR_DATA }, -+ }, -+ /* REG_EVEX_MAP4_83 */ -+ { -+ { "%NFaddQ", { VexGv, Ev, sIb }, PREFIX_NP_OR_DATA }, -+ { "%NForQ", { VexGv, Ev, sIb }, PREFIX_NP_OR_DATA }, -+ { "adcQ", { VexGv, Ev, sIb }, PREFIX_NP_OR_DATA }, -+ { "sbbQ", { VexGv, Ev, sIb }, PREFIX_NP_OR_DATA }, -+ { "%NFandQ", { VexGv, Ev, sIb }, PREFIX_NP_OR_DATA }, -+ { "%NFsubQ", { VexGv, Ev, sIb }, PREFIX_NP_OR_DATA }, -+ { "%NFxorQ", { VexGv, Ev, sIb }, PREFIX_NP_OR_DATA }, -+ }, -+ /* REG_EVEX_MAP4_8F */ -+ { -+ { VEX_W_TABLE (EVEX_W_MAP4_8F_R_0) }, -+ }, -+ /* REG_EVEX_MAP4_F6 */ -+ { -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { "notA", { VexGb, Eb }, NO_PREFIX }, -+ { "%NFnegA", { VexGb, Eb }, NO_PREFIX }, -+ { "%NFmulA", { Eb }, NO_PREFIX }, -+ { "%NFimulA", { Eb }, NO_PREFIX }, -+ { "%NFdivA", { Eb }, NO_PREFIX }, -+ { "%NFidivA", { Eb }, NO_PREFIX }, -+ }, -+ /* REG_EVEX_MAP4_F7 */ -+ { -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { "notQ", { VexGv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%NFnegQ", { VexGv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%NFmulQ", { Ev }, PREFIX_NP_OR_DATA }, -+ { "%NFimulQ", { Ev }, PREFIX_NP_OR_DATA }, -+ { "%NFdivQ", { Ev }, PREFIX_NP_OR_DATA }, -+ { "%NFidivQ", { Ev }, PREFIX_NP_OR_DATA }, -+ }, -+ /* REG_EVEX_MAP4_FE */ -+ { -+ { "%NFincA", { VexGb, Eb }, NO_PREFIX }, -+ { "%NFdecA", { VexGb, Eb }, NO_PREFIX }, -+ }, -+ /* REG_EVEX_MAP4_FF */ -+ { -+ { "%NFincQ", { VexGv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%NFdecQ", { VexGv, Ev }, PREFIX_NP_OR_DATA }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { VEX_W_TABLE (EVEX_W_MAP4_FF_R_6) }, -+ }, -diff --git a/opcodes/i386-dis-evex-w.h b/opcodes/i386-dis-evex-w.h ---- a/opcodes/i386-dis-evex-w.h -+++ b/opcodes/i386-dis-evex-w.h -@@ -442,6 +442,24 @@ - { Bad_Opcode }, - { "vpshrdw", { XM, Vex, EXx, Ib }, 0 }, - }, -+ /* EVEX_W_MAP4_8F_R_0 */ -+ { -+ { "pop2", { { PUSH2_POP2_Fixup, q_mode}, Eq }, NO_PREFIX }, -+ { "pop2p", { { PUSH2_POP2_Fixup, q_mode}, Eq }, NO_PREFIX }, -+ }, -+ /* EVEX_W_MAP4_F8_P1_M_1 */ -+ { -+ { "uwrmsr", { Gq, Eq }, 0 }, -+ }, -+ /* EVEX_W_MAP4_F8_P3_M_1 */ -+ { -+ { "urdmsr", { Eq, Gq }, 0 }, -+ }, -+ /* EVEX_W_MAP4_FF_R_6 */ -+ { -+ { "push2", { { PUSH2_POP2_Fixup, q_mode}, Eq }, 0 }, -+ { "push2p", { { PUSH2_POP2_Fixup, q_mode}, Eq }, 0 }, -+ }, - /* EVEX_W_MAP5_5B_P_0 */ - { - { "vcvtdq2ph%XY", { XMxmmq, EXx, EXxEVexR }, 0 }, -diff --git a/opcodes/i386-dis-evex.h b/opcodes/i386-dis-evex.h ---- a/opcodes/i386-dis-evex.h -+++ b/opcodes/i386-dis-evex.h -@@ -164,10 +164,10 @@ static const struct dis386 evex_table[][256] = { - { Bad_Opcode }, - { Bad_Opcode }, - /* 90 */ -- { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -+ { X86_64_EVEX_W_TABLE (VEX_W_0F90_L_0) }, -+ { X86_64_EVEX_W_TABLE (VEX_W_0F91_L_0) }, -+ { X86_64_EVEX_W_TABLE (VEX_W_0F92_L_0) }, -+ { X86_64_EVEX_W_TABLE (VEX_W_0F93_L_0) }, - { Bad_Opcode }, - { Bad_Opcode }, - { Bad_Opcode }, -@@ -375,9 +375,9 @@ static const struct dis386 evex_table[][256] = { - { "vpsllv%DQ", { XM, Vex, EXx }, PREFIX_DATA }, - /* 48 */ - { Bad_Opcode }, -+ { X86_64_EVEX_MEM_W_TABLE (VEX_W_0F3849_X86_64_L_0) }, - { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -+ { X86_64_EVEX_MEM_W_TABLE (VEX_W_0F384B_X86_64_L_0) }, - { "vrcp14p%XW", { XM, EXx }, PREFIX_DATA }, - { "vrcp14s%XW", { XMScalar, VexScalar, EXdq }, PREFIX_DATA }, - { "vrsqrt14p%XW", { XM, EXx }, 0 }, -@@ -545,32 +545,32 @@ static const struct dis386 evex_table[][256] = { - { "%XEvaesdecY", { XM, Vex, EXx }, PREFIX_DATA }, - { "%XEvaesdeclastY", { XM, Vex, EXx }, PREFIX_DATA }, - /* E0 */ -- { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -+ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E0) }, -+ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E1) }, -+ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E2) }, -+ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E3) }, -+ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E4) }, -+ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E5) }, -+ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E6) }, -+ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E7) }, - /* E8 */ -- { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -+ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E8) }, -+ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38E9) }, -+ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38EA) }, -+ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38EB) }, -+ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38EC) }, -+ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38ED) }, -+ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38EE) }, -+ { X86_64_EVEX_FROM_VEX_TABLE (X86_64_VEX_0F38EF) }, - /* F0 */ - { Bad_Opcode }, - { Bad_Opcode }, -+ { X86_64_EVEX_PFX_TABLE (PREFIX_VEX_0F38F2_L_0) }, -+ { X86_64_EVEX_PFX_TABLE (PREFIX_VEX_0F38F3_L_0) }, - { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -- { Bad_Opcode }, -+ { X86_64_EVEX_PFX_TABLE (PREFIX_VEX_0F38F5_L_0) }, -+ { X86_64_EVEX_PFX_TABLE (PREFIX_VEX_0F38F6_L_0) }, -+ { X86_64_EVEX_PFX_TABLE (PREFIX_VEX_0F38F7_L_0) }, - /* F8 */ - { Bad_Opcode }, - { Bad_Opcode }, -@@ -854,7 +854,7 @@ static const struct dis386 evex_table[][256] = { - { Bad_Opcode }, - { Bad_Opcode }, - /* F0 */ -- { Bad_Opcode }, -+ { X86_64_EVEX_PFX_TABLE (PREFIX_VEX_0F3AF0_L_0) }, - { Bad_Opcode }, - { Bad_Opcode }, - { Bad_Opcode }, -@@ -872,6 +872,297 @@ static const struct dis386 evex_table[][256] = { - { Bad_Opcode }, - { Bad_Opcode }, - }, -+ /* EVEX_MAP4_ */ -+ { -+ /* 00 */ -+ { "%NFaddB", { VexGb, Eb, Gb }, NO_PREFIX }, -+ { "%NFaddS", { VexGv, Ev, Gv }, PREFIX_NP_OR_DATA }, -+ { "%NFaddB", { VexGb, Gb, EbS }, NO_PREFIX }, -+ { "%NFaddS", { VexGv, Gv, EvS }, PREFIX_NP_OR_DATA }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* 08 */ -+ { "%NForB", { VexGb, Eb, Gb }, NO_PREFIX }, -+ { "%NForS", { VexGv, Ev, Gv }, PREFIX_NP_OR_DATA }, -+ { "%NForB", { VexGb, Gb, EbS }, NO_PREFIX }, -+ { "%NForS", { VexGv, Gv, EvS }, PREFIX_NP_OR_DATA }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* 10 */ -+ { "adcB", { VexGb, Eb, Gb }, NO_PREFIX }, -+ { "adcS", { VexGv, Ev, Gv }, PREFIX_NP_OR_DATA }, -+ { "adcB", { VexGb, Gb, EbS }, NO_PREFIX }, -+ { "adcS", { VexGv, Gv, EvS }, PREFIX_NP_OR_DATA }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* 18 */ -+ { "sbbB", { VexGb, Eb, Gb }, NO_PREFIX }, -+ { "sbbS", { VexGv, Ev, Gv }, PREFIX_NP_OR_DATA }, -+ { "sbbB", { VexGb, Gb, EbS }, NO_PREFIX }, -+ { "sbbS", { VexGv, Gv, EvS }, PREFIX_NP_OR_DATA }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* 20 */ -+ { "%NFandB", { VexGb, Eb, Gb }, NO_PREFIX }, -+ { "%NFandS", { VexGv, Ev, Gv }, PREFIX_NP_OR_DATA }, -+ { "%NFandB", { VexGb, Gb, EbS }, NO_PREFIX }, -+ { "%NFandS", { VexGv, Gv, EvS }, PREFIX_NP_OR_DATA }, -+ { "%NFshldS", { VexGv, Ev, Gv, Ib }, PREFIX_NP_OR_DATA }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* 28 */ -+ { "%NFsubB", { VexGb, Eb, Gb }, NO_PREFIX }, -+ { "%NFsubS", { VexGv, Ev, Gv }, PREFIX_NP_OR_DATA }, -+ { "%NFsubB", { VexGb, Gb, EbS }, NO_PREFIX }, -+ { "%NFsubS", { VexGv, Gv, EvS }, PREFIX_NP_OR_DATA }, -+ { "%NFshrdS", { VexGv, Ev, Gv, Ib }, PREFIX_NP_OR_DATA }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* 30 */ -+ { "%NFxorB", { VexGb, Eb, Gb }, NO_PREFIX }, -+ { "%NFxorS", { VexGv, Ev, Gv }, PREFIX_NP_OR_DATA }, -+ { "%NFxorB", { VexGb, Gb, EbS }, NO_PREFIX }, -+ { "%NFxorS", { VexGv, Gv, EvS }, PREFIX_NP_OR_DATA }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* 38 */ -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* 40 */ -+ { "%CFcmovoS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%CFcmovnoS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%CFcmovbS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%CFcmovaeS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%CFcmoveS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%CFcmovneS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%CFcmovbeS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%CFcmovaS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, -+ /* 48 */ -+ { "%CFcmovsS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%CFcmovnsS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%CFcmovpS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%CFcmovnpS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%CFcmovlS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%CFcmovgeS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%CFcmovleS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%CFcmovgS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, -+ /* 50 */ -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* 58 */ -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* 60 */ -+ { "%MEmovbeS", { Gv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%MEmovbeS", { Ev, Gv }, PREFIX_NP_OR_DATA }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { "wrussK", { M, Gdq }, PREFIX_DATA }, -+ { PREFIX_TABLE (PREFIX_0F38F6) }, -+ { Bad_Opcode }, -+ /* 68 */ -+ { Bad_Opcode }, -+ { "%NFimulS", { Gv, Ev, Iv }, PREFIX_NP_OR_DATA }, -+ { Bad_Opcode }, -+ { "%NFimulS", { Gv, Ev, sIb }, PREFIX_NP_OR_DATA }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* 70 */ -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* 78 */ -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* 80 */ -+ { REG_TABLE (REG_EVEX_MAP4_80) }, -+ { REG_TABLE (REG_EVEX_MAP4_81) }, -+ { Bad_Opcode }, -+ { REG_TABLE (REG_EVEX_MAP4_83) }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* 88 */ -+ { "%NFpopcntS", { Gv, Ev }, PREFIX_NP_OR_DATA }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { REG_TABLE (REG_EVEX_MAP4_8F) }, -+ /* 90 */ -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* 98 */ -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* A0 */ -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { "%NFshldS", { VexGv, Ev, Gv, CL }, PREFIX_NP_OR_DATA }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* A8 */ -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { "%NFshrdS", { VexGv, Ev, Gv, CL }, PREFIX_NP_OR_DATA }, -+ { Bad_Opcode }, -+ { "%NFimulS", { VexGv, Gv, Ev }, PREFIX_NP_OR_DATA }, -+ /* B0 */ -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* B8 */ -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* C0 */ -+ { REG_TABLE (REG_C0) }, -+ { REG_TABLE (REG_C1) }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* C8 */ -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* D0 */ -+ { REG_TABLE (REG_D0) }, -+ { REG_TABLE (REG_D1) }, -+ { REG_TABLE (REG_D2) }, -+ { REG_TABLE (REG_D3) }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* D8 */ -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* E0 */ -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* E8 */ -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ /* F0 */ -+ { PREFIX_TABLE (PREFIX_EVEX_MAP4_F0) }, -+ { PREFIX_TABLE (PREFIX_EVEX_MAP4_F1) }, -+ { PREFIX_TABLE (PREFIX_EVEX_MAP4_F2) }, -+ { Bad_Opcode }, -+ { "%NFtzcntS", { Gv, Ev }, PREFIX_NP_OR_DATA }, -+ { "%NFlzcntS", { Gv, Ev }, PREFIX_NP_OR_DATA }, -+ { REG_TABLE (REG_EVEX_MAP4_F6) }, -+ { REG_TABLE (REG_EVEX_MAP4_F7) }, -+ /* F8 */ -+ { PREFIX_TABLE (PREFIX_EVEX_MAP4_F8) }, -+ { "movdiri", { Mdq, Gdq }, NO_PREFIX }, -+ { Bad_Opcode }, -+ { Bad_Opcode }, -+ { PREFIX_TABLE (PREFIX_0F38FC) }, -+ { Bad_Opcode }, -+ { REG_TABLE (REG_EVEX_MAP4_FE) }, -+ { REG_TABLE (REG_EVEX_MAP4_FF) }, -+ }, - /* EVEX_MAP5_ */ - { - /* 00 */ -diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c ---- a/opcodes/i386-dis.c -+++ b/opcodes/i386-dis.c -@@ -1,5 +1,5 @@ - /* Print i386 instructions for GDB, the GNU debugger. -- Copyright (C) 1988-2023 Free Software Foundation, Inc. -+ Copyright (C) 1988-2024 Free Software Foundation, Inc. - - This file is part of the GNU opcodes library. - -@@ -105,6 +105,8 @@ static bool FXSAVE_Fixup (instr_info *, int, int); - static bool MOVSXD_Fixup (instr_info *, int, int); - static bool DistinctDest_Fixup (instr_info *, int, int); - static bool PREFETCHI_Fixup (instr_info *, int, int); -+static bool PUSH2_POP2_Fixup (instr_info *, int, int); -+static bool JMPABS_Fixup (instr_info *, int, int); - - static void ATTRIBUTE_PRINTF_3 i386_dis_printf (const disassemble_info *, - enum disassembler_style, -@@ -132,6 +134,13 @@ enum x86_64_isa - intel64 - }; - -+enum evex_type -+{ -+ evex_default = 0, -+ evex_from_legacy, -+ evex_from_vex, -+}; -+ - struct instr_info - { - enum address_mode address_mode; -@@ -144,6 +153,12 @@ struct instr_info - /* Bits of REX we've already used. */ - uint8_t rex_used; - -+ /* Record W R4 X4 B4 bits for rex2. */ -+ unsigned char rex2; -+ /* Bits of rex2 we've already used. */ -+ unsigned char rex2_used; -+ unsigned char rex2_payload; -+ - bool need_modrm; - unsigned char need_vex; - bool has_sib; -@@ -169,6 +184,7 @@ struct instr_info - signed char last_data_prefix; - signed char last_addr_prefix; - signed char last_rex_prefix; -+ signed char last_rex2_prefix; - signed char last_seg_prefix; - signed char fwait_prefix; - /* The active segment register prefix. */ -@@ -205,14 +221,19 @@ struct instr_info - int ll; - bool w; - bool evex; -- bool r; - bool v; - bool zeroing; - bool b; - bool no_broadcast; -+ bool nf; - } - vex; - -+/* For APX EVEX-promoted prefix, EVEX.ND shares the same bit as vex.b. */ -+#define nd b -+ -+ enum evex_type evex_type; -+ - /* Remember if the current op is a jump instruction. */ - bool op_is_jump; - -@@ -221,6 +242,9 @@ struct instr_info - /* Record whether EVEX masking is used incorrectly. */ - bool illegal_masking; - -+ /* Record whether the modrm byte has been skipped. */ -+ bool has_skipped_modrm; -+ - unsigned char op_ad; - signed char op_index[MAX_OPERANDS]; - bool op_riprel[MAX_OPERANDS]; -@@ -262,8 +286,13 @@ struct dis_private { - { \ - if (value) \ - { \ -- if ((ins->rex & value)) \ -+ if (ins->rex & value) \ - ins->rex_used |= (value) | REX_OPCODE; \ -+ if (ins->rex2 & value) \ -+ { \ -+ ins->rex2_used |= (value); \ -+ ins->rex_used |= REX_OPCODE; \ -+ } \ - } \ - else \ - ins->rex_used |= REX_OPCODE; \ -@@ -273,6 +302,10 @@ struct dis_private { - #define EVEX_b_used 1 - #define EVEX_len_used 2 - -+ -+/* {rex2} is not printed when the REX2_SPECIAL is set. */ -+#define REX2_SPECIAL 16 -+ - /* Flags stored in PREFIXES. */ - #define PREFIX_REPZ 1 - #define PREFIX_REPNZ 2 -@@ -286,6 +319,9 @@ struct dis_private { - #define PREFIX_DATA 0x200 - #define PREFIX_ADDR 0x400 - #define PREFIX_FWAIT 0x800 -+#define PREFIX_REX2 0x1000 -+#define PREFIX_NP_OR_DATA 0x2000 -+#define NO_PREFIX 0x4000 - - /* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive) - to ADDR (exclusive) are valid. Returns true for success, false -@@ -367,6 +403,7 @@ fetch_error (const instr_info *ins) - #define PREFIX_IGNORED_DATA (PREFIX_DATA << PREFIX_IGNORED_SHIFT) - #define PREFIX_IGNORED_ADDR (PREFIX_ADDR << PREFIX_IGNORED_SHIFT) - #define PREFIX_IGNORED_LOCK (PREFIX_LOCK << PREFIX_IGNORED_SHIFT) -+#define PREFIX_REX2_ILLEGAL (PREFIX_REX2 << PREFIX_IGNORED_SHIFT) - - /* Opcode prefixes. */ - #define PREFIX_OPCODE (PREFIX_REPZ \ -@@ -418,6 +455,7 @@ fetch_error (const instr_info *ins) - #define Gv { OP_G, v_mode } - #define Gd { OP_G, d_mode } - #define Gdq { OP_G, dq_mode } -+#define Gq { OP_G, q_mode } - #define Gm { OP_G, m_mode } - #define Gva { OP_G, va_mode } - #define Gw { OP_G, w_mode } -@@ -527,7 +565,8 @@ fetch_error (const instr_info *ins) - #define EXEvexXNoBcst { OP_EX, evex_x_nobcst_mode } - #define Rd { OP_R, d_mode } - #define Rdq { OP_R, dq_mode } --#define Nq { OP_R, q_mode } -+#define Rq { OP_R, q_mode } -+#define Nq { OP_R, q_mm_mode } - #define Ux { OP_R, x_mode } - #define Uxmm { OP_R, xmm_mode } - #define Rxmmq { OP_R, xmmq_mode } -@@ -548,6 +587,8 @@ fetch_error (const instr_info *ins) - #define VexGatherD { OP_VEX, vex_vsib_d_w_dq_mode } - #define VexGatherQ { OP_VEX, vex_vsib_q_w_dq_mode } - #define VexGdq { OP_VEX, dq_mode } -+#define VexGb { OP_VEX, b_mode } -+#define VexGv { OP_VEX, v_mode } - #define VexTmm { OP_VEX, tmm_mode } - #define XMVexI4 { OP_REG_VexI4, x_mode } - #define XMVexScalarI4 { OP_REG_VexI4, scalar_mode } -@@ -624,6 +665,8 @@ enum - d_swap_mode, - /* quad word operand */ - q_mode, -+ /* 8-byte MM operand */ -+ q_mm_mode, - /* quad word operand with operand swapped */ - q_swap_mode, - /* ten-byte operand */ -@@ -778,6 +821,10 @@ enum - USE_RM_TABLE, - USE_PREFIX_TABLE, - USE_X86_64_TABLE, -+ USE_X86_64_EVEX_FROM_VEX_TABLE, -+ USE_X86_64_EVEX_PFX_TABLE, -+ USE_X86_64_EVEX_W_TABLE, -+ USE_X86_64_EVEX_MEM_W_TABLE, - USE_3BYTE_TABLE, - USE_XOP_8F_TABLE, - USE_VEX_C4_TABLE, -@@ -796,6 +843,11 @@ enum - #define RM_TABLE(I) DIS386 (USE_RM_TABLE, (I)) - #define PREFIX_TABLE(I) DIS386 (USE_PREFIX_TABLE, (I)) - #define X86_64_TABLE(I) DIS386 (USE_X86_64_TABLE, (I)) -+#define X86_64_EVEX_FROM_VEX_TABLE(I) \ -+ DIS386 (USE_X86_64_EVEX_FROM_VEX_TABLE, (I)) -+#define X86_64_EVEX_PFX_TABLE(I) DIS386 (USE_X86_64_EVEX_PFX_TABLE, (I)) -+#define X86_64_EVEX_W_TABLE(I) DIS386 (USE_X86_64_EVEX_W_TABLE, (I)) -+#define X86_64_EVEX_MEM_W_TABLE(I) DIS386 (USE_X86_64_EVEX_MEM_W_TABLE, (I)) - #define THREE_BYTE_TABLE(I) DIS386 (USE_3BYTE_TABLE, (I)) - #define XOP_8F_TABLE() DIS386 (USE_XOP_8F_TABLE, 0) - #define VEX_C4_TABLE() DIS386 (USE_VEX_C4_TABLE, 0) -@@ -844,7 +896,8 @@ enum - REG_VEX_0F73, - REG_VEX_0FAE, - REG_VEX_0F3849_X86_64_L_0_W_0_M_1_P_0, -- REG_VEX_0F38F3_L_0, -+ REG_VEX_0F38F3_L_0_P_0, -+ REG_VEX_MAP7_F8_L_0_W_0, - - REG_XOP_09_01_L_0, - REG_XOP_09_02_L_0, -@@ -855,7 +908,15 @@ enum - REG_EVEX_0F72, - REG_EVEX_0F73, - REG_EVEX_0F38C6_L_2, -- REG_EVEX_0F38C7_L_2 -+ REG_EVEX_0F38C7_L_2, -+ REG_EVEX_MAP4_80, -+ REG_EVEX_MAP4_81, -+ REG_EVEX_MAP4_83, -+ REG_EVEX_MAP4_8F, -+ REG_EVEX_MAP4_F6, -+ REG_EVEX_MAP4_F7, -+ REG_EVEX_MAP4_FE, -+ REG_EVEX_MAP4_FF, - }; - - enum -@@ -893,8 +954,12 @@ enum - MOD_0FC7_REG_6, - MOD_0FC7_REG_7, - MOD_0F38DC_PREFIX_1, -+ MOD_0F38F8, - - MOD_VEX_0F3849_X86_64_L_0_W_0, -+ -+ MOD_EVEX_MAP4_F8_P_1, -+ MOD_EVEX_MAP4_F8_P_3, - }; - - enum -@@ -1010,7 +1075,8 @@ enum - PREFIX_0F38F0, - PREFIX_0F38F1, - PREFIX_0F38F6, -- PREFIX_0F38F8, -+ PREFIX_0F38F8_M_0, -+ PREFIX_0F38F8_M_1_X86_64, - PREFIX_0F38FA, - PREFIX_0F38FB, - PREFIX_0F38FC, -@@ -1069,10 +1135,13 @@ enum - PREFIX_VEX_0F38CC, - PREFIX_VEX_0F38CD, - PREFIX_VEX_0F38DA_W_0, -+ PREFIX_VEX_0F38F2_L_0, -+ PREFIX_VEX_0F38F3_L_0, - PREFIX_VEX_0F38F5_L_0, - PREFIX_VEX_0F38F6_L_0, - PREFIX_VEX_0F38F7_L_0, - PREFIX_VEX_0F3AF0_L_0, -+ PREFIX_VEX_MAP7_F8_L_0_W_0_R_0_X86_64, - - PREFIX_EVEX_0F5B, - PREFIX_EVEX_0F6F, -@@ -1130,6 +1199,11 @@ enum - PREFIX_EVEX_0F3A67, - PREFIX_EVEX_0F3AC2, - -+ PREFIX_EVEX_MAP4_F0, -+ PREFIX_EVEX_MAP4_F1, -+ PREFIX_EVEX_MAP4_F2, -+ PREFIX_EVEX_MAP4_F8, -+ - PREFIX_EVEX_MAP5_10, - PREFIX_EVEX_MAP5_11, - PREFIX_EVEX_MAP5_1D, -@@ -1217,6 +1291,7 @@ enum - X86_64_0F18_REG_7_MOD_0, - X86_64_0F24, - X86_64_0F26, -+ X86_64_0F38F8_M_1, - X86_64_0FC7_REG_6_MOD_3_PREFIX_1, - - X86_64_VEX_0F3849, -@@ -1240,6 +1315,8 @@ enum - X86_64_VEX_0F38ED, - X86_64_VEX_0F38EE, - X86_64_VEX_0F38EF, -+ -+ X86_64_VEX_MAP7_F8_L_0_W_0_R_0, - }; - - enum -@@ -1259,7 +1336,8 @@ enum - { - VEX_0F = 0, - VEX_0F38, -- VEX_0F3A -+ VEX_0F3A, -+ VEX_MAP7, - }; - - enum -@@ -1267,8 +1345,10 @@ enum - EVEX_0F = 0, - EVEX_0F38, - EVEX_0F3A, -+ EVEX_MAP4, - EVEX_MAP5, - EVEX_MAP6, -+ EVEX_MAP7, - }; - - enum -@@ -1350,6 +1430,7 @@ enum - VEX_LEN_0F3ADE_W_0, - VEX_LEN_0F3ADF, - VEX_LEN_0F3AF0, -+ VEX_LEN_MAP7_F8, - VEX_LEN_XOP_08_85, - VEX_LEN_XOP_08_86, - VEX_LEN_XOP_08_87, -@@ -1510,6 +1591,7 @@ enum - VEX_W_0F3ACE, - VEX_W_0F3ACF, - VEX_W_0F3ADE, -+ VEX_W_MAP7_F8_L_0, - - VEX_W_XOP_08_85_L_0, - VEX_W_XOP_08_86_L_0, -@@ -1656,6 +1738,11 @@ enum - EVEX_W_0F3A70, - EVEX_W_0F3A72, - -+ EVEX_W_MAP4_8F_R_0, -+ EVEX_W_MAP4_F8_P1_M_1, -+ EVEX_W_MAP4_F8_P3_M_1, -+ EVEX_W_MAP4_FF_R_6, -+ - EVEX_W_MAP5_5B_P_0, - EVEX_W_MAP5_7A_P_3, - }; -@@ -1673,7 +1760,7 @@ struct dis386 { - }; - - /* Upper case letters in the instruction names here are macros. -- 'A' => print 'b' if no register operands or suffix_always is true -+ 'A' => print 'b' if no (suitable) register operand or suffix_always is true - 'B' => print 'b' if suffix_always is true - 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand - size prefix -@@ -1686,14 +1773,14 @@ struct dis386 { - 'I' unused. - 'J' unused. - 'K' => print 'd' or 'q' if rex prefix is present. -- 'L' unused. -+ 'L' => print 'l' or 'q' if suffix_always is true - 'M' => print 'r' if intel_mnemonic is false. - 'N' => print 'n' if instruction has no wait "prefix" - 'O' => print 'd' or 'o' (or 'q' in Intel mode) - 'P' => behave as 'T' except with register operand outside of suffix_always - mode -- 'Q' => print 'w', 'l' or 'q' for memory operand or suffix_always -- is true -+ 'Q' => print 'w', 'l' or 'q' if no (suitable) register operand or -+ suffix_always is true - 'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode) - 'S' => print 'w', 'l' or 'q' if suffix_always is true - 'T' => print 'w', 'l'/'d', or 'q' if instruction has an operand size -@@ -1724,6 +1811,11 @@ struct dis386 { - "XV" => print "{vex} " pseudo prefix - "XE" => print "{evex} " pseudo prefix if no EVEX-specific functionality is - is used by an EVEX-encoded (AVX512VL) instruction. -+ "ME" => print "{evex} " pseudo prefix for ins->modrm.mod != 3,if no -+ EVEX-specific functionality is used by an EVEX-encoded (AVX512VL) -+ instruction. -+ "NF" => print "{nf} " pseudo prefix when EVEX.NF = 1 and print "{evex} " -+ pseudo prefix when instructions without NF, EGPR and VVVV, - "YK" keep unused, to avoid ambiguity with the combined use of Y and K. - "YX" keep unused, to avoid ambiguity with the combined use of Y and X. - "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory operand, cond -@@ -1836,23 +1928,23 @@ static const struct dis386 dis386[] = { - { "dec{S|}", { RMeSI }, 0 }, - { "dec{S|}", { RMeDI }, 0 }, - /* 50 */ -- { "push{!P|}", { RMrAX }, 0 }, -- { "push{!P|}", { RMrCX }, 0 }, -- { "push{!P|}", { RMrDX }, 0 }, -- { "push{!P|}", { RMrBX }, 0 }, -- { "push{!P|}", { RMrSP }, 0 }, -- { "push{!P|}", { RMrBP }, 0 }, -- { "push{!P|}", { RMrSI }, 0 }, -- { "push{!P|}", { RMrDI }, 0 }, -+ { "push!P", { RMrAX }, 0 }, -+ { "push!P", { RMrCX }, 0 }, -+ { "push!P", { RMrDX }, 0 }, -+ { "push!P", { RMrBX }, 0 }, -+ { "push!P", { RMrSP }, 0 }, -+ { "push!P", { RMrBP }, 0 }, -+ { "push!P", { RMrSI }, 0 }, -+ { "push!P", { RMrDI }, 0 }, - /* 58 */ -- { "pop{!P|}", { RMrAX }, 0 }, -- { "pop{!P|}", { RMrCX }, 0 }, -- { "pop{!P|}", { RMrDX }, 0 }, -- { "pop{!P|}", { RMrBX }, 0 }, -- { "pop{!P|}", { RMrSP }, 0 }, -- { "pop{!P|}", { RMrBP }, 0 }, -- { "pop{!P|}", { RMrSI }, 0 }, -- { "pop{!P|}", { RMrDI }, 0 }, -+ { "pop!P", { RMrAX }, 0 }, -+ { "pop!P", { RMrCX }, 0 }, -+ { "pop!P", { RMrDX }, 0 }, -+ { "pop!P", { RMrBX }, 0 }, -+ { "pop!P", { RMrSP }, 0 }, -+ { "pop!P", { RMrBP }, 0 }, -+ { "pop!P", { RMrSI }, 0 }, -+ { "pop!P", { RMrDI }, 0 }, - /* 60 */ - { X86_64_TABLE (X86_64_60) }, - { X86_64_TABLE (X86_64_61) }, -@@ -1872,23 +1964,23 @@ static const struct dis386 dis386[] = { - { "outs{b|}", { indirDXr, Xb }, 0 }, - { X86_64_TABLE (X86_64_6F) }, - /* 70 */ -- { "joH", { Jb, BND, cond_jump_flag }, 0 }, -- { "jnoH", { Jb, BND, cond_jump_flag }, 0 }, -- { "jbH", { Jb, BND, cond_jump_flag }, 0 }, -- { "jaeH", { Jb, BND, cond_jump_flag }, 0 }, -- { "jeH", { Jb, BND, cond_jump_flag }, 0 }, -- { "jneH", { Jb, BND, cond_jump_flag }, 0 }, -- { "jbeH", { Jb, BND, cond_jump_flag }, 0 }, -- { "jaH", { Jb, BND, cond_jump_flag }, 0 }, -+ { "joH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jnoH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jbH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jaeH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jeH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jneH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jbeH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jaH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, - /* 78 */ -- { "jsH", { Jb, BND, cond_jump_flag }, 0 }, -- { "jnsH", { Jb, BND, cond_jump_flag }, 0 }, -- { "jpH", { Jb, BND, cond_jump_flag }, 0 }, -- { "jnpH", { Jb, BND, cond_jump_flag }, 0 }, -- { "jlH", { Jb, BND, cond_jump_flag }, 0 }, -- { "jgeH", { Jb, BND, cond_jump_flag }, 0 }, -- { "jleH", { Jb, BND, cond_jump_flag }, 0 }, -- { "jgH", { Jb, BND, cond_jump_flag }, 0 }, -+ { "jsH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jnsH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jpH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jnpH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jlH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jgeH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jleH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jgH", { Jb, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, - /* 80 */ - { REG_TABLE (REG_80) }, - { REG_TABLE (REG_81) }, -@@ -1926,23 +2018,23 @@ static const struct dis386 dis386[] = { - { "sahf", { XX }, 0 }, - { "lahf", { XX }, 0 }, - /* a0 */ -- { "mov%LB", { AL, Ob }, 0 }, -- { "mov%LS", { eAX, Ov }, 0 }, -- { "mov%LB", { Ob, AL }, 0 }, -- { "mov%LS", { Ov, eAX }, 0 }, -- { "movs{b|}", { Ybr, Xb }, 0 }, -- { "movs{R|}", { Yvr, Xv }, 0 }, -- { "cmps{b|}", { Xb, Yb }, 0 }, -- { "cmps{R|}", { Xv, Yv }, 0 }, -+ { "mov%LB", { AL, Ob }, PREFIX_REX2_ILLEGAL }, -+ { "mov%LS", { { JMPABS_Fixup, eAX_reg }, { JMPABS_Fixup, v_mode } }, PREFIX_REX2_ILLEGAL }, -+ { "mov%LB", { Ob, AL }, PREFIX_REX2_ILLEGAL }, -+ { "mov%LS", { Ov, eAX }, PREFIX_REX2_ILLEGAL }, -+ { "movs{b|}", { Ybr, Xb }, PREFIX_REX2_ILLEGAL }, -+ { "movs{R|}", { Yvr, Xv }, PREFIX_REX2_ILLEGAL }, -+ { "cmps{b|}", { Xb, Yb }, PREFIX_REX2_ILLEGAL }, -+ { "cmps{R|}", { Xv, Yv }, PREFIX_REX2_ILLEGAL }, - /* a8 */ -- { "testB", { AL, Ib }, 0 }, -- { "testS", { eAX, Iv }, 0 }, -- { "stosB", { Ybr, AL }, 0 }, -- { "stosS", { Yvr, eAX }, 0 }, -- { "lodsB", { ALr, Xb }, 0 }, -- { "lodsS", { eAXr, Xv }, 0 }, -- { "scasB", { AL, Yb }, 0 }, -- { "scasS", { eAX, Yv }, 0 }, -+ { "testB", { AL, Ib }, PREFIX_REX2_ILLEGAL }, -+ { "testS", { eAX, Iv }, PREFIX_REX2_ILLEGAL }, -+ { "stosB", { Ybr, AL }, PREFIX_REX2_ILLEGAL }, -+ { "stosS", { Yvr, eAX }, PREFIX_REX2_ILLEGAL }, -+ { "lodsB", { ALr, Xb }, PREFIX_REX2_ILLEGAL }, -+ { "lodsS", { eAXr, Xv }, PREFIX_REX2_ILLEGAL }, -+ { "scasB", { AL, Yb }, PREFIX_REX2_ILLEGAL }, -+ { "scasS", { eAX, Yv }, PREFIX_REX2_ILLEGAL }, - /* b0 */ - { "movB", { RMAL, Ib }, 0 }, - { "movB", { RMCL, Ib }, 0 }, -@@ -1998,23 +2090,23 @@ static const struct dis386 dis386[] = { - { FLOAT }, - { FLOAT }, - /* e0 */ -- { "loopneFH", { Jb, XX, loop_jcxz_flag }, 0 }, -- { "loopeFH", { Jb, XX, loop_jcxz_flag }, 0 }, -- { "loopFH", { Jb, XX, loop_jcxz_flag }, 0 }, -- { "jEcxzH", { Jb, XX, loop_jcxz_flag }, 0 }, -- { "inB", { AL, Ib }, 0 }, -- { "inG", { zAX, Ib }, 0 }, -- { "outB", { Ib, AL }, 0 }, -- { "outG", { Ib, zAX }, 0 }, -+ { "loopneFH", { Jb, XX, loop_jcxz_flag }, PREFIX_REX2_ILLEGAL }, -+ { "loopeFH", { Jb, XX, loop_jcxz_flag }, PREFIX_REX2_ILLEGAL }, -+ { "loopFH", { Jb, XX, loop_jcxz_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jEcxzH", { Jb, XX, loop_jcxz_flag }, PREFIX_REX2_ILLEGAL }, -+ { "inB", { AL, Ib }, PREFIX_REX2_ILLEGAL }, -+ { "inG", { zAX, Ib }, PREFIX_REX2_ILLEGAL }, -+ { "outB", { Ib, AL }, PREFIX_REX2_ILLEGAL }, -+ { "outG", { Ib, zAX }, PREFIX_REX2_ILLEGAL }, - /* e8 */ - { X86_64_TABLE (X86_64_E8) }, - { X86_64_TABLE (X86_64_E9) }, - { X86_64_TABLE (X86_64_EA) }, -- { "jmp", { Jb, BND }, 0 }, -- { "inB", { AL, indirDX }, 0 }, -- { "inG", { zAX, indirDX }, 0 }, -- { "outB", { indirDX, AL }, 0 }, -- { "outG", { indirDX, zAX }, 0 }, -+ { "jmp", { Jb, BND }, PREFIX_REX2_ILLEGAL }, -+ { "inB", { AL, indirDX }, PREFIX_REX2_ILLEGAL }, -+ { "inG", { zAX, indirDX }, PREFIX_REX2_ILLEGAL }, -+ { "outB", { indirDX, AL }, PREFIX_REX2_ILLEGAL }, -+ { "outG", { indirDX, zAX }, PREFIX_REX2_ILLEGAL }, - /* f0 */ - { Bad_Opcode }, /* lock prefix */ - { "int1", { XX }, 0 }, -@@ -2091,12 +2183,12 @@ static const struct dis386 dis386_twobyte[] = { - { PREFIX_TABLE (PREFIX_0F2E) }, - { PREFIX_TABLE (PREFIX_0F2F) }, - /* 30 */ -- { "wrmsr", { XX }, 0 }, -- { "rdtsc", { XX }, 0 }, -- { "rdmsr", { XX }, 0 }, -- { "rdpmc", { XX }, 0 }, -- { "sysenter", { SEP }, 0 }, -- { "sysexit%LQ", { SEP }, 0 }, -+ { "wrmsr", { XX }, PREFIX_REX2_ILLEGAL }, -+ { "rdtsc", { XX }, PREFIX_REX2_ILLEGAL }, -+ { "rdmsr", { XX }, PREFIX_REX2_ILLEGAL }, -+ { "rdpmc", { XX }, PREFIX_REX2_ILLEGAL }, -+ { "sysenter", { SEP }, PREFIX_REX2_ILLEGAL }, -+ { "sysexit%LQ", { SEP }, PREFIX_REX2_ILLEGAL }, - { Bad_Opcode }, - { "getsec", { XX }, 0 }, - /* 38 */ -@@ -2181,23 +2273,23 @@ static const struct dis386 dis386_twobyte[] = { - { PREFIX_TABLE (PREFIX_0F7E) }, - { PREFIX_TABLE (PREFIX_0F7F) }, - /* 80 */ -- { "joH", { Jv, BND, cond_jump_flag }, 0 }, -- { "jnoH", { Jv, BND, cond_jump_flag }, 0 }, -- { "jbH", { Jv, BND, cond_jump_flag }, 0 }, -- { "jaeH", { Jv, BND, cond_jump_flag }, 0 }, -- { "jeH", { Jv, BND, cond_jump_flag }, 0 }, -- { "jneH", { Jv, BND, cond_jump_flag }, 0 }, -- { "jbeH", { Jv, BND, cond_jump_flag }, 0 }, -- { "jaH", { Jv, BND, cond_jump_flag }, 0 }, -+ { "joH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jnoH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jbH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jaeH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jeH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jneH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jbeH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jaH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, - /* 88 */ -- { "jsH", { Jv, BND, cond_jump_flag }, 0 }, -- { "jnsH", { Jv, BND, cond_jump_flag }, 0 }, -- { "jpH", { Jv, BND, cond_jump_flag }, 0 }, -- { "jnpH", { Jv, BND, cond_jump_flag }, 0 }, -- { "jlH", { Jv, BND, cond_jump_flag }, 0 }, -- { "jgeH", { Jv, BND, cond_jump_flag }, 0 }, -- { "jleH", { Jv, BND, cond_jump_flag }, 0 }, -- { "jgH", { Jv, BND, cond_jump_flag }, 0 }, -+ { "jsH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jnsH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jpH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jnpH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jlH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jgeH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jleH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, -+ { "jgH", { Jv, BND, cond_jump_flag }, PREFIX_REX2_ILLEGAL }, - /* 90 */ - { "seto", { Eb }, 0 }, - { "setno", { Eb }, 0 }, -@@ -2390,22 +2482,30 @@ static const char intel_index16[][6] = { - - static const char att_names64[][8] = { - "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi", -- "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15" -+ "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", -+ "%r16", "%r17", "%r18", "%r19", "%r20", "%r21", "%r22", "%r23", -+ "%r24", "%r25", "%r26", "%r27", "%r28", "%r29", "%r30", "%r31", - }; - static const char att_names32[][8] = { - "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi", -- "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d" -+ "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d", -+ "%r16d", "%r17d", "%r18d", "%r19d", "%r20d", "%r21d", "%r22d", "%r23d", -+ "%r24d", "%r25d", "%r26d", "%r27d", "%r28d", "%r29d", "%r30d", "%r31d", - }; - static const char att_names16[][8] = { - "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di", -- "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w" -+ "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w", -+ "%r16w", "%r17w", "%r18w", "%r19w", "%r20w", "%r21w", "%r22w", "%r23w", -+ "%r24w", "%r25w", "%r26w", "%r27w", "%r28w", "%r29w", "%r30w", "%r31w", - }; - static const char att_names8[][8] = { - "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh", - }; - static const char att_names8rex[][8] = { - "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil", -- "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b" -+ "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b", -+ "%r16b", "%r17b", "%r18b", "%r19b", "%r20b", "%r21b", "%r22b", "%r23b", -+ "%r24b", "%r25b", "%r26b", "%r27b", "%r28b", "%r29b", "%r30b", "%r31b", - }; - static const char att_names_seg[][4] = { - "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?", -@@ -2520,25 +2620,25 @@ static const struct dis386 reg_table[][8] = { - }, - /* REG_C0 */ - { -- { "rolA", { Eb, Ib }, 0 }, -- { "rorA", { Eb, Ib }, 0 }, -- { "rclA", { Eb, Ib }, 0 }, -- { "rcrA", { Eb, Ib }, 0 }, -- { "shlA", { Eb, Ib }, 0 }, -- { "shrA", { Eb, Ib }, 0 }, -- { "shlA", { Eb, Ib }, 0 }, -- { "sarA", { Eb, Ib }, 0 }, -+ { "%NFrolA", { VexGb, Eb, Ib }, NO_PREFIX }, -+ { "%NFrorA", { VexGb, Eb, Ib }, NO_PREFIX }, -+ { "rclA", { VexGb, Eb, Ib }, NO_PREFIX }, -+ { "rcrA", { VexGb, Eb, Ib }, NO_PREFIX }, -+ { "%NFshlA", { VexGb, Eb, Ib }, NO_PREFIX }, -+ { "%NFshrA", { VexGb, Eb, Ib }, NO_PREFIX }, -+ { "%NFshlA", { VexGb, Eb, Ib }, NO_PREFIX }, -+ { "%NFsarA", { VexGb, Eb, Ib }, NO_PREFIX }, - }, - /* REG_C1 */ - { -- { "rolQ", { Ev, Ib }, 0 }, -- { "rorQ", { Ev, Ib }, 0 }, -- { "rclQ", { Ev, Ib }, 0 }, -- { "rcrQ", { Ev, Ib }, 0 }, -- { "shlQ", { Ev, Ib }, 0 }, -- { "shrQ", { Ev, Ib }, 0 }, -- { "shlQ", { Ev, Ib }, 0 }, -- { "sarQ", { Ev, Ib }, 0 }, -+ { "%NFrolQ", { VexGv, Ev, Ib }, PREFIX_NP_OR_DATA }, -+ { "%NFrorQ", { VexGv, Ev, Ib }, PREFIX_NP_OR_DATA }, -+ { "rclQ", { VexGv, Ev, Ib }, PREFIX_NP_OR_DATA }, -+ { "rcrQ", { VexGv, Ev, Ib }, PREFIX_NP_OR_DATA }, -+ { "%NFshlQ", { VexGv, Ev, Ib }, PREFIX_NP_OR_DATA }, -+ { "%NFshrQ", { VexGv, Ev, Ib }, PREFIX_NP_OR_DATA }, -+ { "%NFshlQ", { VexGv, Ev, Ib }, PREFIX_NP_OR_DATA }, -+ { "%NFsarQ", { VexGv, Ev, Ib }, PREFIX_NP_OR_DATA }, - }, - /* REG_C6 */ - { -@@ -2564,47 +2664,47 @@ static const struct dis386 reg_table[][8] = { - }, - /* REG_D0 */ - { -- { "rolA", { Eb, I1 }, 0 }, -- { "rorA", { Eb, I1 }, 0 }, -- { "rclA", { Eb, I1 }, 0 }, -- { "rcrA", { Eb, I1 }, 0 }, -- { "shlA", { Eb, I1 }, 0 }, -- { "shrA", { Eb, I1 }, 0 }, -- { "shlA", { Eb, I1 }, 0 }, -- { "sarA", { Eb, I1 }, 0 }, -+ { "%NFrolA", { VexGb, Eb, I1 }, NO_PREFIX }, -+ { "%NFrorA", { VexGb, Eb, I1 }, NO_PREFIX }, -+ { "rclA", { VexGb, Eb, I1 }, NO_PREFIX }, -+ { "rcrA", { VexGb, Eb, I1 }, NO_PREFIX }, -+ { "%NFshlA", { VexGb, Eb, I1 }, NO_PREFIX }, -+ { "%NFshrA", { VexGb, Eb, I1 }, NO_PREFIX }, -+ { "%NFshlA", { VexGb, Eb, I1 }, NO_PREFIX }, -+ { "%NFsarA", { VexGb, Eb, I1 }, NO_PREFIX }, - }, - /* REG_D1 */ - { -- { "rolQ", { Ev, I1 }, 0 }, -- { "rorQ", { Ev, I1 }, 0 }, -- { "rclQ", { Ev, I1 }, 0 }, -- { "rcrQ", { Ev, I1 }, 0 }, -- { "shlQ", { Ev, I1 }, 0 }, -- { "shrQ", { Ev, I1 }, 0 }, -- { "shlQ", { Ev, I1 }, 0 }, -- { "sarQ", { Ev, I1 }, 0 }, -+ { "%NFrolQ", { VexGv, Ev, I1 }, PREFIX_NP_OR_DATA }, -+ { "%NFrorQ", { VexGv, Ev, I1 }, PREFIX_NP_OR_DATA }, -+ { "rclQ", { VexGv, Ev, I1 }, PREFIX_NP_OR_DATA }, -+ { "rcrQ", { VexGv, Ev, I1 }, PREFIX_NP_OR_DATA }, -+ { "%NFshlQ", { VexGv, Ev, I1 }, PREFIX_NP_OR_DATA }, -+ { "%NFshrQ", { VexGv, Ev, I1 }, PREFIX_NP_OR_DATA }, -+ { "%NFshlQ", { VexGv, Ev, I1 }, PREFIX_NP_OR_DATA }, -+ { "%NFsarQ", { VexGv, Ev, I1 }, PREFIX_NP_OR_DATA }, - }, - /* REG_D2 */ - { -- { "rolA", { Eb, CL }, 0 }, -- { "rorA", { Eb, CL }, 0 }, -- { "rclA", { Eb, CL }, 0 }, -- { "rcrA", { Eb, CL }, 0 }, -- { "shlA", { Eb, CL }, 0 }, -- { "shrA", { Eb, CL }, 0 }, -- { "shlA", { Eb, CL }, 0 }, -- { "sarA", { Eb, CL }, 0 }, -+ { "%NFrolA", { VexGb, Eb, CL }, NO_PREFIX }, -+ { "%NFrorA", { VexGb, Eb, CL }, NO_PREFIX }, -+ { "rclA", { VexGb, Eb, CL }, NO_PREFIX }, -+ { "rcrA", { VexGb, Eb, CL }, NO_PREFIX }, -+ { "%NFshlA", { VexGb, Eb, CL }, NO_PREFIX }, -+ { "%NFshrA", { VexGb, Eb, CL }, NO_PREFIX }, -+ { "%NFshlA", { VexGb, Eb, CL }, NO_PREFIX }, -+ { "%NFsarA", { VexGb, Eb, CL }, NO_PREFIX }, - }, - /* REG_D3 */ - { -- { "rolQ", { Ev, CL }, 0 }, -- { "rorQ", { Ev, CL }, 0 }, -- { "rclQ", { Ev, CL }, 0 }, -- { "rcrQ", { Ev, CL }, 0 }, -- { "shlQ", { Ev, CL }, 0 }, -- { "shrQ", { Ev, CL }, 0 }, -- { "shlQ", { Ev, CL }, 0 }, -- { "sarQ", { Ev, CL }, 0 }, -+ { "%NFrolQ", { VexGv, Ev, CL }, PREFIX_NP_OR_DATA }, -+ { "%NFrorQ", { VexGv, Ev, CL }, PREFIX_NP_OR_DATA }, -+ { "rclQ", { VexGv, Ev, CL }, PREFIX_NP_OR_DATA }, -+ { "rcrQ", { VexGv, Ev, CL }, PREFIX_NP_OR_DATA }, -+ { "%NFshlQ", { VexGv, Ev, CL }, PREFIX_NP_OR_DATA }, -+ { "%NFshrQ", { VexGv, Ev, CL }, PREFIX_NP_OR_DATA }, -+ { "%NFshlQ", { VexGv, Ev, CL }, PREFIX_NP_OR_DATA }, -+ { "%NFsarQ", { VexGv, Ev, CL }, PREFIX_NP_OR_DATA }, - }, - /* REG_F6 */ - { -@@ -2794,9 +2894,9 @@ static const struct dis386 reg_table[][8] = { - { Bad_Opcode }, - { "cmpxchg8b", { { CMPXCHG8B_Fixup, q_mode } }, 0 }, - { Bad_Opcode }, -- { "xrstors", { FXSAVE }, 0 }, -- { "xsavec", { FXSAVE }, 0 }, -- { "xsaves", { FXSAVE }, 0 }, -+ { "xrstors", { FXSAVE }, PREFIX_REX2_ILLEGAL }, -+ { "xsavec", { FXSAVE }, PREFIX_REX2_ILLEGAL }, -+ { "xsaves", { FXSAVE }, PREFIX_REX2_ILLEGAL }, - { MOD_TABLE (MOD_0FC7_REG_6) }, - { MOD_TABLE (MOD_0FC7_REG_7) }, - }, -@@ -2842,12 +2942,16 @@ static const struct dis386 reg_table[][8] = { - { - { RM_TABLE (RM_VEX_0F3849_X86_64_L_0_W_0_M_1_P_0_R_0) }, - }, -- /* REG_VEX_0F38F3_L_0 */ -+ /* REG_VEX_0F38F3_L_0_P_0 */ - { - { Bad_Opcode }, -- { "blsrS", { VexGdq, Edq }, PREFIX_OPCODE }, -- { "blsmskS", { VexGdq, Edq }, PREFIX_OPCODE }, -- { "blsiS", { VexGdq, Edq }, PREFIX_OPCODE }, -+ { "%NFblsrS", { VexGdq, Edq }, 0 }, -+ { "%NFblsmskS", { VexGdq, Edq }, 0 }, -+ { "%NFblsiS", { VexGdq, Edq }, 0 }, -+ }, -+ /* REG_VEX_MAP7_F8_L_0_W_0 */ -+ { -+ { X86_64_TABLE (X86_64_VEX_MAP7_F8_L_0_W_0_R_0) }, - }, - /* REG_XOP_09_01_L_0 */ - { -@@ -3364,7 +3468,7 @@ static const struct dis386 prefix_table[][4] = { - - /* PREFIX_0FAE_REG_4_MOD_0 */ - { -- { "xsave", { FXSAVE }, 0 }, -+ { "xsave", { FXSAVE }, PREFIX_REX2_ILLEGAL }, - { "ptwrite{%LQ|}", { Edq }, 0 }, - }, - -@@ -3382,7 +3486,7 @@ static const struct dis386 prefix_table[][4] = { - - /* PREFIX_0FAE_REG_6_MOD_0 */ - { -- { "xsaveopt", { FXSAVE }, PREFIX_OPCODE }, -+ { "xsaveopt", { FXSAVE }, PREFIX_OPCODE | PREFIX_REX2_ILLEGAL }, - { "clrssbsy", { Mq }, PREFIX_OPCODE }, - { "clwb", { Mb }, PREFIX_OPCODE }, - }, -@@ -3550,18 +3654,27 @@ static const struct dis386 prefix_table[][4] = { - /* PREFIX_0F38F6 */ - { - { "wrssK", { M, Gdq }, 0 }, -- { "adoxS", { Gdq, Edq}, 0 }, -- { "adcxS", { Gdq, Edq}, 0 }, -+ { "adoxL", { VexGdq, Gdq, Edq }, 0 }, -+ { "adcxL", { VexGdq, Gdq, Edq }, 0 }, - { Bad_Opcode }, - }, - -- /* PREFIX_0F38F8 */ -+ /* PREFIX_0F38F8_M_0 */ - { - { Bad_Opcode }, - { "enqcmds", { Gva, M }, 0 }, - { "movdir64b", { Gva, M }, 0 }, - { "enqcmd", { Gva, M }, 0 }, - }, -+ -+ /* PREFIX_0F38F8_M_1_X86_64 */ -+ { -+ { Bad_Opcode }, -+ { "uwrmsr", { Gq, Rq }, 0 }, -+ { Bad_Opcode }, -+ { "urdmsr", { Rq, Gq }, 0 }, -+ }, -+ - /* PREFIX_0F38FA */ - { - { Bad_Opcode }, -@@ -3768,38 +3881,38 @@ static const struct dis386 prefix_table[][4] = { - - /* PREFIX_VEX_0F90_L_0_W_0 */ - { -- { "kmovw", { MaskG, MaskE }, 0 }, -+ { "%XEkmovw", { MaskG, MaskE }, 0 }, - { Bad_Opcode }, -- { "kmovb", { MaskG, MaskBDE }, 0 }, -+ { "%XEkmovb", { MaskG, MaskBDE }, 0 }, - }, - - /* PREFIX_VEX_0F90_L_0_W_1 */ - { -- { "kmovq", { MaskG, MaskE }, 0 }, -+ { "%XEkmovq", { MaskG, MaskE }, 0 }, - { Bad_Opcode }, -- { "kmovd", { MaskG, MaskBDE }, 0 }, -+ { "%XEkmovd", { MaskG, MaskBDE }, 0 }, - }, - - /* PREFIX_VEX_0F91_L_0_W_0 */ - { -- { "kmovw", { Mw, MaskG }, 0 }, -+ { "%XEkmovw", { Mw, MaskG }, 0 }, - { Bad_Opcode }, -- { "kmovb", { Mb, MaskG }, 0 }, -+ { "%XEkmovb", { Mb, MaskG }, 0 }, - }, - - /* PREFIX_VEX_0F91_L_0_W_1 */ - { -- { "kmovq", { Mq, MaskG }, 0 }, -+ { "%XEkmovq", { Mq, MaskG }, 0 }, - { Bad_Opcode }, -- { "kmovd", { Md, MaskG }, 0 }, -+ { "%XEkmovd", { Md, MaskG }, 0 }, - }, - - /* PREFIX_VEX_0F92_L_0_W_0 */ - { -- { "kmovw", { MaskG, Rdq }, 0 }, -+ { "%XEkmovw", { MaskG, Rdq }, 0 }, - { Bad_Opcode }, -- { "kmovb", { MaskG, Rdq }, 0 }, -- { "kmovd", { MaskG, Rdq }, 0 }, -+ { "%XEkmovb", { MaskG, Rdq }, 0 }, -+ { "%XEkmovd", { MaskG, Rdq }, 0 }, - }, - - /* PREFIX_VEX_0F92_L_0_W_1 */ -@@ -3807,15 +3920,15 @@ static const struct dis386 prefix_table[][4] = { - { Bad_Opcode }, - { Bad_Opcode }, - { Bad_Opcode }, -- { "kmovK", { MaskG, Rdq }, 0 }, -+ { "%XEkmovK", { MaskG, Rdq }, 0 }, - }, - - /* PREFIX_VEX_0F93_L_0_W_0 */ - { -- { "kmovw", { Gdq, MaskR }, 0 }, -+ { "%XEkmovw", { Gdq, MaskR }, 0 }, - { Bad_Opcode }, -- { "kmovb", { Gdq, MaskR }, 0 }, -- { "kmovd", { Gdq, MaskR }, 0 }, -+ { "%XEkmovb", { Gdq, MaskR }, 0 }, -+ { "%XEkmovd", { Gdq, MaskR }, 0 }, - }, - - /* PREFIX_VEX_0F93_L_0_W_1 */ -@@ -3823,7 +3936,7 @@ static const struct dis386 prefix_table[][4] = { - { Bad_Opcode }, - { Bad_Opcode }, - { Bad_Opcode }, -- { "kmovK", { Gdq, MaskR }, 0 }, -+ { "%XEkmovK", { Gdq, MaskR }, 0 }, - }, - - /* PREFIX_VEX_0F98_L_0_W_0 */ -@@ -3982,12 +4095,22 @@ static const struct dis386 prefix_table[][4] = { - { "vsm4rnds4", { XM, Vex, EXx }, 0 }, - }, - -+ /* PREFIX_VEX_0F38F2_L_0 */ -+ { -+ { "%NFandnS", { Gdq, VexGdq, Edq }, 0 }, -+ }, -+ -+ /* PREFIX_VEX_0F38F3_L_0 */ -+ { -+ { REG_TABLE (REG_VEX_0F38F3_L_0_P_0) }, -+ }, -+ - /* PREFIX_VEX_0F38F5_L_0 */ - { -- { "bzhiS", { Gdq, Edq, VexGdq }, 0 }, -- { "pextS", { Gdq, VexGdq, Edq }, 0 }, -+ { "%NFbzhiS", { Gdq, Edq, VexGdq }, 0 }, -+ { "%XEpextS", { Gdq, VexGdq, Edq }, 0 }, - { Bad_Opcode }, -- { "pdepS", { Gdq, VexGdq, Edq }, 0 }, -+ { "%XEpdepS", { Gdq, VexGdq, Edq }, 0 }, - }, - - /* PREFIX_VEX_0F38F6_L_0 */ -@@ -3995,15 +4118,15 @@ static const struct dis386 prefix_table[][4] = { - { Bad_Opcode }, - { Bad_Opcode }, - { Bad_Opcode }, -- { "mulxS", { Gdq, VexGdq, Edq }, 0 }, -+ { "%XEmulxS", { Gdq, VexGdq, Edq }, 0 }, - }, - - /* PREFIX_VEX_0F38F7_L_0 */ - { -- { "bextrS", { Gdq, Edq, VexGdq }, 0 }, -- { "sarxS", { Gdq, Edq, VexGdq }, 0 }, -- { "shlxS", { Gdq, Edq, VexGdq }, 0 }, -- { "shrxS", { Gdq, Edq, VexGdq }, 0 }, -+ { "%NFbextrS", { Gdq, Edq, VexGdq }, 0 }, -+ { "%XEsarxS", { Gdq, Edq, VexGdq }, 0 }, -+ { "%XEshlxS", { Gdq, Edq, VexGdq }, 0 }, -+ { "%XEshrxS", { Gdq, Edq, VexGdq }, 0 }, - }, - - /* PREFIX_VEX_0F3AF0_L_0 */ -@@ -4011,7 +4134,15 @@ static const struct dis386 prefix_table[][4] = { - { Bad_Opcode }, - { Bad_Opcode }, - { Bad_Opcode }, -- { "rorxS", { Gdq, Edq, Ib }, 0 }, -+ { "%XErorxS", { Gdq, Edq, Ib }, 0 }, -+ }, -+ -+ /* PREFIX_VEX_MAP7_F8_L_0_W_0_R_0_X86_64 */ -+ { -+ { Bad_Opcode }, -+ { "uwrmsr", { Skip_MODRM, Id, Rq }, 0 }, -+ { Bad_Opcode }, -+ { "urdmsr", { Rq, Id }, 0 }, - }, - - #include "i386-dis-evex-prefix.h" -@@ -4160,13 +4291,13 @@ static const struct dis386 x86_64_table[][2] = { - /* X86_64_E8 */ - { - { "callP", { Jv, BND }, 0 }, -- { "call@", { Jv, BND }, 0 } -+ { "call@", { Jv, BND }, PREFIX_REX2_ILLEGAL } - }, - - /* X86_64_E9 */ - { - { "jmpP", { Jv, BND }, 0 }, -- { "jmp@", { Jv, BND }, 0 } -+ { "jmp@", { Jv, BND }, PREFIX_REX2_ILLEGAL } - }, - - /* X86_64_EA */ -@@ -4322,6 +4453,12 @@ static const struct dis386 x86_64_table[][2] = { - { "movZ", { Td, Em }, 0 }, - }, - -+ { -+ /* X86_64_0F38F8_M_1 */ -+ { Bad_Opcode }, -+ { PREFIX_TABLE (PREFIX_0F38F8_M_1_X86_64) }, -+ }, -+ - /* X86_64_0FC7_REG_6_MOD_3_PREFIX_1 */ - { - { Bad_Opcode }, -@@ -4361,97 +4498,103 @@ static const struct dis386 x86_64_table[][2] = { - /* X86_64_VEX_0F38E0 */ - { - { Bad_Opcode }, -- { "cmpoxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, -+ { "%XEcmpoxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, - }, - - /* X86_64_VEX_0F38E1 */ - { - { Bad_Opcode }, -- { "cmpnoxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, -+ { "%XEcmpnoxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, - }, - - /* X86_64_VEX_0F38E2 */ - { - { Bad_Opcode }, -- { "cmpbxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, -+ { "%XEcmpbxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, - }, - - /* X86_64_VEX_0F38E3 */ - { - { Bad_Opcode }, -- { "cmpnbxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, -+ { "%XEcmpnbxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, - }, - - /* X86_64_VEX_0F38E4 */ - { - { Bad_Opcode }, -- { "cmpzxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, -+ { "%XEcmpzxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, - }, - - /* X86_64_VEX_0F38E5 */ - { - { Bad_Opcode }, -- { "cmpnzxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, -+ { "%XEcmpnzxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, - }, - - /* X86_64_VEX_0F38E6 */ - { - { Bad_Opcode }, -- { "cmpbexadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, -+ { "%XEcmpbexadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, - }, - - /* X86_64_VEX_0F38E7 */ - { - { Bad_Opcode }, -- { "cmpnbexadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, -+ { "%XEcmpnbexadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, - }, - - /* X86_64_VEX_0F38E8 */ - { - { Bad_Opcode }, -- { "cmpsxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, -+ { "%XEcmpsxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, - }, - - /* X86_64_VEX_0F38E9 */ - { - { Bad_Opcode }, -- { "cmpnsxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, -+ { "%XEcmpnsxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, - }, - - /* X86_64_VEX_0F38EA */ - { - { Bad_Opcode }, -- { "cmppxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, -+ { "%XEcmppxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, - }, - - /* X86_64_VEX_0F38EB */ - { - { Bad_Opcode }, -- { "cmpnpxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, -+ { "%XEcmpnpxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, - }, - - /* X86_64_VEX_0F38EC */ - { - { Bad_Opcode }, -- { "cmplxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, -+ { "%XEcmplxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, - }, - - /* X86_64_VEX_0F38ED */ - { - { Bad_Opcode }, -- { "cmpnlxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, -+ { "%XEcmpnlxadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, - }, - - /* X86_64_VEX_0F38EE */ - { - { Bad_Opcode }, -- { "cmplexadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, -+ { "%XEcmplexadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, - }, - - /* X86_64_VEX_0F38EF */ - { - { Bad_Opcode }, -- { "cmpnlexadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, -+ { "%XEcmpnlexadd", { Mdq, Gdq, VexGdq }, PREFIX_DATA }, -+ }, -+ -+ /* X86_64_VEX_MAP7_F8_L_0_W_0_R_0 */ -+ { -+ { Bad_Opcode }, -+ { PREFIX_TABLE (PREFIX_VEX_MAP7_F8_L_0_W_0_R_0_X86_64) }, - }, - }; - -@@ -4739,7 +4882,7 @@ static const struct dis386 three_byte_table[][256] = { - { PREFIX_TABLE (PREFIX_0F38F6) }, - { Bad_Opcode }, - /* f8 */ -- { PREFIX_TABLE (PREFIX_0F38F8) }, -+ { MOD_TABLE (MOD_0F38F8) }, - { "movdiri", { Mdq, Gdq }, PREFIX_OPCODE }, - { PREFIX_TABLE (PREFIX_0F38FA) }, - { PREFIX_TABLE (PREFIX_0F38FB) }, -@@ -7039,12 +7182,12 @@ static const struct dis386 vex_len_table[][2] = { - - /* VEX_LEN_0F38F2 */ - { -- { "andnS", { Gdq, VexGdq, Edq }, PREFIX_OPCODE }, -+ { PREFIX_TABLE (PREFIX_VEX_0F38F2_L_0) }, - }, - - /* VEX_LEN_0F38F3 */ - { -- { REG_TABLE(REG_VEX_0F38F3_L_0) }, -+ { PREFIX_TABLE (PREFIX_VEX_0F38F3_L_0) }, - }, - - /* VEX_LEN_0F38F5 */ -@@ -7205,6 +7348,11 @@ static const struct dis386 vex_len_table[][2] = { - { PREFIX_TABLE (PREFIX_VEX_0F3AF0_L_0) }, - }, - -+ /* VEX_LEN_MAP7_F8 */ -+ { -+ { VEX_W_TABLE (VEX_W_MAP7_F8_L_0) }, -+ }, -+ - /* VEX_LEN_XOP_08_85 */ - { - { VEX_W_TABLE (VEX_W_XOP_08_85_L_0) }, -@@ -7811,6 +7959,10 @@ static const struct dis386 vex_w_table[][2] = { - /* VEX_W_0F3ADE */ - { VEX_LEN_TABLE (VEX_LEN_0F3ADE_W_0) }, - }, -+ { -+ /* VEX_W_MAP7_F8_L_0 */ -+ { REG_TABLE (REG_VEX_MAP7_F8_L_0_W_0) }, -+ }, - /* VEX_W_XOP_08_85_L_0 */ - { - { "vpmacssww", { XM, Vex, EXx, XMVexI4 }, 0 }, -@@ -8125,7 +8277,7 @@ static const struct dis386 mod_table[][2] = { - }, - { - /* MOD_0FAE_REG_5 */ -- { "xrstor", { FXSAVE }, PREFIX_OPCODE }, -+ { "xrstor", { FXSAVE }, PREFIX_OPCODE | PREFIX_REX2_ILLEGAL }, - { PREFIX_TABLE (PREFIX_0FAE_REG_5_MOD_3) }, - }, - { -@@ -8153,6 +8305,11 @@ static const struct dis386 mod_table[][2] = { - { "aesenc128kl", { XM, M }, 0 }, - { "loadiwkey", { XM, EXx }, 0 }, - }, -+ /* MOD_0F38F8 */ -+ { -+ { PREFIX_TABLE (PREFIX_0F38F8_M_0) }, -+ { X86_64_TABLE (X86_64_0F38F8_M_1) }, -+ }, - { - /* MOD_VEX_0F3849_X86_64_L_0_W_0 */ - { PREFIX_TABLE (PREFIX_VEX_0F3849_X86_64_L_0_W_0_M_0) }, -@@ -8323,6 +8480,24 @@ ckprefix (instr_info *ins) - return ckp_okay; - ins->last_rex_prefix = i; - break; -+ /* REX2 must be the last prefix. */ -+ case REX2_OPCODE: -+ if (ins->address_mode == mode_64bit) -+ { -+ if (ins->last_rex_prefix >= 0) -+ return ckp_bogus; -+ -+ ins->codep++; -+ if (!fetch_code (ins->info, ins->codep + 1)) -+ return ckp_fetch_error; -+ ins->rex2_payload = *ins->codep; -+ ins->rex2 = ins->rex2_payload >> 4; -+ ins->rex = (ins->rex2_payload & 0xf) | REX_OPCODE; -+ ins->codep++; -+ ins->last_rex2_prefix = i; -+ ins->all_prefixes[i] = REX2_OPCODE; -+ } -+ return ckp_okay; - case 0xf3: - ins->prefixes |= PREFIX_REPZ; - ins->last_repz_prefix = i; -@@ -8490,6 +8665,8 @@ prefix_name (enum address_mode mode, uint8_t pref, int sizeflag) - return "bnd"; - case NOTRACK_PREFIX: - return "notrack"; -+ case REX2_OPCODE: -+ return "rex2"; - default: - return NULL; - } -@@ -8507,10 +8684,10 @@ with the -M switch (multiple options should be separated by commas):\n")); - fprintf (stream, _(" i8086 Disassemble in 16bit mode\n")); - fprintf (stream, _(" att Display instruction in AT&T syntax\n")); - fprintf (stream, _(" intel Display instruction in Intel syntax\n")); -- fprintf (stream, _(" att-mnemonic\n" -- " Display instruction in AT&T mnemonic\n")); -- fprintf (stream, _(" intel-mnemonic\n" -- " Display instruction in Intel mnemonic\n")); -+ fprintf (stream, _(" att-mnemonic (AT&T syntax only)\n" -+ " Display instruction with AT&T mnemonic\n")); -+ fprintf (stream, _(" intel-mnemonic (AT&T syntax only)\n" -+ " Display instruction with Intel mnemonic\n")); - fprintf (stream, _(" addr64 Assume 64bit address size\n")); - fprintf (stream, _(" addr32 Assume 32bit address size\n")); - fprintf (stream, _(" addr16 Assume 16bit address size\n")); -@@ -8527,6 +8704,8 @@ static const struct dis386 bad_opcode = { "(bad)", { XX }, 0 }; - /* Fetch error indicator. */ - static const struct dis386 err_opcode = { NULL, { XX }, 0 }; - -+static const struct dis386 map7_f8_opcode = { VEX_LEN_TABLE (VEX_LEN_MAP7_F8) }; -+ - /* Get a pointer to struct dis386 with a valid name. */ - - static const struct dis386 * -@@ -8553,6 +8732,7 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) - break; - - case USE_PREFIX_TABLE: -+ use_prefix_table: - if (ins->need_vex) - { - /* The prefix in VEX is implicit. */ -@@ -8622,12 +8802,40 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) - dp = &prefix_table[dp->op[1].bytemode][vindex]; - break; - -+ case USE_X86_64_EVEX_FROM_VEX_TABLE: -+ case USE_X86_64_EVEX_PFX_TABLE: -+ case USE_X86_64_EVEX_W_TABLE: -+ case USE_X86_64_EVEX_MEM_W_TABLE: -+ ins->evex_type = evex_from_vex; -+ /* EVEX from VEX instructions are 64-bit only and require that EVEX.z, -+ EVEX.L'L, EVEX.b, and the lower 2 bits of EVEX.aaa must be 0. */ -+ if (ins->address_mode != mode_64bit -+ || (ins->vex.mask_register_specifier & 0x3) != 0 -+ || ins->vex.ll != 0 -+ || ins->vex.zeroing != 0 -+ || ins->vex.b) -+ return &bad_opcode; -+ -+ if (dp->op[0].bytemode == USE_X86_64_EVEX_PFX_TABLE) -+ goto use_prefix_table; -+ if (dp->op[0].bytemode == USE_X86_64_EVEX_W_TABLE) -+ goto use_vex_w_table; -+ if (dp->op[0].bytemode == USE_X86_64_EVEX_MEM_W_TABLE) -+ { -+ if (ins->modrm.mod == 3) -+ return &bad_opcode; -+ goto use_vex_w_table; -+ } -+ -+ /* Fall through. */ - case USE_X86_64_TABLE: - vindex = ins->address_mode == mode_64bit ? 1 : 0; - dp = &x86_64_table[dp->op[1].bytemode][vindex]; - break; - - case USE_3BYTE_TABLE: -+ if (ins->last_rex2_prefix >= 0) -+ return &err_opcode; - if (!fetch_code (ins->info, ins->codep + 2)) - return &err_opcode; - vindex = *ins->codep++; -@@ -8769,6 +8977,9 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) - case 0x3: - vex_table_index = VEX_0F3A; - break; -+ case 0x7: -+ vex_table_index = VEX_MAP7; -+ break; - } - ins->codep++; - ins->vex.w = *ins->codep & 0x80; -@@ -8803,7 +9014,12 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) - ins->need_vex = 3; - ins->codep++; - vindex = *ins->codep++; -- dp = &vex_table[vex_table_index][vindex]; -+ if (vex_table_index != VEX_MAP7) -+ dp = &vex_table[vex_table_index][vindex]; -+ else if (vindex == 0xf8) -+ dp = &map7_f8_opcode; -+ else -+ dp = &bad_opcode; - ins->end_codep = ins->codep; - /* There is no MODRM byte for VEX0F 77. */ - if ((vex_table_index != VEX_0F || vindex != 0x77) -@@ -8846,6 +9062,7 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) - break; - - case USE_VEX_W_TABLE: -+ use_vex_w_table: - if (!ins->need_vex) - abort (); - -@@ -8859,9 +9076,13 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) - if (!fetch_code (ins->info, ins->codep + 4)) - return &err_opcode; - /* The first byte after 0x62. */ -+ if (*ins->codep & 0x8) -+ ins->rex2 |= REX_B; -+ if (!(*ins->codep & 0x10)) -+ ins->rex2 |= REX_R; -+ - ins->rex = ~(*ins->codep >> 5) & 0x7; -- ins->vex.r = *ins->codep & 0x10; -- switch ((*ins->codep & 0xf)) -+ switch (*ins->codep & 0x7) - { - default: - return &bad_opcode; -@@ -8874,12 +9095,21 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) - case 0x3: - vex_table_index = EVEX_0F3A; - break; -+ case 0x4: -+ vex_table_index = EVEX_MAP4; -+ ins->evex_type = evex_from_legacy; -+ if (ins->address_mode != mode_64bit) -+ return &bad_opcode; -+ break; - case 0x5: - vex_table_index = EVEX_MAP5; - break; - case 0x6: - vex_table_index = EVEX_MAP6; - break; -+ case 0x7: -+ vex_table_index = EVEX_MAP7; -+ break; - } - - /* The second byte after 0x62. */ -@@ -8890,9 +9120,8 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) - - ins->vex.register_specifier = (~(*ins->codep >> 3)) & 0xf; - -- /* The U bit. */ - if (!(*ins->codep & 0x4)) -- return &bad_opcode; -+ ins->rex2 |= REX_X; - - switch ((*ins->codep & 0x3)) - { -@@ -8919,24 +9148,54 @@ get_valid_dis386 (const struct dis386 *dp, instr_info *ins) - ins->vex.v = *ins->codep & 0x8; - ins->vex.mask_register_specifier = *ins->codep & 0x7; - ins->vex.zeroing = *ins->codep & 0x80; -+ /* Set the NF bit for EVEX-Promoted instructions, this bit will be cleared -+ when it's an evex_default one. */ -+ ins->vex.nf = *ins->codep & 0x4; - - if (ins->address_mode != mode_64bit) - { -+ /* Report bad for !evex_default and when two fixed values of evex -+ change.. */ -+ if (ins->evex_type != evex_default -+ || (ins->rex2 & (REX_B | REX_X))) -+ return &bad_opcode; - /* In 16/32-bit mode silently ignore following bits. */ - ins->rex &= ~REX_B; -- ins->vex.r = true; -+ ins->rex2 &= ~REX_R; - } - -+ /* EVEX from legacy instructions, when the EVEX.ND bit is 0, -+ all bits of EVEX.vvvv and EVEX.V' must be 1. */ -+ if (ins->evex_type == evex_from_legacy && !ins->vex.nd -+ && (ins->vex.register_specifier || !ins->vex.v)) -+ return &bad_opcode; -+ - ins->need_vex = 4; -+ -+ /* EVEX from legacy instructions require that EVEX.z, EVEX.L’L and the -+ lower 2 bits of EVEX.aaa must be 0. */ -+ if (ins->evex_type == evex_from_legacy -+ && ((ins->vex.mask_register_specifier & 0x3) != 0 -+ || ins->vex.ll != 0 -+ || ins->vex.zeroing != 0)) -+ return &bad_opcode; -+ - ins->codep++; - vindex = *ins->codep++; -- dp = &evex_table[vex_table_index][vindex]; -+ if (vex_table_index != EVEX_MAP7) -+ dp = &evex_table[vex_table_index][vindex]; -+ else if (vindex == 0xf8) -+ dp = &map7_f8_opcode; -+ else -+ dp = &bad_opcode; - ins->end_codep = ins->codep; - if (!fetch_modrm (ins)) - return &err_opcode; - -- /* Set vector length. */ -- if (ins->modrm.mod == 3 && ins->vex.b) -+ /* Set vector length. For EVEX-promoted instructions, evex.ll == 0b00, -+ which has the same encoding as vex.length == 128 and they can share -+ the same processing with vex.length in OP_VEX. */ -+ if (ins->modrm.mod == 3 && ins->vex.b && ins->evex_type != evex_from_legacy) - ins->vex.length = 512; - else - { -@@ -9128,6 +9387,7 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) - .last_data_prefix = -1, - .last_addr_prefix = -1, - .last_rex_prefix = -1, -+ .last_rex2_prefix = -1, - .last_seg_prefix = -1, - .fwait_prefix = -1, - }; -@@ -9167,9 +9427,10 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) - } - else if (startswith (p, "intel")) - { -- ins.intel_syntax = 1; - if (startswith (p + 5, "-mnemonic")) - ins.intel_mnemonic = true; -+ else -+ ins.intel_syntax = 1; - } - else if (startswith (p, "att")) - { -@@ -9292,24 +9553,25 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) - goto out; - } - -- if (*ins.codep == 0x0f) -+ /* REX2.M in rex2 prefix represents map0 or map1. */ -+ if (ins.last_rex2_prefix < 0 ? *ins.codep == 0x0f : (ins.rex2 & REX2_M)) - { -- unsigned char threebyte; -+ if (!ins.rex2) -+ { -+ ins.codep++; -+ if (!fetch_code (info, ins.codep + 1)) -+ goto fetch_error_out; -+ } - -- ins.codep++; -- if (!fetch_code (info, ins.codep + 1)) -- goto fetch_error_out; -- threebyte = *ins.codep; -- dp = &dis386_twobyte[threebyte]; -- ins.need_modrm = twobyte_has_modrm[threebyte]; -- ins.codep++; -+ dp = &dis386_twobyte[*ins.codep]; -+ ins.need_modrm = twobyte_has_modrm[*ins.codep]; - } - else - { - dp = &dis386[*ins.codep]; - ins.need_modrm = onebyte_has_modrm[*ins.codep]; -- ins.codep++; - } -+ ins.codep++; - - /* Save sizeflag for printing the extra ins.prefixes later before updating - it for mnemonic and operand processing. The prefix names depend -@@ -9335,6 +9597,22 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) - dp = get_valid_dis386 (dp, &ins); - if (dp == &err_opcode) - goto fetch_error_out; -+ -+ /* For APX instructions promoted from legacy maps 0/1, embedded prefix -+ is interpreted as the operand size override. */ -+ if (ins.evex_type == evex_from_legacy -+ && ins.vex.prefix == DATA_PREFIX_OPCODE) -+ sizeflag ^= DFLAG; -+ -+ if(ins.evex_type == evex_default) -+ ins.vex.nf = false; -+ else -+ /* For EVEX-promoted formats, we need to clear EVEX.NF (ccmp and ctest -+ are cleared separately.) in mask_register_specifier and keep the low -+ 2 bits of mask_register_specifier to report errors for invalid cases -+ . */ -+ ins.vex.mask_register_specifier &= 0x3; -+ - if (dp != NULL && putop (&ins, dp->name, sizeflag) == 0) - { - if (!get_sib (&ins, sizeflag)) -@@ -9387,10 +9665,13 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) - oappend (&ins, "/(bad)"); - } - } -+ /* vex.nf is cleared after being consumed. */ -+ if (ins.vex.nf) -+ oappend (&ins, "{bad-nf}"); - - /* Check whether rounding control was enabled for an insn not -- supporting it. */ -- if (ins.modrm.mod == 3 && ins.vex.b -+ supporting it, when evex.b is not treated as evex.nd. */ -+ if (ins.modrm.mod == 3 && ins.vex.b && ins.evex_type == evex_default - && !(ins.evex_used & EVEX_b_used)) - { - for (i = 0; i < MAX_OPERANDS; ++i) -@@ -9454,7 +9735,15 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) - goto out; - } - -- switch (dp->prefix_requirement) -+ if ((dp->prefix_requirement & PREFIX_REX2_ILLEGAL) -+ && ins.last_rex2_prefix >= 0 && (ins.rex2 & REX2_SPECIAL) == 0) -+ { -+ i386_dis_printf (info, dis_style_text, "(bad)"); -+ ret = ins.end_codep - priv.the_buffer; -+ goto out; -+ } -+ -+ switch (dp->prefix_requirement & ~PREFIX_REX2_ILLEGAL) - { - case PREFIX_DATA: - /* If only the data prefix is marked as mandatory, its absence renders -@@ -9506,6 +9795,25 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) - if (ins.last_repnz_prefix >= 0) - ins.all_prefixes[ins.last_repnz_prefix] = 0xf2; - break; -+ -+ case PREFIX_NP_OR_DATA: -+ if (ins.vex.prefix == REPE_PREFIX_OPCODE -+ || ins.vex.prefix == REPNE_PREFIX_OPCODE) -+ { -+ i386_dis_printf (info, dis_style_text, "(bad)"); -+ ret = ins.end_codep - priv.the_buffer; -+ goto out; -+ } -+ break; -+ -+ case NO_PREFIX: -+ if (ins.vex.prefix) -+ { -+ i386_dis_printf (info, dis_style_text, "(bad)"); -+ ret = ins.end_codep - priv.the_buffer; -+ goto out; -+ } -+ break; - } - - /* Check if the REX prefix is used. */ -@@ -9513,6 +9821,14 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) - && !ins.need_vex && ins.last_rex_prefix >= 0) - ins.all_prefixes[ins.last_rex_prefix] = 0; - -+ /* Check if the REX2 prefix is used. */ -+ if (ins.last_rex2_prefix >= 0 -+ && ((ins.rex2 & REX2_SPECIAL) -+ || (((ins.rex2 & 7) ^ (ins.rex2_used & 7)) == 0 -+ && (ins.rex ^ ins.rex_used) == 0 -+ && (ins.rex2 & 7)))) -+ ins.all_prefixes[ins.last_rex2_prefix] = 0; -+ - /* Check if the SEG prefix is used. */ - if ((ins.prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS | PREFIX_ES - | PREFIX_FS | PREFIX_GS)) != 0 -@@ -9541,7 +9857,11 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax) - if (name == NULL) - abort (); - prefix_length += strlen (name) + 1; -- i386_dis_printf (info, dis_style_mnemonic, "%s ", name); -+ if (ins.all_prefixes[i] == REX2_OPCODE) -+ i386_dis_printf (info, dis_style_mnemonic, "{%s 0x%x} ", name, -+ (unsigned int) ins.rex2_payload); -+ else -+ i386_dis_printf (info, dis_style_mnemonic, "%s ", name); - } - - /* Check maximum code length. */ -@@ -10077,6 +10397,16 @@ putop (instr_info *ins, const char *in_template, int sizeflag) - int cond = 1; - unsigned int l = 0, len = 0; - char last[4]; -+ bool evex_printed = false; -+ -+ /* We don't want to add any prefix or suffix to (bad), so return early. */ -+ if (!strncmp (in_template, "(bad)", 5)) -+ { -+ oappend (ins, "(bad)"); -+ *ins->obufp = 0; -+ ins->mnemonicendp = ins->obufp; -+ return 0; -+ } - - for (p = in_template; *p; p++) - { -@@ -10090,6 +10420,12 @@ putop (instr_info *ins, const char *in_template, int sizeflag) - switch (*p) - { - default: -+ if (ins->evex_type == evex_from_legacy && !ins->vex.nd -+ && !(ins->rex2 & 7) && !evex_printed) -+ { -+ oappend (ins, "{evex} "); -+ evex_printed = true; -+ } - *ins->obufp++ = *p; - break; - case '%': -@@ -10120,7 +10456,7 @@ putop (instr_info *ins, const char *in_template, int sizeflag) - case 'A': - if (ins->intel_syntax) - break; -- if ((ins->need_modrm && ins->modrm.mod != 3) -+ if ((ins->need_modrm && ins->modrm.mod != 3 && !ins->vex.nd) - || (sizeflag & SUFFIX_ALWAYS)) - *ins->obufp++ = 'b'; - break; -@@ -10204,7 +10540,7 @@ putop (instr_info *ins, const char *in_template, int sizeflag) - { - case 'X': - if (!ins->vex.evex || ins->vex.b || ins->vex.ll >= 2 -- || !ins->vex.r -+ || (ins->rex2 & 7) - || (ins->modrm.mod == 3 && (ins->rex & REX_X)) - || !ins->vex.v || ins->vex.mask_register_specifier) - break; -@@ -10226,6 +10562,11 @@ putop (instr_info *ins, const char *in_template, int sizeflag) - *ins->obufp++ = '}'; - *ins->obufp++ = ' '; - break; -+ case 'M': -+ if (ins->modrm.mod != 3 && !(ins->rex2 & 7)) -+ oappend (ins, "{evex} "); -+ evex_printed = true; -+ break; - default: - abort (); - } -@@ -10245,16 +10586,39 @@ putop (instr_info *ins, const char *in_template, int sizeflag) - ins->used_prefixes |= (ins->prefixes & PREFIX_ADDR); - break; - case 'F': -- if (ins->intel_syntax) -+ if (l == 0) -+ { -+ if (ins->intel_syntax) -+ break; -+ if ((ins->prefixes & PREFIX_ADDR) || (sizeflag & SUFFIX_ALWAYS)) -+ { -+ if (sizeflag & AFLAG) -+ *ins->obufp++ = ins->address_mode == mode_64bit ? 'q' : 'l'; -+ else -+ *ins->obufp++ = ins->address_mode == mode_64bit ? 'l' : 'w'; -+ ins->used_prefixes |= (ins->prefixes & PREFIX_ADDR); -+ } -+ } -+ else if (l == 1 && last[0] == 'C') - break; -- if ((ins->prefixes & PREFIX_ADDR) || (sizeflag & SUFFIX_ALWAYS)) -+ else if (l == 1 && last[0] == 'N') - { -- if (sizeflag & AFLAG) -- *ins->obufp++ = ins->address_mode == mode_64bit ? 'q' : 'l'; -- else -- *ins->obufp++ = ins->address_mode == mode_64bit ? 'l' : 'w'; -- ins->used_prefixes |= (ins->prefixes & PREFIX_ADDR); -+ if (ins->vex.nf) -+ { -+ oappend (ins, "{nf} "); -+ /* This bit needs to be cleared after it is consumed. */ -+ ins->vex.nf = false; -+ evex_printed = true; -+ } -+ else if (ins->evex_type == evex_from_vex && !(ins->rex2 & 7) -+ && ins->vex.v) -+ { -+ oappend (ins, "{evex} "); -+ evex_printed = true; -+ } - } -+ else -+ abort (); - break; - case 'G': - if (ins->intel_syntax || (ins->obufp[-1] != 's' -@@ -10311,7 +10675,16 @@ putop (instr_info *ins, const char *in_template, int sizeflag) - *ins->obufp++ = 'd'; - break; - case 'L': -- abort (); -+ if (ins->intel_syntax) -+ break; -+ if (sizeflag & SUFFIX_ALWAYS) -+ { -+ if (ins->rex & REX_W) -+ *ins->obufp++ = 'q'; -+ else -+ *ins->obufp++ = 'l'; -+ } -+ break; - case 'M': - if (ins->intel_mnemonic != cond) - *ins->obufp++ = 'r'; -@@ -10346,6 +10719,19 @@ putop (instr_info *ins, const char *in_template, int sizeflag) - case 'P': - if (l == 0) - { -+ if (!cond && ins->last_rex2_prefix >= 0 && (ins->rex & REX_W)) -+ { -+ /* For pushp and popp, p is printed and do not print {rex2} -+ for them. */ -+ *ins->obufp++ = 'p'; -+ ins->rex2 |= REX2_SPECIAL; -+ break; -+ } -+ -+ /* For "!P" print nothing else in Intel syntax. */ -+ if (!cond && ins->intel_syntax) -+ break; -+ - if ((ins->modrm.mod == 3 || !cond) - && !(sizeflag & SUFFIX_ALWAYS)) - break; -@@ -10390,7 +10776,7 @@ putop (instr_info *ins, const char *in_template, int sizeflag) - if (ins->intel_syntax && !alt) - break; - USED_REX (REX_W); -- if ((ins->need_modrm && ins->modrm.mod != 3) -+ if ((ins->need_modrm && ins->modrm.mod != 3 && !ins->vex.nd) - || (sizeflag & SUFFIX_ALWAYS)) - { - if (ins->rex & REX_W) -@@ -10818,7 +11204,8 @@ print_displacement (instr_info *ins, bfd_signed_vma val) - static void - intel_operand_size (instr_info *ins, int bytemode, int sizeflag) - { -- if (ins->vex.b) -+ /* Check if there is a broadcast, when evex.b is not treated as evex.nd. */ -+ if (ins->vex.b && ins->evex_type == evex_default) - { - if (!ins->vex.no_broadcast) - switch (bytemode) -@@ -11088,6 +11475,8 @@ print_register (instr_info *ins, unsigned int reg, unsigned int rexmask, - USED_REX (rexmask); - if (ins->rex & rexmask) - reg += 8; -+ if (ins->rex2 & rexmask) -+ reg += 16; - - switch (bytemode) - { -@@ -11095,7 +11484,7 @@ print_register (instr_info *ins, unsigned int reg, unsigned int rexmask, - case b_swap_mode: - if (reg & 4) - USED_REX (0); -- if (ins->rex) -+ if (ins->rex || ins->rex2) - names = att_names8rex; - else - names = att_names8; -@@ -11300,6 +11689,7 @@ OP_Skip_MODRM (instr_info *ins, int bytemode ATTRIBUTE_UNUSED, - /* Skip mod/rm byte. */ - MODRM_CHECK; - ins->codep++; -+ ins->has_skipped_modrm = true; - return true; - } - -@@ -11310,7 +11700,10 @@ OP_E_memory (instr_info *ins, int bytemode, int sizeflag) - int riprel = 0; - int shift; - -- if (ins->vex.evex) -+ add += (ins->rex2 & REX_B) ? 16 : 0; -+ -+ /* Handles EVEX other than APX EVEX-promoted instructions. */ -+ if (ins->vex.evex && ins->evex_type == evex_default) - { - - /* Zeroing-masking is invalid for memory destinations. Set the flag -@@ -11454,6 +11847,13 @@ OP_E_memory (instr_info *ins, int bytemode, int sizeflag) - abort (); - if (ins->vex.evex) - { -+ /* S/G EVEX insns require EVEX.X4 not to be set. */ -+ if (ins->rex2 & REX_X) -+ { -+ oappend (ins, "(bad)"); -+ return true; -+ } -+ - if (!ins->vex.v) - vindex += 16; - check_gather = ins->obufp == ins->op_out[1]; -@@ -11483,6 +11883,9 @@ OP_E_memory (instr_info *ins, int bytemode, int sizeflag) - } - break; - default: -+ if (ins->rex2 & REX_X) -+ vindex += 16; -+ - if (vindex != 4) - indexes = ins->address_mode == mode_64bit && !addr32flag - ? att_names64 : att_names32; -@@ -11653,7 +12056,7 @@ OP_E_memory (instr_info *ins, int bytemode, int sizeflag) - - if (ins->rex & REX_R) - modrm_reg += 8; -- if (!ins->vex.r) -+ if (ins->rex2 & REX_R) - modrm_reg += 16; - if (vindex == modrm_reg) - oappend (ins, "/(bad)"); -@@ -11735,7 +12138,7 @@ OP_E_memory (instr_info *ins, int bytemode, int sizeflag) - print_operand_value (ins, disp & 0xffff, dis_style_text); - } - } -- if (ins->vex.b) -+ if (ins->vex.b && ins->evex_type == evex_default) - { - ins->evex_used |= EVEX_b_used; - -@@ -11818,7 +12221,11 @@ OP_E (instr_info *ins, int bytemode, int sizeflag) - { - /* Skip mod/rm byte. */ - MODRM_CHECK; -- ins->codep++; -+ if (!ins->has_skipped_modrm) -+ { -+ ins->codep++; -+ ins->has_skipped_modrm = true; -+ } - - if (ins->modrm.mod == 3) - { -@@ -11855,10 +12262,7 @@ OP_indirE (instr_info *ins, int bytemode, int sizeflag) - static bool - OP_G (instr_info *ins, int bytemode, int sizeflag) - { -- if (ins->vex.evex && !ins->vex.r && ins->address_mode == mode_64bit) -- oappend (ins, "(bad)"); -- else -- print_register (ins, ins->modrm.reg, REX_R, bytemode, sizeflag); -+ print_register (ins, ins->modrm.reg, REX_R, bytemode, sizeflag); - return true; - } - -@@ -11866,7 +12270,7 @@ static bool - OP_REG (instr_info *ins, int code, int sizeflag) - { - const char *s; -- int add; -+ int add = 0; - - switch (code) - { -@@ -11879,8 +12283,8 @@ OP_REG (instr_info *ins, int code, int sizeflag) - USED_REX (REX_B); - if (ins->rex & REX_B) - add = 8; -- else -- add = 0; -+ if (ins->rex2 & REX_B) -+ add += 16; - - switch (code) - { -@@ -12011,6 +12415,8 @@ OP_I (instr_info *ins, int bytemode, int sizeflag) - case const_1_mode: - if (ins->intel_syntax) - oappend (ins, "1"); -+ else -+ oappend (ins, "$1"); - return true; - default: - oappend (ins, INTERNAL_DISASSEMBLER_ERROR); -@@ -12487,7 +12893,7 @@ OP_XMM (instr_info *ins, int bytemode, int sizeflag ATTRIBUTE_UNUSED) - reg += 8; - if (ins->vex.evex) - { -- if (!ins->vex.r) -+ if (ins->rex2 & REX_R) - reg += 16; - } - -@@ -12592,6 +12998,8 @@ OP_EX (instr_info *ins, int bytemode, int sizeflag) - USED_REX (REX_B); - if (ins->rex & REX_B) - reg += 8; -+ if (ins->rex2 & REX_B) -+ reg += 16; - if (ins->vex.evex) - { - USED_REX (REX_X); -@@ -12623,9 +13031,10 @@ OP_R (instr_info *ins, int bytemode, int sizeflag) - { - case d_mode: - case dq_mode: -+ case q_mode: - case mask_mode: - return OP_E (ins, bytemode, sizeflag); -- case q_mode: -+ case q_mm_mode: - return OP_EM (ins, x_mode, sizeflag); - case xmm_mode: - if (ins->vex.length <= 128) -@@ -13095,6 +13504,13 @@ OP_VEX (instr_info *ins, int bytemode, int sizeflag ATTRIBUTE_UNUSED) - if (!ins->need_vex) - return true; - -+ if (ins->evex_type == evex_from_legacy) -+ { -+ ins->evex_used |= EVEX_b_used; -+ if (!ins->vex.nd) -+ return true; -+ } -+ - reg = ins->vex.register_specifier; - ins->vex.register_specifier = 0; - if (ins->address_mode != mode_64bit) -@@ -13186,12 +13602,22 @@ OP_VEX (instr_info *ins, int bytemode, int sizeflag ATTRIBUTE_UNUSED) - names = att_names_xmm; - ins->evex_used |= EVEX_len_used; - break; -+ case v_mode: - case dq_mode: - if (ins->rex & REX_W) - names = att_names64; -+ else if (bytemode == v_mode -+ && !(sizeflag & DFLAG)) -+ names = att_names16; - else - names = att_names32; - break; -+ case b_mode: -+ names = att_names8rex; -+ break; -+ case q_mode: -+ names = att_names64; -+ break; - case mask_bd_mode: - case mask_mode: - if (reg > 0x7) -@@ -13491,7 +13917,7 @@ DistinctDest_Fixup (instr_info *ins, int bytemode, int sizeflag) - /* Calc destination register number. */ - if (ins->rex & REX_R) - modrm_reg += 8; -- if (!ins->vex.r) -+ if (ins->rex2 & REX_R) - modrm_reg += 16; - - /* Calc src1 register number. */ -@@ -13576,3 +14002,58 @@ PREFETCHI_Fixup (instr_info *ins, int bytemode, int sizeflag) - - return OP_M (ins, bytemode, sizeflag); - } -+ -+static bool -+PUSH2_POP2_Fixup (instr_info *ins, int bytemode, int sizeflag) -+{ -+ if (ins->modrm.mod != 3) -+ return true; -+ -+ unsigned int vvvv_reg = ins->vex.register_specifier -+ | (!ins->vex.v << 4); -+ unsigned int rm_reg = ins->modrm.rm + (ins->rex & REX_B ? 8 : 0) -+ + (ins->rex2 & REX_B ? 16 : 0); -+ -+ /* Push2/Pop2 cannot use RSP and Pop2 cannot pop two same registers. */ -+ if (!ins->vex.nd || vvvv_reg == 0x4 || rm_reg == 0x4 -+ || (!ins->modrm.reg -+ && vvvv_reg == rm_reg)) -+ { -+ oappend (ins, "(bad)"); -+ return true; -+ } -+ -+ return OP_VEX (ins, bytemode, sizeflag); -+} -+ -+static bool -+JMPABS_Fixup (instr_info *ins, int bytemode, int sizeflag) -+{ -+ if (ins->last_rex2_prefix >= 0) -+ { -+ uint64_t op; -+ -+ if ((ins->prefixes & (PREFIX_OPCODE | PREFIX_ADDR | PREFIX_LOCK)) != 0x0 -+ || (ins->rex & REX_W) != 0x0) -+ { -+ oappend (ins, "(bad)"); -+ return true; -+ } -+ -+ if (bytemode == eAX_reg) -+ return true; -+ -+ if (!get64 (ins, &op)) -+ return false; -+ -+ ins->mnemonicendp = stpcpy (ins->obuf, "jmpabs"); -+ ins->rex2 |= REX2_SPECIAL; -+ oappend_immediate (ins, op); -+ -+ return true; -+ } -+ -+ if (bytemode == eAX_reg) -+ return OP_IMREG (ins, bytemode, sizeflag); -+ return OP_OFF64 (ins, bytemode, sizeflag); -+} -diff --git a/opcodes/i386-gen.c b/opcodes/i386-gen.c ---- a/opcodes/i386-gen.c -+++ b/opcodes/i386-gen.c -@@ -1,4 +1,4 @@ --/* Copyright (C) 2007-2023 Free Software Foundation, Inc. -+/* Copyright (C) 2007-2024 Free Software Foundation, Inc. - - This file is part of the GNU opcodes library. - -@@ -63,7 +63,7 @@ static const dependency isa_dependencies[] = - { "NOCONA", - "GENERIC64|FISTTP|SSE3|MONITOR|CX16" }, - { "CORE", -- "P4|FISTTP|SSE3|MONITOR|CX16" }, -+ "P4|FISTTP|SSE3|MONITOR" }, - { "CORE2", - "NOCONA|SSSE3" }, - { "COREI7", -@@ -94,6 +94,8 @@ static const dependency isa_dependencies[] = - "ZNVER2|INVLPGB|TLBSYNC|VAES|VPCLMULQDQ|INVPCID|SNP|OSPKE" }, - { "ZNVER4", - "ZNVER3|AVX512F|AVX512DQ|AVX512IFMA|AVX512CD|AVX512BW|AVX512VL|AVX512_BF16|AVX512VBMI|AVX512_VBMI2|AVX512_VNNI|AVX512_BITALG|AVX512_VPOPCNTDQ|GFNI|RMPQUERY" }, -+ { "ZNVER5", -+ "ZNVER4|AVX_VNNI|MOVDIRI|MOVDIR64B|AVX512_VP2INTERSECT|PREFETCHI" }, - { "BTVER1", - "GENERIC64|FISTTP|MONITOR|CX16|LAHF_SAHF|Rdtscp|SSSE3|SSE4A|ABM|PRFCHW|Clflush|FISTTP|SVME" }, - { "BTVER2", -@@ -166,6 +168,10 @@ static const dependency isa_dependencies[] = - "AVX2" }, - { "AVX_NE_CONVERT", - "AVX2" }, -+ { "CX16", -+ "64" }, -+ { "LKGS", -+ "64" }, - { "FRED", - "LKGS" }, - { "AVX512F", -@@ -240,13 +246,13 @@ static const dependency isa_dependencies[] = - { "SNP", - "SEV_ES" }, - { "RMPQUERY", -- "SNP" }, -+ "SNP|64" }, - { "TSX", - "RTM|HLE" }, - { "TSXLDTRK", - "RTM" }, - { "AMX_TILE", -- "XSAVE" }, -+ "XSAVE|64" }, - { "AMX_INT8", - "AMX_TILE" }, - { "AMX_BF16", -@@ -259,6 +265,20 @@ static const dependency isa_dependencies[] = - "SSE2" }, - { "WIDEKL", - "KL" }, -+ { "PBNDKB", -+ "64" }, -+ { "UINTR", -+ "64" }, -+ { "PREFETCHI", -+ "64" }, -+ { "CMPCCXADD", -+ "64" }, -+ { "MSRLIST", -+ "64" }, -+ { "USER_MSR", -+ "64" }, -+ { "APX_F", -+ "XSAVE|64" }, - }; - - /* This array is populated as process_i386_initializers() walks cpu_flags[]. */ -@@ -380,6 +400,8 @@ static bitfield cpu_flags[] = - BITFIELD (RAO_INT), - BITFIELD (FRED), - BITFIELD (LKGS), -+ BITFIELD (USER_MSR), -+ BITFIELD (APX_F), - BITFIELD (MWAITX), - BITFIELD (CLZERO), - BITFIELD (OSPKE), -@@ -463,12 +485,12 @@ static bitfield opcode_modifiers[] = - BITFIELD (StaticRounding), - BITFIELD (SAE), - BITFIELD (Disp8MemShift), -- BITFIELD (Vsz), - BITFIELD (Optimize), -- BITFIELD (ATTMnemonic), -- BITFIELD (ATTSyntax), -- BITFIELD (IntelSyntax), -+ BITFIELD (Dialect), - BITFIELD (ISA64), -+ BITFIELD (NoEgpr), -+ BITFIELD (NF), -+ BITFIELD (Rex2), - }; - - #define CLASS(n) #n, n -@@ -587,7 +609,7 @@ static void - process_copyright (FILE *fp) - { - fprintf (fp, "/* This file is automatically generated by i386-gen. Do not edit! */\n\ --/* Copyright (C) 2007-2023 Free Software Foundation, Inc.\n\ -+/* Copyright (C) 2007-2024 Free Software Foundation, Inc.\n\ - \n\ - This file is part of the GNU opcodes library.\n\ - \n\ -@@ -771,8 +793,10 @@ add_isa_dependencies (bitfield *flags, const char *f, int value, - } - free (deps); - -- /* ISA extensions with dependencies need CPU_ANY_*_FLAGS emitted. */ -- if (reverse < ARRAY_SIZE (isa_reverse_deps[0])) -+ /* ISA extensions with dependencies need CPU_ANY_*_FLAGS emitted, -+ unless the sole dependency is the "64-bit mode only" one. */ -+ if (reverse < ARRAY_SIZE (isa_reverse_deps[0]) -+ && strcmp (isa_dependencies[i].deps, "64")) - isa_reverse_deps[reverse][reverse] = 1; - - is_avx = orig_is_avx; -@@ -787,15 +811,16 @@ add_isa_dependencies (bitfield *flags, const char *f, int value, - - static void - output_cpu_flags (FILE *table, bitfield *flags, unsigned int size, -- int macro, const char *comma, const char *indent, int lineno) -+ int mode, const char *comma, const char *indent, int lineno) - { - unsigned int i = 0, j = 0; - -- memset (&active_cpu_flags, 0, sizeof(active_cpu_flags)); -+ if (mode < 0) -+ memset (&active_cpu_flags, 0, sizeof(active_cpu_flags)); - - fprintf (table, "%s{ { ", indent); - -- if (!macro) -+ if (mode <= 0) - { - for (j = ~0u; i < CpuAttrEnums; i++) - { -@@ -806,7 +831,8 @@ output_cpu_flags (FILE *table, bitfield *flags, unsigned int size, - fail ("%s: %d: invalid combination of CPU identifiers\n", - filename, lineno); - j = i; -- active_cpu_flags.array[i / 32] |= 1U << (i % 32); -+ if (mode) -+ active_cpu_flags.array[i / 32] |= 1U << (i % 32); - } - - /* Write 0 to indicate "no associated flag". */ -@@ -824,16 +850,25 @@ output_cpu_flags (FILE *table, bitfield *flags, unsigned int size, - if (((j + 1) % 20) == 0) - { - /* We need \\ for macro. */ -- if (macro) -+ if (mode > 0) - fprintf (table, " \\\n %s", indent); - else - fprintf (table, "\n %s", indent); - } -- if (flags[i].value) -+ if (mode < 0 && flags[i].value) - active_cpu_flags.array[i / 32] |= 1U << (i % 32); - } - -- fprintf (table, "%d } }%s\n", flags[i].value, comma); -+#if defined(CpuAttrUnused) != defined(CpuUnused) -+ if (mode <= 0) -+# ifdef CpuUnused -+ fprintf (table, " } }%s\n", comma); -+# else -+ fprintf (table, "%d, 0 } }%s\n", flags[i].value, comma); -+# endif -+ else -+#endif -+ fprintf (table, "%d } }%s\n", flags[i].value, comma); - } - - static void -@@ -846,15 +881,17 @@ process_i386_cpu_flag (FILE *table, char *flag, - unsigned int i; - int value = 1; - bool is_isa = false; -- bitfield flags [ARRAY_SIZE (cpu_flags)]; -+ bitfield all [ARRAY_SIZE (cpu_flags)]; -+ bitfield any [ARRAY_SIZE (cpu_flags)]; - - /* Copy the default cpu flags. */ -- memcpy (flags, cpu_flags, sizeof (cpu_flags)); -+ memcpy (all, cpu_flags, sizeof (cpu_flags)); -+ memcpy (any, cpu_flags, sizeof (cpu_flags)); - - if (flag == NULL) - { - for (i = 0; i < ARRAY_SIZE (isa_reverse_deps[0]); ++i) -- flags[i].value = isa_reverse_deps[reverse][i]; -+ any[i].value = isa_reverse_deps[reverse][i]; - goto output; - } - -@@ -876,9 +913,9 @@ process_i386_cpu_flag (FILE *table, char *flag, - - /* First we turn on everything except for cpuno64 and - if - present - the padding field. */ -- for (i = 0; i < ARRAY_SIZE (flags); i++) -- if (flags[i].position < CpuNo64) -- flags[i].value = 1; -+ for (i = 0; i < ARRAY_SIZE (any); i++) -+ if (any[i].position < CpuNo64) -+ any[i].value = 1; - - /* Turn off selective bits. */ - value = 0; -@@ -886,10 +923,10 @@ process_i386_cpu_flag (FILE *table, char *flag, - - if (name != NULL && value != 0) - { -- for (i = 0; i < ARRAY_SIZE (flags); i++) -- if (strcasecmp (flags[i].name, name) == 0) -+ for (i = 0; i < ARRAY_SIZE (any); i++) -+ if (strcasecmp (any[i].name, name) == 0) - { -- add_isa_dependencies (flags, name, 1, reverse); -+ add_isa_dependencies (any, name, 1, reverse); - is_isa = true; - break; - } -@@ -897,18 +934,40 @@ process_i386_cpu_flag (FILE *table, char *flag, - - if (strcmp (flag, "0")) - { -+ bool combined = false; -+ - if (is_isa) - return; - - /* Turn on/off selective bits. */ - last = flag + strlen (flag); -+ if (name == NULL && strchr (flag, '&')) -+ { -+ for (; next < last && *next != '('; ) -+ { -+ str = next_field (next, '&', &next, last); -+ set_bitfield (str, all, value, ARRAY_SIZE (all), lineno); -+ } -+ if (*next == '(') -+ { -+ if (*--last != ')') -+ fail ("%s: %d: missing `)' in bitfield: %s\n", filename, -+ lineno, flag); -+ ++next; -+ *last = '\0'; -+ } -+ combined = true; -+ } - for (; next && next < last; ) - { - str = next_field (next, '|', &next, last); -- if (name == NULL) -- set_bitfield (str, flags, value, ARRAY_SIZE (flags), lineno); -- else -- add_isa_dependencies (flags, str, value, reverse); -+ if (name) -+ add_isa_dependencies (any, str, value, reverse); -+ else if (combined || next < last) -+ set_bitfield (str, any, value, ARRAY_SIZE (any), lineno); -+ else /* Singular specifiers go into "all". */ -+ set_bitfield (str, all, value, ARRAY_SIZE (all), lineno); -+ combined = true; - } - } - -@@ -918,6 +977,15 @@ process_i386_cpu_flag (FILE *table, char *flag, - size_t len = strlen (name); - char *upper = xmalloc (len + 1); - -+ /* Cpu64 is special: It specifies a mode dependency, not an ISA one. Zap -+ the flag from ISA initializer macros (and from CPU_ANY_64_FLAGS -+ itself we only care about tracking its dependents. Also don't emit the -+ (otherwise all zero) CPU_64_FLAGS. */ -+ if (flag != NULL && reverse == Cpu64) -+ return; -+ if (is_isa || flag == NULL) -+ any[Cpu64].value = 0; -+ - for (i = 0; i < len; ++i) - { - /* Don't emit #define-s for auxiliary entries. */ -@@ -930,8 +998,18 @@ process_i386_cpu_flag (FILE *table, char *flag, - flag != NULL ? "": "ANY_", upper); - free (upper); - } -+ else -+ { -+ /* Synthesize "64-bit mode only" dependencies from the dependencies we -+ have accumulated. */ -+ for (i = 0; i < ARRAY_SIZE (isa_reverse_deps[0]); ++i) -+ if (all[i].value && isa_reverse_deps[Cpu64][i]) -+ all[Cpu64].value = 1; -+ -+ output_cpu_flags(table, all, ARRAY_SIZE (all), -1, comma, indent, lineno); -+ } - -- output_cpu_flags (table, flags, ARRAY_SIZE (flags), name != NULL, -+ output_cpu_flags (table, any, ARRAY_SIZE (any), name != NULL, - comma, indent, lineno); - } - -@@ -1008,10 +1086,44 @@ get_element_size (char **opnd, int lineno) - return elem_size; - } - -+static bool -+rex2_disallowed (const unsigned long long opcode, unsigned int length, -+ unsigned int space, const char *cpu_flags) -+{ -+ /* Some opcodes encode a ModR/M-like byte directly in the opcode. */ -+ unsigned int base_opcode = opcode >> (8 * length - 8); -+ -+ /* All opcodes listed map0 0x4*, 0x7*, 0xa*, 0xe* and map1 0x3*, 0x8* -+ are reserved under REX2 and triggers #UD when prefixed with REX2 */ -+ if (space == 0) -+ switch (base_opcode >> 4) -+ { -+ case 0x4: -+ case 0x7: -+ case 0xA: -+ case 0xE: -+ return true; -+ default: -+ return false; -+ } -+ -+ if (space == SPACE_0F) -+ switch (base_opcode >> 4) -+ { -+ case 0x3: -+ case 0x8: -+ return true; -+ default: -+ return false; -+ } -+ -+ return false; -+} -+ - static void - process_i386_opcode_modifier (FILE *table, char *mod, unsigned int space, - unsigned int prefix, const char *extension_opcode, -- char **opnd, int lineno) -+ char **opnd, int lineno, bool rex2_disallowed) - { - char *str, *next, *last; - bitfield modifiers [ARRAY_SIZE (opcode_modifiers)]; -@@ -1021,8 +1133,10 @@ process_i386_opcode_modifier (FILE *table, char *mod, unsigned int space, - SPACE(0F), - SPACE(0F38), - SPACE(0F3A), -+ SPACE(EVEXMAP4), - SPACE(EVEXMAP5), - SPACE(EVEXMAP6), -+ SPACE(VEXMAP7), - SPACE(XOP08), - SPACE(XOP09), - SPACE(XOP0A), -@@ -1127,6 +1241,22 @@ process_i386_opcode_modifier (FILE *table, char *mod, unsigned int space, - fprintf (table, " SPACE_%s, %s,\n", - spaces[space], extension_opcode ? extension_opcode : "None"); - -+ /* Rather than evaluating multiple conditions at runtime to determine -+ whether an EVEX encoding is being dealt with, derive that information -+ right here. A missing EVex attribute means "dynamic". */ -+ if (!modifiers[EVex].value -+ && (modifiers[Disp8MemShift].value -+ || modifiers[Broadcast].value -+ || modifiers[Masking].value -+ || modifiers[SAE].value)) -+ modifiers[EVex].value = EVEXDYN; -+ -+ /* Vex, legacy map2 and map3 and rex2_disallowed do not support EGPR. -+ For templates supporting both Vex and EVex allowing EGPR. */ -+ if ((modifiers[Vex].value || space > SPACE_0F || rex2_disallowed) -+ && !modifiers[EVex].value) -+ modifiers[NoEgpr].value = 1; -+ - output_opcode_modifier (table, modifiers, ARRAY_SIZE (modifiers)); - } - -@@ -1351,7 +1481,9 @@ output_i386_opcode (FILE *table, const char *name, char *str, - free (ident); - - process_i386_opcode_modifier (table, opcode_modifier, space, prefix, -- extension_opcode, operand_types, lineno); -+ extension_opcode, operand_types, lineno, -+ rex2_disallowed (opcode, length, space, -+ cpu_flags)); - - process_i386_cpu_flag (table, cpu_flags, NULL, ",", " ", lineno, CpuMax); - -@@ -1406,10 +1538,10 @@ opcode_hash_eq (const void *p, const void *q) - return strcmp (name, entry->name) == 0; - } - --static void -+static bool - parse_template (char *buf, int lineno) - { -- char sep, *end, *name; -+ char sep, *end, *ptr; - struct template *tmpl; - struct template_instance *last_inst = NULL; - -@@ -1436,8 +1568,16 @@ parse_template (char *buf, int lineno) - prev->next = tmpl->next; - else - templates = tmpl->next; -- return; -+ return true; - } -+ -+ /* Check whether this actually is a reference to an existing template: -+ If there's '>' ahead of ':', it can't be a new template definition -+ (and template undefs have are dealt with above). */ -+ ptr = strchr (buf, '>'); -+ if (ptr != NULL && ptr < end) -+ return false; -+ - *end++ = '\0'; - remove_trailing_whitespaces (buf); - -@@ -1512,6 +1652,8 @@ parse_template (char *buf, int lineno) - - tmpl->next = templates; - templates = tmpl; -+ -+ return true; - } - - static unsigned int -@@ -1768,10 +1910,12 @@ process_i386_opcodes (FILE *table) - /* Ignore comments. */ - case '\0': - continue; -- break; -+ - case '<': -- parse_template (p, lineno); -- continue; -+ if (parse_template (p, lineno)) -+ continue; -+ break; -+ - default: - if (!marker) - continue; -@@ -1808,23 +1952,26 @@ process_i386_opcodes (FILE *table) - - /* Generate opcode sets array. */ - fprintf (table, "\n/* i386 opcode sets table. */\n\n"); -- fprintf (table, "static const insn_template *const i386_op_sets[] =\n{\n"); -- fprintf (table, " i386_optab,\n"); -+ fprintf (table, "typedef unsigned short i386_op_off_t;\n"); -+ fprintf (table, "static const i386_op_off_t i386_op_sets[] =\n{\n "); - - for (nr = j = 0; j < i; j++) - { - struct opcode_entry *next = &opcode_array[j]->entry; - -+ if ((j + 1) % 8 != 0) -+ fprintf (table, "%5u,", nr); -+ else -+ fprintf (table, "%5u,\n ", nr); - do - { - ++nr; - next = next->next; - } - while (next); -- fprintf (table, " i386_optab + %u,\n", nr); - } - -- fprintf (table, "};\n"); -+ fprintf (table, "%5u\n};\n", nr); - - /* Emit mnemonics and associated #define-s. */ - qsort (opcode_array, i, sizeof (*opcode_array), mnemonic_cmp); -@@ -2140,6 +2287,8 @@ main (int argc, char **argv) - qsort (operand_types, ARRAY_SIZE (operand_types), - sizeof (operand_types [0]), compare); - -+ process_i386_initializers (); -+ - table = fopen ("i386-tbl.h", "w"); - if (table == NULL) - fail ("can't create i386-tbl.h, errno = %s\n", -@@ -2149,7 +2298,6 @@ main (int argc, char **argv) - - process_i386_opcodes (table); - process_i386_registers (table); -- process_i386_initializers (); - - fclose (table); - -diff --git a/opcodes/i386-init.h b/opcodes/i386-init.h ---- a/opcodes/i386-init.h -+++ b/opcodes/i386-init.h -@@ -1,5 +1,5 @@ - /* This file is automatically generated by i386-gen. Do not edit! */ --/* Copyright (C) 2007-2023 Free Software Foundation, Inc. -+/* Copyright (C) 2007-2024 Free Software Foundation, Inc. - - This file is part of the GNU opcodes library. - -@@ -26,7 +26,7 @@ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ - 0, 0, 0, 0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5 +2566,15 @@ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ -- 0, 1, 0, 0 } } -+ 0, 0, 1, 0, 0, 0 } } -+ -+#define CPU_ANY_APX_F_FLAGS \ -+ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ -+ 0, 0, 0, 1, 0, 0 } } - -diff --git a/opcodes/i386-opc.tbl b/opcodes/i386-opc.tbl ---- a/opcodes/i386-opc.tbl -+++ b/opcodes/i386-opc.tbl -@@ -1,5 +1,5 @@ - // i386 opcode table. --// Copyright (C) 2007-2023 Free Software Foundation, Inc. -+// Copyright (C) 2007-2024 Free Software Foundation, Inc. - // - // This file is part of the GNU opcodes library. - // -@@ -85,6 +85,11 @@ - #define RegKludge OperandConstraint=REG_KLUDGE - #define SwapSources OperandConstraint=SWAP_SOURCES - #define Ugh OperandConstraint=UGH -+#define ImplicitStackOp OperandConstraint=IMPLICIT_STACK_OP -+ -+#define ATTSyntax Dialect=ATT_SYNTAX -+#define ATTMnemonic Dialect=ATT_MNEMONIC -+#define IntelSyntax Dialect=INTEL_SYNTAX - - #define IgnoreSize MnemonicSize=IGNORESIZE - #define DefaultSize MnemonicSize=DEFAULTSIZE -@@ -109,9 +114,12 @@ - #define SpaceXOP09 OpcodeSpace=SPACE_XOP09 - #define SpaceXOP0A OpcodeSpace=SPACE_XOP0A - -+#define EVexMap4 OpcodeSpace=SPACE_EVEXMAP4|EVex128 - #define EVexMap5 OpcodeSpace=SPACE_EVEXMAP5 - #define EVexMap6 OpcodeSpace=SPACE_EVEXMAP6 - -+#define VexMap7 OpcodeSpace=SPACE_VEXMAP7 -+ - #define VexW0 VexW=VEXW0 - #define VexW1 VexW=VEXW1 - #define VexWIG VexW=VEXWIG -@@ -133,12 +141,22 @@ - - #define Disp8ShiftVL Disp8MemShift=DISP8_SHIFT_VL - --#define Vsz256 Vsz=VSZ256 --#define Vsz512 Vsz=VSZ512 -+#define DstVVVV VexVVVV=VexVVVV_DST -+ -+// The template supports VEX format for cpuid and EVEX format for cpuid & APX_F. -+// While therefore we really mean cpuid|(cpuid&APX_F) here, this can't be -+// expressed in the generated templates. It's equivalent to just cpuid|APX_F -+// anyway, but that is not what we want (as APX_F alone isn't a sufficient -+// prereq for such insns). Instead the assembler will massage the CPU specifier -+// to the equivalent of either cpuid&(cpuid) or cpuid&(APX_F) (or something -+// substantially similar), depending on what encoding was requested. -+#define APX_F(cpuid) cpuid&(cpuid|APX_F) - - // The EVEX purpose of StaticRounding appears only together with SAE. Re-use - // the bit to mark commutative VEX encodings where swapping the source - // operands may allow to switch from 3-byte to 2-byte VEX encoding. -+// And re-use the bit to mark some NDD insns that swapping the source operands -+// may allow to switch from EVEX encoding to REX2 encoding. - #define C StaticRounding - - #define FP 387|287|8087 -@@ -156,6 +174,8 @@ - #define i287 287 - #define i387 387 - #define i687 687 -+// Note: Don't add this one to any templates already specifying a 64-bit-mode- -+// only ISA extension: i386-gen takes care of adding such dependencies. - #define x64 64 - - ### MARKER ### -@@ -164,11 +184,11 @@ - mov, 0xa0, No64, D|W|CheckOperandSize|No_sSuf|No_qSuf, { Disp16|Disp32|Unspecified|Byte|Word|Dword, Acc|Byte|Word|Dword } - mov, 0xa0, x64, D|W|CheckOperandSize|No_sSuf, { Disp64|Unspecified|Byte|Word|Dword|Qword, Acc|Byte|Word|Dword|Qword } - movabs, 0xa0, x64, D|W|CheckOperandSize|No_sSuf, { Disp64|Unspecified|Byte|Word|Dword|Qword, Acc|Byte|Word|Dword|Qword } --mov, 0x88, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixRelease, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -+mov, 0x88, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixRelease, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } - // In the 64bit mode the short form mov immediate is redefined to have - // 64bit value. - mov, 0xb0, 0, W|No_sSuf|No_qSuf, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32 } --mov, 0xc6/0, 0, W|Modrm|No_sSuf|HLEPrefixRelease|Optimize, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -+mov, 0xc6/0, 0, W|Modrm|No_sSuf|HLEPrefixRelease|Optimize, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } - mov, 0xb8, x64, No_bSuf|No_wSuf|No_lSuf|No_sSuf|Optimize, { Imm64, Reg64 } - movabs, 0xb8, x64, No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Imm64, Reg64 } - // The segment register moves accept WordReg so that a segment register -@@ -181,14 +201,18 @@ mov, 0x8c, 0, D|Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { SReg, Word|U - mov, 0x8e, 0, Modrm|IgnoreSize|No_bSuf|No_sSuf|NoRex64, { Reg16|Reg32|Reg64, SReg } - // Move to/from control debug registers. In the 16 or 32bit modes - // they are 32bit. In the 64bit mode they are 64bit. --mov, 0xf20, i386|No64, D|RegMem|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Control, Reg32 } -+mov, 0xf20, i386&No64, D|RegMem|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Control, Reg32 } - mov, 0xf20, x64, D|RegMem|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Control, Reg64 } --mov, 0xf21, i386|No64, D|RegMem|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Debug, Reg32 } -+mov, 0xf21, i386&No64, D|RegMem|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Debug, Reg32 } - mov, 0xf21, x64, D|RegMem|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Debug, Reg64 } --mov, 0xf24, i386|No64, D|RegMem|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Test, Reg32 } -+mov, 0xf24, i386&No64, D|RegMem|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Test, Reg32 } - - // Move after swapping the bytes - movbe, 0x0f38f0, Movbe, D|Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+movbe, 0x60, Movbe&APX_F, D|Modrm|CheckOperandSize|No_bSuf|No_sSuf|EVexMap4, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+// This needs to live here for easy EVEX -> REX2 conversion, which wants to -+// restart with the next sequential template. -+bswap, 0xfc8, i486, No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64 } - - // Move with sign extend. - movsb, 0xfbe, i386, Modrm|No_bSuf|No_sSuf, { Reg8|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -@@ -201,37 +225,39 @@ movsxd, 0x63, x64, Amd64|Modrm|NoSuf, { Reg32|Unspecified|BaseIndex, Reg16 } - movsxd, 0x63, x64, Intel64|Modrm|NoSuf, { Reg16|Unspecified|BaseIndex, Reg16 } - - // Move with zero extend. --movzb, 0xfb6, i386, Modrm|No_bSuf|No_sSuf, { Reg8|Byte|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } --movzw, 0xfb7, i386, Modrm|No_bSuf|No_wSuf|No_sSuf, { Reg16|Word|Unspecified|BaseIndex, Reg32|Reg64 } -+movzb, 0xfb6, i386, Modrm|No_bSuf|No_sSuf, { Reg8|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+movzw, 0xfb7, i386, Modrm|No_bSuf|No_wSuf|No_sSuf, { Reg16|Unspecified|BaseIndex, Reg32|Reg64 } - // The 64-bit variant is not particularly useful since the zero extend - // 32->64 is implicit, but we can encode them. - movzx, 0xfb6, i386, W|Modrm|No_lSuf|No_sSuf|No_qSuf, { Reg8|Reg16|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } - - // Push instructions. --push, 0x50, No64, No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32 } --push, 0xff/6, No64, Modrm|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32|Word|Dword|Unspecified|BaseIndex } --push, 0x6a, i186|No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Imm8S } --push, 0x68, i186|No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Imm16|Imm32 } --push, 0x6, No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, { SReg } -+push, 0x50, No64, ImplicitStackOp|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32 } -+push, 0xff/6, No64, Modrm|ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32|Unspecified|BaseIndex } -+push, 0x6a, i186&No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Imm8S } -+push, 0x68, i186&No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Imm16|Imm32 } -+push, 0x6, No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { SReg } - // In 64bit mode, the operand size is implicitly 64bit. --push, 0x50, x64, No_bSuf|No_lSuf|No_sSuf|NoRex64, { Reg16|Reg64 } --push, 0xff/6, x64, Modrm|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Reg16|Reg64|Word|Qword|Unspecified|BaseIndex } --push, 0x6a, x64, DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Imm8S } --push, 0x68, x64, DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Imm16|Imm32S } --push, 0xfa0, x64, DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { SReg } -+push, 0x50, x64, ImplicitStackOp|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Reg16|Reg64 } -+pushp, 0x50, APX_F, ImplicitStackOp|No_bSuf|No_wSuf|No_lSuf|No_sSuf|Rex2, { Reg64 } -+push, 0xff/6, x64, Modrm|ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Reg16|Reg64|Unspecified|BaseIndex } -+push, 0x6a, x64, ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Imm8S } -+push, 0x68, x64, ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Imm16|Imm32S } -+push, 0xfa0, x64, ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { SReg } - --pusha, 0x60, i186|No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} -+pusha, 0x60, i186&No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} - - // Pop instructions. --pop, 0x58, No64, No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32 } --pop, 0x8f/0, No64, Modrm|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32|Word|Dword|Unspecified|BaseIndex } --pop, 0x7, No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, { SReg } -+pop, 0x58, No64, ImplicitStackOp|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32 } -+pop, 0x8f/0, No64, Modrm|ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32|Unspecified|BaseIndex } -+pop, 0x7, No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { SReg } - // In 64bit mode, the operand size is implicitly 64bit. --pop, 0x58, x64, No_bSuf|No_lSuf|No_sSuf|NoRex64, { Reg16|Reg64 } --pop, 0x8f/0, x64, Modrm|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Reg16|Reg64|Word|Qword|Unspecified|BaseIndex } --pop, 0xfa1, x64, DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { SReg } -+pop, 0x58, x64, ImplicitStackOp|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Reg16|Reg64 } -+popp, 0x58, APX_F, ImplicitStackOp|No_bSuf|No_wSuf|No_lSuf|No_sSuf|Rex2, { Reg64 } -+pop, 0x8f/0, x64, Modrm|ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Reg16|Reg64|Unspecified|BaseIndex } -+pop, 0xfa1, x64, ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { SReg } - --popa, 0x61, i186|No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} -+popa, 0x61, i186&No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} - - // Exchange instructions. - // xchg commutes: we allow both operand orders. -@@ -273,70 +299,67 @@ lahf, 0x9f, No64, NoSuf, {} - lahf, 0x9f, LAHF_SAHF, NoSuf, {} - sahf, 0x9e, No64, NoSuf, {} - sahf, 0x9e, LAHF_SAHF, NoSuf, {} --pushf, 0x9c, No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} --pushf, 0x9c, x64, DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, {} --popf, 0x9d, No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} --popf, 0x9d, x64, DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, {} -+pushf, 0x9c, No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} -+pushf, 0x9c, x64, ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, {} -+popf, 0x9d, No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} -+popf, 0x9d, x64, ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, {} - stc, 0xf9, 0, NoSuf, {} - std, 0xfd, 0, NoSuf, {} - sti, 0xfb, 0, NoSuf, {} - - // Arithmetic. --add, 0x0, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --add, 0x83/0, 0, Modrm|No_bSuf|No_sSuf|HLEPrefixLock, { Imm8S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } --add, 0x4, 0, W|No_sSuf, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } --add, 0x80/0, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -- --inc, 0x40, No64, No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32 } --inc, 0xfe/0, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } - --sub, 0x28, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock|Optimize, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --sub, 0x83/5, 0, Modrm|No_bSuf|No_sSuf|HLEPrefixLock, { Imm8S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } --sub, 0x2c, 0, W|No_sSuf, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } --sub, 0x80/5, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -+ -+ -+, << 3, APX_F, D||W|CheckOperandSize|Modrm|No_sSuf|DstVVVV|EVexMap4||, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg8|Reg16|Reg32|Reg64 } -+, << 3, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock||, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+, << 3, APX_F, D|W|CheckOperandSize|Modrm|No_sSuf|EVexMap4|, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+, 0x83/, APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|DstVVVV|EVexMap4|, { Imm8S, Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+, 0x83/, 0, Modrm|No_bSuf|No_sSuf|HLEPrefixLock|, { Imm8S, Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+, 0x83/, 0, Modrm|No_bSuf|No_sSuf|EVexMap4|, { Imm8S, Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+, 0x04 | ( << 3), 0, W|No_sSuf|, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } -+, 0x80/, APX_F, W|Modrm|CheckOperandSize|No_sSuf|DstVVVV|EVexMap4|, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg8|Reg16|Reg32|Reg64 } -+, 0x80/, 0, W|Modrm|No_sSuf|HLEPrefixLock|, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+, 0x80/, APX_F, W|Modrm|EVexMap4|No_sSuf|, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+ -+ - --dec, 0x48, No64, No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32 } --dec, 0xfe/1, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -- --sbb, 0x18, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --sbb, 0x83/3, 0, Modrm|No_bSuf|No_sSuf|HLEPrefixLock, { Imm8S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } --sbb, 0x1c, 0, W|No_sSuf, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } --sbb, 0x80/3, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -+// clr with 1 operand is really xor with 2 operands. -+clr, 0x30, 0, W|Modrm|No_sSuf|RegKludge|Optimize, { Reg8|Reg16|Reg32|Reg64 } -+clr, 0x30, APX_F, W|Modrm|No_sSuf|RegKludge|EVexMap4|NF, { Reg8|Reg16|Reg32|Reg64 } - --cmp, 0x38, 0, D|W|CheckOperandSize|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --cmp, 0x83/7, 0, Modrm|No_bSuf|No_sSuf, { Imm8S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } -+cmp, 0x38, 0, D|W|CheckOperandSize|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+cmp, 0x83/7, 0, Modrm|No_bSuf|No_sSuf, { Imm8S, Reg16|Reg32|Reg64|Unspecified|BaseIndex } - cmp, 0x3c, 0, W|No_sSuf, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } --cmp, 0x80/7, 0, W|Modrm|No_sSuf, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -+cmp, 0x80/7, 0, W|Modrm|No_sSuf, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } - - test, 0x84, 0, D|W|C|CheckOperandSize|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } - test, 0xa8, 0, W|No_sSuf|Optimize, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } --test, 0xf6/0, 0, W|Modrm|No_sSuf|Optimize, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -+test, 0xf6/0, 0, W|Modrm|No_sSuf|Optimize, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } - --and, 0x20, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock|Optimize, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --and, 0x83/4, 0, Modrm|No_bSuf|No_sSuf|HLEPrefixLock|Optimize, { Imm8S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } --and, 0x24, 0, W|No_sSuf|Optimize, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } --and, 0x80/4, 0, W|Modrm|No_sSuf|HLEPrefixLock|Optimize, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -+ - --or, 0x8, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock|Optimize, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --or, 0x83/1, 0, Modrm|No_bSuf|No_sSuf|HLEPrefixLock, { Imm8S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } --or, 0xc, 0, W|No_sSuf, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } --or, 0x80/1, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -+, 0x40 | ( << 3), No64, No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32 } -+, 0xfe/, APX_F, W|Modrm|No_sSuf|CheckOperandSize|DstVVVV|EVexMap4|NF, {Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg8|Reg16|Reg32|Reg64} -+, 0xfe/, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+, 0xfe/, APX_F, W|Modrm|No_sSuf|EVexMap4|NF, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } - --xor, 0x30, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock|Optimize, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --xor, 0x83/6, 0, Modrm|No_bSuf|No_sSuf|HLEPrefixLock, { Imm8S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } --xor, 0x34, 0, W|No_sSuf, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } --xor, 0x80/6, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -+ - --// clr with 1 operand is really xor with 2 operands. --clr, 0x30, 0, W|Modrm|No_sSuf|RegKludge|Optimize, { Reg8|Reg16|Reg32|Reg64 } -+ - --adc, 0x10, 0, D|W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --adc, 0x83/2, 0, Modrm|No_bSuf|No_sSuf|HLEPrefixLock, { Imm8S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } --adc, 0x14, 0, W|No_sSuf, { Imm8|Imm16|Imm32|Imm32S, Acc|Byte|Word|Dword|Qword } --adc, 0x80/2, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Imm8|Imm16|Imm32|Imm32S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -+, 0xf6/, APX_F, W|Modrm|CheckOperandSize|No_sSuf|DstVVVV|EVexMap4|, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg8|Reg16|Reg32|Reg64 } -+, 0xf6/, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+, 0xf6/, APX_F, W|Modrm|No_sSuf|EVexMap4|, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } - --neg, 0xf6/3, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --not, 0xf6/2, 0, W|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -+ - - aaa, 0x37, No64, NoSuf, {} - aas, 0x3f, No64, NoSuf, {} -@@ -367,81 +390,82 @@ cqto, 0x99, x64, Size64|NoSuf, {} - // expanding 64-bit multiplies, and *cannot* be selected to accomplish - // 'imul %ebx, %eax' (opcode 0x0faf must be used in this case) - // These multiplies can only be selected with single operand forms. --mul, 0xf6/4, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --imul, 0xf6/5, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --imul, 0xfaf, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Unspecified|Word|Dword|Qword|BaseIndex, Reg16|Reg32|Reg64 } --imul, 0x6b, i186, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Imm8S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } --imul, 0x69, i186, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Imm16|Imm32|Imm32S, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+ -+ -+, 0xf6/, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+, 0xf6/, APX_F, W|Modrm|No_sSuf|EVexMap4|NF, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+imul, 0xaf, APX_F, C|Modrm|CheckOperandSize|No_bSuf|No_sSuf|DstVVVV|EVexMap4|NF, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64 } -+imul, 0xfaf, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+imul, 0xaf, APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|EVexMap4|NF, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+imul, 0x6b, i186, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Imm8S, Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+imul, 0x6b, APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|EVexMap4|NF, { Imm8S, Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+imul, 0x69, i186, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Imm16|Imm32|Imm32S, Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+imul, 0x69, APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|EVexMap4|NF, { Imm16|Imm32|Imm32S, Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } - // imul with 2 operands mimics imul with 3 by putting the register in - // both i.rm.reg & i.rm.regmem fields. RegKludge enables this - // transformation. - imul, 0x6b, i186, Modrm|No_bSuf|No_sSuf|RegKludge, { Imm8S, Reg16|Reg32|Reg64 } -+imul, 0x6b, APX_F, Modrm|No_bSuf|No_sSuf|RegKludge|EVexMap4|NF, { Imm8S, Reg16|Reg32|Reg64 } - imul, 0x69, i186, Modrm|No_bSuf|No_sSuf|RegKludge, { Imm16|Imm32|Imm32S, Reg16|Reg32|Reg64 } -- --div, 0xf6/6, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --div, 0xf6/6, 0, W|CheckOperandSize|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex, Acc|Byte|Word|Dword|Qword } --idiv, 0xf6/7, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --idiv, 0xf6/7, 0, W|CheckOperandSize|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex, Acc|Byte|Word|Dword|Qword } -- --rol, 0xd0/0, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --rol, 0xc0/0, i186, W|Modrm|No_sSuf, { Imm8|Imm8S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --rol, 0xd2/0, 0, W|Modrm|No_sSuf, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --rol, 0xd0/0, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -- --ror, 0xd0/1, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --ror, 0xc0/1, i186, W|Modrm|No_sSuf, { Imm8|Imm8S, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --ror, 0xd2/1, 0, W|Modrm|No_sSuf, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --ror, 0xd0/1, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -- --rcl, 0xd0/2, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --rcl, 0xc0/2, i186, W|Modrm|No_sSuf, { Imm8, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --rcl, 0xd2/2, 0, W|Modrm|No_sSuf, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --rcl, 0xd0/2, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -- --rcr, 0xd0/3, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --rcr, 0xc0/3, i186, W|Modrm|No_sSuf, { Imm8, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --rcr, 0xd2/3, 0, W|Modrm|No_sSuf, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --rcr, 0xd0/3, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -- --sal, 0xd0/4, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --sal, 0xc0/4, i186, W|Modrm|No_sSuf, { Imm8, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --sal, 0xd2/4, 0, W|Modrm|No_sSuf, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --sal, 0xd0/4, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -- --shl, 0xd0/4, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --shl, 0xc0/4, i186, W|Modrm|No_sSuf, { Imm8, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --shl, 0xd2/4, 0, W|Modrm|No_sSuf, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --shl, 0xd0/4, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -- --shr, 0xd0/5, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --shr, 0xc0/5, i186, W|Modrm|No_sSuf, { Imm8, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --shr, 0xd2/5, 0, W|Modrm|No_sSuf, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --shr, 0xd0/5, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -- --sar, 0xd0/7, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --sar, 0xc0/7, i186, W|Modrm|No_sSuf, { Imm8, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --sar, 0xd2/7, 0, W|Modrm|No_sSuf, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --sar, 0xd0/7, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -- --shld, 0xfa4, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Imm8, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } --shld, 0xfa5, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { ShiftCount, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } --shld, 0xfa5, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } -- --shrd, 0xfac, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Imm8, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } --shrd, 0xfad, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { ShiftCount, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } --shrd, 0xfad, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } -+imul, 0x69, APX_F, Modrm|No_bSuf|No_sSuf|RegKludge|EVexMap4|NF, { Imm16|Imm32|Imm32S, Reg16|Reg32|Reg64 } -+ -+ -+ -+ -+ -+
, 0xf6/, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+
, 0xf6/, APX_F, W|Modrm|No_sSuf|EVexMap4|NF, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+
, 0xf6/, 0, W|CheckOperandSize|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Acc|Byte|Word|Dword|Qword } -+
, 0xf6/, APX_F, W|CheckOperandSize|Modrm|No_sSuf|EVexMap4|NF, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Acc|Byte|Word|Dword|Qword } -+ -+
-+ -+ -+ -+, 0xd0/, APX_F, W|Modrm|No_sSuf|CheckOperandSize|DstVVVV|EVexMap4|, { Imm1, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg8|Reg16|Reg32|Reg64 } -+, 0xd0/, 0, W|Modrm|No_sSuf, { Imm1, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+, 0xd0/, APX_F, W|Modrm|No_sSuf|EVexMap4|, { Imm1, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+, 0xc0/, APX_F, W|Modrm|No_sSuf|CheckOperandSize|DstVVVV|EVexMap4|, { , Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg8|Reg16|Reg32|Reg64 } -+, 0xc0/, i186, W|Modrm|No_sSuf, { , Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+, 0xc0/, APX_F, W|Modrm|No_sSuf|EVexMap4|, { , Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+, 0xd2/, APX_F, W|Modrm|No_sSuf|CheckOperandSize|DstVVVV|EVexMap4|, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg8|Reg16|Reg32|Reg64 } -+, 0xd2/, 0, W|Modrm|No_sSuf, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+, 0xd2/, APX_F, W|Modrm|No_sSuf|EVexMap4|, { ShiftCount, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+, 0xd0/, 0, W|Modrm|No_sSuf, { Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+ -+ -+ -+ -+ -+shd, 0x24 | , APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|DstVVVV|EVexMap4|NF, { Imm8, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+shd, 0x0fa4 | , i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Imm8, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+shd, 0x24 | , APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|EVexMap4|NF, { Imm8, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+shd, 0xa5 | , APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|DstVVVV|EVexMap4|NF, { ShiftCount, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+shd, 0x0fa5 | , i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { ShiftCount, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+shd, 0xa5 | , APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|EVexMap4|NF, { ShiftCount, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+shd, 0x0fa5 | , i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+ -+ - - // Control transfer instructions. --call, 0xe8, No64, JumpDword|DefaultSize|No_bSuf|No_sSuf|No_qSuf|BNDPrefixOk, { Disp16|Disp32 } --call, 0xe8, x64, Amd64|JumpDword|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64|BNDPrefixOk, { Disp16|Disp32 } --call, 0xe8, x64, Intel64|JumpDword|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64|BNDPrefixOk, { Disp32 } --call, 0xff/2, No64, Modrm|JumpAbsolute|DefaultSize|No_bSuf|No_sSuf|No_qSuf|BNDPrefixOk|NoTrackPrefixOk, { Reg16|Reg32|Unspecified|BaseIndex } --call, 0xff/2, x64, Amd64|Modrm|JumpAbsolute|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64|BNDPrefixOk|NoTrackPrefixOk, { Reg16|Reg64|Unspecified|BaseIndex } --call, 0xff/2, x64, Intel64|Modrm|JumpAbsolute|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64|BNDPrefixOk|NoTrackPrefixOk, { Reg64|Unspecified|BaseIndex } -+call, 0xe8, No64, JumpDword|ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf|BNDPrefixOk, { Disp16|Disp32 } -+call, 0xe8, x64, Amd64|JumpDword|ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64|BNDPrefixOk, { Disp16|Disp32 } -+call, 0xe8, x64, Intel64|JumpDword|ImplicitStackOp|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64|BNDPrefixOk, { Disp32 } -+call, 0xff/2, No64, Modrm|JumpAbsolute|ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf|BNDPrefixOk|NoTrackPrefixOk, { Reg16|Reg32|Unspecified|BaseIndex } -+call, 0xff/2, x64, Amd64|Modrm|JumpAbsolute|ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64|BNDPrefixOk|NoTrackPrefixOk, { Reg16|Reg64|Unspecified|BaseIndex } -+call, 0xff/2, x64, Intel64|Modrm|JumpAbsolute|ImplicitStackOp|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64|BNDPrefixOk|NoTrackPrefixOk, { Reg64|Unspecified|BaseIndex } - // Intel Syntax remaining call instances. --call, 0x9a, No64, JumpInterSegment|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Imm16, Imm16|Imm32 } --call, 0xff/3, 0, Amd64|Modrm|JumpAbsolute|DefaultSize|NoSuf, { Dword|Fword|BaseIndex } --call, 0xff/3, x64, Intel64|Modrm|JumpAbsolute|NoSuf, { Dword|Fword|Tbyte|BaseIndex } -+call, 0x9a, No64, JumpInterSegment|ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Imm16, Imm16|Imm32 } -+call, 0xff/3, 0, Amd64|Modrm|JumpAbsolute|ImplicitStackOp|DefaultSize|NoSuf, { Dword|Fword|BaseIndex } -+call, 0xff/3, x64, Intel64|Modrm|JumpAbsolute|ImplicitStackOp|NoSuf, { Dword|Fword|Tbyte|BaseIndex } - lcall, 0x9a, No64, JumpInterSegment|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Imm16, Imm16|Imm32 } - lcall, 0xff/3, 0, Amd64|Modrm|JumpAbsolute|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Unspecified|BaseIndex } - lcall, 0xff/3, x64, Intel64|Modrm|JumpAbsolute|No_bSuf|No_sSuf, { Unspecified|BaseIndex } -@@ -459,22 +483,22 @@ ljmp, 0xea, No64, JumpInterSegment|No_bSuf|No_sSuf|No_qSuf, { Imm16, Imm16|Imm32 - ljmp, 0xff/5, 0, Amd64|Modrm|JumpAbsolute|No_bSuf|No_sSuf|No_qSuf, { Unspecified|BaseIndex } - ljmp, 0xff/5, x64, Intel64|Modrm|JumpAbsolute|No_bSuf|No_sSuf, { Unspecified|BaseIndex } - --ret, 0xc3, No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf|RepPrefixOk|BNDPrefixOk, {} --ret, 0xc2, No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf|RepPrefixOk|BNDPrefixOk, { Imm16 } --ret, 0xc3, x64, Amd64|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64|RepPrefixOk|BNDPrefixOk, {} --ret, 0xc2, x64, Amd64|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64|RepPrefixOk|BNDPrefixOk, { Imm16 } --ret, 0xc3, x64, Intel64|Size64|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64|RepPrefixOk|BNDPrefixOk, {} --ret, 0xc2, x64, Intel64|Size64|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64|RepPrefixOk|BNDPrefixOk, { Imm16 } -+ret, 0xc3, No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf|RepPrefixOk|BNDPrefixOk, {} -+ret, 0xc2, No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf|RepPrefixOk|BNDPrefixOk, { Imm16 } -+ret, 0xc3, x64, Amd64|ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64|RepPrefixOk|BNDPrefixOk, {} -+ret, 0xc2, x64, Amd64|ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64|RepPrefixOk|BNDPrefixOk, { Imm16 } -+ret, 0xc3, x64, Intel64|ImplicitStackOp|Size64|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64|RepPrefixOk|BNDPrefixOk, {} -+ret, 0xc2, x64, Intel64|ImplicitStackOp|Size64|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64|RepPrefixOk|BNDPrefixOk, { Imm16 } - lret, 0xcb, 0, DefaultSize|No_bSuf|No_sSuf, {} - lret, 0xca, 0, DefaultSize|No_bSuf|No_sSuf, { Imm16 } - // Intel Syntax. - retf, 0xcb, 0, DefaultSize|No_bSuf|No_sSuf, {} - retf, 0xca, 0, DefaultSize|No_bSuf|No_sSuf, { Imm16 } - --enter, 0xc8, i186|No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Imm16, Imm8 } --enter, 0xc8, x64, DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Imm16, Imm8 } --leave, 0xc9, i186|No64, DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} --leave, 0xc9, x64, DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, {} -+enter, 0xc8, i186&No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, { Imm16, Imm8 } -+enter, 0xc8, x64, ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, { Imm16, Imm8 } -+leave, 0xc9, i186&No64, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf|No_qSuf, {} -+leave, 0xc9, x64, ImplicitStackOp|DefaultSize|No_bSuf|No_lSuf|No_sSuf|NoRex64, {} - - -@@ -503,7 +527,7 @@ loopne, 0xe0, No64, JumpByte|No_bSuf|No_sSuf|No_qSuf, { Disp8 } - loopne, 0xe0, x64, JumpByte|No_bSuf|No_wSuf|No_sSuf|NoRex64, { Disp8 } - - // Set byte on flag instructions. --set, 0xf9/0, i386, Modrm|No_wSuf|No_lSuf|No_sSuf|No_qSuf, { Reg8|Byte|Unspecified|BaseIndex } -+set, 0xf9/0, i386, Modrm|No_wSuf|No_lSuf|No_sSuf|No_qSuf, { Reg8|Unspecified|BaseIndex } - - // String manipulation. - cmps, 0xa6, 0, W|No_sSuf|RepPrefixOk, {} -@@ -540,58 +564,58 @@ xlat, 0xd7, 0, No_wSuf|No_lSuf|No_sSuf|No_qSuf, {} - xlat, 0xd7, 0, No_wSuf|No_lSuf|No_sSuf|No_qSuf|IsString, { Byte|Unspecified|BaseIndex } - - // Bit manipulation. --bsf, 0xfbc, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|RepPrefixOk, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } --bsr, 0xfbd, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|RepPrefixOk, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } --bt, 0xfa3, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } -+bsf, 0xfbc, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|RepPrefixOk, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+bsr, 0xfbd, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|RepPrefixOk, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+bt, 0xfa3, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex } - bt, 0xfba/4, i386, Modrm|No_bSuf|No_sSuf|Optimize, { Imm8, Reg16|Reg32|Reg64|Unspecified|BaseIndex } --btc, 0xfbb, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|HLEPrefixLock, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } -+btc, 0xfbb, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|HLEPrefixLock, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex } - btc, 0xfba/7, i386, Modrm|No_bSuf|No_sSuf|Optimize|HLEPrefixLock, { Imm8, Reg16|Reg32|Reg64|Unspecified|BaseIndex } --btr, 0xfb3, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|HLEPrefixLock, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } -+btr, 0xfb3, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|HLEPrefixLock, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex } - btr, 0xfba/6, i386, Modrm|No_bSuf|No_sSuf|Optimize|HLEPrefixLock, { Imm8, Reg16|Reg32|Reg64|Unspecified|BaseIndex } --bts, 0xfab, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|HLEPrefixLock, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } -+bts, 0xfab, i386, Modrm|CheckOperandSize|No_bSuf|No_sSuf|HLEPrefixLock, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64|Unspecified|BaseIndex } - bts, 0xfba/5, i386, Modrm|No_bSuf|No_sSuf|Optimize|HLEPrefixLock, { Imm8, Reg16|Reg32|Reg64|Unspecified|BaseIndex } - - // Interrupts & op. sys insns. - // See gas/config/tc-i386.c for conversion of 'int $3' into the special - // int 3 insn. --int, 0xcd, 0, NoSuf, { Imm8 } --int1, 0xf1, 0, NoSuf, {} --int3, 0xcc, 0, NoSuf, {} --into, 0xce, No64, NoSuf, {} --iret, 0xcf, 0, DefaultSize|No_bSuf|No_sSuf, {} -+int, 0xcd, 0, ImplicitStackOp|NoSuf, { Imm8 } -+int1, 0xf1, 0, ImplicitStackOp|NoSuf, {} -+int3, 0xcc, 0, ImplicitStackOp|NoSuf, {} -+into, 0xce, No64, ImplicitStackOp|NoSuf, {} -+iret, 0xcf, 0, ImplicitStackOp|DefaultSize|No_bSuf|No_sSuf, {} - // i386sl, i486sl, later 486, and Pentium. - rsm, 0xfaa, i386, NoSuf, {} - --bound, 0x62, i186|No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32, Dword|Qword|Unspecified|BaseIndex } -+bound, 0x62, i186&No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32, Dword|Qword|Unspecified|BaseIndex } - - hlt, 0xf4, 0, NoSuf, {} - --nop, 0xf1f/0, Nop, Modrm|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex } -+nop, 0xf1f/0, Nop, Modrm|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Unspecified|BaseIndex } - - // nop is actually "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in - // 32bit mode and "xchg %rax,%rax" in 64bit mode. - nop, 0x90, 0, NoSuf|RepPrefixOk, {} - - // Protection control. --arpl, 0x63, i286|No64, RegMem|CheckOperandSize|IgnoreSize|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32, Reg16|Reg32 } --arpl, 0x63, i286|No64, Modrm|IgnoreSize|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32, Word|Unspecified|BaseIndex } -+arpl, 0x63, i286&No64, RegMem|CheckOperandSize|IgnoreSize|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32, Reg16|Reg32 } -+arpl, 0x63, i286&No64, Modrm|IgnoreSize|No_bSuf|No_sSuf|No_qSuf, { Reg16|Reg32, Word|Unspecified|BaseIndex } - lar, 0xf02, i286, Modrm|CheckOperandSize|No_bSuf|No_sSuf|NoRex64, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64 } - lar, 0xf02, i286, Modrm|No_bSuf|No_sSuf|NoRex64, { Reg16|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } --lgdt, 0xf01/2, i286|No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } -+lgdt, 0xf01/2, i286&No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } - lgdt, 0xf01/2, x64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Tbyte|Unspecified|BaseIndex } --lidt, 0xf01/3, i286|No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } -+lidt, 0xf01/3, i286&No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } - lidt, 0xf01/3, x64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Tbyte|Unspecified|BaseIndex } - lldt, 0xf00/2, i286, Modrm|IgnoreSize|No_bSuf|No_sSuf|NoRex64, { Reg16|Reg32|Reg64 } - lldt, 0xf00/2, i286, Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { Word|Unspecified|BaseIndex } --lmsw, 0xf01/6, i286, Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { Reg16|Word|Unspecified|BaseIndex } -+lmsw, 0xf01/6, i286, Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { Reg16|Unspecified|BaseIndex } - lsl, 0xf03, i286, Modrm|CheckOperandSize|No_bSuf|No_sSuf|NoRex64, { Reg16|Reg32|Reg64, Reg16|Reg32|Reg64 } - lsl, 0xf03, i286, Modrm|No_bSuf|No_sSuf|NoRex64, { Reg16|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } - ltr, 0xf00/3, i286, Modrm|IgnoreSize|No_bSuf|No_sSuf|NoRex64, { Reg16|Reg32|Reg64 } - ltr, 0xf00/3, i286, Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { Word|Unspecified|BaseIndex } - --sgdt, 0xf01/0, i286|No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } -+sgdt, 0xf01/0, i286&No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } - sgdt, 0xf01/0, x64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Tbyte|Unspecified|BaseIndex } --sidt, 0xf01/1, i286|No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } -+sidt, 0xf01/1, i286&No64, Modrm|No_bSuf|No_sSuf|No_qSuf, { Fword|Unspecified|BaseIndex } - sidt, 0xf01/1, x64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Tbyte|Unspecified|BaseIndex } - sldt, 0xf00/0, i286, Modrm|No_bSuf|No_sSuf|NoRex64, { Reg16|Reg32|Reg64 } - sldt, 0xf00/0, i286, Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { Word|Unspecified|BaseIndex } -@@ -700,14 +724,13 @@ faddp, 0xdec1, FP, NoSuf, {} - fsub, 0xd8/4, FP, Modrm|NoSuf, { FloatReg } - fsub, 0xd8/4, FP, D|Modrm|NoSuf, { FloatReg, FloatAcc } - // alias for fsubp --fsub, 0xdee1, FP, NoSuf|Ugh|ATTMnemonic|ATTSyntax, {} --fsub, 0xdee9, FP, NoSuf|Ugh|ATTMnemonic, {} -+fsub, 0xdee1, FP, NoSuf|Ugh|ATTMnemonic, {} - fsub, 0xd8/4, FP, Modrm|FloatMF|No_bSuf|No_wSuf|No_qSuf, { Dword|Qword|Unspecified|BaseIndex } - fisub, 0xde/4, FP, Modrm|FloatMF|No_bSuf|No_wSuf|No_qSuf, { Word|Dword|Unspecified|BaseIndex } - --fsubp, 0xde/4, FP, Modrm|NoSuf|ATTMnemonic|ATTSyntax, { FloatAcc, FloatReg } --fsubp, 0xde/4, FP, Modrm|NoSuf|ATTMnemonic|ATTSyntax, { FloatReg } --fsubp, 0xdee1, FP, NoSuf|ATTMnemonic|ATTSyntax, {} -+fsubp, 0xde/4, FP, Modrm|NoSuf|ATTMnemonic, { FloatAcc, FloatReg } -+fsubp, 0xde/4, FP, Modrm|NoSuf|ATTMnemonic, { FloatReg } -+fsubp, 0xdee1, FP, NoSuf|ATTMnemonic, {} - fsubp, 0xde/5, FP, Modrm|NoSuf, { FloatAcc, FloatReg } - fsubp, 0xde/5, FP, Modrm|NoSuf, { FloatReg } - fsubp, 0xdee9, FP, NoSuf, {} -@@ -716,14 +739,13 @@ fsubp, 0xdee9, FP, NoSuf, {} - fsubr, 0xd8/5, FP, Modrm|NoSuf, { FloatReg } - fsubr, 0xd8/5, FP, D|Modrm|NoSuf, { FloatReg, FloatAcc } - // alias for fsubrp --fsubr, 0xdee9, FP, NoSuf|Ugh|ATTMnemonic|ATTSyntax, {} --fsubr, 0xdee1, FP, NoSuf|Ugh|ATTMnemonic, {} -+fsubr, 0xdee9, FP, NoSuf|Ugh|ATTMnemonic, {} - fsubr, 0xd8/5, FP, Modrm|FloatMF|No_bSuf|No_wSuf|No_qSuf, { Dword|Qword|Unspecified|BaseIndex } - fisubr, 0xde/5, FP, Modrm|FloatMF|No_bSuf|No_wSuf|No_qSuf, { Word|Dword|Unspecified|BaseIndex } - --fsubrp, 0xde/5, FP, Modrm|NoSuf|ATTMnemonic|ATTSyntax, { FloatAcc, FloatReg } --fsubrp, 0xde/5, FP, Modrm|NoSuf|ATTMnemonic|ATTSyntax, { FloatReg } --fsubrp, 0xdee9, FP, NoSuf|ATTMnemonic|ATTSyntax, {} -+fsubrp, 0xde/5, FP, Modrm|NoSuf|ATTMnemonic, { FloatAcc, FloatReg } -+fsubrp, 0xde/5, FP, Modrm|NoSuf|ATTMnemonic, { FloatReg } -+fsubrp, 0xdee9, FP, NoSuf|ATTMnemonic, {} - fsubrp, 0xde/4, FP, Modrm|NoSuf, { FloatAcc, FloatReg } - fsubrp, 0xde/4, FP, Modrm|NoSuf, { FloatReg } - fsubrp, 0xdee1, FP, NoSuf, {} -@@ -745,14 +767,13 @@ fmulp, 0xdec9, FP, NoSuf, {} - fdiv, 0xd8/6, FP, Modrm|NoSuf, { FloatReg } - fdiv, 0xd8/6, FP, D|Modrm|NoSuf, { FloatReg, FloatAcc } - // alias for fdivp --fdiv, 0xdef1, FP, NoSuf|Ugh|ATTMnemonic|ATTSyntax, {} --fdiv, 0xdef9, FP, NoSuf|Ugh|ATTMnemonic, {} -+fdiv, 0xdef1, FP, NoSuf|Ugh|ATTMnemonic, {} - fdiv, 0xd8/6, FP, Modrm|FloatMF|No_bSuf|No_wSuf|No_qSuf, { Dword|Qword|Unspecified|BaseIndex } - fidiv, 0xde/6, FP, Modrm|FloatMF|No_bSuf|No_wSuf|No_qSuf, { Word|Dword|Unspecified|BaseIndex } - --fdivp, 0xde/6, FP, Modrm|NoSuf|ATTMnemonic|ATTSyntax, { FloatAcc, FloatReg } --fdivp, 0xde/6, FP, Modrm|NoSuf|ATTMnemonic|ATTSyntax, { FloatReg } --fdivp, 0xdef1, FP, NoSuf|ATTMnemonic|ATTSyntax, {} -+fdivp, 0xde/6, FP, Modrm|NoSuf|ATTMnemonic, { FloatAcc, FloatReg } -+fdivp, 0xde/6, FP, Modrm|NoSuf|ATTMnemonic, { FloatReg } -+fdivp, 0xdef1, FP, NoSuf|ATTMnemonic, {} - fdivp, 0xde/7, FP, Modrm|NoSuf, { FloatAcc, FloatReg } - fdivp, 0xde/7, FP, Modrm|NoSuf, { FloatReg } - fdivp, 0xdef9, FP, NoSuf, {} -@@ -761,14 +782,13 @@ fdivp, 0xdef9, FP, NoSuf, {} - fdivr, 0xd8/7, FP, Modrm|NoSuf, { FloatReg } - fdivr, 0xd8/7, FP, D|Modrm|NoSuf, { FloatReg, FloatAcc } - // alias for fdivrp --fdivr, 0xdef9, FP, NoSuf|Ugh|ATTMnemonic|ATTSyntax, {} --fdivr, 0xdef1, FP, NoSuf|Ugh|ATTMnemonic, {} -+fdivr, 0xdef9, FP, NoSuf|Ugh|ATTMnemonic, {} - fdivr, 0xd8/7, FP, Modrm|FloatMF|No_bSuf|No_wSuf|No_qSuf, { Dword|Qword|Unspecified|BaseIndex } - fidivr, 0xde/7, FP, Modrm|FloatMF|No_bSuf|No_wSuf|No_qSuf, { Word|Dword|Unspecified|BaseIndex } - --fdivrp, 0xde/7, FP, Modrm|NoSuf|ATTMnemonic|ATTSyntax, { FloatAcc, FloatReg } --fdivrp, 0xde/7, FP, Modrm|NoSuf|ATTMnemonic|ATTSyntax, { FloatReg } --fdivrp, 0xdef9, FP, NoSuf|ATTMnemonic|ATTSyntax, {} -+fdivrp, 0xde/7, FP, Modrm|NoSuf|ATTMnemonic, { FloatAcc, FloatReg } -+fdivrp, 0xde/7, FP, Modrm|NoSuf|ATTMnemonic, { FloatReg } -+fdivrp, 0xdef9, FP, NoSuf|ATTMnemonic, {} - fdivrp, 0xde/6, FP, Modrm|NoSuf, { FloatAcc, FloatReg } - fdivrp, 0xde/6, FP, Modrm|NoSuf, { FloatReg } - fdivrp, 0xdef1, FP, NoSuf, {} -@@ -831,14 +851,14 @@ fwait, 0x9b, FP, NoSuf, {} - - // Opcode prefixes; we allow them as separate insns too. - --addr16, 0x67, i386|No64, Size16|IgnoreSize|NoSuf|IsPrefix, {} -+addr16, 0x67, i386&No64, Size16|IgnoreSize|NoSuf|IsPrefix, {} - addr32, 0x67, i386, Size32|IgnoreSize|NoSuf|IsPrefix, {} --aword, 0x67, i386|No64, Size16|IgnoreSize|NoSuf|IsPrefix, {} -+aword, 0x67, i386&No64, Size16|IgnoreSize|NoSuf|IsPrefix, {} - adword, 0x67, i386, Size32|IgnoreSize|NoSuf|IsPrefix, {} - data16, 0x66, i386, Size16|IgnoreSize|NoSuf|IsPrefix, {} --data32, 0x66, i386|No64, Size32|IgnoreSize|NoSuf|IsPrefix, {} -+data32, 0x66, i386&No64, Size32|IgnoreSize|NoSuf|IsPrefix, {} - word, 0x66, i386, Size16|IgnoreSize|NoSuf|IsPrefix, {} --dword, 0x66, i386|No64, Size32|IgnoreSize|NoSuf|IsPrefix, {} -+dword, 0x66, i386&No64, Size32|IgnoreSize|NoSuf|IsPrefix, {} - lock, 0xf0, 0, NoSuf|IsPrefix, {} - wait, 0x9b, 0, NoSuf|IsPrefix, {} - cs, 0x2e, 0, NoSuf|IsPrefix, {} -@@ -888,18 +908,18 @@ rex.wrxb, 0x4f, x64, NoSuf|IsPrefix, {} - - // Pseudo prefixes (base_opcode == PSEUDO_PREFIX) - -- -+ rex:REX:x64, rex2:REX2:APX_F, nf:NF:APX_F, + -+ nooptimize:NoOptimize:0> - - {}, PSEUDO_PREFIX/Prefix_, , NoSuf|IsPrefix, {} - --// 486 extensions. -+// 486 extensions (BSWAP moved elsewhere). - --bswap, 0xfc8, i486, No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64 } --xadd, 0xfc0, i486, W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } --cmpxchg, 0xfb0, i486, W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Byte|Word|Dword|Qword|Unspecified|BaseIndex } -+xadd, 0xfc0, i486, W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } -+cmpxchg, 0xfb0, i486, W|CheckOperandSize|Modrm|No_sSuf|HLEPrefixLock, { Reg8|Reg16|Reg32|Reg64, Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex } - invd, 0xf08, i486, NoSuf, {} - wbinvd, 0xf09, i486, NoSuf, {} - invlpg, 0xf01/7, i486, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex } -@@ -915,13 +935,13 @@ cmpxchg8b, 0xfc7/1, i586, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64|HLEPrefi - - // Pentium II/Pentium Pro extensions. - sysenter, 0xf34, x64, Intel64Only|NoSuf, {} --sysenter, 0xf34, i686|No64, NoSuf, {} -+sysenter, 0xf34, i686&No64, NoSuf, {} - sysexit, 0xf35, x64, Intel64Only|No_bSuf|No_wSuf|No_sSuf, {} --sysexit, 0xf35, i686|No64, NoSuf, {} -+sysexit, 0xf35, i686&No64, NoSuf, {} - fxsave, 0xfae/0, FXSR, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Unspecified|BaseIndex } --fxsave64, 0xfae/0, FXSR|x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } -+fxsave64, 0xfae/0, FXSR&x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } - fxrstor, 0xfae/1, FXSR, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Unspecified|BaseIndex } --fxrstor64, 0xfae/1, FXSR|x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } -+fxrstor64, 0xfae/1, FXSR&x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } - rdpmc, 0xf33, i686, NoSuf, {} - // official undefined instr. - ud2, 0xf0b, i186, NoSuf, {} -@@ -934,7 +954,8 @@ ud2b, 0xfb9, i186, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|U - // 3rd official undefined instr (older CPUs don't take a ModR/M byte) - ud0, 0xfff, i186, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } - --cmov, 0xf4, CMOV, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+cmov, 0x4, CMOV&APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|DstVVVV|EVexMap4, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64, Reg16|Reg32|Reg64 } -+cmov, 0xf4, CMOV, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } - - fcmovb, 0xda/0, i687, Modrm|NoSuf, { FloatReg, FloatAcc } - fcmovnae, 0xda/0, i687, Modrm|NoSuf, { FloatReg, FloatAcc } -@@ -992,9 +1013,9 @@ pause, 0xf390, i186, NoSuf, {} - b:0:VexW0:Byte:AVX512DQ:66:AVX512VBMI, + - w:1:VexW1:Word:AVX512F::AVX512BW> - -- -+ - - emms, 0xf77, MMX, NoSuf, {} - // These really shouldn't allow for Reg64 (movq is the right mnemonic for -@@ -1002,21 +1023,21 @@ emms, 0xf77, MMX, NoSuf, {} - // spec). AMD's spec, having been in existence for much longer, failed to - // recognize that and specified movd for 32- and 64-bit operations. - movd, 0x666e, AVX, D|Modrm|Vex128|Space0F|VexW0|NoSuf|SSE2AVX, { Reg32|Unspecified|BaseIndex, RegXMM } --movd, 0x666e, AVX|x64, D|Modrm|Vex=1|Space0F|VexW1|NoSuf|Size64|SSE2AVX, { Reg64|BaseIndex, RegXMM } -+movd, 0x666e, AVX&x64, D|Modrm|Vex=1|Space0F|VexW1|NoSuf|Size64|SSE2AVX, { Reg64|BaseIndex, RegXMM } - movd, 0x660f6e, SSE2, D|Modrm|IgnoreSize|NoSuf, { Reg32|Unspecified|BaseIndex, RegXMM } --movd, 0x660f6e, SSE2|x64, D|Modrm|NoSuf|Size64, { Reg64|BaseIndex, RegXMM } -+movd, 0x660f6e, SSE2&x64, D|Modrm|NoSuf|Size64, { Reg64|BaseIndex, RegXMM } - // The MMX templates have to remain after at least the SSE2AVX ones. - movd, 0xf6e, MMX, D|Modrm|IgnoreSize|NoSuf, { Reg32|Unspecified|BaseIndex, RegMMX } --movd, 0xf6e, MMX|x64, D|Modrm|NoSuf|Size64, { Reg64|BaseIndex, RegMMX } --movq, 0xf37e, AVX, Load|Modrm|Vex=1|Space0F|VexWIG|NoSuf|SSE2AVX, { Qword|Unspecified|BaseIndex|RegXMM, RegXMM } --movq, 0x66d6, AVX, Modrm|Vex=1|Space0F|VexWIG|NoSuf|SSE2AVX, { RegXMM, Qword|Unspecified|BaseIndex|RegXMM } --movq, 0x666e, AVX|x64, D|Modrm|Vex=1|Space0F|VexW1|NoSuf|Size64|SSE2AVX, { Reg64|Unspecified|BaseIndex, RegXMM } -+movd, 0xf6e, MMX&x64, D|Modrm|NoSuf|Size64, { Reg64|BaseIndex, RegMMX } -+movq, 0xf37e, AVX, Load|Modrm|Vex128|Space0F|VexW0|NoSuf|SSE2AVX, { Qword|Unspecified|BaseIndex|RegXMM, RegXMM } -+movq, 0x66d6, AVX, Modrm|Vex128|Space0F|VexW0|NoSuf|SSE2AVX, { RegXMM, Qword|Unspecified|BaseIndex|RegXMM } -+movq, 0x666e, AVX&x64, D|Modrm|Vex=1|Space0F|VexW1|NoSuf|Size64|SSE2AVX, { Reg64|Unspecified|BaseIndex, RegXMM } - movq, 0xf30f7e, SSE2, Load|Modrm|NoSuf, { Unspecified|Qword|BaseIndex|RegXMM, RegXMM } - movq, 0x660fd6, SSE2, Modrm|NoSuf, { RegXMM, Unspecified|Qword|BaseIndex|RegXMM } --movq, 0x660f6e, SSE2|x64, D|Modrm|NoSuf|Size64, { Reg64|Unspecified|BaseIndex, RegXMM } -+movq, 0x660f6e, SSE2&x64, D|Modrm|NoSuf|Size64, { Reg64|Unspecified|BaseIndex, RegXMM } - // The MMX templates have to remain after at least the SSE2AVX ones. - movq, 0xf6f, MMX, D|Modrm|NoSuf, { Unspecified|Qword|BaseIndex|RegMMX, RegMMX } --movq, 0xf6e, MMX|x64, D|Modrm|NoSuf|Size64, { Reg64|Unspecified|BaseIndex, RegMMX } -+movq, 0xf6e, MMX&x64, D|Modrm|NoSuf|Size64, { Reg64|Unspecified|BaseIndex, RegMMX } - packssdw, 0x0f6b, , Modrm||NoSuf, { ||Unspecified|BaseIndex, } - packsswb, 0x0f63, , Modrm||NoSuf, { ||Unspecified|BaseIndex, } - packuswb, 0x0f67, , Modrm||NoSuf, { ||Unspecified|BaseIndex, } -@@ -1083,11 +1104,11 @@ cmpss, 0xf30fc2, , Modrm|||NoSuf, { Imm8, Dwor - comiss, 0x0f2f, , Modrm||NoSuf, { Dword|Unspecified|BaseIndex|RegXMM, RegXMM } - cvtpi2ps, 0xf2a, SSE, Modrm|NoSuf, { Qword|Unspecified|BaseIndex|RegMMX, RegXMM } - cvtps2pi, 0xf2d, SSE, Modrm|NoSuf, { Qword|Unspecified|BaseIndex|RegXMM, RegMMX } --cvtsi2ss, 0xf30f2a, |No64, Modrm|||IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Reg32|Unspecified|BaseIndex, RegXMM } --cvtsi2ss, 0xf32a, AVX|x64, Modrm|Vex=3|Space0F|VexVVVV|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|SSE2AVX|ATTSyntax, { Reg32|Reg64|Dword|Qword|Unspecified|BaseIndex, RegXMM } --cvtsi2ss, 0xf32a, AVX|x64, Modrm|Vex=3|Space0F|VexVVVV|No_bSuf|No_wSuf|No_sSuf|SSE2AVX|IntelSyntax, { Reg32|Reg64|Dword|Qword|Unspecified|BaseIndex, RegXMM } --cvtsi2ss, 0xf30f2a, SSE|x64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|ATTSyntax, { Reg32|Reg64|Dword|Qword|Unspecified|BaseIndex, RegXMM } --cvtsi2ss, 0xf30f2a, SSE|x64, Modrm|No_bSuf|No_wSuf|No_sSuf|IntelSyntax, { Reg32|Reg64|Dword|Qword|Unspecified|BaseIndex, RegXMM } -+cvtsi2ss, 0xf30f2a, &No64, Modrm|||IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Reg32|Unspecified|BaseIndex, RegXMM } -+cvtsi2ss, 0xf32a, AVX&x64, Modrm|Vex=3|Space0F|VexVVVV|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|SSE2AVX|ATTSyntax, { Reg32|Reg64|Unspecified|BaseIndex, RegXMM } -+cvtsi2ss, 0xf32a, AVX&x64, Modrm|Vex=3|Space0F|VexVVVV|No_bSuf|No_wSuf|No_sSuf|SSE2AVX|IntelSyntax, { Reg32|Reg64|Unspecified|BaseIndex, RegXMM } -+cvtsi2ss, 0xf30f2a, SSE&x64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|ATTSyntax, { Reg32|Reg64|Unspecified|BaseIndex, RegXMM } -+cvtsi2ss, 0xf30f2a, SSE&x64, Modrm|No_bSuf|No_wSuf|No_sSuf|IntelSyntax, { Reg32|Reg64|Unspecified|BaseIndex, RegXMM } - cvtss2si, 0xf32d, AVX, Modrm|VexLIG|Space0F|No_bSuf|No_wSuf|No_sSuf|SSE2AVX, { Dword|Unspecified|BaseIndex|RegXMM, Reg32|Reg64 } - cvtss2si, 0xf30f2d, SSE, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Dword|Unspecified|BaseIndex|RegXMM, Reg32|Reg64 } - cvttps2pi, 0xf2c, SSE, Modrm|NoSuf, { Qword|Unspecified|BaseIndex|RegXMM, RegMMX } -@@ -1178,11 +1199,11 @@ comisd, 0x660f2f, , Modrm||NoSuf, { Qword|Unspecified - cvtpi2pd, 0x660f2a, SSE2, Modrm|NoSuf, { RegMMX, RegXMM } - cvtpi2pd, 0xf3e6, AVX, Modrm|Vex|Space0F|VexW0|NoSuf|SSE2AVX, { Qword|Unspecified|BaseIndex, RegXMM } - cvtpi2pd, 0x660f2a, SSE2, Modrm|NoSuf, { Qword|Unspecified|BaseIndex, RegXMM } --cvtsi2sd, 0xf20f2a, |No64, Modrm|IgnoreSize|||No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Reg32|Unspecified|BaseIndex, RegXMM } --cvtsi2sd, 0xf22a, AVX|x64, Modrm|Vex=3|Space0F|VexVVVV|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|SSE2AVX|ATTSyntax, { Reg32|Reg64|Dword|Qword|Unspecified|BaseIndex, RegXMM } --cvtsi2sd, 0xf22a, AVX|x64, Modrm|Vex=3|Space0F|VexVVVV|No_bSuf|No_wSuf|No_sSuf|SSE2AVX|IntelSyntax, { Reg32|Reg64|Dword|Qword|Unspecified|BaseIndex, RegXMM } --cvtsi2sd, 0xf20f2a, SSE2|x64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|ATTSyntax, { Reg32|Reg64|Dword|Qword|Unspecified|BaseIndex, RegXMM } --cvtsi2sd, 0xf20f2a, SSE2|x64, Modrm|No_bSuf|No_wSuf|No_sSuf|IntelSyntax, { Reg32|Reg64|Dword|Qword|Unspecified|BaseIndex, RegXMM } -+cvtsi2sd, 0xf20f2a, &No64, Modrm|IgnoreSize|||No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Reg32|Unspecified|BaseIndex, RegXMM } -+cvtsi2sd, 0xf22a, AVX&x64, Modrm|Vex=3|Space0F|VexVVVV|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|SSE2AVX|ATTSyntax, { Reg32|Reg64|Unspecified|BaseIndex, RegXMM } -+cvtsi2sd, 0xf22a, AVX&x64, Modrm|Vex=3|Space0F|VexVVVV|No_bSuf|No_wSuf|No_sSuf|SSE2AVX|IntelSyntax, { Reg32|Reg64|Unspecified|BaseIndex, RegXMM } -+cvtsi2sd, 0xf20f2a, SSE2&x64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|ATTSyntax, { Reg32|Reg64|Unspecified|BaseIndex, RegXMM } -+cvtsi2sd, 0xf20f2a, SSE2&x64, Modrm|No_bSuf|No_wSuf|No_sSuf|IntelSyntax, { Reg32|Reg64|Unspecified|BaseIndex, RegXMM } - divpd, 0x660f5e, , Modrm|||NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM } - divsd, 0xf20f5e, , Modrm|||NoSuf, { Qword|Unspecified|BaseIndex|RegXMM, RegXMM } - maxpd, 0x660f5f, , Modrm|||NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM } -@@ -1271,7 +1292,7 @@ fisttpll, 0xdd/1, FISTTP, Modrm|NoSuf|ATTSyntax, { Unspecified|BaseIndex } - - // CMPXCHG16B instruction. - --cmpxchg16b, 0xfc7/1, CX16|x64, Modrm|NoSuf|Size64|LockPrefixOk, { Oword|Unspecified|BaseIndex } -+cmpxchg16b, 0xfc7/1, CX16, Modrm|NoSuf|Size64|LockPrefixOk, { Oword|Unspecified|BaseIndex } - - // MONITOR instructions. - -@@ -1281,7 +1302,7 @@ monitor, 0xf01c8, MONITOR, NoSuf, {} - // all modes. - monitor, 0xf01c8, MONITOR, AddrPrefixOpReg|NoSuf, { Acc|Word|Dword|Qword, RegC|Dword, RegD|Dword } - // The 64-bit form exists only for compatibility with older gas. --monitor, 0xf01c8, MONITOR|x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword, RegD|Qword } -+monitor, 0xf01c8, MONITOR&x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword, RegD|Qword } - mwait, 0xf01c9, MONITOR, NoSuf, {} - // mwait is very special. AX and CX are always 32 bits. - // The 64-bit form exists only for compatibility with older gas. -@@ -1295,10 +1316,10 @@ vmlaunch, 0xf01c2, VMX, NoSuf, {} - vmresume, 0xf01c3, VMX, NoSuf, {} - vmptrld, 0xfc7/6, VMX, Modrm|NoSuf, { Qword|Unspecified|BaseIndex } - vmptrst, 0xfc7/7, VMX, Modrm|NoSuf, { Qword|Unspecified|BaseIndex } --vmread, 0xf78, VMX|No64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Reg32, Reg32|Unspecified|BaseIndex } --vmread, 0xf78, VMX|x64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Reg64, Reg64|Qword|Unspecified|BaseIndex } --vmwrite, 0xf79, VMX|No64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Reg32|Unspecified|BaseIndex, Reg32 } --vmwrite, 0xf79, VMX|x64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Reg64|Qword|Unspecified|BaseIndex, Reg64 } -+vmread, 0xf78, VMX&No64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Reg32, Reg32|Unspecified|BaseIndex } -+vmread, 0xf78, VMX&x64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Reg64, Reg64|Unspecified|BaseIndex } -+vmwrite, 0xf79, VMX&No64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Reg32|Unspecified|BaseIndex, Reg32 } -+vmwrite, 0xf79, VMX&x64, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoRex64, { Reg64|Unspecified|BaseIndex, Reg64 } - vmxoff, 0xf01c4, VMX, NoSuf, {} - vmxon, 0xf30fc7/6, VMX, Modrm|NoSuf, { Qword|Unspecified|BaseIndex } - -@@ -1312,15 +1333,18 @@ getsec, 0xf37, SMX, NoSuf, {} - - // EPT instructions. - --invept, 0x660f3880, EPT|No64, Modrm|IgnoreSize|NoSuf, { Oword|Unspecified|BaseIndex, Reg32 } --invept, 0x660f3880, EPT|x64, Modrm|NoSuf|NoRex64, { Oword|Unspecified|BaseIndex, Reg64 } --invvpid, 0x660f3881, EPT|No64, Modrm|IgnoreSize|NoSuf, { Oword|Unspecified|BaseIndex, Reg32 } --invvpid, 0x660f3881, EPT|x64, Modrm|NoSuf|NoRex64, { Oword|Unspecified|BaseIndex, Reg64 } -+invept, 0x660f3880, EPT&No64, Modrm|IgnoreSize|NoSuf, { Oword|Unspecified|BaseIndex, Reg32 } -+invept, 0x660f3880, EPT&x64, Modrm|NoSuf|NoRex64, { Oword|Unspecified|BaseIndex, Reg64 } -+invept, 0xf3f0, EPT&APX_F, Modrm|NoSuf|EVexMap4|VexWIG, { Oword|Unspecified|BaseIndex, Reg64 } -+invvpid, 0x660f3881, EPT&No64, Modrm|IgnoreSize|NoSuf, { Oword|Unspecified|BaseIndex, Reg32 } -+invvpid, 0x660f3881, EPT&x64, Modrm|NoSuf|NoRex64, { Oword|Unspecified|BaseIndex, Reg64 } -+invvpid, 0xf3f1, EPT&APX_F, Modrm|NoSuf|EVexMap4|VexWIG, { Oword|Unspecified|BaseIndex, Reg64 } - - // INVPCID instruction - --invpcid, 0x660f3882, INVPCID|No64, Modrm|IgnoreSize|NoSuf, { Oword|Unspecified|BaseIndex, Reg32 } --invpcid, 0x660f3882, INVPCID|x64, Modrm|NoSuf|NoRex64, { Oword|Unspecified|BaseIndex, Reg64 } -+invpcid, 0x660f3882, INVPCID&No64, Modrm|IgnoreSize|NoSuf, { Oword|Unspecified|BaseIndex, Reg32 } -+invpcid, 0x660f3882, INVPCID&x64, Modrm|NoSuf|NoRex64, { Oword|Unspecified|BaseIndex, Reg64 } -+invpcid, 0xf3f2, INVPCID&APX_F, Modrm|NoSuf|EVexMap4|VexWIG, { Oword|Unspecified|BaseIndex, Reg64 } - - // SSSE3 instructions. - -@@ -1355,10 +1379,10 @@ blendvp, 0x664a | , AVX, Modrm|Vex128|Space0F3A|VexVVVV|VexW0|NoSuf| - blendvp, 0x660f3814 | , SSE4_1, Modrm|NoSuf, { Acc|Xmmword, RegXMM|Unspecified|BaseIndex, RegXMM } - blendvp, 0x660f3814 | , SSE4_1, Modrm|NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM } - dpp, 0x660f3a40 | , , Modrm|||NoSuf, { Imm8|Imm8S, RegXMM|Unspecified|BaseIndex, RegXMM } --extractps, 0x6617, AVX, Modrm|Vex|Space0F3A|VexWIG|NoSuf|SSE2AVX, { Imm8, RegXMM, Reg32|Dword|Unspecified|BaseIndex } --extractps, 0x6617, AVX|x64, RegMem|Vex|Space0F3A|VexWIG|NoSuf|SSE2AVX, { Imm8, RegXMM, Reg64 } --extractps, 0x660f3a17, SSE4_1, Modrm|IgnoreSize|NoSuf, { Imm8, RegXMM, Reg32|Dword|Unspecified|BaseIndex } --extractps, 0x660f3a17, SSE4_1|x64, RegMem|NoSuf|NoRex64, { Imm8, RegXMM, Reg64 } -+extractps, 0x6617, AVX, Modrm|Vex128|Space0F3A|VexW0|NoSuf|SSE2AVX, { Imm8, RegXMM, Reg32|Unspecified|BaseIndex } -+extractps, 0x6617, AVX&x64, RegMem|Vex128|Space0F3A|VexW1|NoSuf|SSE2AVX, { Imm8, RegXMM, Reg64 } -+extractps, 0x660f3a17, SSE4_1, Modrm|IgnoreSize|NoSuf, { Imm8, RegXMM, Reg32|Unspecified|BaseIndex } -+extractps, 0x660f3a17, SSE4_1&x64, RegMem|NoSuf|NoRex64, { Imm8, RegXMM, Reg64 } - insertps, 0x660f3a21, , Modrm|||NoSuf, { Imm8, Dword|Unspecified|BaseIndex|RegXMM, RegXMM } - movntdqa, 0x660f382a, , Modrm||NoSuf, { Xmmword|Unspecified|BaseIndex, RegXMM } - mpsadbw, 0x660f3a42, , Modrm|||NoSuf, { Imm8|Imm8S, RegXMM|Unspecified|BaseIndex, RegXMM } -@@ -1372,14 +1396,14 @@ pcmpeqq, 0x660f3829, , Modrm|||NoSuf|O - pextr, 0x660f3a14 | , , RegMem||NoSuf|IgnoreSize|NoRex64, { Imm8, RegXMM, Reg32|Reg64 } - pextr, 0x660f3a14 | , , Modrm||NoSuf, { Imm8, RegXMM, |Unspecified|BaseIndex } - pextrd, 0x660f3a16, , Modrm||NoSuf|IgnoreSize, { Imm8, RegXMM, Reg32|Unspecified|BaseIndex } --pextrq, 0x6616, AVX|x64, Modrm|Vex|Space0F3A|VexW1|NoSuf|SSE2AVX, { Imm8, RegXMM, Reg64|Unspecified|BaseIndex } --pextrq, 0x660f3a16, SSE4_1|x64, Modrm|Size64|NoSuf, { Imm8, RegXMM, Reg64|Unspecified|BaseIndex } -+pextrq, 0x6616, AVX&x64, Modrm|Vex|Space0F3A|VexW1|NoSuf|SSE2AVX, { Imm8, RegXMM, Reg64|Unspecified|BaseIndex } -+pextrq, 0x660f3a16, SSE4_1&x64, Modrm|Size64|NoSuf, { Imm8, RegXMM, Reg64|Unspecified|BaseIndex } - phminposuw, 0x660f3841, , Modrm||NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM } - pinsrb, 0x660f3a20, , Modrm|||NoSuf|IgnoreSize|NoRex64, { Imm8, Reg32|Reg64, RegXMM } - pinsrb, 0x660f3a20, , Modrm|||NoSuf, { Imm8, Byte|Unspecified|BaseIndex, RegXMM } - pinsrd, 0x660f3a22, , Modrm|||NoSuf|IgnoreSize, { Imm8, Reg32|Unspecified|BaseIndex, RegXMM } --pinsrq, 0x6622, AVX|x64, Modrm|Vex|Space0F3A|VexVVVV|VexW1|NoSuf|SSE2AVX, { Imm8, Reg64|Unspecified|BaseIndex, RegXMM } --pinsrq, 0x660f3a22, SSE4_1|x64, Modrm|Size64|NoSuf, { Imm8, Reg64|Unspecified|BaseIndex, RegXMM } -+pinsrq, 0x6622, AVX&x64, Modrm|Vex|Space0F3A|VexVVVV|VexW1|NoSuf|SSE2AVX, { Imm8, Reg64|Unspecified|BaseIndex, RegXMM } -+pinsrq, 0x660f3a22, SSE4_1&x64, Modrm|Size64|NoSuf, { Imm8, Reg64|Unspecified|BaseIndex, RegXMM } - pmaxsb, 0x660f383c, , Modrm|||NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM } - pmaxsd, 0x660f383d, , Modrm|||NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM } - pmaxud, 0x660f383f, , Modrm|||NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM } -@@ -1411,33 +1435,36 @@ rounds, 0x660f3a0a | , , Modrm|| - - pcmpgtq, 0x660f3837, , Modrm|||NoSuf|Optimize, { RegXMM|Unspecified|BaseIndex, RegXMM } --pcmpestri, 0x660f3a61, |No64, Modrm||NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } --pcmpestri, 0x6661, AVX|x64, Modrm|Vex|Space0F3A|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|SSE2AVX, { Imm8, Xmmword|Unspecified|BaseIndex|RegXMM, RegXMM } --pcmpestri, 0x660f3a61, SSE4_2|x64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Imm8, Xmmword|Unspecified|BaseIndex|RegXMM, RegXMM } --pcmpestrm, 0x660f3a60, |No64, Modrm||NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } --pcmpestrm, 0x6660, AVX|x64, Modrm|Vex|Space0F3A|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|SSE2AVX, { Imm8, Xmmword|Unspecified|BaseIndex|RegXMM, RegXMM } --pcmpestrm, 0x660f3a60, SSE4_2|x64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Imm8, Xmmword|Unspecified|BaseIndex|RegXMM, RegXMM } -+pcmpestri, 0x660f3a61, &No64, Modrm||NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } -+pcmpestri, 0x6661, AVX&x64, Modrm|Vex|Space0F3A|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|SSE2AVX, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } -+pcmpestri, 0x660f3a61, SSE4_2&x64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } -+pcmpestrm, 0x660f3a60, &No64, Modrm||NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } -+pcmpestrm, 0x6660, AVX&x64, Modrm|Vex|Space0F3A|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|SSE2AVX, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } -+pcmpestrm, 0x660f3a60, SSE4_2&x64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } - pcmpistri, 0x660f3a63, , Modrm||NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } - pcmpistrm, 0x660f3a62, , Modrm||NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } - crc32, 0xf20f38f0, SSE4_2, W|Modrm|No_sSuf|No_qSuf, { Reg8|Reg16|Reg32|Unspecified|BaseIndex, Reg32 } --crc32, 0xf20f38f0, SSE4_2|x64, W|Modrm|No_wSuf|No_lSuf|No_sSuf, { Reg8|Reg64|Unspecified|BaseIndex, Reg64 } -+crc32, 0xf20f38f0, SSE4_2&x64, W|Modrm|No_wSuf|No_lSuf|No_sSuf, { Reg8|Reg64|Unspecified|BaseIndex, Reg64 } -+crc32, 0xf0, APX_F, W|Modrm|No_sSuf|No_qSuf|EVexMap4, { Reg8|Reg16|Reg32|Unspecified|BaseIndex, Reg32 } -+crc32, 0xf0, APX_F, W|Modrm|No_wSuf|No_lSuf|No_sSuf|EVexMap4, { Reg8|Reg64|Unspecified|BaseIndex, Reg64 } - - // xsave/xrstor New Instructions. - --xsave, 0xfae/4, Xsave, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Unspecified|BaseIndex } --xsave64, 0xfae/4, Xsave|x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } --xrstor, 0xfae/5, Xsave, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Unspecified|BaseIndex } --xrstor64, 0xfae/5, Xsave|x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } -+xsave, 0xfae/4, Xsave, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoEgpr, { Unspecified|BaseIndex } -+xsave64, 0xfae/4, Xsave&x64, Modrm|NoSuf|Size64|NoEgpr, { Unspecified|BaseIndex } -+xrstor, 0xfae/5, Xsave, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoEgpr, { Unspecified|BaseIndex } -+xrstor64, 0xfae/5, Xsave&x64, Modrm|NoSuf|Size64|NoEgpr, { Unspecified|BaseIndex } - xgetbv, 0xf01d0, Xsave, NoSuf, {} - xsetbv, 0xf01d1, Xsave, NoSuf, {} - - // xsaveopt --xsaveopt, 0xfae/6, Xsaveopt, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Unspecified|BaseIndex } --xsaveopt64, 0xfae/6, Xsaveopt|x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } -+ -+xsaveopt, 0xfae/6, Xsaveopt, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|NoEgpr, { Unspecified|BaseIndex } -+xsaveopt64, 0xfae/6, Xsaveopt&x64, Modrm|NoSuf|Size64|NoEgpr, { Unspecified|BaseIndex } - - // AES instructions. - -- -+ - - aesdec, 0x660f38de, AES, Modrm|||NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM } - aesdeclast, 0x660f38df, AES, Modrm|||NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM } -@@ -1448,7 +1475,7 @@ aeskeygenassist, 0x660f3adf, AES, Modrm||NoSuf, { Imm8, - - // PCLMULQDQ - -- -+ - - pclmulqdq, 0x660f3a44, PCLMULQDQ, Modrm||NoSuf, { Imm8|Imm8S, RegXMM|Unspecified|BaseIndex, RegXMM } - pclmullqlqdq, 0x660f3a44/0x00, PCLMULQDQ, Modrm||NoSuf|ImmExt, { RegXMM|Unspecified|BaseIndex, RegXMM } -@@ -1458,7 +1485,7 @@ pclmulhqhqdq, 0x660f3a44/0x11, PCLMULQDQ, Modrm| -+ - - gf2p8affineqb, 0x660f3ace, GFNI, Modrm||NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } - gf2p8affineinvqb, 0x660f3acf, GFNI, Modrm||NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } -@@ -1477,6 +1504,9 @@ gf2p8mulb, 0x660f38cf, GFNI, Modrm||NoSuf, { RegXMM|Uns - true_us:1f:C> - - // is used for VEX instructions with x/y suffixes. -+// NOTE: The order of the "unnamed" ($-prefixed) entries here needs to remain -+// in sync with , for match_template()'s EVEX-to-VEX lowering to -+// continue to work. - , 0x55, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSiz - vandp, 0x54, AVX, Modrm|C|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } - vblendp, 0x660c | , AVX, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } - vblendvp, 0x664a | , AVX, Modrm|Vex|Space0F3A|VexVVVV|VexW0|CheckOperandSize|NoSuf, { RegXMM|RegYMM, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } --vbroadcastf128, 0x661a, AVX, Modrm|Vex=2|Space0F38|VexW=1|NoSuf, { Xmmword|Unspecified|BaseIndex, RegYMM } -+vbroadcastf128, 0x661a, AVX, Modrm|Vex256|Space0F38|VexW0|NoSuf, { Xmmword|Unspecified|BaseIndex, RegYMM } -+// vbroadcastf32x4 in disguise (see vround{p,s}{s,d} comment) -+vbroadcastf128, 0x661a, APX_F&AVX512VL, Modrm|EVex256|Space0F38|VexW0|Disp8MemShift=4|NoSuf, { Xmmword|Unspecified|BaseIndex, RegYMM } - vbroadcastsd, 0x6619, AVX, Modrm|Vex256|Space0F38|VexW0|NoSuf, { Qword|Unspecified|BaseIndex, RegYMM } - vbroadcastss, 0x6618, AVX, Modrm|Vex128|Space0F38|VexW0|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM|RegYMM } - vcmpp, 0xc2/0x, AVX, Modrm||Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|Unspecified|BaseIndex, RegXMM|RegYMM, RegXMM|RegYMM } -@@ -1519,14 +1551,18 @@ vdivp, 0x5e, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize - vdivs, 0x5e, AVX, Modrm|VexLIG|Space0F|VexVVVV|VexWIG|NoSuf, { |Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } - vdppd, 0x6641, AVX, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } - vdpps, 0x6640, AVX, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } --vextractf128, 0x6619, AVX, Modrm|Vex=2|Space0F3A|VexW=1|NoSuf, { Imm8, RegYMM, Unspecified|BaseIndex|RegXMM } --vextractps, 0x6617, AVX|AVX512F, Modrm|Vex128|EVex128|Space0F3A|VexWIG|Disp8MemShift=2|NoSuf, { Imm8, RegXMM, Reg32|Dword|Unspecified|BaseIndex } --vextractps, 0x6617, AVX|AVX512F|x64, RegMem|Vex128|EVex128|Space0F3A|VexWIG|NoSuf, { Imm8, RegXMM, Reg64 } -+vextractf128, 0x6619, AVX, Modrm|Vex256|Space0F3A|VexW0|NoSuf, { Imm8, RegYMM, Unspecified|BaseIndex|RegXMM } -+// vextractf32x4 in disguise (see vround{p,s}{s,d} comment) -+vextractf128, 0x6619, APX_F&AVX512VL, Modrm|EVex256|Space0F3A|VexW0|Disp8MemShift=4|NoSuf, { Imm8, RegYMM, Xmmword|Unspecified|BaseIndex } -+vextractps, 0x6617, AVX|AVX512F, Modrm|Vex128|EVex128|Space0F3A|VexWIG|Disp8MemShift=2|NoSuf, { Imm8, RegXMM, Reg32|Unspecified|BaseIndex } -+vextractps, 0x6617, x64&(AVX|AVX512F), RegMem|Vex128|EVex128|Space0F3A|VexWIG|NoSuf, { Imm8, RegXMM, Reg64 } - vhaddpd, 0x667c, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } - vhaddps, 0xf27c, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } - vhsubpd, 0x667d, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } - vhsubps, 0xf27d, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } - vinsertf128, 0x6618, AVX, Modrm|Vex256|Space0F3A|VexVVVV|VexW0|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegYMM, RegYMM } -+// vinsertf32x4 in disguise (see vround{p,s}{s,d} comment) -+vinsertf128, 0x6618, APX_F&AVX512VL, Modrm|EVex256|Space0F3A|VexVVVV|VexW0|Disp8MemShift=4|NoSuf, { Imm8, Xmmword|Unspecified|BaseIndex, RegYMM, RegYMM } - vinsertps, 0x6621, AVX, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8, Dword|Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } - vlddqu, 0xf2f0, AVX, Modrm|Vex|Space0F|VexWIG|CheckOperandSize|NoSuf, { Xmmword|Ymmword|Unspecified|BaseIndex, RegXMM|RegYMM } - vldmxcsr, 0xae/2, AVX, Modrm|Vex128|Space0F|VexWIG|NoSuf, { Dword|Unspecified|BaseIndex } -@@ -1544,7 +1580,7 @@ vmovap, 0x28, AVX, D|Modrm|Vex|Space0F|VexWIG|CheckOperandSize|NoSu - // support assembler for AMD64, we accept 64bit operand on vmovd so - // that we can use one template for both SSE and AVX instructions. - vmovd, 0x666e, AVX|AVX512F, D|Modrm|Vex128|EVex128|Space0F|Disp8MemShift=2|NoSuf, { Reg32|Unspecified|BaseIndex, RegXMM } --vmovd, 0x667e, AVX|x64, D|RegMem|Vex=1|Space0F|VexW=2|NoSuf|Size64, { RegXMM, Reg64 } -+vmovd, 0x667e, AVX&x64, D|RegMem|Vex=1|Space0F|VexW=2|NoSuf|Size64, { RegXMM, Reg64 } - vmovddup, 0xf212, AVX, Modrm|Vex|Space0F|VexWIG|NoSuf, { Qword|Unspecified|BaseIndex|RegXMM, RegXMM } - vmovddup, 0xf212, AVX, Modrm|Vex=2|Space0F|VexWIG|NoSuf, { Unspecified|BaseIndex|RegYMM, RegYMM } - vmovdqa, 0x666f, AVX, D|Modrm|Vex|Space0F|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM } -@@ -1561,7 +1597,7 @@ vmovntdqa, 0x662a, AVX|AVX2, Modrm|Vex|Space0F38|VexWIG|CheckOperandSize|NoSuf, - vmovntp, 0x2b, AVX, Modrm|Vex|Space0F|VexWIG|CheckOperandSize|NoSuf, { RegXMM|RegYMM, Xmmword|Ymmword|Unspecified|BaseIndex } - vmovq, 0xf37e, AVX, Load|Modrm|Vex=1|Space0F|VexWIG|NoSuf, { Qword|Unspecified|BaseIndex|RegXMM, RegXMM } - vmovq, 0x66d6, AVX, Modrm|Vex=1|Space0F|VexWIG|NoSuf, { RegXMM, Qword|Unspecified|BaseIndex|RegXMM } --vmovq, 0x666e, AVX|AVX512F|x64, D|Modrm|Vex128|EVex128|Space0F|VexW1|Disp8MemShift=3|NoSuf, { Reg64|Unspecified|BaseIndex, RegXMM } -+vmovq, 0x666e, x64&(AVX|AVX512F), D|Modrm|Vex128|EVex128|Space0F|VexW1|Disp8MemShift=3|NoSuf, { Reg64|Unspecified|BaseIndex, RegXMM } - vmovs, 0x10, AVX, D|Modrm|VexLIG|Space0F|VexWIG|NoSuf, { |Unspecified|BaseIndex, RegXMM } - vmovs, 0x10, AVX, D|Modrm|VexLIG|Space0F|VexVVVV|VexWIG|NoSuf, { RegXMM, RegXMM, RegXMM } - vmovshdup, 0xf316, AVX, Modrm|Vex|Space0F|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM } -@@ -1591,10 +1627,10 @@ vpblendw, 0x660e, AVX|AVX2, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|CheckOperandSize| - vpcmpeq, 0x6674 | , AVX|AVX2, Modrm|C|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } - vpcmpeqd, 0x6676, AVX|AVX2, Modrm|C|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } - vpcmpeqq, 0x6629, AVX|AVX2, Modrm|Vex|Space0F38|VexVVVV|VexWIG|CheckOperandSize|NoSuf|Optimize, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } --vpcmpestri, 0x6661, AVX|No64, Modrm|Vex|Space0F3A|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegXMM } --vpcmpestri, 0x6661, AVX|x64, Modrm|Vex|Space0F3A|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Imm8, Xmmword|Unspecified|BaseIndex|RegXMM, RegXMM } --vpcmpestrm, 0x6660, AVX|No64, Modrm|Vex|Space0F3A|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegXMM } --vpcmpestrm, 0x6660, AVX|x64, Modrm|Vex|Space0F3A|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Imm8, Xmmword|Unspecified|BaseIndex|RegXMM, RegXMM } -+vpcmpestri, 0x6661, AVX&No64, Modrm|Vex|Space0F3A|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegXMM } -+vpcmpestri, 0x6661, AVX&x64, Modrm|Vex|Space0F3A|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegXMM } -+vpcmpestrm, 0x6660, AVX&No64, Modrm|Vex|Space0F3A|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegXMM } -+vpcmpestrm, 0x6660, AVX&x64, Modrm|Vex|Space0F3A|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegXMM } - vpcmpgt, 0x6664 | , AVX|AVX2, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf|Optimize, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } - vpcmpgtd, 0x6666, AVX|AVX2, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf|Optimize, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } - vpcmpgtq, 0x6637, AVX|AVX2, Modrm|Vex|Space0F38|VexVVVV|VexWIG|CheckOperandSize|NoSuf|Optimize, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } -@@ -1605,7 +1641,7 @@ vpermilps, 0x660c, AVX|AVX512F, Modrm|Vex|EVexDYN|Masking|Space0F38|VexVVVV|VexW - vpermilps, 0x6604, AVX|AVX512F, Modrm|Vex|EVexDYN|Masking|Space0F3A|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8|Imm8S, RegXMM|RegYMM|RegZMM|Dword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } - vpermilpd, 0x660d, AVX, Modrm|Vex|Space0F38|VexVVVV|VexW0|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } - vpermilpd, 0x6605, AVX, Modrm|Vex|Space0F3A|VexW0|CheckOperandSize|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM } --vpextr, 0x6616, AVX|, Modrm|Vex|Space0F3A||NoSuf, { Imm8, RegXMM, |Unspecified|BaseIndex } -+vpextr, 0x6616, AVX&, Modrm|Vex|Space0F3A||NoSuf, { Imm8, RegXMM, |Unspecified|BaseIndex } - vpextrw, 0x66c5, AVX, Load|Modrm|Vex|Space0F|VexWIG|No_bSuf|No_wSuf|No_sSuf, { Imm8, RegXMM, Reg32|Reg64 } - vpextr, 0x6614 | , AVX, RegMem|Vex|Space0F3A|VexWIG|NoSuf, { Imm8, RegXMM, Reg32|Reg64 } - vpextr, 0x6614 | , AVX, Modrm|Vex|Space0F3A|VexWIG|NoSuf, { Imm8, RegXMM, |Unspecified|BaseIndex } -@@ -1618,7 +1654,7 @@ vphsubsw, 0x6607, AVX|AVX2, Modrm|Vex|Space0F38|VexVVVV|VexWIG|CheckOperandSize| - vphsubw, 0x6605, AVX|AVX2, Modrm|Vex|Space0F38|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } - vpinsrb, 0x6620, AVX, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8, Reg32|Reg64, RegXMM, RegXMM } - vpinsrb, 0x6620, AVX, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8, Byte|Unspecified|BaseIndex, RegXMM, RegXMM } --vpinsr, 0x6622, AVX|, Modrm|Vex|Space0F3A|VexVVVV||NoSuf, { Imm8, |Unspecified|BaseIndex, RegXMM, RegXMM } -+vpinsr, 0x6622, AVX&, Modrm|Vex|Space0F3A|VexVVVV||NoSuf, { Imm8, |Unspecified|BaseIndex, RegXMM, RegXMM } - vpinsrw, 0x66c4, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|No_bSuf|No_wSuf|No_sSuf, { Imm8, Reg32|Reg64, RegXMM, RegXMM } - vpinsrw, 0x66c4, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|NoSuf, { Imm8, Word|Unspecified|BaseIndex, RegXMM, RegXMM } - vpmaddubsw, 0x6604, AVX|AVX2, Modrm|Vex|Space0F38|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } -@@ -1636,18 +1672,18 @@ vpminub, 0x66da, AVX|AVX2, Modrm|C|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|N - vpminud, 0x663b, AVX|AVX2, Modrm|Vex|Space0F38|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } - vpminuw, 0x663a, AVX|AVX2, Modrm|Vex|Space0F38|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } - vpmovmskb, 0x66d7, AVX|AVX2, Modrm|Vex|Space0F|VexWIG|No_bSuf|No_wSuf|No_sSuf, { RegXMM|RegYMM, Reg32|Reg64 } --vpmovsxbd, 0x6621, AVX|AVX512F|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM } --vpmovsxbq, 0x6622, AVX|AVX512F|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=1|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegXMM } -+vpmovsxbd, 0x6621, AVX|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM } -+vpmovsxbq, 0x6622, AVX|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=1|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegXMM } - vpmovsxbw, 0x6620, AVX, Modrm|Vex|Space0F38|VexWIG|NoSuf, { Qword|Unspecified|BaseIndex|RegXMM, RegXMM } - vpmovsxdq, 0x6625, AVX, Modrm|Vex|Space0F38|VexWIG|NoSuf, { Qword|Unspecified|BaseIndex|RegXMM, RegXMM } --vpmovsxwd, 0x6623, AVX|AVX512F|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } --vpmovsxwq, 0x6624, AVX|AVX512F|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM } --vpmovzxbd, 0x6631, AVX|AVX512F|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM } --vpmovzxbq, 0x6632, AVX|AVX512F|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=1|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegXMM } -+vpmovsxwd, 0x6623, AVX|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } -+vpmovsxwq, 0x6624, AVX|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM } -+vpmovzxbd, 0x6631, AVX|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM } -+vpmovzxbq, 0x6632, AVX|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=1|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegXMM } - vpmovzxbw, 0x6630, AVX, Modrm|Vex|Space0F38|VexWIG|NoSuf, { Qword|Unspecified|BaseIndex|RegXMM, RegXMM } - vpmovzxdq, 0x6635, AVX, Modrm|Vex|Space0F38|VexWIG|NoSuf, { Qword|Unspecified|BaseIndex|RegXMM, RegXMM } --vpmovzxwd, 0x6633, AVX|AVX512F|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } --vpmovzxwq, 0x6634, AVX|AVX512F|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM } -+vpmovzxwd, 0x6633, AVX|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } -+vpmovzxwq, 0x6634, AVX|AVX512VL, Modrm|Vex128|EVex128|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM } - vpmuldq, 0x6628, AVX|AVX2, Modrm|Vex|Space0F38|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } - vpmulhrsw, 0x660b, AVX|AVX2, Modrm|Vex|Space0F38|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } - vpmulhuw, 0x66e4, AVX|AVX2, Modrm|C|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } -@@ -1695,6 +1731,10 @@ vrcpps, 0x53, AVX, Modrm|Vex|Space0F|VexWIG|CheckOperandSize|NoSuf, { Unspecifie - vrcpss, 0xf353, AVX, Modrm|Vex=3|Space0F|VexVVVV|VexWIG|NoSuf, { Dword|Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } - vroundp, 0x6608 | , AVX, Modrm|Vex|Space0F3A|VexWIG|CheckOperandSize|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM } - vrounds, 0x660a | , AVX, Modrm|VexLIG|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8, |Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } -+// These are really clones of VRNDSCALE{P,S}{S,D}, with broadcast, masking, SAE, -+// 512-bit operand size, and register sources dropped. -+vroundp, 0x6608 | , APX_F&AVX512VL, Modrm|Space0F3A||Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8, Xmmword|Ymmword|Unspecified|BaseIndex, RegXMM|RegYMM } -+vrounds, 0x660a | , APX_F&AVX512F, Modrm|EVexLIG|Space0F3A|VexVVVV||Disp8MemShift|NoSuf, { Imm8, |Unspecified|BaseIndex, RegXMM, RegXMM } - vrsqrtps, 0x52, AVX, Modrm|Vex|Space0F|VexWIG|CheckOperandSize|NoSuf, { Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM } - vrsqrtss, 0xf352, AVX, Modrm|Vex=3|Space0F|VexVVVV|VexWIG|NoSuf, { Dword|Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } - vshufp, 0xc6, AVX, Modrm|Vex|Space0F|VexVVVV|VexWIG|CheckOperandSize|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } -@@ -1714,22 +1754,24 @@ vzeroupper, 0x77, AVX, Vex|Space0F|VexWIG|NoSuf, {} - - // 256bit integer AVX2 instructions. - --vpmovsxbd, 0x6621, AVX2|AVX512F|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegYMM } --vpmovsxbq, 0x6622, AVX2|AVX512F|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } -+vpmovsxbd, 0x6621, AVX2|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegYMM } -+vpmovsxbq, 0x6622, AVX2|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } - vpmovsxbw, 0x6620, AVX2, Modrm|Vex=2|Space0F38|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegYMM } - vpmovsxdq, 0x6625, AVX2, Modrm|Vex=2|Space0F38|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegYMM } --vpmovsxwd, 0x6623, AVX2|AVX512F|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } --vpmovsxwq, 0x6624, AVX2|AVX512F|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegYMM } --vpmovzxbd, 0x6631, AVX2|AVX512F|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegYMM } --vpmovzxbq, 0x6632, AVX2|AVX512F|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } -+vpmovsxwd, 0x6623, AVX2|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } -+vpmovsxwq, 0x6624, AVX2|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegYMM } -+vpmovzxbd, 0x6631, AVX2|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegYMM } -+vpmovzxbq, 0x6632, AVX2|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } - vpmovzxbw, 0x6630, AVX2, Modrm|Vex=2|Space0F38|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegYMM } - vpmovzxdq, 0x6635, AVX2, Modrm|Vex=2|Space0F38|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegYMM } --vpmovzxwd, 0x6633, AVX2|AVX512F|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } --vpmovzxwq, 0x6634, AVX2|AVX512F|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegYMM } -+vpmovzxwd, 0x6633, AVX2|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } -+vpmovzxwq, 0x6634, AVX2|AVX512VL, Modrm|Vex256|EVex256|Masking|Space0F38|VexWIG|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegYMM } - - // New AVX2 instructions. - --vbroadcasti128, 0x665A, AVX2, Modrm|Vex=2|Space0F38|VexW=1|NoSuf, { Xmmword|Unspecified|BaseIndex, RegYMM } -+vbroadcasti128, 0x665A, AVX2, Modrm|Vex256|Space0F38|VexW0|NoSuf, { Xmmword|Unspecified|BaseIndex, RegYMM } -+// vbroadcasti32x4 in disguise (see vround{p,s}{s,d} comment) -+vbroadcasti128, 0x665a, APX_F&AVX512VL, Modrm|EVex256|Space0F38|VexW0|Disp8MemShift=4|NoSuf, { Xmmword|Unspecified|BaseIndex, RegYMM } - vbroadcastsd, 0x6619, AVX2, Modrm|Vex=2|Space0F38|VexW=1|NoSuf, { RegXMM, RegYMM } - vbroadcastss, 0x6618, AVX2|AVX512F, Modrm|Vex|EVexDYN|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } - vpblendd, 0x6602, AVX2, Modrm|Vex|Space0F3A|VexVVVV|VexW0|CheckOperandSize|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } -@@ -1741,8 +1783,12 @@ vpermd, 0x6636, AVX2|AVX512F, Modrm|Vex256|EVexDYN|Masking|Space0F38|VexVVVV|Vex - vpermpd, 0x6601, AVX2|AVX512F, Modrm|Vex256|EVexDYN|Masking|Space0F3A|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8|Imm8S, RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegYMM|RegZMM } - vpermps, 0x6616, AVX2|AVX512F, Modrm|Vex256|EVexDYN|Masking|Space0F38|VexVVVV|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegYMM|RegZMM|Dword|Unspecified|BaseIndex, RegYMM|RegZMM, RegYMM|RegZMM } - vpermq, 0x6600, AVX2|AVX512F, Modrm|Vex256|EVexDYN|Masking|Space0F3A|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8|Imm8S, RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegYMM|RegZMM } --vextracti128, 0x6639, AVX2, Modrm|Vex=2|Space0F3A|VexW=1|NoSuf, { Imm8, RegYMM, Unspecified|BaseIndex|RegXMM } -+vextracti128, 0x6639, AVX2, Modrm|Vex256|Space0F3A|VexW0|NoSuf, { Imm8, RegYMM, Unspecified|BaseIndex|RegXMM } -+// vextracti32x4 in disguise (see vround{p,s}{s,d} comment) -+vextracti128, 0x6639, APX_F&AVX512VL, Modrm|EVex256|Space0F3A|VexW0|Disp8MemShift=4|NoSuf, { Imm8, RegYMM, Xmmword|Unspecified|BaseIndex } - vinserti128, 0x6638, AVX2, Modrm|Vex256|Space0F3A|VexVVVV|VexW0|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegYMM, RegYMM } -+// vinserti32x4 in disguise (see vround{p,s}{s,d} comment) -+vinserti128, 0x6638, APX_F&AVX512VL, Modrm|EVex256|Space0F3A|VexVVVV|VexW0|Disp8MemShift=4|NoSuf, { Imm8, Xmmword|Unspecified|BaseIndex, RegYMM, RegYMM } - vpmaskmov, 0x668e, AVX2, Modrm|Vex|Space0F38|VexVVVV||CheckOperandSize|NoSuf, { RegXMM|RegYMM, RegXMM|RegYMM, Xmmword|Ymmword|Unspecified|BaseIndex } - vpmaskmov, 0x668c, AVX2, Modrm|Vex|Space0F38|VexVVVV||CheckOperandSize|NoSuf, { Xmmword|Ymmword|Unspecified|BaseIndex, RegXMM|RegYMM, RegXMM|RegYMM } - vpsllv, 0x6647, AVX2|AVX512F, Modrm|Vex|EVexDYN|Masking|Space0F38|VexVVVV||Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM||Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } -@@ -1765,26 +1811,26 @@ vpgatherqq, 0x6691, AVX2, Modrm|Vex256|Space0F38|VexVVVV|VexW1|SwapSources|NoSuf - - // AES + AVX - --vaesdec, 0x66de, AVX|AES, Modrm|Vex|Space0F38|VexVVVV|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } --vaesdeclast, 0x66df, AVX|AES, Modrm|Vex|Space0F38|VexVVVV|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } --vaesenc, 0x66dc, AVX|AES, Modrm|Vex|Space0F38|VexVVVV|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } --vaesenclast, 0x66dd, AVX|AES, Modrm|Vex|Space0F38|VexVVVV|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } --vaesimc, 0x66db, AVX|AES, Modrm|Vex|Space0F38|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM } --vaeskeygenassist, 0x66df, AVX|AES, Modrm|Vex|Space0F3A|VexWIG|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegXMM } -+vaesdec, 0x66de, AVX&AES, Modrm|Vex|Space0F38|VexVVVV|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } -+vaesdeclast, 0x66df, AVX&AES, Modrm|Vex|Space0F38|VexVVVV|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } -+vaesenc, 0x66dc, AVX&AES, Modrm|Vex|Space0F38|VexVVVV|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } -+vaesenclast, 0x66dd, AVX&AES, Modrm|Vex|Space0F38|VexVVVV|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } -+vaesimc, 0x66db, AVX&AES, Modrm|Vex|Space0F38|VexWIG|NoSuf, { Unspecified|BaseIndex|RegXMM, RegXMM } -+vaeskeygenassist, 0x66df, AVX&AES, Modrm|Vex|Space0F3A|VexWIG|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM, RegXMM } - - // PCLMULQDQ + AVX - --vpclmulqdq, 0x6644, AVX|PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } --vpclmullqlqdq, 0x6644/0x00, AVX|PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } --vpclmulhqlqdq, 0x6644/0x01, AVX|PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } --vpclmullqhqdq, 0x6644/0x10, AVX|PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } --vpclmulhqhqdq, 0x6644/0x11, AVX|PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } -+vpclmulqdq, 0x6644, AVX&PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf, { Imm8|Imm8S, Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } -+vpclmullqlqdq, 0x6644/0x00, AVX&PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } -+vpclmulhqlqdq, 0x6644/0x01, AVX&PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } -+vpclmullqhqdq, 0x6644/0x10, AVX&PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } -+vpclmulhqhqdq, 0x6644/0x11, AVX&PCLMULQDQ, Modrm|Vex|Space0F3A|VexVVVV|VexWIG|NoSuf|ImmExt, { Unspecified|BaseIndex|RegXMM, RegXMM, RegXMM } - - // GFNI + AVX - --vgf2p8affineinvqb, 0x66cf, AVX|GFNI, Modrm|Vex|Space0F3A|VexVVVV|VexW1|CheckOperandSize|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } --vgf2p8affineqb, 0x66ce, AVX|GFNI, Modrm|Vex|Space0F3A|VexVVVV|VexW1|CheckOperandSize|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } --vgf2p8mulb, 0x66cf, GFNI|AVX|AVX512F, Modrm|Vex|EVexDYN|Masking|Space0F38|VexVVVV|VexW0|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } -+vgf2p8affineinvqb, 0x66cf, AVX&GFNI, Modrm|Vex|Space0F3A|VexVVVV|VexW1|CheckOperandSize|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } -+vgf2p8affineqb, 0x66ce, AVX&GFNI, Modrm|Vex|Space0F3A|VexVVVV|VexW1|CheckOperandSize|NoSuf, { Imm8, Unspecified|BaseIndex|RegXMM|RegYMM, RegXMM|RegYMM, RegXMM|RegYMM } -+vgf2p8mulb, 0x66cf, GFNI&(AVX|AVX512F), Modrm|Vex|EVexDYN|Masking|Space0F38|VexVVVV|VexW0|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } - - // FSGSBASE, RDRND and F16C - -@@ -1803,8 +1849,8 @@ vcvtps2ph, 0x661d, F16C, Modrm|Vex=2|Space0F3A|VexW=1|NoSuf, { Imm8, RegYMM, Uns - - - - - vfmaddp, 0x6688 | 0x, , Modrm||Masking||VexVVVV||Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|StaticRounding|SAE, { RegXMM|RegYMM|RegZMM||Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } -@@ -1831,14 +1877,14 @@ xtest, 0xf01d6, HLE|RTM, NoSuf, {} - - // BMI2 instructions. - --bzhi, 0xf5, BMI2, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } --mulx, 0xf2f6, BMI2, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 } --pdep, 0xf2f5, BMI2, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 } --pext, 0xf3f5, BMI2, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 } --rorx, 0xf2f0, BMI2, Modrm|CheckOperandSize|Vex128|Space0F3A|No_bSuf|No_wSuf|No_sSuf, { Imm8|Imm8S, Reg32|Reg64|Dword|Qword|Unspecified|BaseIndex, Reg32|Reg64 } --sarx, 0xf3f7, BMI2, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } --shlx, 0x66f7, BMI2, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } --shrx, 0xf2f7, BMI2, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } -+bzhi, 0xf5, APX_F(BMI2), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf|NF, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } -+mulx, 0xf2f6, APX_F(BMI2), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 } -+pdep, 0xf2f5, APX_F(BMI2), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 } -+pext, 0xf3f5, APX_F(BMI2), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 } -+rorx, 0xf2f0, APX_F(BMI2), Modrm|CheckOperandSize|Vex128|EVex128|Space0F3A|No_bSuf|No_wSuf|No_sSuf, { Imm8|Imm8S, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } -+sarx, 0xf3f7, APX_F(BMI2), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } -+shlx, 0x66f7, APX_F(BMI2), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } -+shrx, 0xf2f7, APX_F(BMI2), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } - - // FMA4 instructions - -@@ -1908,12 +1954,13 @@ lwpins, 0x12/0, LWP, Modrm|SpaceXOP0A|NoSuf|VexVVVV|Vex, { Imm32|Imm32S, Reg32|U - - // BMI instructions - --andn, 0xf2, BMI, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 } --bextr, 0xf7, BMI, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } --blsi, 0xf3/3, BMI, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } --blsmsk, 0xf3/2, BMI, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } --blsr, 0xf3/1, BMI, Modrm|CheckOperandSize|Vex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } --tzcnt, 0xf30fbc, BMI, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+andn, 0xf2, APX_F(BMI), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf|NF, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 } -+bextr, 0xf7, APX_F(BMI), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|SwapSources|No_bSuf|No_wSuf|No_sSuf|NF, { Reg32|Reg64, Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } -+blsi, 0xf3/3, APX_F(BMI), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf|NF, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } -+blsmsk, 0xf3/2, APX_F(BMI), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf|NF, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } -+blsr, 0xf3/1, APX_F(BMI), Modrm|CheckOperandSize|Vex128|EVex128|Space0F38|VexVVVV|No_bSuf|No_wSuf|No_sSuf|NF, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } -+tzcnt, 0xf30fbc, BMI, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+tzcnt, 0xf4, BMI&APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|EVexMap4|NF, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } - - // TBM instructions - -@@ -1990,10 +2037,12 @@ insertq, 0xf20f79, SSE4a, Modrm|NoSuf, { RegXMM, RegXMM } - insertq, 0xf20f78, SSE4a, Modrm|NoSuf, { Imm8, Imm8, RegXMM, RegXMM } - - // LZCNT instruction --lzcnt, 0xf30fbd, LZCNT, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+lzcnt, 0xf30fbd, LZCNT, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+lzcnt, 0xf5, LZCNT&APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|EVexMap4|NF, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } - - // POPCNT instruction --popcnt, 0xf30fb8, POPCNT, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+popcnt, 0xf30fb8, POPCNT, Modrm|CheckOperandSize|No_bSuf|No_sSuf, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+popcnt, 0x88, POPCNT&APX_F, Modrm|CheckOperandSize|No_bSuf|No_sSuf|EVexMap4|NF, { Reg16|Reg32|Reg64|Unspecified|BaseIndex, Reg16|Reg32|Reg64 } - - // VIA PadLock extensions. - xstore-rng, 0xfa7c0, PadLock, NoSuf|RepPrefixOk, {} -@@ -2016,8 +2065,11 @@ xcryptofb, 0xf30fa7e8, PadLock, NoSuf|RepPrefixOk, {} - xstore, 0xfa7c0, PadLock, NoSuf|RepPrefixOk, {} - - // Multy-precision Add Carry, rdseed instructions. --adcx, 0x660f38f6, ADX, Modrm|CheckOperandSize|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } --adox, 0xf30f38f6, ADX, Modrm|CheckOperandSize|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } -+ -+adx, 0x66, ADX&APX_F, C|Modrm|CheckOperandSize|No_bSuf|No_wSuf|No_sSuf|DstVVVV|EVexMap4, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64, Reg32|Reg64 } -+adx, 0x0f38f6, ADX, Modrm|CheckOperandSize|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } -+adx, 0x66, ADX&APX_F, Modrm|CheckOperandSize|No_bSuf|No_wSuf|No_sSuf|EVexMap4, { Reg32|Reg64|Unspecified|BaseIndex, Reg32|Reg64 } -+ - rdseed, 0xfc7/7, RdSeed, Modrm|NoSuf, { Reg16|Reg32|Reg64 } - - // SMAP instructions. -@@ -2030,12 +2082,12 @@ bnd, 0xf2, MPX, NoSuf|IsPrefix, {} - // MPX instructions. - bndmk, 0xf30f1b, MPX, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex, RegBND } - bndmov, 0x660f1a, MPX, D|Modrm|NoSuf, { Xmmword|Unspecified|BaseIndex|RegBND, RegBND } --bndcl, 0xf30f1a, MPX|No64, Modrm|Anysize|IgnoreSize|NoSuf, { Reg32|BaseIndex, RegBND } --bndcl, 0xf30f1a, MPX|x64, Modrm|Anysize|IgnoreSize|NoSuf|NoRex64, { Reg64|BaseIndex, RegBND } --bndcu, 0xf20f1a, MPX|No64, Modrm|Anysize|IgnoreSize|NoSuf, { Reg32|BaseIndex, RegBND } --bndcu, 0xf20f1a, MPX|x64, Modrm|Anysize|IgnoreSize|NoSuf|NoRex64, { Reg64|BaseIndex, RegBND } --bndcn, 0xf20f1b, MPX|No64, Modrm|Anysize|IgnoreSize|NoSuf, { Reg32|BaseIndex, RegBND } --bndcn, 0xf20f1b, MPX|x64, Modrm|Anysize|IgnoreSize|NoSuf|NoRex64, { Reg64|BaseIndex, RegBND } -+bndcl, 0xf30f1a, MPX&No64, Modrm|Anysize|IgnoreSize|NoSuf, { Reg32|BaseIndex, RegBND } -+bndcl, 0xf30f1a, MPX&x64, Modrm|Anysize|IgnoreSize|NoSuf|NoRex64, { Reg64|BaseIndex, RegBND } -+bndcu, 0xf20f1a, MPX&No64, Modrm|Anysize|IgnoreSize|NoSuf, { Reg32|BaseIndex, RegBND } -+bndcu, 0xf20f1a, MPX&x64, Modrm|Anysize|IgnoreSize|NoSuf|NoRex64, { Reg64|BaseIndex, RegBND } -+bndcn, 0xf20f1b, MPX&No64, Modrm|Anysize|IgnoreSize|NoSuf, { Reg32|BaseIndex, RegBND } -+bndcn, 0xf20f1b, MPX&x64, Modrm|Anysize|IgnoreSize|NoSuf|NoRex64, { Reg64|BaseIndex, RegBND } - bndstx, 0x0f1b, MPX, Modrm|Anysize|IgnoreSize|NoSuf, { RegBND, BaseIndex } - bndldx, 0x0f1a, MPX, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex, RegBND } - -@@ -2073,26 +2125,29 @@ vsm4rnds4, 0xf2da, SM4, Modrm|Space0F38|Vex|VexVVVV|VexW0|CheckOperandSize|NoSuf - - // VAES - --vaesdec, 0x66de, VAES|AVX|AVX512F, Modrm|Vex|EVexDYN|Space0F38|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } --vaesdeclast, 0x66df, VAES|AVX|AVX512F, Modrm|Vex|EVexDYN|Space0F38|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } --vaesenc, 0x66dc, VAES|AVX|AVX512F, Modrm|Vex|EVexDYN|Space0F38|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } --vaesenclast, 0x66dd, VAES|AVX|AVX512F, Modrm|Vex|EVexDYN|Space0F38|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } -+vaesdec, 0x66de, VAES&(AVX|AVX512F), Modrm|Vex|EVexDYN|Space0F38|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } -+vaesdeclast, 0x66df, VAES&(AVX|AVX512F), Modrm|Vex|EVexDYN|Space0F38|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } -+vaesenc, 0x66dc, VAES&(AVX|AVX512F), Modrm|Vex|EVexDYN|Space0F38|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } -+vaesenclast, 0x66dd, VAES&(AVX|AVX512F), Modrm|Vex|EVexDYN|Space0F38|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } - - // VAES instructions end - - // VPCLMULQDQ instructions - --vpclmulqdq, 0x6644, VPCLMULQDQ|AVX|AVX512F, Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8|Imm8S, RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } --vpclmullqlqdq, 0x6644/0x00, VPCLMULQDQ|AVX|AVX512F, Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } --vpclmulhqlqdq, 0x6644/0x01, VPCLMULQDQ|AVX|AVX512F, Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } --vpclmullqhqdq, 0x6644/0x10, VPCLMULQDQ|AVX|AVX512F, Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } --vpclmulhqhqdq, 0x6644/0x11, VPCLMULQDQ|AVX|AVX512F, Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } -+vpclmulqdq, 0x6644, VPCLMULQDQ&(AVX|AVX512F), Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8|Imm8S, RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } -+vpclmullqlqdq, 0x6644/0x00, VPCLMULQDQ&(AVX|AVX512F), Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } -+vpclmulhqlqdq, 0x6644/0x01, VPCLMULQDQ&(AVX|AVX512F), Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } -+vpclmullqhqdq, 0x6644/0x10, VPCLMULQDQ&(AVX|AVX512F), Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } -+vpclmulhqhqdq, 0x6644/0x11, VPCLMULQDQ&(AVX|AVX512F), Modrm|Space0F3A|Vex|EVexDYN|VexWIG|VexVVVV|Disp8ShiftVL|CheckOperandSize|NoSuf|ImmExt, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } - - // VPCLMULQDQ instructions end - - // AVX512F instructions. - - // is used for EVEX instructions with x/y suffixes. -+// NOTE: The order of the "unnamed" ($-prefixed) entries here needs to remain -+// in sync with , for match_template()'s EVEX-to-VEX lowering to -+// continue to work. - , 0x45, , Modrm|Vex256|Space0F|VexVVVV|VexW0|NoSuf, { R - kxnor, 0x46, , Modrm|Vex256|Space0F|VexVVVV|VexW0|NoSuf, { RegMask, RegMask, RegMask } - kxor, 0x47, , Modrm|Vex256|Space0F|VexVVVV|VexW0|NoSuf, { RegMask, RegMask, RegMask } - --kmov, 0x90, , Modrm|Vex128|Space0F|VexW0|NoSuf, { RegMask||Unspecified|BaseIndex, RegMask } --kmov, 0x91, , Modrm|Vex128|Space0F|VexW0|NoSuf, { RegMask, |Unspecified|BaseIndex } --kmov, 0x92, , D|Modrm|Vex128|Space0F|VexW0|NoSuf, { Reg32, RegMask } -+kmov, 0x90, APX_F(), Modrm|Vex128|EVex128|Space0F|VexW0|NoSuf, { RegMask||Unspecified|BaseIndex, RegMask } -+kmov, 0x91, APX_F(), Modrm|Vex128|EVex128|Space0F|VexW0|NoSuf, { RegMask, |Unspecified|BaseIndex } -+kmov, 0x92, APX_F(), D|Modrm|Vex128|EVex128|Space0F|VexW0|NoSuf, { Reg32, RegMask } - - knot, 0x44, , Modrm|Vex128|Space0F|VexW0|NoSuf, { RegMask, RegMask } - kortest, 0x98, , Modrm|Vex128|Space0F|VexW0|NoSuf, { RegMask, RegMask } -@@ -2188,11 +2243,11 @@ vcvtudq2pd, 0xF37A, AVX512F, Modrm|EVex=1|Masking|Space0F|VexW=1|Broadcast|Disp8 - vcvtdq2ps, 0x5B, AVX512F, Modrm|Masking|Space0F|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|StaticRounding|SAE, { RegXMM|RegYMM|RegZMM|Dword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } - vcvtps2udq, 0x79, AVX512F, Modrm|Masking|Space0F|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|StaticRounding|SAE, { RegXMM|RegYMM|RegZMM|Dword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } - --vcvtpd2dq, 0xf2e6, AVX512F|, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } -+vcvtpd2dq, 0xf2e6, AVX512F&, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } - --vcvtpd2ps, 0x665a, AVX512F|, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } -+vcvtpd2ps, 0x665a, AVX512F&, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } - --vcvtpd2udq, 0x79, AVX512F|, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } -+vcvtpd2udq, 0x79, AVX512F&, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } - - vcvtph2ps, 0x6613, AVX512F, Modrm|EVex512|Masking|Space0F38|VexW0|Disp8MemShift=5|NoSuf|SAE, { RegYMM|Unspecified|BaseIndex, RegZMM } - -@@ -2223,8 +2278,8 @@ vcvtusi2ss, 0xF37B, AVX512F, Modrm|EVexLIG|Space0F|VexVVVV|Disp8ShiftVL|No_bSuf| - - vcvtss2sd, 0xF35A, AVX512F, Modrm|EVexLIG|Masking|Space0F|VexVVVV|VexW0|Disp8MemShift=2|NoSuf|SAE, { RegXMM|Dword|Unspecified|BaseIndex, RegXMM, RegXMM } - --vcvttpd2dq, 0x66e6, AVX512F|, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } --vcvttpd2udq, 0x78, AVX512F|, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } -+vcvttpd2dq, 0x66e6, AVX512F&, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } -+vcvttpd2udq, 0x78, AVX512F&, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } - - vcvttps2dq, 0xF35B, AVX512F, Modrm|Masking|Space0F|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|SAE, { RegXMM|RegYMM|RegZMM|Dword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } - vcvttps2udq, 0x78, AVX512F, Modrm|Masking|Space0F|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|SAE, { RegXMM|RegYMM|RegZMM|Dword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } -@@ -2272,8 +2327,8 @@ vmovntdqa, 0x662A, AVX512F, Modrm|Space0F38|VexW=1|Disp8ShiftVL|CheckOperandSize - vgetexpp, 0x6642, , Modrm|Masking|||Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|SAE, { RegXMM|RegYMM|RegZMM||Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } - vgetexps, 0x6643, , Modrm|EVexLIG|Masking||VexVVVV||Disp8MemShift|NoSuf|SAE, { RegXMM||Unspecified|BaseIndex, RegXMM, RegXMM } - --vinsertf32x4, 0x6618, AVX512F, Modrm|Masking|Space0F3A|VexVVVV|VexW0|Disp8MemShift=4|CheckOperandSize|NoSuf, { Imm8, RegXMM|XMMword|Unspecified|BaseIndex, RegYMM|RegZMM, RegYMM|RegZMM } --vinserti32x4, 0x6638, AVX512F, Modrm|Masking|Space0F3A|VexVVVV|VexW0|Disp8MemShift=4|CheckOperandSize|NoSuf, { Imm8, RegXMM|XMMword|Unspecified|BaseIndex, RegYMM|RegZMM, RegYMM|RegZMM } -+vinsertf32x4, 0x6618, AVX512F, Modrm|Masking|Space0F3A|VexVVVV|VexW0|Disp8MemShift=4|CheckOperandSize|NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegYMM|RegZMM, RegYMM|RegZMM } -+vinserti32x4, 0x6638, AVX512F, Modrm|Masking|Space0F3A|VexVVVV|VexW0|Disp8MemShift=4|CheckOperandSize|NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegYMM|RegZMM, RegYMM|RegZMM } - - vinsertf64x4, 0x661A, AVX512F, Modrm|EVex=1|Masking|Space0F3A|VexVVVV|VexW1|Disp8MemShift=5|NoSuf, { Imm8, RegYMM|Unspecified|BaseIndex, RegZMM, RegZMM } - vinserti64x4, 0x663A, AVX512F, Modrm|EVex=1|Masking|Space0F3A|VexVVVV|VexW1|Disp8MemShift=5|NoSuf, { Imm8, RegYMM|Unspecified|BaseIndex, RegZMM, RegZMM } -@@ -2470,17 +2525,17 @@ clflushopt, 0x660fae/7, ClflushOpt, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex - - // XSAVES/XRSTORS instructions. - --xrstors, 0xfc7/3, XSAVES, Modrm|NoSuf, { Unspecified|BaseIndex } --xrstors64, 0xfc7/3, XSAVES|x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } --xsaves, 0xfc7/5, XSAVES, Modrm|NoSuf, { Unspecified|BaseIndex } --xsaves64, 0xfc7/5, XSAVES|x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } -+xrstors, 0xfc7/3, XSAVES, Modrm|NoSuf|NoEgpr, { Unspecified|BaseIndex } -+xrstors64, 0xfc7/3, XSAVES&x64, Modrm|NoSuf|Size64|NoEgpr, { Unspecified|BaseIndex } -+xsaves, 0xfc7/5, XSAVES, Modrm|NoSuf|NoEgpr, { Unspecified|BaseIndex } -+xsaves64, 0xfc7/5, XSAVES&x64, Modrm|NoSuf|Size64|NoEgpr, { Unspecified|BaseIndex } - - // XSAVES instructions end. - - // XSAVEC instructions. - --xsavec, 0xfc7/4, XSAVEC, Modrm|NoSuf, { Unspecified|BaseIndex } --xsavec64, 0xfc7/4, XSAVEC|x64, Modrm|NoSuf|Size64, { Unspecified|BaseIndex } -+xsavec, 0xfc7/4, XSAVEC, Modrm|NoSuf|NoEgpr, { Unspecified|BaseIndex } -+xsavec64, 0xfc7/4, XSAVEC&x64, Modrm|NoSuf|Size64|NoEgpr, { Unspecified|BaseIndex } - - // XSAVEC instructions end. - -@@ -2494,108 +2549,108 @@ enclv, 0xf01c0, SE1, NoSuf, {} - - // AVX512VL instructions. - --vgatherdpd, 0x6692, AVX512F|AVX512VL, Modrm|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB128|NoSuf, { Qword|Unspecified|BaseIndex, RegXMM|RegYMM } --vgatherdps, 0x6692, AVX512F|AVX512VL, Modrm|EVex=2|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB128|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM } --vgatherdps, 0x6692, AVX512F|AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { Dword|Unspecified|BaseIndex, RegYMM } --vgatherqp, 0x6693, AVX512F|AVX512VL, Modrm|EVex128|Masking|NoDefMask|Space0F38||Disp8MemShift|VecSIB128|NoSuf, { |Unspecified|BaseIndex, RegXMM } --vgatherqpd, 0x6693, AVX512F|AVX512VL, Modrm|EVex256|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB256|NoSuf, { Qword|Unspecified|BaseIndex, RegYMM } --vgatherqps, 0x6693, AVX512F|AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM } --vpgatherdd, 0x6690, AVX512F|AVX512VL, Modrm|EVex=2|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB128|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM } --vpgatherdd, 0x6690, AVX512F|AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { Dword|Unspecified|BaseIndex, RegYMM } --vpgatherdq, 0x6690, AVX512F|AVX512VL, Modrm|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB128|NoSuf, { Qword|Unspecified|BaseIndex, RegXMM|RegYMM } --vpgatherq, 0x6691, AVX512F|AVX512VL, Modrm|EVex128|Masking|NoDefMask|Space0F38||Disp8MemShift|VecSIB128|NoSuf, { |Unspecified|BaseIndex, RegXMM } --vpgatherqd, 0x6691, AVX512F|AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM } --vpgatherqq, 0x6691, AVX512F|AVX512VL, Modrm|EVex256|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB256|NoSuf, { Qword|Unspecified|BaseIndex, RegYMM } -- --vpscatterdd, 0x66A0, AVX512F|AVX512VL, Modrm|EVex=2|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB128|NoSuf, { RegXMM, Dword|Unspecified|BaseIndex } --vpscatterdd, 0x66A0, AVX512F|AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { RegYMM, Dword|Unspecified|BaseIndex } --vpscatterdq, 0x66A0, AVX512F|AVX512VL, Modrm|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB128|NoSuf, { RegXMM|RegYMM, Qword|Unspecified|BaseIndex } --vpscatterq, 0x66A1, AVX512F|AVX512VL, Modrm|EVex128|Masking|NoDefMask|Space0F38||Disp8MemShift|VecSIB128|NoSuf, { RegXMM, |Unspecified|BaseIndex } --vpscatterqd, 0x66A1, AVX512F|AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { RegXMM, Dword|Unspecified|BaseIndex } --vpscatterqq, 0x66A1, AVX512F|AVX512VL, Modrm|EVex256|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB256|NoSuf, { RegYMM, Qword|Unspecified|BaseIndex } --vscatterdpd, 0x66A2, AVX512F|AVX512VL, Modrm|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB128|NoSuf, { RegXMM|RegYMM, Qword|Unspecified|BaseIndex } --vscatterdps, 0x66A2, AVX512F|AVX512VL, Modrm|EVex=2|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB128|NoSuf, { RegXMM, Dword|Unspecified|BaseIndex } --vscatterdps, 0x66A2, AVX512F|AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { RegYMM, Dword|Unspecified|BaseIndex } --vscatterqp, 0x66A3, AVX512F|AVX512VL, Modrm|EVex128|Masking|NoDefMask|Space0F38||Disp8MemShift|VecSIB128|NoSuf, { RegXMM, |Unspecified|BaseIndex } --vscatterqpd, 0x66A3, AVX512F|AVX512VL, Modrm|EVex256|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB256|NoSuf, { RegYMM, Qword|Unspecified|BaseIndex } --vscatterqps, 0x66A3, AVX512F|AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { RegXMM, Dword|Unspecified|BaseIndex } -- --vcvtdq2pd, 0xF3E6, AVX512F|AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } --vcvtdq2pd, 0xF3E6, AVX512F|AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } --vcvtudq2pd, 0xF37A, AVX512F|AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } --vcvtudq2pd, 0xF37A, AVX512F|AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } -- --vcvtph2ps, 0x6613, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } --vcvtph2ps, 0x6613, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } -- --vcvtps2pd, 0x5A, AVX512F|AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } --vcvtps2pd, 0x5A, AVX512F|AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } -- --vcvtps2ph, 0x661D, AVX512F|AVX512VL, Modrm|EVex128|Masking|Space0F3A|VexW0|Disp8MemShift=3|NoSuf, { Imm8, RegXMM, RegXMM|Qword|Unspecified|BaseIndex } --vcvtps2ph, 0x661D, AVX512F|AVX512VL, Modrm|EVex256|Masking|Space0F3A|VexW0|Disp8MemShift=4|NoSuf, { Imm8, RegYMM, RegXMM|Unspecified|BaseIndex } -- --vmovddup, 0xF212, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F|VexW1|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } -- --vpmovdb, 0xF331, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } --vpmovdb, 0xF331, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } --vpmovsdb, 0xF321, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } --vpmovsdb, 0xF321, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } --vpmovusdb, 0xF311, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } --vpmovusdb, 0xF311, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } -- --vpmovdw, 0xF333, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } --vpmovdw, 0xF333, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } --vpmovsdw, 0xF323, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } --vpmovsdw, 0xF323, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } --vpmovusdw, 0xF313, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } --vpmovusdw, 0xF313, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } -- --vpmovqb, 0xF332, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=1|NoSuf, { RegXMM, RegXMM|Word|Unspecified|BaseIndex } --vpmovqb, 0xF332, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegYMM, RegXMM|Dword|Unspecified|BaseIndex } --vpmovsqb, 0xF322, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=1|NoSuf, { RegXMM, RegXMM|Word|Unspecified|BaseIndex } --vpmovsqb, 0xF322, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegYMM, RegXMM|Dword|Unspecified|BaseIndex } --vpmovusqb, 0xF312, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=1|NoSuf, { RegXMM, RegXMM|Word|Unspecified|BaseIndex } --vpmovusqb, 0xF312, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegYMM, RegXMM|Dword|Unspecified|BaseIndex } -- --vpmovqd, 0xF335, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } --vpmovqd, 0xF335, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } --vpmovsqd, 0xF325, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } --vpmovsqd, 0xF325, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } --vpmovusqd, 0xF315, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } --vpmovusqd, 0xF315, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } -- --vpmovqw, 0xF334, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } --vpmovqw, 0xF334, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } --vpmovsqw, 0xF324, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } --vpmovsqw, 0xF324, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } --vpmovusqw, 0xF314, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } --vpmovusqw, 0xF314, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } -- --vpmovsxdq, 0x6625, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } --vpmovsxdq, 0x6625, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } --vpmovzxdq, 0x6635, AVX512F|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } --vpmovzxdq, 0x6635, AVX512F|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } -+vgatherdpd, 0x6692, AVX512VL, Modrm|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB128|NoSuf, { Qword|Unspecified|BaseIndex, RegXMM|RegYMM } -+vgatherdps, 0x6692, AVX512VL, Modrm|EVex=2|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB128|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM } -+vgatherdps, 0x6692, AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { Dword|Unspecified|BaseIndex, RegYMM } -+vgatherqp, 0x6693, AVX512VL, Modrm|EVex128|Masking|NoDefMask|Space0F38||Disp8MemShift|VecSIB128|NoSuf, { |Unspecified|BaseIndex, RegXMM } -+vgatherqpd, 0x6693, AVX512VL, Modrm|EVex256|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB256|NoSuf, { Qword|Unspecified|BaseIndex, RegYMM } -+vgatherqps, 0x6693, AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM } -+vpgatherdd, 0x6690, AVX512VL, Modrm|EVex=2|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB128|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM } -+vpgatherdd, 0x6690, AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { Dword|Unspecified|BaseIndex, RegYMM } -+vpgatherdq, 0x6690, AVX512VL, Modrm|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB128|NoSuf, { Qword|Unspecified|BaseIndex, RegXMM|RegYMM } -+vpgatherq, 0x6691, AVX512VL, Modrm|EVex128|Masking|NoDefMask|Space0F38||Disp8MemShift|VecSIB128|NoSuf, { |Unspecified|BaseIndex, RegXMM } -+vpgatherqd, 0x6691, AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { Dword|Unspecified|BaseIndex, RegXMM } -+vpgatherqq, 0x6691, AVX512VL, Modrm|EVex256|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB256|NoSuf, { Qword|Unspecified|BaseIndex, RegYMM } -+ -+vpscatterdd, 0x66A0, AVX512VL, Modrm|EVex=2|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB128|NoSuf, { RegXMM, Dword|Unspecified|BaseIndex } -+vpscatterdd, 0x66A0, AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { RegYMM, Dword|Unspecified|BaseIndex } -+vpscatterdq, 0x66A0, AVX512VL, Modrm|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB128|NoSuf, { RegXMM|RegYMM, Qword|Unspecified|BaseIndex } -+vpscatterq, 0x66A1, AVX512VL, Modrm|EVex128|Masking|NoDefMask|Space0F38||Disp8MemShift|VecSIB128|NoSuf, { RegXMM, |Unspecified|BaseIndex } -+vpscatterqd, 0x66A1, AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { RegXMM, Dword|Unspecified|BaseIndex } -+vpscatterqq, 0x66A1, AVX512VL, Modrm|EVex256|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB256|NoSuf, { RegYMM, Qword|Unspecified|BaseIndex } -+vscatterdpd, 0x66A2, AVX512VL, Modrm|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB128|NoSuf, { RegXMM|RegYMM, Qword|Unspecified|BaseIndex } -+vscatterdps, 0x66A2, AVX512VL, Modrm|EVex=2|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB128|NoSuf, { RegXMM, Dword|Unspecified|BaseIndex } -+vscatterdps, 0x66A2, AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { RegYMM, Dword|Unspecified|BaseIndex } -+vscatterqp, 0x66A3, AVX512VL, Modrm|EVex128|Masking|NoDefMask|Space0F38||Disp8MemShift|VecSIB128|NoSuf, { RegXMM, |Unspecified|BaseIndex } -+vscatterqpd, 0x66A3, AVX512VL, Modrm|EVex256|Masking|NoDefMask|Space0F38|VexW1|Disp8MemShift=3|VecSIB256|NoSuf, { RegYMM, Qword|Unspecified|BaseIndex } -+vscatterqps, 0x66A3, AVX512VL, Modrm|EVex=3|Masking|NoDefMask|Space0F38|VexW0|Disp8MemShift=2|VecSIB256|NoSuf, { RegXMM, Dword|Unspecified|BaseIndex } -+ -+vcvtdq2pd, 0xF3E6, AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } -+vcvtdq2pd, 0xF3E6, AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } -+vcvtudq2pd, 0xF37A, AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } -+vcvtudq2pd, 0xF37A, AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } -+ -+vcvtph2ps, 0x6613, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } -+vcvtph2ps, 0x6613, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } -+ -+vcvtps2pd, 0x5A, AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } -+vcvtps2pd, 0x5A, AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } -+ -+vcvtps2ph, 0x661D, AVX512VL, Modrm|EVex128|Masking|Space0F3A|VexW0|Disp8MemShift=3|NoSuf, { Imm8, RegXMM, RegXMM|Qword|Unspecified|BaseIndex } -+vcvtps2ph, 0x661D, AVX512VL, Modrm|EVex256|Masking|Space0F3A|VexW0|Disp8MemShift=4|NoSuf, { Imm8, RegYMM, RegXMM|Unspecified|BaseIndex } -+ -+vmovddup, 0xF212, AVX512VL, Modrm|EVex=2|Masking|Space0F|VexW1|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } -+ -+vpmovdb, 0xF331, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } -+vpmovdb, 0xF331, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } -+vpmovsdb, 0xF321, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } -+vpmovsdb, 0xF321, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } -+vpmovusdb, 0xF311, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } -+vpmovusdb, 0xF311, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } -+ -+vpmovdw, 0xF333, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } -+vpmovdw, 0xF333, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } -+vpmovsdw, 0xF323, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } -+vpmovsdw, 0xF323, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } -+vpmovusdw, 0xF313, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } -+vpmovusdw, 0xF313, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } -+ -+vpmovqb, 0xF332, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=1|NoSuf, { RegXMM, RegXMM|Word|Unspecified|BaseIndex } -+vpmovqb, 0xF332, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegYMM, RegXMM|Dword|Unspecified|BaseIndex } -+vpmovsqb, 0xF322, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=1|NoSuf, { RegXMM, RegXMM|Word|Unspecified|BaseIndex } -+vpmovsqb, 0xF322, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegYMM, RegXMM|Dword|Unspecified|BaseIndex } -+vpmovusqb, 0xF312, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=1|NoSuf, { RegXMM, RegXMM|Word|Unspecified|BaseIndex } -+vpmovusqb, 0xF312, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegYMM, RegXMM|Dword|Unspecified|BaseIndex } -+ -+vpmovqd, 0xF335, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } -+vpmovqd, 0xF335, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } -+vpmovsqd, 0xF325, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } -+vpmovsqd, 0xF325, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } -+vpmovusqd, 0xF315, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } -+vpmovusqd, 0xF315, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } -+ -+vpmovqw, 0xF334, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } -+vpmovqw, 0xF334, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } -+vpmovsqw, 0xF324, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } -+vpmovsqw, 0xF324, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } -+vpmovusqw, 0xF314, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=2|NoSuf, { RegXMM, RegXMM|Dword|Unspecified|BaseIndex } -+vpmovusqw, 0xF314, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegYMM, RegXMM|Qword|Unspecified|BaseIndex } -+ -+vpmovsxdq, 0x6625, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } -+vpmovsxdq, 0x6625, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } -+vpmovzxdq, 0x6635, AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } -+vpmovzxdq, 0x6635, AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } - - // AVX512VL instructions end. - - // AVX512BW instructions. - --kadd, 0x4a, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1||NoSuf, { RegMask, RegMask, RegMask } --kand, 0x41, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1||NoSuf, { RegMask, RegMask, RegMask } --kandn, 0x42, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1||NoSuf|Optimize, { RegMask, RegMask, RegMask } --kmov, 0x90, AVX512BW, Modrm|Vex128|Space0F|VexW1||NoSuf, { RegMask||Unspecified|BaseIndex, RegMask } --kmov, 0x91, AVX512BW, Modrm|Vex128|Space0F|VexW1||NoSuf, { RegMask, |Unspecified|BaseIndex } --kmov, 0xf292, AVX512BW, D|Modrm|Vex128|Space0F|||NoSuf, { , RegMask } --knot, 0x44, AVX512BW, Modrm|Vex128|Space0F|VexW1||NoSuf, { RegMask, RegMask } --kor, 0x45, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1||NoSuf, { RegMask, RegMask, RegMask } --kortest, 0x98, AVX512BW, Modrm|Vex128|Space0F|VexW1||NoSuf, { RegMask, RegMask } --ktest, 0x99, AVX512BW, Modrm|Vex128|Space0F|VexW1||NoSuf, { RegMask, RegMask } --kxnor, 0x46, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1||NoSuf, { RegMask, RegMask, RegMask } --kxor, 0x47, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1||NoSuf|Optimize, { RegMask, RegMask, RegMask } --kunpckdq, 0x4B, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1|Vsz512|NoSuf, { RegMask, RegMask, RegMask } --kunpckwd, 0x4B, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW0|Vsz256|NoSuf, { RegMask, RegMask, RegMask } --kshiftl, 0x6633, AVX512BW, Modrm|Vex128|Space0F3A|||NoSuf, { Imm8, RegMask, RegMask } --kshiftr, 0x6631, AVX512BW, Modrm|Vex128|Space0F3A|||NoSuf, { Imm8, RegMask, RegMask } -+kadd, 0x4a, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1|NoSuf, { RegMask, RegMask, RegMask } -+kand, 0x41, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1|NoSuf, { RegMask, RegMask, RegMask } -+kandn, 0x42, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1|NoSuf|Optimize, { RegMask, RegMask, RegMask } -+kmov, 0x90, APX_F(AVX512BW), Modrm|Vex128|EVex128|Space0F|VexW1|NoSuf, { RegMask||Unspecified|BaseIndex, RegMask } -+kmov, 0x91, APX_F(AVX512BW), Modrm|Vex128|EVex128|Space0F|VexW1|NoSuf, { RegMask, |Unspecified|BaseIndex } -+kmov, 0xf292, APX_F(AVX512BW), D|Modrm|Vex128|EVex128|Space0F||NoSuf, { , RegMask } -+knot, 0x44, AVX512BW, Modrm|Vex128|Space0F|VexW1|NoSuf, { RegMask, RegMask } -+kor, 0x45, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1|NoSuf, { RegMask, RegMask, RegMask } -+kortest, 0x98, AVX512BW, Modrm|Vex128|Space0F|VexW1|NoSuf, { RegMask, RegMask } -+ktest, 0x99, AVX512BW, Modrm|Vex128|Space0F|VexW1|NoSuf, { RegMask, RegMask } -+kxnor, 0x46, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1|NoSuf, { RegMask, RegMask, RegMask } -+kxor, 0x47, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1|NoSuf|Optimize, { RegMask, RegMask, RegMask } -+kunpckdq, 0x4B, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW1|NoSuf, { RegMask, RegMask, RegMask } -+kunpckwd, 0x4B, AVX512BW, Modrm|Vex256|Space0F|VexVVVV|VexW0|NoSuf, { RegMask, RegMask, RegMask } -+kshiftl, 0x6633, AVX512BW, Modrm|Vex128|Space0F3A||NoSuf, { Imm8, RegMask, RegMask } -+kshiftr, 0x6631, AVX512BW, Modrm|Vex128|Space0F3A||NoSuf, { Imm8, RegMask, RegMask } - - vdbpsadbw, 0x6642, AVX512BW, Modrm|Masking|Space0F3A|VexVVVV|VexW0|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8|Imm8S, RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } - -@@ -2681,23 +2736,23 @@ vpmov2m, 0xf329, AVX512BW, Modrm|EVexDYN|Space0F38||NoSuf, { RegXMM - vpmovm2, 0xf328, AVX512BW, Modrm|EVexDYN|Space0F38||NoSuf, { RegMask, RegXMM|RegYMM|RegZMM } - - vpmovswb, 0xF320, AVX512BW, Modrm|EVex=1|Masking|Space0F38|VexW=1|Disp8MemShift=5|NoSuf, { RegZMM, RegYMM|Unspecified|BaseIndex } --vpmovswb, 0xF320, AVX512BW|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } --vpmovswb, 0xF320, AVX512BW|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } -+vpmovswb, 0xF320, AVX512BW&AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } -+vpmovswb, 0xF320, AVX512BW&AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } - - vpmovuswb, 0xF310, AVX512BW, Modrm|EVex=1|Masking|Space0F38|VexW=1|Disp8MemShift=5|NoSuf, { RegZMM, RegYMM|Unspecified|BaseIndex } --vpmovuswb, 0xF310, AVX512BW|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } --vpmovuswb, 0xF310, AVX512BW|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } -+vpmovuswb, 0xF310, AVX512BW&AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } -+vpmovuswb, 0xF310, AVX512BW&AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } - - vpmovwb, 0xF330, AVX512BW, Modrm|EVex=1|Masking|Space0F38|VexW=1|Disp8MemShift=5|NoSuf, { RegZMM, RegYMM|Unspecified|BaseIndex } --vpmovwb, 0xF330, AVX512BW|AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } --vpmovwb, 0xF330, AVX512BW|AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } -+vpmovwb, 0xF330, AVX512BW&AVX512VL, Modrm|EVex=2|Masking|Space0F38|VexW0|Disp8MemShift=3|NoSuf, { RegXMM, RegXMM|Qword|Unspecified|BaseIndex } -+vpmovwb, 0xF330, AVX512BW&AVX512VL, Modrm|EVex=3|Masking|Space0F38|VexW=1|Disp8MemShift=4|NoSuf, { RegYMM, RegXMM|Unspecified|BaseIndex } - - vpmovsxbw, 0x6620, AVX512BW, Modrm|EVex=1|Masking|Space0F38|VexWIG|Disp8MemShift=5|NoSuf, { RegYMM|Unspecified|BaseIndex, RegZMM } --vpmovsxbw, 0x6620, AVX512BW|AVX512VL, Modrm|EVex=2|Masking|VexWIG|Space0F38|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } --vpmovsxbw, 0x6620, AVX512BW|AVX512VL, Modrm|EVex=3|Masking|VexWIG|Space0F38|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } -+vpmovsxbw, 0x6620, AVX512BW&AVX512VL, Modrm|EVex=2|Masking|VexWIG|Space0F38|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } -+vpmovsxbw, 0x6620, AVX512BW&AVX512VL, Modrm|EVex=3|Masking|VexWIG|Space0F38|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } - vpmovzxbw, 0x6630, AVX512BW, Modrm|EVex=1|Masking|Space0F38|VexWIG|Disp8MemShift=5|NoSuf, { RegYMM|Unspecified|BaseIndex, RegZMM } --vpmovzxbw, 0x6630, AVX512BW|AVX512VL, Modrm|EVex=2|Masking|VexWIG|Space0F38|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } --vpmovzxbw, 0x6630, AVX512BW|AVX512VL, Modrm|EVex=3|Masking|VexWIG|Space0F38|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } -+vpmovzxbw, 0x6630, AVX512BW&AVX512VL, Modrm|EVex=2|Masking|VexWIG|Space0F38|Disp8MemShift=3|NoSuf, { RegXMM|Qword|Unspecified|BaseIndex, RegXMM } -+vpmovzxbw, 0x6630, AVX512BW&AVX512VL, Modrm|EVex=3|Masking|VexWIG|Space0F38|Disp8MemShift=4|NoSuf, { RegXMM|Unspecified|BaseIndex, RegYMM } - - vpsadbw, 0x66F6, AVX512BW, Modrm|Space0F|VexVVVV|VexWIG|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } - -@@ -2738,36 +2793,36 @@ vcvtpd2qq, 0x667B, AVX512DQ, Modrm|Masking|Space0F|VexW1|Broadcast|Disp8ShiftVL| - vcvtpd2uqq, 0x6679, AVX512DQ, Modrm|Masking|Space0F|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|StaticRounding|SAE, { RegXMM|RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } - - vcvtps2qq, 0x667B, AVX512DQ, Modrm|EVex512|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=5|NoSuf|StaticRounding|SAE, { RegYMM|Dword|Unspecified|BaseIndex, RegZMM } --vcvtps2qq, 0x667B, AVX512DQ|AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } --vcvtps2qq, 0x667B, AVX512DQ|AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } -+vcvtps2qq, 0x667B, AVX512DQ&AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } -+vcvtps2qq, 0x667B, AVX512DQ&AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } - vcvtps2uqq, 0x6679, AVX512DQ, Modrm|EVex512|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=5|NoSuf|StaticRounding|SAE, { RegYMM|Dword|Unspecified|BaseIndex, RegZMM } --vcvtps2uqq, 0x6679, AVX512DQ|AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } --vcvtps2uqq, 0x6679, AVX512DQ|AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|RegXMM|Dword|Unspecified|BaseIndex, RegYMM } -+vcvtps2uqq, 0x6679, AVX512DQ&AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } -+vcvtps2uqq, 0x6679, AVX512DQ&AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|RegXMM|Dword|Unspecified|BaseIndex, RegYMM } - - vcvtqq2pd, 0xF3E6, AVX512DQ, Modrm|Masking|Space0F|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|StaticRounding|SAE, { RegXMM|RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } - vcvtuqq2pd, 0xF37A, AVX512DQ, Modrm|Masking|Space0F|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|StaticRounding|SAE, { RegXMM|RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } - --vcvtqq2ps, 0x5b, AVX512DQ|, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } -+vcvtqq2ps, 0x5b, AVX512DQ&, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } - - vcvttpd2qq, 0x667A, AVX512DQ, Modrm|Masking|Space0F|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|SAE, { RegXMM|RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } - vcvttpd2uqq, 0x6678, AVX512DQ, Modrm|Masking|Space0F|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|SAE, { RegXMM|RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } - - vcvttps2qq, 0x667A, AVX512DQ, Modrm|EVex512|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=5|NoSuf|SAE, { RegYMM|Dword|Unspecified|BaseIndex, RegZMM } --vcvttps2qq, 0x667A, AVX512DQ|AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } --vcvttps2qq, 0x667A, AVX512DQ|AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } -+vcvttps2qq, 0x667A, AVX512DQ&AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } -+vcvttps2qq, 0x667A, AVX512DQ&AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } - vcvttps2uqq, 0x6678, AVX512DQ, Modrm|EVex512|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=5|NoSuf|SAE, { RegYMM|Dword|Unspecified|BaseIndex, RegZMM } --vcvttps2uqq, 0x6678, AVX512DQ|AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } --vcvttps2uqq, 0x6678, AVX512DQ|AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } -+vcvttps2uqq, 0x6678, AVX512DQ&AVX512VL, Modrm|EVex128|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Dword|Qword|Unspecified|BaseIndex, RegXMM } -+vcvttps2uqq, 0x6678, AVX512DQ&AVX512VL, Modrm|EVex256|Masking|Space0F|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Dword|Unspecified|BaseIndex, RegYMM } - --vcvtuqq2ps, 0xf27a, AVX512DQ|, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } -+vcvtuqq2ps, 0xf27a, AVX512DQ&, Modrm||Masking|Space0F|VexW1|Broadcast|NoSuf|, { |Qword, } - - vextractf32x8, 0x661B, AVX512DQ, Modrm|EVex=1|Masking|Space0F3A|VexW=1|Disp8MemShift=5|NoSuf, { Imm8, RegZMM, RegYMM|Unspecified|BaseIndex } - vextracti32x8, 0x663B, AVX512DQ, Modrm|EVex=1|Masking|Space0F3A|VexW=1|Disp8MemShift=5|NoSuf, { Imm8, RegZMM, RegYMM|Unspecified|BaseIndex } - vinsertf32x8, 0x661A, AVX512DQ, Modrm|EVex512|Masking|Space0F3A|VexVVVV|VexW0|Disp8MemShift=5|NoSuf, { Imm8, RegYMM|Unspecified|BaseIndex, RegZMM, RegZMM } - vinserti32x8, 0x663A, AVX512DQ, Modrm|EVex512|Masking|Space0F3A|VexVVVV|VexW0|Disp8MemShift=5|NoSuf, { Imm8, RegYMM|Unspecified|BaseIndex, RegZMM, RegZMM } - --vpextr, 0x6616, AVX512DQ|, Modrm|EVex128|Space0F3A||Disp8MemShift|NoSuf, { Imm8, RegXMM, |Unspecified|BaseIndex } --vpinsr, 0x6622, AVX512DQ|, Modrm|EVex128|Space0F3A|VexVVVV||Disp8MemShift|NoSuf, { Imm8, |Unspecified|BaseIndex, RegXMM, RegXMM } -+vpextr, 0x6616, AVX512DQ&, Modrm|EVex128|Space0F3A||Disp8MemShift|NoSuf, { Imm8, RegXMM, |Unspecified|BaseIndex } -+vpinsr, 0x6622, AVX512DQ&, Modrm|EVex128|Space0F3A|VexVVVV||Disp8MemShift|NoSuf, { Imm8, |Unspecified|BaseIndex, RegXMM, RegXMM } - - vextractf64x2, 0x6619, AVX512DQ, Modrm|Masking|Space0F3A|VexW=2|Disp8MemShift=4|NoSuf, { Imm8, RegYMM|RegZMM, RegXMM|Unspecified|BaseIndex } - vextracti64x2, 0x6639, AVX512DQ, Modrm|Masking|Space0F3A|VexW=2|Disp8MemShift=4|NoSuf, { Imm8, RegYMM|RegZMM, RegXMM|Unspecified|BaseIndex } -@@ -2777,8 +2832,8 @@ vinserti64x2, 0x6638, AVX512DQ, Modrm|Masking|Space0F3A|VexVVVV|VexW1|Disp8MemSh - vfpclassp, 0x6666, AVX512DQ, Modrm|Masking|Space0F3A||Broadcast|Disp8ShiftVL|NoSuf|IntelSyntax, { Imm8|Imm8S, RegXMM|RegYMM|RegZMM||Unspecified|BaseIndex, RegMask } - vfpclassp, 0x6666, AVX512DQ, Modrm|Masking|Space0F3A||Broadcast|Disp8ShiftVL|NoSuf|ATTSyntax, { Imm8|Imm8S, RegXMM|RegYMM|RegZMM||BaseIndex, RegMask } - vfpclasspz, 0x6666, AVX512DQ, Modrm|EVex512|Masking|Space0F3A||Broadcast|Disp8MemShift=6|NoSuf, { Imm8|Imm8S, RegZMM||Unspecified|BaseIndex, RegMask } --vfpclasspx, 0x6666, AVX512DQ|AVX512VL, Modrm|EVex128|Masking|Space0F3A||Broadcast|Disp8MemShift=4|NoSuf, { Imm8|Imm8S, RegXMM||Unspecified|BaseIndex, RegMask } --vfpclasspy, 0x6666, AVX512DQ|AVX512VL, Modrm|EVex256|Masking|Space0F3A||Broadcast|Disp8MemShift=5|NoSuf, { Imm8|Imm8S, RegYMM||Unspecified|BaseIndex, RegMask } -+vfpclasspx, 0x6666, AVX512DQ&AVX512VL, Modrm|EVex128|Masking|Space0F3A||Broadcast|Disp8MemShift=4|NoSuf, { Imm8|Imm8S, RegXMM||Unspecified|BaseIndex, RegMask } -+vfpclasspy, 0x6666, AVX512DQ&AVX512VL, Modrm|EVex256|Masking|Space0F3A||Broadcast|Disp8MemShift=5|NoSuf, { Imm8|Imm8S, RegYMM||Unspecified|BaseIndex, RegMask } - vfpclasss, 0x67, , Modrm|EVexLIG|Masking|Space0F3A||Disp8MemShift|NoSuf, { Imm8|Imm8S, RegXMM||Unspecified|BaseIndex, RegMask } - - vpmov2m, 0xf339, AVX512DQ, Modrm|EVexDYN|Space0F38||NoSuf, { RegXMM|RegYMM|RegZMM, RegMask } -@@ -2916,8 +2971,8 @@ vpshufbitqmb, 0x668f, AVX512_BITALG, Modrm|Masking|Space0F38|VexVVVV|VexW0|Disp8 - - // AVX512 + GFNI instructions - --vgf2p8affineinvqb, 0x66cf, GFNI|AVX512F, Modrm|Masking|Space0F3A|VexVVVV|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8, RegXMM|RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } --vgf2p8affineqb, 0x66ce, GFNI|AVX512F, Modrm|Masking|Space0F3A|VexVVVV|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8, RegXMM|RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } -+vgf2p8affineinvqb, 0x66cf, GFNI&AVX512F, Modrm|Masking|Space0F3A|VexVVVV|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8, RegXMM|RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } -+vgf2p8affineqb, 0x66ce, GFNI&AVX512F, Modrm|Masking|Space0F3A|VexVVVV|VexW1|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { Imm8, RegXMM|RegYMM|RegZMM|Qword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } - - // AVX512 + GFNI instructions end - -@@ -2946,7 +3001,7 @@ clzero, 0xf01fc, CLZERO, AddrPrefixOpReg|NoSuf, { Acc|Word|Dword|Qword } - monitorx, 0xf01fa, MWAITX, NoSuf, {} - monitorx, 0xf01fa, MWAITX, AddrPrefixOpReg|NoSuf, { Acc|Word|Dword|Qword, RegC|Dword, RegD|Dword } - // The 64-bit form exists only for compatibility with older gas. --monitorx, 0xf01fa, MWAITX|x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword, RegD|Qword } -+monitorx, 0xf01fa, MWAITX&x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword, RegD|Qword } - - mwaitx, 0xf01fb, MWAITX, NoSuf, {} - // The 64-bit form exists only for compatibility with older gas. -@@ -2963,30 +3018,34 @@ wrpkru, 0xf01ef, OSPKE, NoSuf, {} - - // RDPID instructions. - --rdpid, 0xf30fc7/7, RDPID|No64, Modrm|IgnoreSize|NoSuf, { Reg32 } --rdpid, 0xf30fc7/7, RDPID|x64, Modrm|NoSuf|NoRex64, { Reg64 } -+rdpid, 0xf30fc7/7, RDPID&No64, Modrm|IgnoreSize|NoSuf, { Reg32 } -+rdpid, 0xf30fc7/7, RDPID&x64, Modrm|NoSuf|NoRex64, { Reg64 } - - // RDPID instructions end. - - // PTWRITE instructions. - --ptwrite, 0xf30fae/4, PTWRITE|No64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Reg32|Unspecified|BaseIndex } --ptwrite, 0xf30fae/4, PTWRITE|x64, Modrm|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex } -+ptwrite, 0xf30fae/4, PTWRITE&No64, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf, { Reg32|Unspecified|BaseIndex } -+ptwrite, 0xf30fae/4, PTWRITE&x64, Modrm|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64|Unspecified|BaseIndex } - - // PTWRITE instructions end. - - // CET instructions. - - incsspd, 0xf30fae/5, SHSTK, Modrm|IgnoreSize|NoSuf, { Reg32 } --incsspq, 0xf30fae/5, SHSTK|x64, Modrm|NoSuf, { Reg64 } -+incsspq, 0xf30fae/5, SHSTK&x64, Modrm|NoSuf, { Reg64 } - rdsspd, 0xf30f1e/1, SHSTK, Modrm|IgnoreSize|NoSuf, { Reg32 } --rdsspq, 0xf30f1e/1, SHSTK|x64, Modrm|NoSuf, { Reg64 } -+rdsspq, 0xf30f1e/1, SHSTK&x64, Modrm|NoSuf, { Reg64 } - saveprevssp, 0xf30f01ea, SHSTK, NoSuf, {} - rstorssp, 0xf30f01/5, SHSTK, Modrm|NoSuf, { Qword|Unspecified|BaseIndex } - wrssd, 0x0f38f6, SHSTK, Modrm|IgnoreSize|NoSuf, { Reg32, Dword|Unspecified|BaseIndex } --wrssq, 0x0f38f6, SHSTK|x64, Modrm|NoSuf|Size64, { Reg64, Qword|Unspecified|BaseIndex } -+wrssd, 0x66, SHSTK&APX_F, Modrm|NoSuf|EVexMap4, { Reg32, Dword|Unspecified|BaseIndex } -+wrssq, 0x0f38f6, SHSTK&x64, Modrm|NoSuf, { Reg64, Qword|Unspecified|BaseIndex } -+wrssq, 0x66, SHSTK&APX_F, Modrm|NoSuf|EVexMap4, { Reg64, Qword|Unspecified|BaseIndex } - wrussd, 0x660f38f5, SHSTK, Modrm|IgnoreSize|NoSuf, { Reg32, Dword|Unspecified|BaseIndex } --wrussq, 0x660f38f5, SHSTK|x64, Modrm|NoSuf, { Reg64, Qword|Unspecified|BaseIndex } -+wrussd, 0x6665, SHSTK&APX_F, Modrm|NoSuf|EVexMap4, { Reg32, Dword|Unspecified|BaseIndex } -+wrussq, 0x660f38f5, SHSTK&x64, Modrm|NoSuf, { Reg64, Qword|Unspecified|BaseIndex } -+wrussq, 0x6665, SHSTK&APX_F, Modrm|NoSuf|EVexMap4, { Reg64, Qword|Unspecified|BaseIndex } - setssbsy, 0xf30f01e8, SHSTK, NoSuf, {} - clrssbsy, 0xf30fae/6, SHSTK, Modrm|NoSuf, { Qword|Unspecified|BaseIndex } - endbr64, 0xf30f1efa, IBT, NoSuf, {} -@@ -3011,7 +3070,7 @@ pconfig, 0x0f01c5, PCONFIG, NoSuf, {} - - // PBNDKB instruction. - --pbndkb, 0x0f01c7, PBNDKB|x64, NoSuf, {} -+pbndkb, 0x0f01c7, PBNDKB, NoSuf, {} - - // PBNDKB instruction end. - -@@ -3034,7 +3093,9 @@ cldemote, 0x0f1c/0, CLDEMOTE, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex } - // MOVDIR[I,64B] instructions. - - movdiri, 0xf38f9, MOVDIRI, Modrm|CheckOperandSize|IgnoreSize|No_bSuf|No_wSuf|No_sSuf, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } -+movdiri, 0xf9, MOVDIRI&APX_F, Modrm|CheckOperandSize|No_bSuf|No_wSuf|No_sSuf|EVexMap4, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } - movdir64b, 0x660f38f8, MOVDIR64B, Modrm|AddrPrefixOpReg|NoSuf, { Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+movdir64b, 0x66f8, MOVDIR64B&APX_F, Modrm|AddrPrefixOpReg|NoSuf|EVexMap4, { Unspecified|BaseIndex, Reg32|Reg64 } - - // MOVEDIR instructions end. - -@@ -3042,7 +3103,7 @@ movdir64b, 0x660f38f8, MOVDIR64B, Modrm|AddrPrefixOpReg|NoSuf, { Unspecified|Bas - - vcvtne2ps2bf16, 0xf272, AVX512_BF16, Modrm|Space0F38|VexVVVV|Masking|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Dword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } - --vcvtneps2bf16, 0xf372, AVX512_BF16|, Modrm|Space0F38||Masking|VexW0|Broadcast|NoSuf, { |Dword, } -+vcvtneps2bf16, 0xf372, AVX512_BF16&, Modrm|Space0F38||Masking|VexW0|Broadcast|NoSuf, { |Dword, } - - vdpbf16ps, 0xf352, AVX512_BF16, Modrm|Space0F38|VexVVVV|Masking|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf, { RegXMM|RegYMM|RegZMM|Dword|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM, RegXMM|RegYMM|RegZMM } - -@@ -3063,7 +3124,9 @@ vcvtneps2bf16, 0xf372, AVX_NE_CONVERT, Modrm||Space0F38|VexW0|NoSu - // ENQCMD instructions. - - enqcmd, 0xf20f38f8, ENQCMD, Modrm|AddrPrefixOpReg|NoSuf, { Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+enqcmd, 0xf2f8, APX_F(ENQCMD), Modrm|AddrPrefixOpReg|NoSuf|EVexMap4, { Unspecified|BaseIndex, Reg32|Reg64 } - enqcmds, 0xf30f38f8, ENQCMD, Modrm|AddrPrefixOpReg|NoSuf, { Unspecified|BaseIndex, Reg16|Reg32|Reg64 } -+enqcmds, 0xf3f8, APX_F(ENQCMD), Modrm|AddrPrefixOpReg|NoSuf|EVexMap4, { Unspecified|BaseIndex, Reg32|Reg64 } - - // ENQCMD instructions end. - -@@ -3081,25 +3144,25 @@ mcommit, 0xf30f01fa, MCOMMIT, NoSuf, {} - - // SNP instructions - --psmash, 0xf30f01ff, SNP|x64, NoSuf, {} --psmash, 0xf30f01ff, SNP|x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword } -+psmash, 0xf30f01ff, SNP&x64, NoSuf, {} -+psmash, 0xf30f01ff, SNP&x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword } - pvalidate, 0xf20f01ff, SNP, NoSuf, {} - pvalidate, 0xf20f01ff, SNP, AddrPrefixOpReg|NoSuf, { Acc|Word|Dword|Qword, RegC|Dword, RegD|Dword } --rmpupdate, 0xf20f01fe, SNP|x64, NoSuf, {} --rmpupdate, 0xf20f01fe, SNP|x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword } --rmpadjust, 0xf30f01fe, SNP|x64, NoSuf, {} --rmpadjust, 0xf30f01fe, SNP|x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword, RegD|Qword } -+rmpupdate, 0xf20f01fe, SNP&x64, NoSuf, {} -+rmpupdate, 0xf20f01fe, SNP&x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword } -+rmpadjust, 0xf30f01fe, SNP&x64, NoSuf, {} -+rmpadjust, 0xf30f01fe, SNP&x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword, RegD|Qword } - // The single-operand forms exist only for compatibility with older gas. - pvalidate, 0xf20f01ff, SNP, AddrPrefixOpReg|NoSuf, { Acc|Word|Dword|Qword } --rmpupdate, 0xf20f01fe, SNP|x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword } --rmpadjust, 0xf30f01fe, SNP|x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword } -+rmpupdate, 0xf20f01fe, SNP&x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword } -+rmpadjust, 0xf30f01fe, SNP&x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword } - - // SNP instructions end - - // RMPQUERY instruction - --rmpquery, 0xf30f01fd, RMPQUERY|x64, NoSuf, {} --rmpquery, 0xf30f01fd, RMPQUERY|x64, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword, RegD|Qword } -+rmpquery, 0xf30f01fd, RMPQUERY, NoSuf, {} -+rmpquery, 0xf30f01fd, RMPQUERY, AddrPrefixOpReg|NoSuf, { Acc|Dword|Qword, RegC|Qword, RegD|Qword } - - // RMPQUERY instruction end - -@@ -3124,26 +3187,26 @@ xresldtrk, 0xf20f01e9, TSXLDTRK, NoSuf, {} - - // AMX instructions. - --ldtilecfg, 0x49/0, AMX_TILE|x64, Modrm|Vex128|Space0F38|VexW0|NoSuf, { Unspecified|BaseIndex } --sttilecfg, 0x6649/0, AMX_TILE|x64, Modrm|Vex128|Space0F38|VexW0|NoSuf, { Unspecified|BaseIndex } -+ldtilecfg, 0x49/0, APX_F(AMX_TILE), Modrm|Vex128|EVex128|Space0F38|VexW0|NoSuf, { Unspecified|BaseIndex } -+sttilecfg, 0x6649/0, APX_F(AMX_TILE), Modrm|Vex128|EVex128|Space0F38|VexW0|NoSuf, { Unspecified|BaseIndex } - --tcmmimfp16ps, 0x666c, AMX_COMPLEX|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } --tcmmrlfp16ps, 0x6c, AMX_COMPLEX|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } -+tcmmimfp16ps, 0x666c, AMX_COMPLEX, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } -+tcmmrlfp16ps, 0x6c, AMX_COMPLEX, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } - --tdpbf16ps, 0xf35c, AMX_BF16|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } --tdpfp16ps, 0xf25c, AMX_FP16|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } --tdpbssd, 0xf25e, AMX_INT8|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } --tdpbuud, 0x5e, AMX_INT8|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } --tdpbusd, 0x665e, AMX_INT8|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } --tdpbsud, 0xf35e, AMX_INT8|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } -+tdpbf16ps, 0xf35c, AMX_BF16, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } -+tdpfp16ps, 0xf25c, AMX_FP16, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } -+tdpbssd, 0xf25e, AMX_INT8, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } -+tdpbuud, 0x5e, AMX_INT8, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } -+tdpbusd, 0x665e, AMX_INT8, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } -+tdpbsud, 0xf35e, AMX_INT8, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM } - --tileloadd, 0xf24b, AMX_TILE|x64, Sibmem|Vex128|Space0F38|VexW0|NoSuf, { Unspecified|BaseIndex, RegTMM } --tileloaddt1, 0x664b, AMX_TILE|x64, Sibmem|Vex128|Space0F38|VexW0|NoSuf, { Unspecified|BaseIndex, RegTMM } --tilestored, 0xf34b, AMX_TILE|x64, Sibmem|Vex128|Space0F38|VexW0|NoSuf, { RegTMM, Unspecified|BaseIndex } -+tileloadd, 0xf24b, APX_F(AMX_TILE), Sibmem|Vex128|EVex128|Space0F38|VexW0|NoSuf, { Unspecified|BaseIndex, RegTMM } -+tileloaddt1, 0x664b, APX_F(AMX_TILE), Sibmem|Vex128|EVex128|Space0F38|VexW0|NoSuf, { Unspecified|BaseIndex, RegTMM } -+tilestored, 0xf34b, APX_F(AMX_TILE), Sibmem|Vex128|EVex128|Space0F38|VexW0|NoSuf, { RegTMM, Unspecified|BaseIndex } - --tilerelease, 0x49c0, AMX_TILE|x64, Vex128|Space0F38|VexW0|NoSuf, {} -+tilerelease, 0x49c0, AMX_TILE, Vex128|Space0F38|VexW0|NoSuf, {} - --tilezero, 0xf249, AMX_TILE|x64, Modrm|Vex128|Space0F38|VexW0|NoSuf, { RegTMM } -+tilezero, 0xf249, AMX_TILE, Modrm|Vex128|Space0F38|VexW0|NoSuf, { RegTMM } - - // AMX instructions end. - -@@ -3166,19 +3229,19 @@ aesdecwide256kl, 0xf30f38d8/3, WideKL, Modrm|NoSuf, { Unspecified|BaseIndex } - // TDX instructions. - - tdcall, 0x660f01cc, TDX, NoSuf, {} --seamret, 0x660f01cd, TDX|x64, NoSuf, {} --seamops, 0x660f01ce, TDX|x64, NoSuf, {} --seamcall, 0x660f01cf, TDX|x64, NoSuf, {} -+seamret, 0x660f01cd, TDX&x64, NoSuf, {} -+seamops, 0x660f01ce, TDX&x64, NoSuf, {} -+seamcall, 0x660f01cf, TDX&x64, NoSuf, {} - - // TDX instructions end. - - // UINTR instructions. - --uiret, 0xf30f01ec, UINTR|x64, NoSuf, {} --clui, 0xf30f01ee, UINTR|x64, NoSuf, {} --stui, 0xf30f01ef, UINTR|x64, NoSuf, {} --testui, 0xf30f01ed, UINTR|x64, NoSuf, {} --senduipi, 0xf30fc7/6, UINTR|x64, Modrm|NoSuf|NoRex64, { Reg64 } -+uiret, 0xf30f01ec, UINTR, NoSuf, {} -+clui, 0xf30f01ee, UINTR, NoSuf, {} -+stui, 0xf30f01ef, UINTR, NoSuf, {} -+testui, 0xf30f01ed, UINTR, NoSuf, {} -+senduipi, 0xf30fc7/6, UINTR, Modrm|NoSuf|NoRex64, { Reg64 } - - // UINTR instructions end. - -@@ -3208,37 +3271,37 @@ vcmpph, 0xc2, AVX512_FP16, Modrm|Masking|Space0F3A|VexVVVV|VexW0|Broadcast|Disp8 - vcmpsh, 0xf3c2/0x, AVX512_FP16, Modrm|EVexLIG|Masking|Space0F3A|VexVVVV|VexW0|Disp8MemShift=1|NoSuf|ImmExt|SAE, { RegXMM|Word|Unspecified|BaseIndex, RegXMM, RegMask } - vcmpsh, 0xf3c2, AVX512_FP16, Modrm|EVexLIG|Masking|Space0F3A|VexVVVV|VexW0|Disp8MemShift=1|NoSuf|SAE, { Imm8, RegXMM|Word|Unspecified|BaseIndex, RegXMM, RegMask } - --vcvtdq2ph, 0x5b, AVX512_FP16|, Modrm||Masking|EVexMap5|VexW0|Broadcast|NoSuf|, { |Dword, } --vcvtudq2ph, 0xf27a, AVX512_FP16|, Modrm||Masking|EVexMap5|VexW0|Broadcast|NoSuf|, { |Dword, } -+vcvtdq2ph, 0x5b, AVX512_FP16&, Modrm||Masking|EVexMap5|VexW0|Broadcast|NoSuf|, { |Dword, } -+vcvtudq2ph, 0xf27a, AVX512_FP16&, Modrm||Masking|EVexMap5|VexW0|Broadcast|NoSuf|, { |Dword, } - --vcvtqq2ph, 0x5b, AVX512_FP16|, Modrm||Masking|EVexMap5|VexW1|Broadcast|NoSuf||, { |Qword, RegXMM } --vcvtuqq2ph, 0xf27a, AVX512_FP16|, Modrm||Masking|EVexMap5|VexW1|Broadcast|NoSuf||, { |Qword, RegXMM } -+vcvtqq2ph, 0x5b, AVX512_FP16&, Modrm||Masking|EVexMap5|VexW1|Broadcast|NoSuf||, { |Qword, RegXMM } -+vcvtuqq2ph, 0xf27a, AVX512_FP16&, Modrm||Masking|EVexMap5|VexW1|Broadcast|NoSuf||, { |Qword, RegXMM } - --vcvtpd2ph, 0x665a, AVX512_FP16|, Modrm||Masking|EVexMap5|VexW1|Broadcast|NoSuf||, { |Qword, RegXMM } -+vcvtpd2ph, 0x665a, AVX512_FP16&, Modrm||Masking|EVexMap5|VexW1|Broadcast|NoSuf||, { |Qword, RegXMM } - --vcvtps2phx, 0x661d, AVX512_FP16|, Modrm||Masking|EVexMap5|VexW0|Broadcast|NoSuf|, { |Dword, } -+vcvtps2phx, 0x661d, AVX512_FP16&, Modrm||Masking|EVexMap5|VexW0|Broadcast|NoSuf|, { |Dword, } - - vcvtw2ph, 0xf37d, AVX512_FP16, Modrm|Masking|EVexMap5|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|StaticRounding|SAE, { RegXMM|RegYMM|RegZMM|Word|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } - vcvtuw2ph, 0xf27d, AVX512_FP16, Modrm|Masking|EVexMap5|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|StaticRounding|SAE, { RegXMM|RegYMM|RegZMM|Word|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } - --vcvtph2dq, 0x665b, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } --vcvtph2dq, 0x665b, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } -+vcvtph2dq, 0x665b, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } -+vcvtph2dq, 0x665b, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } - vcvtph2dq, 0x665b, AVX512_FP16, Modrm|EVex512|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=5|NoSuf|StaticRounding|SAE, { RegYMM|Word|Unspecified|BaseIndex, RegZMM } - --vcvtph2udq, 0x79, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } --vcvtph2udq, 0x79, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } -+vcvtph2udq, 0x79, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } -+vcvtph2udq, 0x79, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } - vcvtph2udq, 0x79, AVX512_FP16, Modrm|EVex512|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=5|NoSuf|StaticRounding|SAE, { RegYMM|Word|Unspecified|BaseIndex, RegZMM } - --vcvtph2qq, 0x667b, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } --vcvtph2qq, 0x667b, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } -+vcvtph2qq, 0x667b, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } -+vcvtph2qq, 0x667b, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } - vcvtph2qq, 0x667b, AVX512_FP16, Modrm|EVex512|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf|StaticRounding|SAE, { RegXMM|Word|Unspecified|BaseIndex, RegZMM } - --vcvtph2uqq, 0x6679, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } --vcvtph2uqq, 0x6679, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } -+vcvtph2uqq, 0x6679, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } -+vcvtph2uqq, 0x6679, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } - vcvtph2uqq, 0x6679, AVX512_FP16, Modrm|EVex512|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf|StaticRounding|SAE, { RegXMM|Word|Unspecified|BaseIndex, RegZMM } - --vcvtph2pd, 0x5a, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } --vcvtph2pd, 0x5a, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } -+vcvtph2pd, 0x5a, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } -+vcvtph2pd, 0x5a, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } - vcvtph2pd, 0x5a, AVX512_FP16, Modrm|EVex512|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf|SAE, { RegXMM|Word|Unspecified|BaseIndex, RegZMM } - - vcvtph2w, 0x667d, AVX512_FP16, Modrm|Masking|EVexMap5|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|StaticRounding|SAE, { RegXMM|RegYMM|RegZMM|Word|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } -@@ -3258,24 +3321,24 @@ vcvtsh2ss, 0x13, AVX512_FP16, Modrm|EVexLIG|Masking|EVexMap6|VexVVVV|VexW0|Disp8 - - vcvtsh2si, 0xf32d, AVX512_FP16, Modrm|EVexLIG|EVexMap5|Disp8MemShift=1|NoSuf|StaticRounding|SAE, { RegXMM|Word|Unspecified|BaseIndex, Reg32|Reg64 } - --vcvttph2dq, 0xf35b, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } --vcvttph2dq, 0xf35b, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } -+vcvttph2dq, 0xf35b, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } -+vcvttph2dq, 0xf35b, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } - vcvttph2dq, 0xf35b, AVX512_FP16, Modrm|EVex512|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=5|NoSuf|SAE, { RegYMM|Word|Unspecified|BaseIndex, RegZMM } - --vcvttph2udq, 0x78, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } --vcvttph2udq, 0x78, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } -+vcvttph2udq, 0x78, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } -+vcvttph2udq, 0x78, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } - vcvttph2udq, 0x78, AVX512_FP16, Modrm|EVex512|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=5|NoSuf|SAE, { RegYMM|Word|Unspecified|BaseIndex, RegZMM } - --vcvttph2qq, 0x667a, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } --vcvttph2qq, 0x667a, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } -+vcvttph2qq, 0x667a, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } -+vcvttph2qq, 0x667a, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } - vcvttph2qq, 0x667a, AVX512_FP16, Modrm|EVex512|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf|SAE, { RegXMM|Word|Unspecified|BaseIndex, RegZMM } - --vcvttph2uqq, 0x6678, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } --vcvttph2uqq, 0x6678, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } -+vcvttph2uqq, 0x6678, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=2|NoSuf, { RegXMM|Word|Dword|Unspecified|BaseIndex, RegXMM } -+vcvttph2uqq, 0x6678, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegYMM } - vcvttph2uqq, 0x6678, AVX512_FP16, Modrm|EVex512|Masking|EVexMap5|VexW0|Broadcast|Disp8MemShift=4|NoSuf|SAE, { RegXMM|Word|Unspecified|BaseIndex, RegZMM } - --vcvtph2psx, 0x6613, AVX512_FP16|AVX512VL, Modrm|EVex128|Masking|EVexMap6|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } --vcvtph2psx, 0x6613, AVX512_FP16|AVX512VL, Modrm|EVex256|Masking|EVexMap6|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } -+vcvtph2psx, 0x6613, AVX512_FP16&AVX512VL, Modrm|EVex128|Masking|EVexMap6|VexW0|Broadcast|Disp8MemShift=3|NoSuf, { RegXMM|Word|Qword|Unspecified|BaseIndex, RegXMM } -+vcvtph2psx, 0x6613, AVX512_FP16&AVX512VL, Modrm|EVex256|Masking|EVexMap6|VexW0|Broadcast|Disp8MemShift=4|NoSuf, { RegXMM|Word|Unspecified|BaseIndex, RegYMM } - vcvtph2psx, 0x6613, AVX512_FP16, Modrm|EVex512|Masking|EVexMap6|VexW0|Broadcast|Disp8MemShift=5|NoSuf|SAE, { RegYMM|Word|Unspecified|BaseIndex, RegZMM } - - vcvttph2w, 0x667c, AVX512_FP16, Modrm|Masking|EVexMap5|VexW0|Broadcast|Disp8ShiftVL|CheckOperandSize|NoSuf|SAE, { RegXMM|RegYMM|RegZMM|Word|Unspecified|BaseIndex, RegXMM|RegYMM|RegZMM } -@@ -3283,7 +3346,7 @@ vcvttph2uw, 0x7c, AVX512_FP16, Modrm|Masking|EVexMap5|VexW0|Broadcast|Disp8Shift - - vcvttsh2si, 0xf32c, AVX512_FP16, Modrm|EVexLIG|EVexMap5|Disp8MemShift=1|NoSuf|SAE, { RegXMM|Word|Unspecified|BaseIndex, Reg32|Reg64 } - --vfpclassph, 0x66, AVX512_FP16|, Modrm||Masking|Space0F3A|VexW0|Broadcast|NoSuf|, { Imm8|Imm8S, |Word, RegMask } -+vfpclassph, 0x66, AVX512_FP16&, Modrm||Masking|Space0F3A|VexW0|Broadcast|NoSuf|, { Imm8|Imm8S, |Word, RegMask } - - vmovw, 0x666e, AVX512_FP16, D|Modrm|EVex128|VexWIG|EVexMap5|Disp8MemShift=1|NoSuf, { Word|Unspecified|BaseIndex, RegXMM } - vmovw, 0x667e, AVX512_FP16, D|RegMem|EVex128|VexWIG|EVexMap5|NoSuf, { RegXMM, Reg32 } -@@ -3300,14 +3363,14 @@ vrsqrtsh, 0x664f, AVX512_FP16, Modrm|EVexLIG|Masking|EVexMap6|VexVVVV|VexW0|Disp - - // PREFETCHI instructions. - --prefetchit0, 0xf18/7, PREFETCHI|x64, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex } --prefetchit1, 0xf18/6, PREFETCHI|x64, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex } -+prefetchit0, 0xf18/7, PREFETCHI, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex } -+prefetchit1, 0xf18/6, PREFETCHI, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex } - - // PREFETCHI instructions end. - - // CMPCCXADD instructions. - --cmpxadd, 0x66e, CMPCCXADD|x64, Modrm|Vex|Space0F38|VexVVVV|SwapSources|CheckOperandSize|NoSuf, { Reg32|Reg64, Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } -+cmpxadd, 0x66e, APX_F(CMPCCXADD), Modrm|Vex|EVex128|Space0F38|VexVVVV|SwapSources|CheckOperandSize|NoSuf, { Reg32|Reg64, Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } - - // CMPCCXADD instructions end. - -@@ -3319,30 +3382,52 @@ wrmsrns, 0x0f01c6, WRMSRNS, NoSuf, {} - - // MSRLIST instructions. - --rdmsrlist, 0xf20f01c6, MSRLIST|x64, NoSuf, {} --wrmsrlist, 0xf30f01c6, MSRLIST|x64, NoSuf, {} -+rdmsrlist, 0xf20f01c6, MSRLIST, NoSuf, {} -+wrmsrlist, 0xf30f01c6, MSRLIST, NoSuf, {} - - // MSRLIST instructions end. - - // RAO-INT instructions. - --aadd, 0xf38fc, RAO_INT, Modrm|IgnoreSize|CheckOperandSize|NoSuf, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } --aand, 0x660f38fc, RAO_INT, Modrm|IgnoreSize|CheckOperandSize|NoSuf, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } --aor, 0xf20f38fc, RAO_INT, Modrm|IgnoreSize|CheckOperandSize|NoSuf, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } --axor, 0xf30f38fc, RAO_INT, Modrm|IgnoreSize|CheckOperandSize|NoSuf, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } -+ -+a, 0x0f38fc, RAO_INT, Modrm|IgnoreSize|CheckOperandSize|NoSuf, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } -+a, 0xfc, RAO_INT&APX_F, Modrm|CheckOperandSize|NoSuf|EVexMap4, { Reg32|Reg64, Dword|Qword|Unspecified|BaseIndex } -+ - - // RAO-INT instructions end. - - // LKGS instruction. - --lkgs, 0xf20f00/6, LKGS|x64, Modrm|IgnoreSize|No_bSuf|No_sSuf|NoRex64, { Reg16|Reg32|Reg64 } --lkgs, 0xf20f00/6, LKGS|x64, Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { Word|Unspecified|BaseIndex } -+lkgs, 0xf20f00/6, LKGS, Modrm|IgnoreSize|No_bSuf|No_sSuf|NoRex64, { Reg16|Reg32|Reg64 } -+lkgs, 0xf20f00/6, LKGS, Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf, { Word|Unspecified|BaseIndex } - - // LKGS instruction end. - - // FRED instructions. - --erets, 0xf20f01ca, FRED|x64, NoSuf, {} --eretu, 0xf30f01ca, FRED|x64, NoSuf, {} -+erets, 0xf20f01ca, FRED, NoSuf, {} -+eretu, 0xf30f01ca, FRED, NoSuf, {} - - // FRED instructions end. -+ -+// USER_MSR instructions. -+ -+urdmsr, 0xf20f38f8, USER_MSR, RegMem|NoSuf|NoRex64, { Reg64, Reg64 } -+urdmsr, 0xf2f8, USER_MSR&APX_F, RegMem|EVexMap4|VexW0|NoSuf, { Reg64, Reg64 } -+urdmsr, 0xf2f8/0, APX_F(USER_MSR), Modrm|Vex128|VexMap7|EVex128|VexW0|NoSuf, { Imm32, Reg64 } -+uwrmsr, 0xf30f38f8, USER_MSR, Modrm|NoSuf|NoRex64, { Reg64, Reg64 } -+uwrmsr, 0xf3f8, USER_MSR&APX_F, Modrm|EVexMap4|VexW0|NoSuf, { Reg64, Reg64 } -+// Immediates want to be first; md_assemble() takes care of swapping operands -+// accordingly. -+uwrmsr, 0xf3f8/0, APX_F(USER_MSR), Modrm|Vex128|VexMap7|EVex128|VexW0|NoSuf, { Imm32, Reg64 } -+ -+// USER_MSR instructions end. -+ -+// APX Push2/Pop2 instructions. -+ -+push2, 0xff/6, APX_F, Modrm|VexW0|EVexMap4|VexVVVV|ImplicitStackOp|No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Reg64, Reg64 } -+push2p, 0xff/6, APX_F, Modrm|VexW1|EVexMap4|VexVVVV|ImplicitStackOp|No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Reg64, Reg64 } -+pop2, 0x8f/0, APX_F, Modrm|VexW0|EVexMap4|VexVVVV|ImplicitStackOp|No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Reg64, Reg64 } -+pop2p, 0x8f/0, APX_F, Modrm|VexW1|EVexMap4|VexVVVV|ImplicitStackOp|No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Reg64, Reg64 } -+ -+// APX Push2/Pop2 instructions end. diff --git a/gdb-rhel2295897-pre-read-DWZ-file-in-DWARF-reader.patch b/gdb-rhel2295897-pre-read-DWZ-file-in-DWARF-reader.patch deleted file mode 100644 index 9a3feb5..0000000 --- a/gdb-rhel2295897-pre-read-DWZ-file-in-DWARF-reader.patch +++ /dev/null @@ -1,149 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Tom Tromey -Date: Mon, 23 Oct 2023 16:44:53 -0600 -Subject: gdb-rhel2295897-pre-read-DWZ-file-in-DWARF-reader.patch - -;; backport of upstream commit 91874afabcd -;; This (somehow) solves a double-free when reading minimal symbols - -Pre-read DWZ file in DWARF reader - -While working on background reading of DWARF, I came across the -DWZ-reading code. This code can query the user (via the debuginfod -support) -- something that cannot be done off the main thread. - -Looking into it, I realized that this code can be run much earlier, -avoiding this problem. Digging a bit deeper, I also found a -discrepancy here between how the DWARF reader works in "readnow" mode -as compared to the normal modes. - -This patch cleans this up by trying to read the DWZ file earlier, and -also by having the DWARF reader convert any exception here into a -warning. This unifies the various cases, but also makes it so that -errors do not prevent gdb from continuing on to the extent possible. - -Regression tested on x86-64 Fedora 38. - -diff --git a/gdb/dwarf2/dwz.c b/gdb/dwarf2/dwz.c ---- a/gdb/dwarf2/dwz.c -+++ b/gdb/dwarf2/dwz.c -@@ -29,6 +29,7 @@ - #include "gdbcore.h" - #include "gdbsupport/pathstuff.h" - #include "gdbsupport/scoped_fd.h" -+#include "run-on-main-thread.h" - - const char * - dwz_file::read_string (struct objfile *objfile, LONGEST str_offset) -@@ -196,8 +197,20 @@ dwarf2_get_dwz_file (dwarf2_per_bfd *per_bfd, bool require) - size_t buildid_len; - bfd_byte *buildid; - -- if (per_bfd->dwz_file != NULL) -- return per_bfd->dwz_file.get (); -+ if (per_bfd->dwz_file.has_value ()) -+ { -+ dwz_file *result = per_bfd->dwz_file->get (); -+ if (require && result == nullptr) -+ error (_("could not read '.gnu_debugaltlink' section")); -+ return result; -+ } -+ -+ /* This may query the user via the debuginfod support, so it may -+ only be run in the main thread. */ -+ gdb_assert (is_main_thread ()); -+ -+ /* Set this early, so that on error it remains NULL. */ -+ per_bfd->dwz_file.emplace (nullptr); - - bfd_set_error (bfd_error_no_error); - gdb::unique_xmalloc_ptr data -@@ -283,5 +296,5 @@ dwarf2_get_dwz_file (dwarf2_per_bfd *per_bfd, bool require) - - gdb_bfd_record_inclusion (per_bfd->obfd, result->dwz_bfd.get ()); - per_bfd->dwz_file = std::move (result); -- return per_bfd->dwz_file.get (); -+ return per_bfd->dwz_file->get (); - } -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -3387,6 +3387,17 @@ dwarf2_initialize_objfile (struct objfile *objfile) - - dwarf_read_debug_printf ("called"); - -+ /* Try to fetch any potential dwz file early, while still on the -+ main thread. */ -+ try -+ { -+ dwarf2_get_dwz_file (per_bfd); -+ } -+ catch (const gdb_exception_error &err) -+ { -+ warning (_("%s"), err.what ()); -+ } -+ - /* If we're about to read full symbols, don't bother with the - indices. In this case we also don't care if some other debug - format is making psymtabs, because they are all about to be -@@ -5294,16 +5305,7 @@ create_all_units (dwarf2_per_objfile *per_objfile) - &per_objfile->per_bfd->abbrev, 0, - types_htab, rcuh_kind::TYPE); - -- dwz_file *dwz; -- try -- { -- dwz = dwarf2_get_dwz_file (per_objfile->per_bfd); -- } -- catch (const gdb_exception_error &) -- { -- per_objfile->per_bfd->all_units.clear (); -- throw; -- } -+ dwz_file *dwz = dwarf2_get_dwz_file (per_objfile->per_bfd); - if (dwz != NULL) - { - /* Pre-read the sections we'll need to construct an index. */ -diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h ---- a/gdb/dwarf2/read.h -+++ b/gdb/dwarf2/read.h -@@ -520,7 +520,7 @@ struct dwarf2_per_bfd - - /* The shared '.dwz' file, if one exists. This is used when the - original data was compressed using 'dwz -m'. */ -- std::unique_ptr dwz_file; -+ gdb::optional> dwz_file; - - /* Whether copy relocations are supported by this object format. */ - bool can_copy; -diff --git a/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp b/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp ---- a/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp -+++ b/gdb/testsuite/gdb.dwarf2/dwzbuildid.exp -@@ -142,13 +142,6 @@ proc do_test {} { - - gdb_load ${::binfile}-${::testname} - -- if { $::testname == "mismatch" && [readnow] } { -- # Main is found in the minimal symbols. When using readnow, a -- # failure to read the dwarf also causes the minimal symbols to be -- # unavailable. -- # Setup a kfail for "FAIL: gdb_breakpoint: set breakpoint at main". -- setup_kfail "symtab/26797" *-*-* -- } - if {![runto_main]} { - return - } -diff --git a/gdb/testsuite/gdb.dwarf2/no-gnu-debuglink.exp b/gdb/testsuite/gdb.dwarf2/no-gnu-debuglink.exp ---- a/gdb/testsuite/gdb.dwarf2/no-gnu-debuglink.exp -+++ b/gdb/testsuite/gdb.dwarf2/no-gnu-debuglink.exp -@@ -37,8 +37,8 @@ if { [build_executable $testfile.exp $testfile [list $srcfile $asm_file]] } { - - clean_restart - --set msg "\r\ncould not find '\.gnu_debugaltlink' file for \[^\r\n\]*" -+set msg "\r\nwarning: could not find '\.gnu_debugaltlink' file for \[^\r\n\]*" - gdb_test "file $binfile" "$msg" "file command" - - set question "Load new symbol table from .*\? .y or n. " --gdb_test "file $binfile" "$msg" "file command, again" $question "y" -+gdb_test "file $binfile" "" "file command, again" $question "y" diff --git a/gdb-s390-add-arch14-record-replay-support.patch b/gdb-s390-add-arch14-record-replay-support.patch deleted file mode 100644 index 185e315..0000000 --- a/gdb-s390-add-arch14-record-replay-support.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 6cfb7bf81be3ab6f131dbc6a27eefca516cf7517 Mon Sep 17 00:00:00 2001 -From: Andreas Arnez -Date: Tue, 13 Feb 2024 18:55:29 +0100 -Subject: [PATCH 2/2] gdb: s390: Add arch14 record/replay support - -Enable recording of the new "arch14" instructions on z/Architecture -targets, except for the specialized-function-assist instruction NNPA. ---- - gdb/s390-tdep.c | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c -index 54b5c89e5e3..dcac407caef 100644 ---- a/gdb/s390-tdep.c -+++ b/gdb/s390-tdep.c -@@ -5534,6 +5534,14 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, - case 0xe635: /* VLRL - vector load rightmost with immed. length */ - case 0xe637: /* VLRLR - vector load rightmost with length */ - case 0xe649: /* VLIP - vector load immediate decimal */ -+ case 0xe656: /* VCLFNH - vector fp convert and lengthen from NNP high */ -+ case 0xe65e: /* VCLFNL - vector fp convert and lengthen from NNP low */ -+ case 0xe655: /* VCNF - vector fp convert to NNP */ -+ case 0xe65d: /* VCFN - vector fp convert from NNP */ -+ case 0xe674: /* VSCHP - decimal scale and convert to HFP */ -+ case 0xe675: /* VCRNF - vector fp convert and round to NNP */ -+ case 0xe67c: /* VSCSHP - decimal scale and convert and split to HFP */ -+ case 0xe67d: /* VCSPH - vector convert HFP to scaled decimal */ - case 0xe700: /* VLEB - vector load element */ - case 0xe701: /* VLEH - vector load element */ - case 0xe702: /* VLEG - vector load element */ -@@ -5791,11 +5799,16 @@ s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache, - - /* 0xe747-0xe749 undefined */ - -+ case 0xe651: /* VCLZDP - vector count leading zero digits */ -+ case 0xe654: /* VUPKZH - vector unpack zoned high */ - case 0xe658: /* VCVD - vector convert to decimal 32 bit */ - case 0xe659: /* VSRP - vector shift and round decimal */ - case 0xe65a: /* VCVDG - vector convert to decimal 64 bit*/ - case 0xe65b: /* VPSOP - vector perform sign operation decimal */ -+ case 0xe65c: /* VUPKZL - vector unpack zoned low */ -+ case 0xe670: /* VPKZR - vector pack zoned register */ - case 0xe671: /* VAP - vector add decimal */ -+ case 0xe672: /* VSRPR - vector shift and round decimal register */ - case 0xe673: /* VSP - vector subtract decimal */ - case 0xe678: /* VMP - vector multiply decimal */ - case 0xe679: /* VMSP - vector multiply decimal */ --- -2.35.3 - diff --git a/gdb-symtab-add-producer_is_gas.patch b/gdb-symtab-add-producer_is_gas.patch deleted file mode 100644 index 3ede8a8..0000000 --- a/gdb-symtab-add-producer_is_gas.patch +++ /dev/null @@ -1,125 +0,0 @@ -From aa8ba17b9a3fdfeeb65df4c3e0731a0e9e96cbf7 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Wed, 1 Nov 2023 00:33:12 +0100 -Subject: [PATCH 1/2] [gdb/symtab] Add producer_is_gas - -Add producer_is_gas, a generic way to get the gas version from the -producer string. - -Tested on x86_64-linux. ---- - gdb/dwarf2/read.c | 4 ++-- - gdb/producer.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++ - gdb/producer.h | 5 +++++ - 3 files changed, 63 insertions(+), 2 deletions(-) - -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c -index 970dd54c7a5..472684a5817 100644 ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -13376,8 +13376,8 @@ check_producer (struct dwarf2_cu *cu) - cu->producer_is_codewarrior = true; - else if (producer_is_clang (cu->producer, &major, &minor)) - cu->producer_is_clang = true; -- else if (startswith (cu->producer, "GNU AS 2.39.0")) -- cu->producer_is_gas_2_39 = true; -+ else if (producer_is_gas (cu->producer, &major, &minor)) -+ cu->producer_is_gas_2_39 = major == 2 && minor == 39; - else - { - /* For other non-GCC compilers, expect their behavior is DWARF version -diff --git a/gdb/producer.c b/gdb/producer.c -index 9fcf749e3d4..cd83dfce128 100644 ---- a/gdb/producer.c -+++ b/gdb/producer.c -@@ -81,6 +81,45 @@ producer_is_gcc (const char *producer, int *major, int *minor) - - /* See producer.h. */ - -+bool -+producer_is_gas (const char *producer, int *major, int *minor) -+{ -+ if (producer == nullptr) -+ { -+ /* No producer, don't know. */ -+ return false; -+ } -+ -+ /* Detect prefix. */ -+ const char prefix[] = "GNU AS "; -+ if (!startswith (producer, prefix)) -+ { -+ /* Producer is not gas. */ -+ return false; -+ } -+ -+ /* Skip prefix. */ -+ const char *cs = &producer[strlen (prefix)]; -+ -+ /* Ensure that major/minor are not nullptrs. */ -+ int maj, min; -+ if (major == nullptr) -+ major = &maj; -+ if (minor == nullptr) -+ minor = &min; -+ -+ int scanned = sscanf (cs, "%d.%d", major, minor); -+ if (scanned != 2) -+ { -+ /* Unable to scan major/minor version. */ -+ return false; -+ } -+ -+ return true; -+} -+ -+ /* See producer.h. */ -+ - bool - producer_is_icc_ge_19 (const char *producer) - { -@@ -251,6 +290,23 @@ Version 18.0 Beta"; - SELF_CHECK (!producer_is_gcc (flang_llvm_exp, &major, &minor)); - SELF_CHECK (producer_is_llvm (flang_llvm_exp)); - } -+ -+ { -+ static const char gas_exp[] = "GNU AS 2.39.0"; -+ int major = 0, minor = 0; -+ SELF_CHECK (!producer_is_gcc (gas_exp, &major, &minor)); -+ SELF_CHECK (producer_is_gas (gas_exp, &major, &minor)); -+ SELF_CHECK (major == 2 && minor == 39); -+ -+ static const char gas_incomplete_exp[] = "GNU AS "; -+ SELF_CHECK (!producer_is_gas (gas_incomplete_exp, &major, &minor)); -+ SELF_CHECK (!producer_is_gcc (gas_incomplete_exp, &major, &minor)); -+ -+ static const char gas_incomplete_exp_2[] = "GNU AS 2"; -+ SELF_CHECK (!producer_is_gas (gas_incomplete_exp_2, &major, &minor)); -+ SELF_CHECK (!producer_is_gcc (gas_incomplete_exp_2, &major, &minor)); -+ } -+ - } - } - } -diff --git a/gdb/producer.h b/gdb/producer.h -index c915979b122..00718511775 100644 ---- a/gdb/producer.h -+++ b/gdb/producer.h -@@ -30,6 +30,11 @@ extern int producer_is_gcc_ge_4 (const char *producer); - is NULL or it isn't GCC. */ - extern int producer_is_gcc (const char *producer, int *major, int *minor); - -+/* Returns nonzero if the given PRODUCER string is GAS and sets the MAJOR -+ and MINOR versions when not NULL. Returns zero if the given PRODUCER -+ is NULL or it isn't GAS. */ -+bool producer_is_gas (const char *producer, int *major, int *minor); -+ - /* Check for Intel compilers >= 19.0. */ - extern bool producer_is_icc_ge_19 (const char *producer); - - -base-commit: 39553c1e285c426946188ec2a890c1c1cb933060 --- -2.35.3 - diff --git a/gdb-symtab-don-t-defer-backward-refs-inter-cu-intra-.patch b/gdb-symtab-don-t-defer-backward-refs-inter-cu-intra-.patch deleted file mode 100644 index 5bf0f52..0000000 --- a/gdb-symtab-don-t-defer-backward-refs-inter-cu-intra-.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 0218e033b415df76be0a14871447bbd94dce62a3 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Sat, 16 Sep 2023 04:07:22 +0200 -Subject: [PATCH 10/13] [gdb/symtab] Don't defer backward refs, inter-cu - intra-shard case - -In patch "[gdb/symtab] Resolve deferred entries, inter-shard case" we've -solved the generic case of handling deferred entries. - -Add an optimization that doesn't defer inter-CU intra-shard dependencies that -are present in the shard's parent map. - -Tested on x86_64-linux. ---- - gdb/dwarf2/read.c | 29 ++++++++++++++++++++++++++++- - 1 file changed, 28 insertions(+), 1 deletion(-) - -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c -index a97f738a54e..e7904532434 100644 ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -4709,6 +4709,12 @@ class cooked_index_storage - m_index->set_parent_valid (start, end); - } - -+ /* Return true if find_parents can be relied upon. */ -+ bool parent_valid (CORE_ADDR addr) -+ { -+ return m_index->parent_valid (addr); -+ } -+ - private: - - /* Hash function for a cutu_reader. */ -@@ -4857,6 +4863,12 @@ class cooked_indexer - { - m_index_storage->set_parent_valid (start, end); - } -+ -+ /* Return true if find_parents can be relied upon. */ -+ bool parent_valid (CORE_ADDR addr) -+ { -+ return m_index_storage->parent_valid (addr); -+ } - }; - - /* Subroutine of dwarf2_build_psymtabs_hard to simplify it. -@@ -16482,7 +16494,22 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu, - else - { - /* Inter-CU case. */ -- *maybe_defer = addr; -+ if (parent_valid (addr)) -+ { -+ auto tmp = find_parent (addr); -+ if (tmp == &parent_map::deferred) -+ { -+ /* Defer because origin is deferred. */ -+ *maybe_defer = addr; -+ } -+ else -+ *parent_entry = tmp; -+ } -+ else -+ { -+ /* Defer because origin is in other shard. */ -+ *maybe_defer = addr; -+ } - } - } - --- -2.35.3 - diff --git a/gdb-symtab-factor-out-m_deferred_entries-usage.patch b/gdb-symtab-factor-out-m_deferred_entries-usage.patch deleted file mode 100644 index a3dfe4f..0000000 --- a/gdb-symtab-factor-out-m_deferred_entries-usage.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 8a444a93d4bd78355fc4e6ecb1935cc2b0a6a997 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Fri, 15 Sep 2023 08:38:00 +0200 -Subject: [PATCH 04/13] [gdb/symtab] Factor out m_deferred_entries usage - -Factor out usage of cooked_indexer::m_deferred_entries in new member -functions defer_entry, handle_deferred_entries and resolve_deferred_entry. - -Tested on x86_64-linux. ---- - gdb/dwarf2/read.c | 35 ++++++++++++++++++++++++++++------- - 1 file changed, 28 insertions(+), 7 deletions(-) - -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c -index d48f3010063..afdf9e870a8 100644 ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -4822,6 +4822,32 @@ class cooked_indexer - we'll know the containing context of all the DIEs that we might - have scanned. This vector stores these deferred entries. */ - std::vector m_deferred_entries; -+ -+ /* Defer creating a cooked_index_entry corresponding to deferred_entry DE. */ -+ void defer_entry (const deferred_entry &de) -+ { -+ m_deferred_entries.push_back (de); -+ } -+ -+ /* Create a cooked_index_entry corresponding to deferred_entry DE with -+ parent PARENT_ENTRY. */ -+ const cooked_index_entry *resolve_deferred_entry -+ (const deferred_entry &de, const cooked_index_entry *parent_entry) -+ { -+ return m_index_storage->add (de.die_offset, de.tag, de.flags, de.name, -+ parent_entry, m_per_cu); -+ } -+ -+ /* Create cooked_index_entries for the deferred entries. */ -+ void handle_deferred_entries () -+ { -+ for (const auto &entry : m_deferred_entries) -+ { -+ const cooked_index_entry *parent_entry -+ = find_parent (entry.spec_offset); -+ resolve_deferred_entry (entry, parent_entry); -+ } -+ } - }; - - /* Subroutine of dwarf2_build_psymtabs_hard to simplify it. -@@ -16611,7 +16637,7 @@ cooked_indexer::index_dies (cutu_reader *reader, - if (name != nullptr) - { - if (defer != 0) -- m_deferred_entries.push_back ({ -+ defer_entry ({ - this_die, name, defer, abbrev->tag, flags - }); - else -@@ -16716,12 +16742,7 @@ cooked_indexer::make_index (cutu_reader *reader) - return; - index_dies (reader, reader->info_ptr, nullptr, false); - -- for (const auto &entry : m_deferred_entries) -- { -- const cooked_index_entry *parent = find_parent (entry.spec_offset); -- m_index_storage->add (entry.die_offset, entry.tag, entry.flags, -- entry.name, parent, m_per_cu); -- } -+ handle_deferred_entries (); - } - - /* An implementation of quick_symbol_functions for the cooked DWARF --- -2.35.3 - diff --git a/gdb-symtab-factor-out-m_die_range_map-usage.patch b/gdb-symtab-factor-out-m_die_range_map-usage.patch deleted file mode 100644 index c827f0e..0000000 --- a/gdb-symtab-factor-out-m_die_range_map-usage.patch +++ /dev/null @@ -1,151 +0,0 @@ -From b2f260d117dc11b8e90d4e9bf7f4b2cbd63d1d49 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Tue, 22 Aug 2023 13:17:47 +0200 -Subject: [PATCH 02/13] [gdb/symtab] Factor out m_die_range_map usage - -Factor out usage of cooked_indexer::m_die_range_map into new class parent_map -with member functions find_parent and set_parent, and static member function -form_addr. - -Tested on x86_64-linux. ---- - gdb/dwarf2/cooked-index.h | 32 +++++++++++++++++++++++++++ - gdb/dwarf2/read.c | 46 ++++++++++++++++++++------------------- - 2 files changed, 56 insertions(+), 22 deletions(-) - -diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h -index 5aacb321c91..979541fbf60 100644 ---- a/gdb/dwarf2/cooked-index.h -+++ b/gdb/dwarf2/cooked-index.h -@@ -239,6 +239,38 @@ struct cooked_index_entry : public allocate_on_obstack - bool for_name) const; - }; - -+class parent_map -+{ -+public: -+ /* A helper function to turn a section offset into an address that -+ can be used in a parent_map. */ -+ static CORE_ADDR form_addr (sect_offset offset, bool is_dwz) -+ { -+ CORE_ADDR value = to_underlying (offset); -+ if (is_dwz) -+ value |= ((CORE_ADDR) 1) << (8 * sizeof (CORE_ADDR) - 1); -+ return value; -+ } -+ -+ /* Find the parent of DIE LOOKUP. */ -+ const cooked_index_entry *find_parent (CORE_ADDR lookup) const -+ { -+ const void *obj = m_parent_map.find (lookup); -+ return static_cast (obj); -+ } -+ -+ /* Set the parent of DIES in range [START, END] to PARENT_ENTRY. */ -+ void set_parent (CORE_ADDR start, CORE_ADDR end, -+ const cooked_index_entry *parent_entry) -+ { -+ m_parent_map.set_empty (start, end, (void *)parent_entry); -+ } -+ -+private: -+ /* An addrmap that maps from section offsets to cooked_index_entry *. */ -+ addrmap_mutable m_parent_map; -+}; -+ - class cooked_index; - - /* An index of interesting DIEs. This is "cooked", in contrast to a -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c -index 466d3e59878..d48f3010063 100644 ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -4722,16 +4722,6 @@ class cooked_indexer - - private: - -- /* A helper function to turn a section offset into an address that -- can be used in an addrmap. */ -- CORE_ADDR form_addr (sect_offset offset, bool is_dwz) -- { -- CORE_ADDR value = to_underlying (offset); -- if (is_dwz) -- value |= ((CORE_ADDR) 1) << (8 * sizeof (CORE_ADDR) - 1); -- return value; -- } -- - /* A helper function to scan the PC bounds of READER and record them - in the storage's addrmap. */ - void check_bounds (cutu_reader *reader); -@@ -4799,7 +4789,20 @@ class cooked_indexer - /* An addrmap that maps from section offsets (see the form_addr - method) to newly-created entries. See m_deferred_entries to - understand this. */ -- addrmap_mutable m_die_range_map; -+ parent_map m_die_range_map; -+ -+ /* Find the parent of DIE LOOKUP. */ -+ const cooked_index_entry *find_parent (CORE_ADDR lookup) const -+ { -+ return m_die_range_map.find_parent (lookup); -+ } -+ -+ /* Set the parent of DIES in range [START, END] to PARENT_ENTRY. */ -+ void set_parent (CORE_ADDR start, CORE_ADDR end, -+ const cooked_index_entry *parent_entry) -+ { -+ m_die_range_map.set_parent (start, end, parent_entry); -+ } - - /* A single deferred entry. */ - struct deferred_entry -@@ -16412,15 +16415,13 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu, - - if (*parent_entry == nullptr) - { -- CORE_ADDR addr = form_addr (origin_offset, origin_is_dwz); -+ CORE_ADDR addr -+ = parent_map::form_addr (origin_offset, origin_is_dwz); - if (new_reader->cu == reader->cu - && new_info_ptr > watermark_ptr) - *maybe_defer = addr; - else -- { -- void *obj = m_die_range_map.find (addr); -- *parent_entry = static_cast (obj); -- } -+ *parent_entry = find_parent (addr); - } - - unsigned int bytes_read; -@@ -16538,11 +16539,13 @@ cooked_indexer::recurse (cutu_reader *reader, - { - /* Both start and end are inclusive, so use both "+ 1" and "- 1" to - limit the range to the children of parent_entry. */ -- CORE_ADDR start = form_addr (parent_entry->die_offset + 1, -- reader->cu->per_cu->is_dwz); -- CORE_ADDR end = form_addr (sect_offset (info_ptr - 1 - reader->buffer), -+ CORE_ADDR start -+ = parent_map::form_addr (parent_entry->die_offset + 1, -+ reader->cu->per_cu->is_dwz); -+ CORE_ADDR end -+ = parent_map::form_addr (sect_offset (info_ptr - 1 - reader->buffer), - reader->cu->per_cu->is_dwz); -- m_die_range_map.set_empty (start, end, (void *) parent_entry); -+ set_parent (start, end, parent_entry); - } - - return info_ptr; -@@ -16715,8 +16718,7 @@ cooked_indexer::make_index (cutu_reader *reader) - - for (const auto &entry : m_deferred_entries) - { -- void *obj = m_die_range_map.find (entry.spec_offset); -- cooked_index_entry *parent = static_cast (obj); -+ const cooked_index_entry *parent = find_parent (entry.spec_offset); - m_index_storage->add (entry.die_offset, entry.tag, entry.flags, - entry.name, parent, m_per_cu); - } --- -2.35.3 - diff --git a/gdb-symtab-fix-dw_tag_inlined_subroutine-entries-in-.patch b/gdb-symtab-fix-dw_tag_inlined_subroutine-entries-in-.patch deleted file mode 100644 index 0f20941..0000000 --- a/gdb-symtab-fix-dw_tag_inlined_subroutine-entries-in-.patch +++ /dev/null @@ -1,112 +0,0 @@ -From c79ecacd3f75cfb0ec1a3afc49ca3f30b1759009 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Fri, 11 Aug 2023 01:36:50 +0200 -Subject: [PATCH 13/13] [gdb/symtab] Fix DW_TAG_inlined_subroutine entries in - the cooked index - -We get incorrect qualified names in the cooked index for -DW_TAG_inlined_subroutine DIEs with abstract origin, due to the fact that the -DIE parent is used instead of the abstract origin. - -Fix this by preferring the abstract origin parent, if available. - -Tested on x86_64-linux. - -PR symtab/30728 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30728 ---- - gdb/dwarf2/read.c | 67 ++++++++++++++++++++++------------------------- - 1 file changed, 32 insertions(+), 35 deletions(-) - -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c -index 93708ef11b9..a4f982962ae 100644 ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -16464,52 +16464,49 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu, - const gdb_byte *new_info_ptr = (new_reader->buffer - + to_underlying (origin_offset)); - -- if (*parent_entry == nullptr) -+ gdb_assert (reader->cu->per_cu->is_debug_types -+ == new_reader->cu->per_cu->is_debug_types); -+ CORE_ADDR addr -+ = parent_map::form_addr (origin_offset, origin_is_dwz, -+ reader->cu->per_cu->is_debug_types); -+ if (new_reader->cu == reader->cu) - { -- gdb_assert (reader->cu->per_cu->is_debug_types -- == new_reader->cu->per_cu->is_debug_types); -- CORE_ADDR addr -- = parent_map::form_addr (origin_offset, origin_is_dwz, -- reader->cu->per_cu->is_debug_types); -- if (new_reader->cu == reader->cu) -+ /* Intra-CU case. */ -+ if (new_info_ptr > watermark_ptr) - { -- /* Intra-CU case. */ -- if (new_info_ptr > watermark_ptr) -- { -- /* Defer because origin is not read yet. */ -- *maybe_defer = addr; -- } -- else -- { -- auto tmp = find_parent (addr); -- if (tmp == &parent_map::deferred) -- { -- /* Defer because origin is deferred. */ -- *maybe_defer = addr; -- } -- else -- *parent_entry = tmp; -- } -+ /* Defer because origin is not read yet. */ -+ *maybe_defer = addr; - } - else - { -- /* Inter-CU case. */ -- if (parent_valid (addr)) -+ auto tmp = find_parent (addr); -+ if (tmp == &parent_map::deferred) - { -- auto tmp = find_parent (addr); -- if (tmp == &parent_map::deferred) -- { -- /* Defer because origin is deferred. */ -- *maybe_defer = addr; -- } -- else -- *parent_entry = tmp; -+ /* Defer because origin is deferred. */ -+ *maybe_defer = addr; - } - else -+ *parent_entry = tmp; -+ } -+ } -+ else -+ { -+ /* Inter-CU case. */ -+ if (parent_valid (addr)) -+ { -+ auto tmp = find_parent (addr); -+ if (tmp == &parent_map::deferred) - { -- /* Defer because origin is in other shard. */ -+ /* Defer because origin is deferred. */ - *maybe_defer = addr; - } -+ else -+ *parent_entry = tmp; -+ } -+ else -+ { -+ /* Defer because origin is in other shard. */ -+ *maybe_defer = addr; - } - } - --- -2.35.3 - diff --git a/gdb-symtab-handle-nullptr-parent-in-parent_map-set_p.patch b/gdb-symtab-handle-nullptr-parent-in-parent_map-set_p.patch deleted file mode 100644 index 21f26df..0000000 --- a/gdb-symtab-handle-nullptr-parent-in-parent_map-set_p.patch +++ /dev/null @@ -1,37 +0,0 @@ -From bc970668f83cf142c4955d1cbeaa24e8bcc4b238 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Fri, 25 Aug 2023 09:30:54 +0200 -Subject: [PATCH 03/13] [gdb/symtab] Handle nullptr parent in - parent_map::set_parent - -Set_parent uses m_die_range_map.set_empty, which doesn't allow -parent_entry == nullptr. - -So it may be necessary to guard calls to set_parent with -"if (parent_entry != nullptr)". - -Fix this by handling the parent_entry == nullptr case in set_parent. - -Tested on x86_64-linux. ---- - gdb/dwarf2/cooked-index.h | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h -index 979541fbf60..79fbfe88c03 100644 ---- a/gdb/dwarf2/cooked-index.h -+++ b/gdb/dwarf2/cooked-index.h -@@ -263,7 +263,9 @@ class parent_map - void set_parent (CORE_ADDR start, CORE_ADDR end, - const cooked_index_entry *parent_entry) - { -- m_parent_map.set_empty (start, end, (void *)parent_entry); -+ /* Calling set_empty with nullptr is currently not allowed. */ -+ if (parent_entry != nullptr) -+ m_parent_map.set_empty (start, end, (void *)parent_entry); - } - - private: --- -2.35.3 - diff --git a/gdb-symtab-keep-track-of-all-parents-for-cooked-inde.patch b/gdb-symtab-keep-track-of-all-parents-for-cooked-inde.patch deleted file mode 100644 index 03acf13..0000000 --- a/gdb-symtab-keep-track-of-all-parents-for-cooked-inde.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 0e706742f37ee90629350780263b573f326f1a5f Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 7 Dec 2023 10:38:05 +0100 -Subject: [PATCH 12/13] [gdb/symtab] Keep track of all parents for cooked index - -Keep track of all parents for cooked index. - -Tested on x86_64-linux. ---- - gdb/dwarf2/read.c | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c -index de7b655d26c..93708ef11b9 100644 ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -16718,9 +16718,15 @@ cooked_indexer::index_dies (cutu_reader *reader, - }); - } - else -- this_entry = m_index_storage->add (this_die, abbrev->tag, flags, -- name, this_parent_entry, -- m_per_cu); -+ { -+ CORE_ADDR addr -+ = parent_map::form_addr (this_die, reader->cu->per_cu->is_dwz, -+ reader->cu->per_cu->is_debug_types); -+ set_parent (addr, addr, this_parent_entry); -+ this_entry = m_index_storage->add (this_die, abbrev->tag, flags, -+ name, this_parent_entry, -+ m_per_cu); -+ } - } - - if (linkage_name != nullptr) --- -2.35.3 - diff --git a/gdb-symtab-keep-track-of-processed-dies-in-shard.patch b/gdb-symtab-keep-track-of-processed-dies-in-shard.patch deleted file mode 100644 index 371363a..0000000 --- a/gdb-symtab-keep-track-of-processed-dies-in-shard.patch +++ /dev/null @@ -1,126 +0,0 @@ -From e8285c8b37d28033209cad6579db4b9f6a48a01a Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Sun, 24 Sep 2023 11:41:39 +0200 -Subject: [PATCH 08/13] [gdb/symtab] Keep track of processed DIEs in shard - -For optimizations in two following patches, we keep track in each shard which -DIEs have been processed. - -Tested on x86_64-linux. ---- - gdb/dwarf2/cooked-index.c | 1 + - gdb/dwarf2/cooked-index.h | 15 +++++++++++++++ - gdb/dwarf2/read.c | 24 ++++++++++++++++++++++++ - 3 files changed, 40 insertions(+) - -diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c -index 3231d25db5a..c096da57d62 100644 ---- a/gdb/dwarf2/cooked-index.c -+++ b/gdb/dwarf2/cooked-index.c -@@ -723,6 +723,7 @@ cooked_index::handle_deferred_entries () - { - shard->m_die_range_map.reset (nullptr); - shard->m_deferred_entries.reset (nullptr); -+ shard->m_die_range_map_valid.reset (nullptr); - } - } - -diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h -index 66424c37f7c..fa895233035 100644 ---- a/gdb/dwarf2/cooked-index.h -+++ b/gdb/dwarf2/cooked-index.h -@@ -316,6 +316,7 @@ class cooked_index_shard - { - m_die_range_map.reset (new parent_map); - m_deferred_entries.reset (new std::vector); -+ m_die_range_map_valid.reset (new addrmap_mutable); - } - - DISABLE_COPY_AND_ASSIGN (cooked_index_shard); -@@ -407,6 +408,18 @@ class cooked_index_shard - const cooked_index_entry *resolve_deferred_entry - (const deferred_entry &entry, const cooked_index_entry *parent_entry); - -+ /* Mark parents in range [START, END] as valid . */ -+ void set_parent_valid (CORE_ADDR start, CORE_ADDR end) -+ { -+ m_die_range_map_valid->set_empty (start, end, (void *) 1); -+ } -+ -+ /* Return true if find_parents can be relied upon. */ -+ bool parent_valid (CORE_ADDR addr) -+ { -+ return m_die_range_map_valid->find (addr) != nullptr; -+ } -+ - private: - - /* Return the entry that is believed to represent the program's -@@ -470,6 +483,8 @@ class cooked_index_shard - understand this. */ - std::unique_ptr m_die_range_map; - -+ std::unique_ptr m_die_range_map_valid; -+ - /* The generated DWARF can sometimes have the declaration for a - method in a class (or perhaps namespace) scope, with the - definition appearing outside this scope... just one of the many -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c -index 5b7c0969ed7..09598e702bc 100644 ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -4697,6 +4697,12 @@ class cooked_index_storage - m_index->defer_entry (de); - } - -+ /* Mark parents in range [START, END] as valid . */ -+ void set_parent_valid (CORE_ADDR start, CORE_ADDR end) -+ { -+ m_index->set_parent_valid (start, end); -+ } -+ - private: - - /* Hash function for a cutu_reader. */ -@@ -4840,6 +4846,11 @@ class cooked_indexer - { - m_index_storage->defer_entry (de); - } -+ -+ void set_parent_valid (CORE_ADDR start, CORE_ADDR end) -+ { -+ m_index_storage->set_parent_valid (start, end); -+ } - }; - - /* Subroutine of dwarf2_build_psymtabs_hard to simplify it. -@@ -16604,6 +16615,11 @@ cooked_indexer::index_dies (cutu_reader *reader, - + to_underlying (reader->cu->header.sect_off) - + reader->cu->header.get_length_with_initial ()); - -+ const CORE_ADDR start_cu -+ = parent_map::form_addr (sect_offset (info_ptr - reader->buffer), -+ reader->cu->per_cu->is_dwz, -+ reader->cu->per_cu->is_debug_types); -+ - while (info_ptr < end_ptr) - { - sect_offset this_die = (sect_offset) (info_ptr - reader->buffer); -@@ -16754,6 +16770,14 @@ cooked_indexer::index_dies (cutu_reader *reader, - } - } - -+ { -+ CORE_ADDR end_prev_die -+ = parent_map::form_addr (sect_offset (info_ptr - reader->buffer - 1), -+ reader->cu->per_cu->is_dwz, -+ reader->cu->per_cu->is_debug_types); -+ set_parent_valid (start_cu, end_prev_die); -+ } -+ - return info_ptr; - } - --- -2.35.3 - diff --git a/gdb-symtab-refactor-condition-in-scan_attributes.patch b/gdb-symtab-refactor-condition-in-scan_attributes.patch deleted file mode 100644 index 169e8f4..0000000 --- a/gdb-symtab-refactor-condition-in-scan_attributes.patch +++ /dev/null @@ -1,70 +0,0 @@ -From f72f115b4c012e3748a2e702d7b970be19974885 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Mon, 11 Dec 2023 15:41:26 +0100 -Subject: [PATCH 01/13] [gdb/symtab] Refactor condition in scan_attributes - -In scan_attributes there's code: -... - if (new_reader->cu == reader->cu - && new_info_ptr > watermark_ptr - && *parent_entry == nullptr) - ... - else if (*parent_entry == nullptr) - ... -... -that uses the "*parent_entry == nullptr" condition twice. - -Make this somewhat more readable by factoring out the condition: -... - if (*parent_entry == nullptr) - { - if (new_reader->cu == reader->cu - && new_info_ptr > watermark_ptr) - ... - else - ... - } -... - -This also allows us to factor out "form_addr (origin_offset, origin_is_dwz)". - -Tested on x86_64-linux. ---- - gdb/dwarf2/read.c | 18 ++++++++++-------- - 1 file changed, 10 insertions(+), 8 deletions(-) - -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c -index 50fa302b43a..466d3e59878 100644 ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -16410,15 +16410,17 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu, - const gdb_byte *new_info_ptr = (new_reader->buffer - + to_underlying (origin_offset)); - -- if (new_reader->cu == reader->cu -- && new_info_ptr > watermark_ptr -- && *parent_entry == nullptr) -- *maybe_defer = form_addr (origin_offset, origin_is_dwz); -- else if (*parent_entry == nullptr) -+ if (*parent_entry == nullptr) - { -- CORE_ADDR lookup = form_addr (origin_offset, origin_is_dwz); -- void *obj = m_die_range_map.find (lookup); -- *parent_entry = static_cast (obj); -+ CORE_ADDR addr = form_addr (origin_offset, origin_is_dwz); -+ if (new_reader->cu == reader->cu -+ && new_info_ptr > watermark_ptr) -+ *maybe_defer = addr; -+ else -+ { -+ void *obj = m_die_range_map.find (addr); -+ *parent_entry = static_cast (obj); -+ } - } - - unsigned int bytes_read; - -base-commit: 3490f51a80a10d46dc1885ba672d9390a8221170 --- -2.35.3 - diff --git a/gdb-symtab-resolve-deferred-entries-inter-shard-case.patch b/gdb-symtab-resolve-deferred-entries-inter-shard-case.patch deleted file mode 100644 index cc4f6f3..0000000 --- a/gdb-symtab-resolve-deferred-entries-inter-shard-case.patch +++ /dev/null @@ -1,500 +0,0 @@ -From e2d7097cf236c9ea6959785754d067833fc302af Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Tue, 22 Aug 2023 14:24:42 +0200 -Subject: [PATCH 05/13] [gdb/symtab] Resolve deferred entries, inter-shard case - -Generically solve the case of inter-CU dependencies, including inter-shard -dependencies: -- mark deferred entries in new data structure m_deferred, -- return &parent_map::deferred in find_parent for deferred entries, -- defer all intra-CU dependencies that depend on deferred entries, -- defer all inter-CU dependencies (note that two subsequent patches implement - optimizations to deal with this more optimally), -- move m_die_range_map and m_deferred_dies to cooked_index_shard, and -- move handle_deferred_dies to the cooked_index, where it is called in the - constructor, and update it to handle the intra-shard case. - -Handling units from the .debug_info section alongside units from the -.debug_types section requires us to extend form_addr to take is_debug_types -into account. - -Tested on x86_64-linux. - -PR symtab/30846 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30846 ---- - gdb/dwarf2/cooked-index.c | 77 +++++++++++++++++++++++ - gdb/dwarf2/cooked-index.h | 105 ++++++++++++++++++++++++++++++- - gdb/dwarf2/read.c | 128 ++++++++++++++++++++++---------------- - 3 files changed, 254 insertions(+), 56 deletions(-) - -diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c -index 58ea541a5c9..3231d25db5a 100644 ---- a/gdb/dwarf2/cooked-index.c -+++ b/gdb/dwarf2/cooked-index.c -@@ -228,6 +228,12 @@ cooked_index_entry::write_scope (struct obstack *storage, - - /* See cooked-index.h. */ - -+cooked_index_entry parent_map::deferred((sect_offset)0, (dwarf_tag)0, -+ (cooked_index_flag)0, nullptr, -+ nullptr, nullptr); -+ -+/* See cooked-index.h. */ -+ - const cooked_index_entry * - cooked_index_shard::add (sect_offset die_offset, enum dwarf_tag tag, - cooked_index_flag flags, const char *name, -@@ -446,6 +452,8 @@ cooked_index_shard::wait (bool allow_quit) const - cooked_index::cooked_index (vec_type &&vec) - : m_vector (std::move (vec)) - { -+ handle_deferred_entries (); -+ - for (auto &idx : m_vector) - idx->finalize (); - -@@ -649,6 +657,75 @@ cooked_index::maybe_write_index (dwarf2_per_bfd *per_bfd, - global_index_cache.store (per_bfd, ctx); - } - -+/* See cooked-index.h. */ -+ -+const cooked_index_entry * -+cooked_index_shard::resolve_deferred_entry -+ (const deferred_entry &de, const cooked_index_entry *parent_entry) -+{ -+ reset_parent_deferred (parent_map::form_addr (de.die_offset, de.per_cu_2->is_dwz, -+ de.per_cu_2->is_debug_types)); -+ return add (de.die_offset, de.tag, de.flags, de.name, -+ parent_entry, de.per_cu); -+} -+ -+/* See cooked-index.h. */ -+ -+const cooked_index_entry * -+cooked_index::find_parent_deferred_entry -+ (const cooked_index_shard::deferred_entry &entry) const -+{ -+ const cooked_index_entry *parent_entry = nullptr; -+ for (auto &parent_map_shard : m_vector) -+ { -+ auto res = parent_map_shard->find_parent (entry.spec_offset); -+ if (res != nullptr) -+ { -+ parent_entry = res; -+ break; -+ } -+ } -+ -+ return parent_entry; -+} -+ -+/* See cooked-index.h. */ -+ -+void -+cooked_index::handle_deferred_entries () -+{ -+ bool changed; -+ bool deferred; -+ do -+ { -+ deferred = false; -+ changed = false; -+ for (auto &shard : m_vector) -+ for (auto it = shard->m_deferred_entries->begin (); -+ it != shard->m_deferred_entries->end (); ) -+ { -+ const cooked_index_entry *parent_entry -+ = find_parent_deferred_entry (*it); -+ if (parent_entry == &parent_map::deferred) -+ { -+ deferred = true; -+ it++; -+ continue; -+ } -+ shard->resolve_deferred_entry (*it, parent_entry); -+ it = shard->m_deferred_entries->erase (it); -+ changed = true; -+ } -+ } -+ while (changed && deferred); -+ -+ for (auto &shard : m_vector) -+ { -+ shard->m_die_range_map.reset (nullptr); -+ shard->m_deferred_entries.reset (nullptr); -+ } -+} -+ - /* Wait for all the index cache entries to be written before gdb - exits. */ - static void -diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h -index 79fbfe88c03..66424c37f7c 100644 ---- a/gdb/dwarf2/cooked-index.h -+++ b/gdb/dwarf2/cooked-index.h -@@ -34,6 +34,7 @@ - #include "dwarf2/mapped-index.h" - #include "dwarf2/tag.h" - #include "gdbsupport/range-chain.h" -+#include - - struct dwarf2_per_cu_data; - struct dwarf2_per_bfd; -@@ -242,19 +243,29 @@ struct cooked_index_entry : public allocate_on_obstack - class parent_map - { - public: -+ /* A dummy cooked_index_entry to mark that computing the parent has been -+ deferred. */ -+ static cooked_index_entry deferred; -+ - /* A helper function to turn a section offset into an address that - can be used in a parent_map. */ -- static CORE_ADDR form_addr (sect_offset offset, bool is_dwz) -+ static CORE_ADDR form_addr (sect_offset offset, bool is_dwz, -+ bool is_debug_types) - { - CORE_ADDR value = to_underlying (offset); - if (is_dwz) - value |= ((CORE_ADDR) 1) << (8 * sizeof (CORE_ADDR) - 1); -+ if (is_debug_types) -+ value |= ((CORE_ADDR) 1) << (8 * sizeof (CORE_ADDR) - 2); - return value; - } - - /* Find the parent of DIE LOOKUP. */ - const cooked_index_entry *find_parent (CORE_ADDR lookup) const - { -+ if (m_deferred.find (lookup) != m_deferred.end ()) -+ return &parent_map::deferred; -+ - const void *obj = m_parent_map.find (lookup); - return static_cast (obj); - } -@@ -265,12 +276,28 @@ class parent_map - { - /* Calling set_empty with nullptr is currently not allowed. */ - if (parent_entry != nullptr) -- m_parent_map.set_empty (start, end, (void *)parent_entry); -+ { -+ gdb_assert (parent_entry != &parent_map::deferred); -+ m_parent_map.set_empty (start, end, (void *)parent_entry); -+ } -+ } -+ -+ void set_parent_deferred (CORE_ADDR addr) -+ { -+ m_deferred.emplace (addr); -+ } -+ -+ void reset_parent_deferred (CORE_ADDR addr) -+ { -+ m_deferred.erase (addr); - } - - private: - /* An addrmap that maps from section offsets to cooked_index_entry *. */ - addrmap_mutable m_parent_map; -+ -+ /* DIEs that are deffered. */ -+ std::unordered_set m_deferred; - }; - - class cooked_index; -@@ -285,7 +312,12 @@ class cooked_index; - class cooked_index_shard - { - public: -- cooked_index_shard () = default; -+ cooked_index_shard () -+ { -+ m_die_range_map.reset (new parent_map); -+ m_deferred_entries.reset (new std::vector); -+ } -+ - DISABLE_COPY_AND_ASSIGN (cooked_index_shard); - - /* Create a new cooked_index_entry and register it with this object. -@@ -329,6 +361,52 @@ class cooked_index_shard - for completion, will be returned. */ - range find (const std::string &name, bool completing) const; - -+ /* Find the parent of DIE LOOKUP. */ -+ const cooked_index_entry * -+ find_parent (CORE_ADDR lookup) const -+ { -+ return m_die_range_map->find_parent (lookup); -+ } -+ -+ /* Set the parent of DIES in range [START, END] to PARENT_ENTRY. */ -+ void set_parent (CORE_ADDR start, CORE_ADDR end, -+ const cooked_index_entry *parent_entry) -+ { -+ m_die_range_map->set_parent (start, end, parent_entry); -+ } -+ -+ void set_parent_deferred (CORE_ADDR addr) -+ { -+ m_die_range_map->set_parent_deferred (addr); -+ } -+ -+ void reset_parent_deferred (CORE_ADDR addr) -+ { -+ m_die_range_map->reset_parent_deferred (addr); -+ } -+ -+ /* A single deferred entry. See m_deferred_entries. */ -+ struct deferred_entry -+ { -+ sect_offset die_offset; -+ const char *name; -+ CORE_ADDR spec_offset; -+ dwarf_tag tag; -+ cooked_index_flag flags; -+ dwarf2_per_cu_data *per_cu; -+ dwarf2_per_cu_data *per_cu_2; -+ }; -+ -+ /* Defer creating a cooked_index_entry corresponding to DEFERRED. */ -+ void defer_entry (deferred_entry de) -+ { -+ m_deferred_entries->push_back (de); -+ } -+ -+ /* Variant of add that takes a deferred_entry as parameter. */ -+ const cooked_index_entry *resolve_deferred_entry -+ (const deferred_entry &entry, const cooked_index_entry *parent_entry); -+ - private: - - /* Return the entry that is believed to represent the program's -@@ -386,6 +464,20 @@ class cooked_index_shard - that the 'get' method is never called on this future, only - 'wait'. */ - gdb::future m_future; -+ -+ /* An addrmap that maps from section offsets (see the form_addr -+ method) to newly-created entries. See m_deferred_entries to -+ understand this. */ -+ std::unique_ptr m_die_range_map; -+ -+ /* The generated DWARF can sometimes have the declaration for a -+ method in a class (or perhaps namespace) scope, with the -+ definition appearing outside this scope... just one of the many -+ bad things about DWARF. In order to handle this situation, we -+ defer certain entries until the end of scanning, at which point -+ we'll know the containing context of all the DIEs that we might -+ have scanned. This vector stores these deferred entries. */ -+ std::unique_ptr> m_deferred_entries; - }; - - /* The main index of DIEs. The parallel DIE indexers create -@@ -469,6 +561,13 @@ class cooked_index : public dwarf_scanner_base - - private: - -+ /* Find the parent corresponding to deferred entry ENTRY. */ -+ const cooked_index_entry *find_parent_deferred_entry -+ (const cooked_index_shard::deferred_entry &entry) const; -+ -+ /* Create cooked_index_entries for the deferred entries. */ -+ void handle_deferred_entries (); -+ - /* Maybe write the index to the index cache. */ - void maybe_write_index (dwarf2_per_bfd *per_bfd, - const index_cache_store_context &); -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c -index afdf9e870a8..5b7c0969ed7 100644 ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -4672,6 +4672,31 @@ class cooked_index_storage - return &m_addrmap; - } - -+ /* Find the parent of DIE LOOKUP. */ -+ const cooked_index_entry *find_parent (CORE_ADDR lookup) -+ { -+ return m_index->find_parent (lookup); -+ } -+ -+ /* Set the parent of DIES in range [START, END] to PARENT_ENTRY. */ -+ void set_parent (CORE_ADDR start, CORE_ADDR end, -+ const cooked_index_entry *parent_entry) -+ { -+ m_index->set_parent (start, end, parent_entry); -+ } -+ -+ /* Set the parent of DIE at ADDR as deferred. */ -+ void set_parent_deferred (CORE_ADDR addr) -+ { -+ m_index->set_parent_deferred (addr); -+ } -+ -+ /* Defer creating a cooked_index_entry corresponding to deferred_entry DE. */ -+ void defer_entry (cooked_index_shard::deferred_entry de) -+ { -+ m_index->defer_entry (de); -+ } -+ - private: - - /* Hash function for a cutu_reader. */ -@@ -4794,59 +4819,26 @@ class cooked_indexer - /* Find the parent of DIE LOOKUP. */ - const cooked_index_entry *find_parent (CORE_ADDR lookup) const - { -- return m_die_range_map.find_parent (lookup); -+ return m_index_storage->find_parent (lookup); - } - - /* Set the parent of DIES in range [START, END] to PARENT_ENTRY. */ - void set_parent (CORE_ADDR start, CORE_ADDR end, - const cooked_index_entry *parent_entry) - { -- m_die_range_map.set_parent (start, end, parent_entry); -+ m_index_storage->set_parent (start, end, parent_entry); - } - -- /* A single deferred entry. */ -- struct deferred_entry -- { -- sect_offset die_offset; -- const char *name; -- CORE_ADDR spec_offset; -- dwarf_tag tag; -- cooked_index_flag flags; -- }; -- -- /* The generated DWARF can sometimes have the declaration for a -- method in a class (or perhaps namespace) scope, with the -- definition appearing outside this scope... just one of the many -- bad things about DWARF. In order to handle this situation, we -- defer certain entries until the end of scanning, at which point -- we'll know the containing context of all the DIEs that we might -- have scanned. This vector stores these deferred entries. */ -- std::vector m_deferred_entries; -- -- /* Defer creating a cooked_index_entry corresponding to deferred_entry DE. */ -- void defer_entry (const deferred_entry &de) -+ /* Set the parent of DIE at ADDR as deferred. */ -+ void set_parent_deferred (CORE_ADDR addr) - { -- m_deferred_entries.push_back (de); -+ m_index_storage->set_parent_deferred (addr); - } - -- /* Create a cooked_index_entry corresponding to deferred_entry DE with -- parent PARENT_ENTRY. */ -- const cooked_index_entry *resolve_deferred_entry -- (const deferred_entry &de, const cooked_index_entry *parent_entry) -- { -- return m_index_storage->add (de.die_offset, de.tag, de.flags, de.name, -- parent_entry, m_per_cu); -- } -- -- /* Create cooked_index_entries for the deferred entries. */ -- void handle_deferred_entries () -+ /* Defer creating a cooked_index_entry corresponding to deferred_entry DE. */ -+ void defer_entry (const cooked_index_shard::deferred_entry &de) - { -- for (const auto &entry : m_deferred_entries) -- { -- const cooked_index_entry *parent_entry -- = find_parent (entry.spec_offset); -- resolve_deferred_entry (entry, parent_entry); -- } -+ m_index_storage->defer_entry (de); - } - }; - -@@ -16441,13 +16433,36 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu, - - if (*parent_entry == nullptr) - { -+ gdb_assert (reader->cu->per_cu->is_debug_types -+ == new_reader->cu->per_cu->is_debug_types); - CORE_ADDR addr -- = parent_map::form_addr (origin_offset, origin_is_dwz); -- if (new_reader->cu == reader->cu -- && new_info_ptr > watermark_ptr) -- *maybe_defer = addr; -+ = parent_map::form_addr (origin_offset, origin_is_dwz, -+ reader->cu->per_cu->is_debug_types); -+ if (new_reader->cu == reader->cu) -+ { -+ /* Intra-CU case. */ -+ if (new_info_ptr > watermark_ptr) -+ { -+ /* Defer because origin is not read yet. */ -+ *maybe_defer = addr; -+ } -+ else -+ { -+ auto tmp = find_parent (addr); -+ if (tmp == &parent_map::deferred) -+ { -+ /* Defer because origin is deferred. */ -+ *maybe_defer = addr; -+ } -+ else -+ *parent_entry = tmp; -+ } -+ } - else -- *parent_entry = find_parent (addr); -+ { -+ /* Inter-CU case. */ -+ *maybe_defer = addr; -+ } - } - - unsigned int bytes_read; -@@ -16567,10 +16582,12 @@ cooked_indexer::recurse (cutu_reader *reader, - limit the range to the children of parent_entry. */ - CORE_ADDR start - = parent_map::form_addr (parent_entry->die_offset + 1, -- reader->cu->per_cu->is_dwz); -+ reader->cu->per_cu->is_dwz, -+ reader->cu->per_cu->is_debug_types); - CORE_ADDR end - = parent_map::form_addr (sect_offset (info_ptr - 1 - reader->buffer), -- reader->cu->per_cu->is_dwz); -+ reader->cu->per_cu->is_dwz, -+ reader->cu->per_cu->is_debug_types); - set_parent (start, end, parent_entry); - } - -@@ -16637,9 +16654,16 @@ cooked_indexer::index_dies (cutu_reader *reader, - if (name != nullptr) - { - if (defer != 0) -- defer_entry ({ -- this_die, name, defer, abbrev->tag, flags -- }); -+ { -+ CORE_ADDR addr -+ = parent_map::form_addr (this_die, reader->cu->per_cu->is_dwz, -+ reader->cu->per_cu->is_debug_types); -+ set_parent_deferred (addr); -+ defer_entry ({ -+ this_die, name, defer, abbrev->tag, flags, m_per_cu, -+ reader->cu->per_cu -+ }); -+ } - else - this_entry = m_index_storage->add (this_die, abbrev->tag, flags, - name, this_parent_entry, -@@ -16741,8 +16765,6 @@ cooked_indexer::make_index (cutu_reader *reader) - if (!reader->comp_unit_die->has_children) - return; - index_dies (reader, reader->info_ptr, nullptr, false); -- -- handle_deferred_entries (); - } - - /* An implementation of quick_symbol_functions for the cooked DWARF --- -2.35.3 - diff --git a/gdb-symtab-resolve-deferred-entries-intra-shard-case.patch b/gdb-symtab-resolve-deferred-entries-intra-shard-case.patch deleted file mode 100644 index a18108a..0000000 --- a/gdb-symtab-resolve-deferred-entries-intra-shard-case.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 3b2f2b376bb80edadacc582161c362612947e3a6 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Sun, 24 Sep 2023 11:43:24 +0200 -Subject: [PATCH 09/13] [gdb/symtab] Resolve deferred entries, intra-shard case - -In patch "[gdb/symtab] Resolve deferred entries, inter-shard case" we've -solved the generic case of handling deferred entries. - -Now add an optimization that handles deferred entries with an intra-shard -dependency in the parallel for. - -Tested on x86_64-linux. ---- - gdb/dwarf2/cooked-index.c | 35 +++++++++++++++++++++++++++++++++++ - gdb/dwarf2/cooked-index.h | 7 +++++++ - gdb/dwarf2/read.c | 10 ++++++++++ - 3 files changed, 52 insertions(+) - -diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c -index c096da57d62..ebed21d510c 100644 ---- a/gdb/dwarf2/cooked-index.c -+++ b/gdb/dwarf2/cooked-index.c -@@ -452,6 +452,7 @@ cooked_index_shard::wait (bool allow_quit) const - cooked_index::cooked_index (vec_type &&vec) - : m_vector (std::move (vec)) - { -+ /* Handle deferred entries, inter-cu case. */ - handle_deferred_entries (); - - for (auto &idx : m_vector) -@@ -659,6 +660,40 @@ cooked_index::maybe_write_index (dwarf2_per_bfd *per_bfd, - - /* See cooked-index.h. */ - -+const cooked_index_entry * -+cooked_index_shard::find_parent_deferred_entry -+ (const cooked_index_shard::deferred_entry &entry) const -+{ -+ return find_parent (entry.spec_offset); -+} -+ -+/* See cooked-index.h. */ -+ -+void -+cooked_index_shard::handle_deferred_entries () -+{ -+ for (auto it = m_deferred_entries->begin (); it != m_deferred_entries->end (); ) -+ { -+ const deferred_entry & deferred_entry = *it; -+ if (!parent_valid (deferred_entry.spec_offset)) -+ { -+ it++; -+ continue; -+ } -+ const cooked_index_entry *parent_entry -+ = find_parent_deferred_entry (deferred_entry); -+ if (parent_entry == &parent_map::deferred) -+ { -+ it++; -+ continue; -+ } -+ resolve_deferred_entry (deferred_entry, parent_entry); -+ it = m_deferred_entries->erase (it); -+ } -+} -+ -+/* See cooked-index.h. */ -+ - const cooked_index_entry * - cooked_index_shard::resolve_deferred_entry - (const deferred_entry &de, const cooked_index_entry *parent_entry) -diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h -index fa895233035..106e3091a90 100644 ---- a/gdb/dwarf2/cooked-index.h -+++ b/gdb/dwarf2/cooked-index.h -@@ -408,6 +408,13 @@ class cooked_index_shard - const cooked_index_entry *resolve_deferred_entry - (const deferred_entry &entry, const cooked_index_entry *parent_entry); - -+ /* Find the parent entry for deferred_entry ENTRY. */ -+ const cooked_index_entry *find_parent_deferred_entry -+ (const cooked_index_shard::deferred_entry &entry) const; -+ -+ /* Create cooked_index_entries for the deferred entries. */ -+ void handle_deferred_entries (); -+ - /* Mark parents in range [START, END] as valid . */ - void set_parent_valid (CORE_ADDR start, CORE_ADDR end) - { -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c -index 09598e702bc..a97f738a54e 100644 ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -4697,6 +4697,12 @@ class cooked_index_storage - m_index->defer_entry (de); - } - -+ /* Handle deferred entries, intra-cu case. */ -+ void handle_deferred_entries () -+ { -+ m_index->handle_deferred_entries (); -+ } -+ - /* Mark parents in range [START, END] as valid . */ - void set_parent_valid (CORE_ADDR start, CORE_ADDR end) - { -@@ -5183,6 +5189,10 @@ dwarf2_build_psymtabs_hard (dwarf2_per_objfile *per_objfile) - errors.push_back (std::move (except)); - } - } -+ -+ /* Handle deferred entries, intra-cu case. */ -+ thread_storage.handle_deferred_entries (); -+ - return result_type (thread_storage.release (), std::move (errors)); - }, task_size); - --- -2.35.3 - diff --git a/gdb-symtab-work-around-gas-pr28629.patch b/gdb-symtab-work-around-gas-pr28629.patch deleted file mode 100644 index 9bcab94..0000000 --- a/gdb-symtab-work-around-gas-pr28629.patch +++ /dev/null @@ -1,278 +0,0 @@ -From 1b878333913343630472f89b4bc42f51b1619308 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Wed, 1 Nov 2023 00:33:12 +0100 -Subject: [PATCH 1/2] [gdb/symtab] Work around gas PR28629 - -When running test-case gdb.tui/tui-layout-asm-short-prog.exp on AlmaLinux 9.2 -ppc64le, I run into: -... -FAIL: gdb.tui/tui-layout-asm-short-prog.exp: check asm box contents -... - -The problem is that we get: -... - 7 [ No Assembly Available ] -... -because tui_get_begin_asm_address doesn't succeed. - -In more detail, tui_get_begin_asm_address calls: -... - find_line_pc (sal.symtab, sal.line, &addr); -... -with: -... -(gdb) p *sal.symtab -$5 = {next = 0x130393c0, m_compunit = 0x130392f0, m_linetable = 0x0, - filename = "tui-layout-asm-short-prog.S", - filename_for_id = "$gdb/build/gdb/testsuite/tui-layout-asm-short-prog.S", - m_language = language_asm, fullname = 0x0} -(gdb) p sal.line -$6 = 1 -... - -The problem is the filename_for_id which is the source file prefixed with the -compilation dir rather than the source dir. - -This is due to faulty debug info generated by gas, PR28629: -... - <1a> DW_AT_name : tui-layout-asm-short-prog.S - <1e> DW_AT_comp_dir : $gdb/build/gdb/testsuite - <22> DW_AT_producer : GNU AS 2.35.2 -... - -The DW_AT_name is relative, and it's relative to the DW_AT_comp_dir entry, -making the effective name $gdb/build/gdb/testsuite/tui-layout-asm-short-prog.S. - -The bug is fixed starting version 2.38, where we get instead: -... - <1a> DW_AT_name : - $gdb/src/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S - <1e> DW_AT_comp_dir : $gdb/build/gdb/testsuite - <22> DW_AT_producer : GNU AS 2.38 -... - -Work around the faulty debug info by constructing the filename_for_id using -the second directory from the directory table in the .debug_line header: -... - The Directory Table (offset 0x22, lines 2, columns 1): - Entry Name - 0 $gdb/build/gdb/testsuite - 1 $gdb/src/gdb/testsuite/gdb.tui -... - -Note that the used gas contains a backport of commit 3417bfca676 ("GAS: -DWARF-5: Ensure that the 0'th entry in the directory table contains the -current working directory."), because directory 0 is correct. With the -unpatched 2.35.2 release the directory 0 entry is incorrect: it's a copy of -entry 1. - -Add a dwarf assembly test-case that reflects the debug info as generated by -unpatched gas 2.35.2. - -Tested on x86_64-linux. - -Approved-By: Tom Tromey ---- - gdb/dwarf2/cu.c | 1 + - gdb/dwarf2/cu.h | 1 + - gdb/dwarf2/read.c | 37 +++++++- - .../gdb.dwarf2/dw2-gas-workaround.exp | 92 +++++++++++++++++++ - 4 files changed, 130 insertions(+), 1 deletion(-) - create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp - -diff --git a/gdb/dwarf2/cu.c b/gdb/dwarf2/cu.c -index a908ec908cd..f9b05dfc709 100644 ---- a/gdb/dwarf2/cu.c -+++ b/gdb/dwarf2/cu.c -@@ -40,6 +40,7 @@ dwarf2_cu::dwarf2_cu (dwarf2_per_cu_data *per_cu, - producer_is_icc_lt_14 (false), - producer_is_codewarrior (false), - producer_is_clang (false), -+ producer_is_gas_lt_2_38 (false), - producer_is_gas_2_39 (false), - processing_has_namespace_info (false), - load_all_dies (false) -diff --git a/gdb/dwarf2/cu.h b/gdb/dwarf2/cu.h -index 6c611710503..ef8db480e3f 100644 ---- a/gdb/dwarf2/cu.h -+++ b/gdb/dwarf2/cu.h -@@ -265,6 +265,7 @@ struct dwarf2_cu - bool producer_is_icc_lt_14 : 1; - bool producer_is_codewarrior : 1; - bool producer_is_clang : 1; -+ bool producer_is_gas_lt_2_38 : 1; - bool producer_is_gas_2_39 : 1; - - /* When true, the file that we're processing is known to have -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c -index fc4667b782f..50fa302b43a 100644 ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -147,6 +147,8 @@ static int dwarf2_locexpr_block_index; - static int dwarf2_loclist_block_index; - static int ada_block_index; - -+static bool producer_is_gas_lt_2_38 (struct dwarf2_cu *cu); -+ - /* Size of .debug_loclists section header for 32-bit DWARF format. */ - #define LOCLIST_HEADER_SIZE32 12 - -@@ -7665,6 +7667,27 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu) - - file_and_directory &fnd = find_file_and_directory (die, cu); - -+ /* GAS supports generating dwarf-5 info starting version 2.35. Versions -+ 2.35-2.37 generate an incorrect CU name attribute: it's relative, -+ implicitly prefixing it with the compilation dir. Work around this by -+ prefixing it with the source dir instead. */ -+ if (cu->header.version == 5 && !IS_ABSOLUTE_PATH (fnd.get_name ()) -+ && producer_is_gas_lt_2_38 (cu)) -+ { -+ attr = dwarf2_attr (die, DW_AT_stmt_list, cu); -+ if (attr != nullptr && attr->form_is_unsigned ()) -+ { -+ sect_offset line_offset = (sect_offset) attr->as_unsigned (); -+ line_header_up lh = dwarf_decode_line_header (line_offset, cu, -+ fnd.get_comp_dir ()); -+ if (lh->version == 5 && lh->is_valid_file_index (1)) -+ { -+ std::string dir = lh->include_dir_at (1); -+ fnd.set_comp_dir (std::move (dir)); -+ } -+ } -+ } -+ - cu->start_compunit_symtab (fnd.get_name (), fnd.intern_comp_dir (objfile), - lowpc); - -@@ -11427,7 +11450,10 @@ check_producer (struct dwarf2_cu *cu) - else if (producer_is_clang (cu->producer, &major, &minor)) - cu->producer_is_clang = true; - else if (producer_is_gas (cu->producer, &major, &minor)) -- cu->producer_is_gas_2_39 = major == 2 && minor == 39; -+ { -+ cu->producer_is_gas_lt_2_38 = major < 2 || (major == 2 && minor < 38); -+ cu->producer_is_gas_2_39 = major == 2 && minor == 39; -+ } - else - { - /* For other non-GCC compilers, expect their behavior is DWARF version -@@ -11463,6 +11489,15 @@ producer_is_codewarrior (struct dwarf2_cu *cu) - return cu->producer_is_codewarrior; - } - -+static bool -+producer_is_gas_lt_2_38 (struct dwarf2_cu *cu) -+{ -+ if (!cu->checked_producer) -+ check_producer (cu); -+ -+ return cu->producer_is_gas_lt_2_38; -+} -+ - static bool - producer_is_gas_2_39 (struct dwarf2_cu *cu) - { -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp b/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp -new file mode 100644 -index 00000000000..ca2b10f23b3 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp -@@ -0,0 +1,92 @@ -+# Copyright 2023 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# Test line number information in various configurations. -+ -+load_lib dwarf.exp -+ -+# This test can only be run on targets which support DWARF-2 and use gas. -+require dwarf2_support -+ -+standard_testfile dw2-lines.c -dw2.S -+ -+with_shared_gdb { -+ set func_info_vars [get_func_info bar] -+} -+ -+# Helper function. -+proc line_for { l } { -+ global srcfile -+ set line [gdb_get_line_number "$l:" $srcfile] -+ return [expr $line + 1] -+} -+ -+set asm_file [standard_output_file $srcfile2] -+Dwarf::assemble $asm_file { -+ declare_labels Llines -+ global srcdir subdir srcfile objdir -+ global func_info_vars -+ foreach var $func_info_vars { -+ global $var -+ } -+ -+ cu { version 5 } { -+ compile_unit { -+ {language @DW_LANG_Mips_Assembler} -+ {name $srcfile} -+ {comp_dir $objdir} -+ {stmt_list $Llines DW_FORM_sec_offset} -+ {producer "GNU AS 2.35.2"} -+ } { -+ subprogram { -+ {external 1 flag} -+ {name bar} -+ {low_pc $bar_start addr} -+ {high_pc "$bar_start + $bar_len" addr} -+ } -+ } -+ } -+ -+ lines [list version 5] Llines { -+ set diridx1 [include_dir "${srcdir}/${subdir}"] -+ set diridx2 [include_dir "${srcdir}/${subdir}"] -+ file_name "$srcfile" $diridx1 -+ file_name "$srcfile" $diridx2 -+ -+ program { -+ DW_LNE_set_address bar_label -+ line [line_for bar_label] -+ DW_LNS_copy -+ -+ DW_LNE_set_address bar_label_2 -+ DW_LNE_end_sequence -+ } -+ } -+} -+ -+if { [prepare_for_testing "failed to prepare" ${testfile} \ -+ [list $srcfile $asm_file] {nodebug}] } { -+ return -1 -+} -+ -+gdb_test_no_output "set debug symtab-create 1" -+gdb_test_multiple "ptype bar" "" { -+ -re -wrap "$objdir.*" { -+ fail $gdb_test_name -+ } -+ -re -wrap "" { -+ pass $gdb_test_name -+ } -+} - -base-commit: d9951c3c9ea2e542d071710e9706ed505046fe36 --- -2.35.3 - diff --git a/gdb-symtab-work-around-pr-gas-29517-dwarf2-case.patch b/gdb-symtab-work-around-pr-gas-29517-dwarf2-case.patch deleted file mode 100644 index be57664..0000000 --- a/gdb-symtab-work-around-pr-gas-29517-dwarf2-case.patch +++ /dev/null @@ -1,137 +0,0 @@ -From 582fc35843fdf71b82d645d83d2903e2546cc21a Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Wed, 1 May 2024 15:10:50 +0200 -Subject: [PATCH 2/2] [gdb/symtab] Work around PR gas/29517, dwarf2 case - -In commit 1d45d90934b ("[gdb/symtab] Work around PR gas/29517") we added a -workaround for PR gas/29517. - -The problem is present in gas version 2.39, and fixed in 2.40, so the -workaround is only active for gas version == 2.39. - -However, the problem in gas is only fixed for dwarf version >= 3, which -supports DW_TAG_unspecified_type. - -Fix this by also activating the workaround for dwarf version == 2. - -Tested on x86_64-linux. - -PR symtab/31689 -https://sourceware.org/bugzilla/show_bug.cgi?id=31689 ---- - gdb/dwarf2/read.c | 5 +++- - .../gdb.dwarf2/dw2-unspecified-type-foo.c | 7 ++++++ - .../gdb.dwarf2/dw2-unspecified-type.c | 3 ++- - .../gdb.dwarf2/dw2-unspecified-type.exp | 23 ++++++++++++++++++- - 4 files changed, 35 insertions(+), 3 deletions(-) - -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c -index 761437f6631..fc4667b782f 100644 ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -14646,10 +14646,13 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu) - - type = die_type (die, cu); - -+ /* PR gas/29517 occurs in 2.39, and is fixed in 2.40, but it's only fixed -+ for dwarf version >= 3 which supports DW_TAG_unspecified_type. */ - if (type->code () == TYPE_CODE_VOID - && !type->is_stub () - && die->child == nullptr -- && producer_is_gas_2_39 (cu)) -+ && (cu->per_cu->version () == 2 -+ || producer_is_gas_2_39 (cu))) - { - /* Work around PR gas/29517, pretend we have an DW_TAG_unspecified_type - return type. */ -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c -index 164e781c9f0..bcf525a4d2e 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c -+++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type-foo.c -@@ -21,3 +21,10 @@ foo (void) - asm ("foo_label: .globl foo_label"); - return 0; - } -+ -+int -+foo2 (void) -+{ -+ asm ("foo2_label: .globl foo2_label"); -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c -index e07d9517ff2..9e600f9dcce 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c -+++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c -@@ -16,6 +16,7 @@ - along with this program. If not, see . */ - - extern int foo (void); -+extern int foo2 (void); - - int - bar (void) -@@ -27,6 +28,6 @@ bar (void) - int - main (void) - { -- int res = foo () + bar (); -+ int res = foo () + bar () + foo2 (); - return res; - } -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp -index a6f2a57e33e..947246ba44d 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp -+++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp -@@ -34,11 +34,19 @@ lassign $bar_res \ - bar_start bar_len - set bar_end "$bar_start + $bar_len" - -+set foo2_res \ -+ [function_range foo2 \ -+ [list ${srcdir}/${subdir}/$srcfile ${srcdir}/${subdir}/$srcfile2]] -+lassign $foo2_res \ -+ foo2_start foo2_len -+set foo2_end "$foo2_start + $foo2_len" -+ - # Create the DWARF. - set asm_file [standard_output_file $srcfile3] - Dwarf::assemble $asm_file { - global foo_start foo_end - global bar_start bar_end -+ global foo2_start foo2_end - declare_labels unspecified_type_label - - cu {} { -@@ -68,6 +76,19 @@ Dwarf::assemble $asm_file { - } - } - } -+ -+ cu { version 2 } { -+ compile_unit { -+ {language @DW_LANG_Mips_Assembler} -+ {producer "GNU AS 2.40.0"} -+ } { -+ DW_TAG_subprogram { -+ {name foo2} -+ {low_pc $foo2_start addr} -+ {high_pc $foo2_end addr} -+ } -+ } -+ } - } - - if [prepare_for_testing "failed to prepare" $testfile \ -@@ -79,7 +100,7 @@ if ![runto_main] { - return -1 - } - --foreach f {foo bar} { -+foreach f {foo bar foo2} { - # Print the function type. Return type should be stub type, which is printed - # as void. - gdb_test "ptype $f" "type = void \\(void\\)" --- -2.35.3 - diff --git a/gdb-symtab-work-around-pr-gas-29517.patch b/gdb-symtab-work-around-pr-gas-29517.patch deleted file mode 100644 index 54fc9de..0000000 --- a/gdb-symtab-work-around-pr-gas-29517.patch +++ /dev/null @@ -1,256 +0,0 @@ -From 7a2731d9d1c0926d22905b9d07e32a7b63c43b34 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 28 Sep 2023 13:55:07 +0200 -Subject: [PATCH 57/65] Work around PR gas/29517 - -When using glibc debuginfo generated with gas 2.39, we run into PR gas/29517: -... -$ gdb -q -batch a.out -ex start -ex "p (char *)strstr (\"haha\", \"ah\")" -Temporary breakpoint 1 at 0x40051b: file hello.c, line 6. - -Temporary breakpoint 1, main () at hello.c:6 -6 printf ("hello\n"); -Invalid cast. -... -while without glibc debuginfo installed we get the expected result: -... -$n = 0x7ffff7daa1b1 "aha" -... -and likewise with glibc debuginfo generated with gas 2.40. - -The strstr ifunc resolves to __strstr_sse2_unaligned. The problem is that gas -generates dwarf that states that the return type is void: -... -<1><3e1e58>: Abbrev Number: 2 (DW_TAG_subprogram) - <3e1e59> DW_AT_name : __strstr_sse2_unaligned - <3e1e5d> DW_AT_external : 1 - <3e1e5e> DW_AT_low_pc : 0xbbd2e - <3e1e66> DW_AT_high_pc : 0xbc1c3 -... -while the return type should be a DW_TAG_unspecified_type, as is the case -with gas 2.40. - -We can still use the workaround of casting to another function type for both -__strstr_sse2_unaligned: -... -(gdb) p ((char * (*) (const char *, const char *))__strstr_sse2_unaligned) \ - ("haha", "ah") -$n = 0x7ffff7daa211 "aha" -... -and strstr (which requires using *strstr to dereference the ifunc before we -cast): -... -gdb) p ((char * (*) (const char *, const char *))*strstr) ("haha", "ah") -$n = 0x7ffff7daa251 "aha" -... -but that's a bit cumbersome to use. - -Work around this in the dwarf reader, such that we have instead: -... -(gdb) p (char *)strstr ("haha", "ah") -$n = 0x7ffff7daa1b1 "aha" -... - -This also requires fixing producer_is_gcc to stop returning true for -producer "GNU AS 2.39.0". - -Tested on x86_64-linux. - -PR symtab/30911 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30911 ---- - gdb/dwarf2/cu.c | 1 + - gdb/dwarf2/cu.h | 1 + - gdb/dwarf2/read.c | 23 ++++++++++++ - gdb/producer.c | 8 ++++- - .../gdb.dwarf2/dw2-unspecified-type.c | 9 ++++- - .../gdb.dwarf2/dw2-unspecified-type.exp | 36 +++++++++++++++---- - 6 files changed, 69 insertions(+), 9 deletions(-) - -diff --git a/gdb/dwarf2/cu.c b/gdb/dwarf2/cu.c -index 89de40daab0..a908ec908cd 100644 ---- a/gdb/dwarf2/cu.c -+++ b/gdb/dwarf2/cu.c -@@ -40,6 +40,7 @@ dwarf2_cu::dwarf2_cu (dwarf2_per_cu_data *per_cu, - producer_is_icc_lt_14 (false), - producer_is_codewarrior (false), - producer_is_clang (false), -+ producer_is_gas_2_39 (false), - processing_has_namespace_info (false), - load_all_dies (false) - { -diff --git a/gdb/dwarf2/cu.h b/gdb/dwarf2/cu.h -index 0c15d8b02db..6c611710503 100644 ---- a/gdb/dwarf2/cu.h -+++ b/gdb/dwarf2/cu.h -@@ -265,6 +265,7 @@ struct dwarf2_cu - bool producer_is_icc_lt_14 : 1; - bool producer_is_codewarrior : 1; - bool producer_is_clang : 1; -+ bool producer_is_gas_2_39 : 1; - - /* When true, the file that we're processing is known to have - debugging info for C++ namespaces. GCC 3.3.x did not produce -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c -index a5c48baa6f8..e5e557c17d3 100644 ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -11426,6 +11426,8 @@ check_producer (struct dwarf2_cu *cu) - cu->producer_is_codewarrior = true; - else if (producer_is_clang (cu->producer, &major, &minor)) - cu->producer_is_clang = true; -+ else if (startswith (cu->producer, "GNU AS 2.39.0")) -+ cu->producer_is_gas_2_39 = true; - else - { - /* For other non-GCC compilers, expect their behavior is DWARF version -@@ -11461,6 +11463,15 @@ producer_is_codewarrior (struct dwarf2_cu *cu) - return cu->producer_is_codewarrior; - } - -+static bool -+producer_is_gas_2_39 (struct dwarf2_cu *cu) -+{ -+ if (!cu->checked_producer) -+ check_producer (cu); -+ -+ return cu->producer_is_gas_2_39; -+} -+ - /* Return the accessibility of DIE, as given by DW_AT_accessibility. - If that attribute is not available, return the appropriate - default. */ -@@ -14635,6 +14646,18 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu) - - type = die_type (die, cu); - -+ if (type->code () == TYPE_CODE_VOID -+ && !type->is_stub () -+ && die->child == nullptr -+ && producer_is_gas_2_39 (cu)) -+ { -+ /* Work around PR gas/29517, pretend we have an DW_TAG_unspecified_type -+ return type. */ -+ type = (type_allocator (cu->per_objfile->objfile, cu->lang ()) -+ .new_type (TYPE_CODE_VOID, 0, nullptr)); -+ type->set_is_stub (true); -+ } -+ - /* The die_type call above may have already set the type for this DIE. */ - ftype = get_die_type (die, cu); - if (ftype) -diff --git a/gdb/producer.c b/gdb/producer.c -index 655eb971283..9fcf749e3d4 100644 ---- a/gdb/producer.c -+++ b/gdb/producer.c -@@ -54,13 +54,19 @@ producer_is_gcc (const char *producer, int *major, int *minor) - if (minor == NULL) - minor = &min; - -+ /* Skip GNU. */ -+ cs = &producer[strlen ("GNU ")]; -+ -+ /* Bail out for GNU AS. */ -+ if (startswith (cs, "AS ")) -+ return 0; -+ - /* Skip any identifier after "GNU " - such as "C11" "C++" or "Java". - A full producer string might look like: - "GNU C 4.7.2" - "GNU Fortran 4.8.2 20140120 (Red Hat 4.8.2-16) -mtune=generic ..." - "GNU C++14 5.0.0 20150123 (experimental)" - */ -- cs = &producer[strlen ("GNU ")]; - while (*cs && !isspace (*cs)) - cs++; - if (*cs && isspace (*cs)) -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c -index 1df09214d4a..e07d9517ff2 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c -+++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.c -@@ -17,9 +17,16 @@ - - extern int foo (void); - -+int -+bar (void) -+{ -+ asm ("bar_label: .globl bar_label"); -+ return 0; -+} -+ - int - main (void) - { -- int res = foo (); -+ int res = foo () + bar (); - return res; - } -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp -index 5fa6ee544b2..a6f2a57e33e 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp -+++ b/gdb/testsuite/gdb.dwarf2/dw2-unspecified-type.exp -@@ -27,10 +27,18 @@ lassign $foo_res \ - foo_start foo_len - set foo_end "$foo_start + $foo_len" - -+set bar_res \ -+ [function_range bar \ -+ [list ${srcdir}/${subdir}/$srcfile ${srcdir}/${subdir}/$srcfile2]] -+lassign $bar_res \ -+ bar_start bar_len -+set bar_end "$bar_start + $bar_len" -+ - # Create the DWARF. - set asm_file [standard_output_file $srcfile3] - Dwarf::assemble $asm_file { - global foo_start foo_end -+ global bar_start bar_end - declare_labels unspecified_type_label - - cu {} { -@@ -45,7 +53,19 @@ Dwarf::assemble $asm_file { - {high_pc $foo_end addr} - {type :$unspecified_type_label} - } -+ } -+ } - -+ cu {} { -+ compile_unit { -+ {language @DW_LANG_Mips_Assembler} -+ {producer "GNU AS 2.39.0"} -+ } { -+ DW_TAG_subprogram { -+ {name bar} -+ {low_pc $bar_start addr} -+ {high_pc $bar_end addr} -+ } - } - } - } -@@ -59,12 +79,14 @@ if ![runto_main] { - return -1 - } - --# Print the function type. Return type should be stub type, which is printed --# as void. --gdb_test "ptype foo" "type = void \\(void\\)" -+foreach f {foo bar} { -+ # Print the function type. Return type should be stub type, which is printed -+ # as void. -+ gdb_test "ptype $f" "type = void \\(void\\)" - --# Call the function, casting the function to the correct function type. --gdb_test "p ((int (*) ()) foo) ()" " = 0" -+ # Call the function, casting the function to the correct function type. -+ gdb_test "p ((int (*) ()) $f) ()" " = 0" - --# Call the function, casting the function result to the correct type. --gdb_test "p (int) foo ()" " = 0" -+ # Call the function, casting the function result to the correct type. -+ gdb_test "p (int) $f ()" " = 0" -+} --- -2.35.3 - diff --git a/gdb-symtab-workaround-pr-gas-31115.patch b/gdb-symtab-workaround-pr-gas-31115.patch deleted file mode 100644 index d5869cf..0000000 --- a/gdb-symtab-workaround-pr-gas-31115.patch +++ /dev/null @@ -1,122 +0,0 @@ -From d25e3f4ed05c3a6c207263d7e532f829860b83f0 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Wed, 20 Mar 2024 09:57:49 +0100 -Subject: [PATCH 1/7] [gdb/symtab] Workaround PR gas/31115 - -On arm-linux, with gas 2.40, I run into: -... -(gdb) x /i main+8^M - 0x4e1 : vrhadd.u16 d14, d14, d31^M -(gdb) FAIL: gdb.arch/pr25124.exp: disassemble thumb instruction (1st try) -... - -This is a regression due to PR gas/31115, which makes gas produce a low_pc -with the thumb bit set (0x4d8 & 0x1): -... - <1><24>: Abbrev Number: 2 (DW_TAG_subprogram) - <25> DW_AT_name : main - <29> DW_AT_external : 1 - <29> DW_AT_type : <0x2f> - <2a> DW_AT_low_pc : 0x4d9 - <2e> DW_AT_high_pc : 12 -... - -The regression was introduced in 2.39, and is also present in 2.40 and 2.41, -and hasn't been fixed yet. - -Work around this in read_func_scope, by using gdbarch_addr_bits_remove on -low_pc and high_pc. - -Tested on arm-linux and x86_64-linux. - -PR tdep/31453 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31453 ---- - gdb/dwarf2/cu.c | 1 + - gdb/dwarf2/cu.h | 1 + - gdb/dwarf2/read.c | 22 ++++++++++++++++++++++ - 3 files changed, 24 insertions(+) - -diff --git a/gdb/dwarf2/cu.c b/gdb/dwarf2/cu.c -index f9b05dfc709..7f89500effd 100644 ---- a/gdb/dwarf2/cu.c -+++ b/gdb/dwarf2/cu.c -@@ -42,6 +42,7 @@ dwarf2_cu::dwarf2_cu (dwarf2_per_cu_data *per_cu, - producer_is_clang (false), - producer_is_gas_lt_2_38 (false), - producer_is_gas_2_39 (false), -+ producer_is_gas_ge_2_40 (false), - processing_has_namespace_info (false), - load_all_dies (false) - { -diff --git a/gdb/dwarf2/cu.h b/gdb/dwarf2/cu.h -index ef8db480e3f..1b02f89ed2f 100644 ---- a/gdb/dwarf2/cu.h -+++ b/gdb/dwarf2/cu.h -@@ -267,6 +267,7 @@ struct dwarf2_cu - bool producer_is_clang : 1; - bool producer_is_gas_lt_2_38 : 1; - bool producer_is_gas_2_39 : 1; -+ bool producer_is_gas_ge_2_40 : 1; - - /* When true, the file that we're processing is known to have - debugging info for C++ namespaces. GCC 3.3.x did not produce -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c -index a4f982962ae..8f2d7a34aef 100644 ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -148,6 +148,7 @@ static int dwarf2_loclist_block_index; - static int ada_block_index; - - static bool producer_is_gas_lt_2_38 (struct dwarf2_cu *cu); -+static bool producer_is_gas_ge_2_39 (struct dwarf2_cu *cu); - - /* Size of .debug_loclists section header for 32-bit DWARF format. */ - #define LOCLIST_HEADER_SIZE32 12 -@@ -10223,6 +10224,15 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) - lowpc = per_objfile->relocate (unrel_low); - highpc = per_objfile->relocate (unrel_high); - -+ if (gdbarch_bfd_arch_info (gdbarch)->arch == bfd_arch_arm -+ && producer_is_gas_ge_2_39 (cu)) -+ { -+ /* Gas version 2.39 produces DWARF for a Thumb subprogram with a low_pc -+ attribute with the thumb bit set (PR gas/31115). Work around this. */ -+ lowpc = gdbarch_addr_bits_remove (gdbarch, lowpc); -+ highpc = gdbarch_addr_bits_remove (gdbarch, highpc); -+ } -+ - /* If we have any template arguments, then we must allocate a - different sort of symbol. */ - for (child_die = die->child; child_die; child_die = child_die->sibling) -@@ -11507,6 +11517,7 @@ check_producer (struct dwarf2_cu *cu) - { - cu->producer_is_gas_lt_2_38 = major < 2 || (major == 2 && minor < 38); - cu->producer_is_gas_2_39 = major == 2 && minor == 39; -+ cu->producer_is_gas_ge_2_40 = major > 2 || (major == 2 && minor >= 40); - } - else - { -@@ -11561,6 +11572,17 @@ producer_is_gas_2_39 (struct dwarf2_cu *cu) - return cu->producer_is_gas_2_39; - } - -+/* Return true if CU is produced by GAS 2.39 or later. */ -+ -+static bool -+producer_is_gas_ge_2_39 (struct dwarf2_cu *cu) -+{ -+ if (!cu->checked_producer) -+ check_producer (cu); -+ -+ return cu->producer_is_gas_2_39 || cu->producer_is_gas_ge_2_40; -+} -+ - /* Return the accessibility of DIE, as given by DW_AT_accessibility. - If that attribute is not available, return the appropriate - default. */ - -base-commit: c79ecacd3f75cfb0ec1a3afc49ca3f30b1759009 --- -2.35.3 - diff --git a/gdb-sync-coffread-with-elfread.patch b/gdb-sync-coffread-with-elfread.patch deleted file mode 100644 index f71b28f..0000000 --- a/gdb-sync-coffread-with-elfread.patch +++ /dev/null @@ -1,47 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Andrew Burgess -Date: Thu, 12 Oct 2023 19:42:19 +0100 -Subject: gdb-sync-coffread-with-elfread.patch - -;; Backport upstream commit 7628a997f27. - -gdb/coffread: bring separate debug file logic into line with elfread.c - -In this commit: - - commit 8a92335bfca80cc9b4cd217505ea0dcbfdefbf07 - Date: Fri Feb 1 19:39:04 2013 +0000 - -the logic for when we try to load a separate debug file in elfread.c -was extended. The new code checks that the objfile doesn't already -have a separate debug objfile linked to it, and that the objfile isn't -itself a separate debug objfile for some other objfile. - -The coffread code wasn't extended at the same time. - -I don't know if it's possible for the coffread code to get into the -same state where these checks are needed, but I don't see why having -these checks would be a problem. In a later commit I plan to merge -this part of the elfread and coffread code, so bringing these two -pieces of code into line first makes that job easier. - -I've tested this with a simple test binary compiled with the mingw -toolchain on a Linux host. After compiling the binary and splitting -out the debug info GDB still finds and loads the separate debug info. - -Approved-By: Tom Tromey - -diff --git a/gdb/coffread.c b/gdb/coffread.c ---- a/gdb/coffread.c -+++ b/gdb/coffread.c -@@ -725,7 +725,9 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) - } - - /* Try to add separate debug file if no symbols table found. */ -- if (!objfile->has_partial_symbols ()) -+ else if (!objfile->has_partial_symbols () -+ && objfile->separate_debug_objfile == NULL -+ && objfile->separate_debug_objfile_backlink == NULL) - { - deferred_warnings warnings; - std::string debugfile diff --git a/gdb-tdep-fix-catching-syscall-execve-exit-for-arm.patch b/gdb-tdep-fix-catching-syscall-execve-exit-for-arm.patch deleted file mode 100644 index 3aa1420..0000000 --- a/gdb-tdep-fix-catching-syscall-execve-exit-for-arm.patch +++ /dev/null @@ -1,130 +0,0 @@ -From e2a2cb30bc4e85f462b817bac5393b3fee1ecf9f Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Tue, 21 Nov 2023 11:44:07 +0100 -Subject: [PATCH 3/7] [gdb/tdep] Fix catching syscall execve exit for arm - -When running test-case gdb.base/catch-syscall.exp on a pinebook (64-bit -aarch64 kernel, 32-bit userland) I run into: -... -(gdb) PASS: $exp: execve: syscall(s) execve appears in 'info breakpoints' -continue^M -Continuing.^M -^M -Catchpoint 18 (call to syscall execve), 0xf7726318 in execve () from \ - /lib/arm-linux-gnueabihf/libc.so.6^M -(gdb) PASS: gdb.base/catch-syscall.exp: execve: program has called execve -continue^M -Continuing.^M -process 32392 is executing new program: catch-syscall^M -Cannot access memory at address 0xf77c6a7c^M -(gdb) FAIL: $exp: execve: syscall execve has returned -... - -The memory error is thrown by arm_linux_get_syscall_number, when doing: -... - /* PC gets incremented before the syscall-stop, so read the - previous instruction. */ - unsigned long this_instr = - read_memory_unsigned_integer (pc - 4, 4, byte_order_for_code); -... - -The reason for the error is that we're stopped at the syscall exit of syscall -execve, and the pc is at the first insn of the new exec, which also happens to -be the first insn in the code segment, so consequently we cannot read the -previous insn. - -Fix this by detecting the situation by looking at the register state, similar -to what is done in aarch64_linux_get_syscall_number. - -Furthermore, catch the memory error by using safe_read_memory_unsigned_integer -and return -1 instead, matching the documented behaviour of -arm_linux_get_syscall_number. - -Finally, rather than using a hardcoded constant 11, introduce an ad-hoc -arm_sys_execve. - -Tested on pinebook. - -PR tdep/31071 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31071 ---- - gdb/arm-linux-tdep.c | 42 ++++++++++++++++++++++++++++++++++++++---- - 1 file changed, 38 insertions(+), 4 deletions(-) - -diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c -index 33748731cfd..8116c1368ff 100644 ---- a/gdb/arm-linux-tdep.c -+++ b/gdb/arm-linux-tdep.c -@@ -813,6 +813,32 @@ arm_linux_sigreturn_next_pc (struct regcache *regcache, - return next_pc; - } - -+/* Return true if we're at execve syscall-exit-stop. */ -+ -+static bool -+is_execve_syscall_exit (struct regcache *regs) -+{ -+ ULONGEST reg = -1; -+ -+ /* Check that lr is 0. */ -+ regcache_cooked_read_unsigned (regs, ARM_LR_REGNUM, ®); -+ if (reg != 0) -+ return false; -+ -+ /* Check that r0-r8 is 0. */ -+ for (int i = 0; i <= 8; ++i) -+ { -+ reg = -1; -+ regcache_cooked_read_unsigned (regs, ARM_A1_REGNUM + i, ®); -+ if (reg != 0) -+ return false; -+ } -+ -+ return true; -+} -+ -+#define arm_sys_execve 11 -+ - /* At a ptrace syscall-stop, return the syscall number. This either - comes from the SWI instruction (OABI) or from r7 (EABI). - -@@ -830,6 +856,9 @@ arm_linux_get_syscall_number (struct gdbarch *gdbarch, - int is_thumb; - ULONGEST svc_number = -1; - -+ if (is_execve_syscall_exit (regs)) -+ return arm_sys_execve; -+ - regcache_cooked_read_unsigned (regs, ARM_PC_REGNUM, &pc); - regcache_cooked_read_unsigned (regs, ARM_PS_REGNUM, &cpsr); - is_thumb = (cpsr & t_bit) != 0; -@@ -845,9 +874,14 @@ arm_linux_get_syscall_number (struct gdbarch *gdbarch, - - /* PC gets incremented before the syscall-stop, so read the - previous instruction. */ -- unsigned long this_instr = -- read_memory_unsigned_integer (pc - 4, 4, byte_order_for_code); -- -+ unsigned long this_instr; -+ { -+ ULONGEST val; -+ if (!safe_read_memory_unsigned_integer (pc - 4, 4, byte_order_for_code, -+ &val)) -+ return -1; -+ this_instr = val; -+ } - unsigned long svc_operand = (0x00ffffff & this_instr); - - if (svc_operand) -@@ -1265,7 +1299,7 @@ arm_canonicalize_syscall (int syscall) - case 8: return gdb_sys_creat; - case 9: return gdb_sys_link; - case 10: return gdb_sys_unlink; -- case 11: return gdb_sys_execve; -+ case arm_sys_execve: return gdb_sys_execve; - case 12: return gdb_sys_chdir; - case 13: return gdb_sys_time; - case 14: return gdb_sys_mknod; --- -2.35.3 - diff --git a/gdb-tdep-fix-gdb.base-watch-bitfields.exp-on-aarch64.patch b/gdb-tdep-fix-gdb.base-watch-bitfields.exp-on-aarch64.patch deleted file mode 100644 index 2b4fcd5..0000000 --- a/gdb-tdep-fix-gdb.base-watch-bitfields.exp-on-aarch64.patch +++ /dev/null @@ -1,349 +0,0 @@ -From 83b2b88c96f87a3649b4440f43a088dc6e292181 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Tue, 12 Mar 2024 17:08:18 +0100 -Subject: [PATCH 08/48] [gdb/tdep] Fix gdb.base/watch-bitfields.exp on aarch64 - -On aarch64-linux, with test-case gdb.base/watch-bitfields.exp I run into: -... -(gdb) continue^M -Continuing.^M -^M -Hardware watchpoint 2: -location q.a^M -^M -Old value = 1^M -New value = 0^M -main () at watch-bitfields.c:42^M -42 q.h--;^M -(gdb) FAIL: $exp: -location watch against bitfields: q.e: 0->5: continue -... - -In a minimal form, if we step past line 37 which sets q.e, and we have a -watchpoint set on q.e, it triggers: -... -$ gdb -q -batch watch-bitfields -ex "b 37" -ex run -ex "watch q.e" -ex step -Breakpoint 1 at 0x410204: file watch-bitfields.c, line 37. - -Breakpoint 1, main () at watch-bitfields.c:37 -37 q.e = 5; -Hardware watchpoint 2: q.e - -Hardware watchpoint 2: q.e - -Old value = 0 -New value = 5 -main () at /home/vries/gdb/src/gdb/testsuite/gdb.base/watch-bitfields.c:38 -38 q.f = 6; -... - -However, if we set in addition a watchpoint on q.a, the watchpoint on q.e -doesn't trigger. - -How does this happen? - -Bitfield q.a is just bit 0 of byte 0, and bitfield q.e is bit 4..7 of byte 1 -and bit 1 of byte 2. So, watch q.a should watch byte 0, and watch q.e should -watch bytes 1 and 2. - -Using "maint set show-debug-regs on" (and some more detailed debug prints) we -get: -... -WP2: addr=0x440028 (orig=0x440029), ctrl=0x000000d5, ref.count=1 - ctrl: enabled=1, offset=1, len=2 -WP3: addr=0x440028 (orig=0x440028), ctrl=0x00000035, ref.count=1 - ctrl: enabled=1, offset=0, len=1 -... -which matches that. - -When executing line 37, a hardware watchpoint trap triggers and we hit -aarch64_stopped_data_address with addr_trap == 0x440028: -... -(gdb) p /x addr_trap -$1 = 0x440028 -.... -and since the loop in aarch64_stopped_data_address walks backward, we check -WP3 first, which matches, and consequently target_stopped_by_watchpoint -returns true in watchpoints_triggered. - -Likewise for target_stopped_data_address, which also returns addr == 0x440028. -Watchpoints_triggered matches watchpoint q.a to that address, and sets -watch_triggered_yes. - -However, subsequently the value of q.a is checked, and it's the same value as -before (becase the insn in line 37 didn't change q.a), so the watchpoint -hardware trap is not reported to the user. - -The problem originates from that fact that aarch64_stopped_data_address picked -WP3 instead of WP2. - -There's something we can do about this. In the example above, both -target_stopped_by_watchpoint and target_stopped_data_address returned true. -Instead we can return true in target_stopped_by_watchpoint but false in -target_stopped_data_address. This lets watchpoints_triggered known that a -watchpoint was triggered, but we don't know where, and both watchpoints -get set to watch_triggered_unknown. - -Subsequently, the values of both q.a and q.e are checked, and since q.e is not -the same value as before, the watchpoint hardware trap is reported to the user. - -Note that this works well for regular (write) watchpoints (watch command), but -not for read watchpoints (rwatch command), because for those no value is -checked. Likewise for access watchpoints (awatch command). - -So, fix this by: -- passing a nullptr in aarch64_fbsd_nat_target::stopped_by_watchpoint and - aarch64_linux_nat_target::stopped_by_watchpoint to make clear we're not - interested in the stop address, -- introducing a two-phase approach in aarch64_stopped_data_address, where: - - phase one handles access and read watchpoints, as before, and - - phase two handles write watchpoints, where multiple matches cause: - - return true if addr_p == null, and - - return false if addr_p != null. - -Tested on aarch64-linux. - -Approved-By: Luis Machado - -PR tdep/31214 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31214 ---- - gdb/aarch64-fbsd-nat.c | 4 +- - gdb/aarch64-linux-nat.c | 4 +- - gdb/aarch64-nat.c | 132 ++++++++++++++++++++++++++----------- - gdb/nat/aarch64-hw-point.c | 25 +++++++ - gdb/nat/aarch64-hw-point.h | 2 + - 5 files changed, 123 insertions(+), 44 deletions(-) - -diff --git a/gdb/aarch64-fbsd-nat.c b/gdb/aarch64-fbsd-nat.c -index 38fb093f139..58518248248 100644 ---- a/gdb/aarch64-fbsd-nat.c -+++ b/gdb/aarch64-fbsd-nat.c -@@ -164,9 +164,7 @@ aarch64_fbsd_nat_target::stopped_data_address (CORE_ADDR *addr_p) - bool - aarch64_fbsd_nat_target::stopped_by_watchpoint () - { -- CORE_ADDR addr; -- -- return stopped_data_address (&addr); -+ return stopped_data_address (nullptr); - } - - /* Implement the "stopped_by_hw_breakpoint" target_ops method. */ -diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c -index c1d59b5d77c..768748a20db 100644 ---- a/gdb/aarch64-linux-nat.c -+++ b/gdb/aarch64-linux-nat.c -@@ -972,9 +972,7 @@ aarch64_linux_nat_target::stopped_data_address (CORE_ADDR *addr_p) - bool - aarch64_linux_nat_target::stopped_by_watchpoint () - { -- CORE_ADDR addr; -- -- return stopped_data_address (&addr); -+ return stopped_data_address (nullptr); - } - - /* Implement the "can_do_single_step" target_ops method. */ -diff --git a/gdb/aarch64-nat.c b/gdb/aarch64-nat.c -index ee8c5a1e21d..89d1ba6acc6 100644 ---- a/gdb/aarch64-nat.c -+++ b/gdb/aarch64-nat.c -@@ -231,46 +231,102 @@ bool - aarch64_stopped_data_address (const struct aarch64_debug_reg_state *state, - CORE_ADDR addr_trap, CORE_ADDR *addr_p) - { -- int i; -- -- for (i = aarch64_num_wp_regs - 1; i >= 0; --i) -- { -- const unsigned int offset -- = aarch64_watchpoint_offset (state->dr_ctrl_wp[i]); -- const unsigned int len = aarch64_watchpoint_length (state->dr_ctrl_wp[i]); -- const CORE_ADDR addr_watch = state->dr_addr_wp[i] + offset; -- const CORE_ADDR addr_watch_aligned = align_down (state->dr_addr_wp[i], 8); -- const CORE_ADDR addr_orig = state->dr_addr_orig_wp[i]; -- -- if (state->dr_ref_count_wp[i] -- && DR_CONTROL_ENABLED (state->dr_ctrl_wp[i]) -- && addr_trap >= addr_watch_aligned -- && addr_trap < addr_watch + len) -- { -- /* ADDR_TRAP reports the first address of the memory range -- accessed by the CPU, regardless of what was the memory -- range watched. Thus, a large CPU access that straddles -- the ADDR_WATCH..ADDR_WATCH+LEN range may result in an -- ADDR_TRAP that is lower than the -- ADDR_WATCH..ADDR_WATCH+LEN range. E.g.: -- -- addr: | 4 | 5 | 6 | 7 | 8 | -- |---- range watched ----| -- |----------- range accessed ------------| -- -- In this case, ADDR_TRAP will be 4. -- -- To match a watchpoint known to GDB core, we must never -- report *ADDR_P outside of any ADDR_WATCH..ADDR_WATCH+LEN -- range. ADDR_WATCH <= ADDR_TRAP < ADDR_ORIG is a false -- positive on kernels older than 4.10. See PR -- external/20207. */ -+ bool found = false; -+ for (int phase = 0; phase <= 1; ++phase) -+ for (int i = aarch64_num_wp_regs - 1; i >= 0; --i) -+ { -+ if (!(state->dr_ref_count_wp[i] -+ && DR_CONTROL_ENABLED (state->dr_ctrl_wp[i]))) -+ { -+ /* Watchpoint disabled. */ -+ continue; -+ } -+ -+ const enum target_hw_bp_type type -+ = aarch64_watchpoint_type (state->dr_ctrl_wp[i]); -+ if (type == hw_execute) -+ { -+ /* Watchpoint disabled. */ -+ continue; -+ } -+ -+ if (phase == 0) -+ { -+ /* Phase 0: No hw_write. */ -+ if (type == hw_write) -+ continue; -+ } -+ else -+ { -+ /* Phase 1: Only hw_write. */ -+ if (type != hw_write) -+ continue; -+ } -+ -+ const unsigned int offset -+ = aarch64_watchpoint_offset (state->dr_ctrl_wp[i]); -+ const unsigned int len -+ = aarch64_watchpoint_length (state->dr_ctrl_wp[i]); -+ const CORE_ADDR addr_watch = state->dr_addr_wp[i] + offset; -+ const CORE_ADDR addr_watch_aligned -+ = align_down (state->dr_addr_wp[i], 8); -+ const CORE_ADDR addr_orig = state->dr_addr_orig_wp[i]; -+ -+ /* ADDR_TRAP reports the first address of the memory range -+ accessed by the CPU, regardless of what was the memory -+ range watched. Thus, a large CPU access that straddles -+ the ADDR_WATCH..ADDR_WATCH+LEN range may result in an -+ ADDR_TRAP that is lower than the -+ ADDR_WATCH..ADDR_WATCH+LEN range. E.g.: -+ -+ addr: | 4 | 5 | 6 | 7 | 8 | -+ |---- range watched ----| -+ |----------- range accessed ------------| -+ -+ In this case, ADDR_TRAP will be 4. */ -+ if (!(addr_trap >= addr_watch_aligned -+ && addr_trap < addr_watch + len)) -+ { -+ /* Not a match. */ -+ continue; -+ } -+ -+ /* To match a watchpoint known to GDB core, we must never -+ report *ADDR_P outside of any ADDR_WATCH..ADDR_WATCH+LEN -+ range. ADDR_WATCH <= ADDR_TRAP < ADDR_ORIG is a false -+ positive on kernels older than 4.10. See PR -+ external/20207. */ -+ if (addr_p != nullptr) - *addr_p = addr_orig; -- return true; -- } -- } - -- return false; -+ if (phase == 0) -+ { -+ /* Phase 0: Return first match. */ -+ return true; -+ } -+ -+ /* Phase 1. */ -+ if (addr_p == nullptr) -+ { -+ /* First match, and we don't need to report an address. No need -+ to look for other matches. */ -+ return true; -+ } -+ -+ if (!found) -+ { -+ /* First match, and we need to report an address. Look for other -+ matches. */ -+ found = true; -+ continue; -+ } -+ -+ /* More than one match, and we need to return an address. No need to -+ look for further matches. */ -+ return false; -+ } -+ -+ return found; - } - - /* Define AArch64 maintenance commands. */ -diff --git a/gdb/nat/aarch64-hw-point.c b/gdb/nat/aarch64-hw-point.c -index 6747e61e026..3b8cdcba23b 100644 ---- a/gdb/nat/aarch64-hw-point.c -+++ b/gdb/nat/aarch64-hw-point.c -@@ -73,6 +73,31 @@ aarch64_watchpoint_length (unsigned int ctrl) - return retval; - } - -+/* Utility function that returns the type of a watchpoint according to the -+ content of a hardware debug control register CTRL. */ -+ -+enum target_hw_bp_type -+aarch64_watchpoint_type (unsigned int ctrl) -+{ -+ unsigned int type = DR_CONTROL_TYPE (ctrl); -+ -+ switch (type) -+ { -+ case 1: -+ return hw_read; -+ case 2: -+ return hw_write; -+ case 3: -+ return hw_access; -+ case 0: -+ /* Reserved for a watchpoint. It must behave as if the watchpoint is -+ disabled. */ -+ return hw_execute; -+ default: -+ gdb_assert_not_reached (""); -+ } -+} -+ - /* Given the hardware breakpoint or watchpoint type TYPE and its - length LEN, return the expected encoding for a hardware - breakpoint/watchpoint control register. */ -diff --git a/gdb/nat/aarch64-hw-point.h b/gdb/nat/aarch64-hw-point.h -index 2ff9ccb5c1c..71ae2864927 100644 ---- a/gdb/nat/aarch64-hw-point.h -+++ b/gdb/nat/aarch64-hw-point.h -@@ -73,6 +73,7 @@ - - #define DR_CONTROL_ENABLED(ctrl) (((ctrl) & 0x1) == 1) - #define DR_CONTROL_MASK(ctrl) (((ctrl) >> 5) & 0xff) -+#define DR_CONTROL_TYPE(ctrl) (((ctrl) >> 3) & 0x3) - - /* Structure for managing the hardware breakpoint/watchpoint resources. - DR_ADDR_* stores the address, DR_CTRL_* stores the control register -@@ -107,6 +108,7 @@ void aarch64_notify_debug_reg_change (ptid_t ptid, int is_watchpoint, - - unsigned int aarch64_watchpoint_offset (unsigned int ctrl); - unsigned int aarch64_watchpoint_length (unsigned int ctrl); -+enum target_hw_bp_type aarch64_watchpoint_type (unsigned int ctrl); - - int aarch64_handle_breakpoint (enum target_hw_bp_type type, CORE_ADDR addr, - int len, int is_insert, ptid_t ptid, --- -2.35.3 - diff --git a/gdb-tdep-fix-gdb.base-watchpoint-running-on-arm-ppc6.patch b/gdb-tdep-fix-gdb.base-watchpoint-running-on-arm-ppc6.patch deleted file mode 100644 index 74340f0..0000000 --- a/gdb-tdep-fix-gdb.base-watchpoint-running-on-arm-ppc6.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 1e64a66f72c79874016e78a4672b85cdeb506b9f Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Tue, 4 Jun 2024 09:30:03 +0000 -Subject: [PATCH] [gdb/tdep] Fix gdb.base/watchpoint-running on - {arm,ppc64le}-linux - -When running test-case gdb.base/watchpoint-running on ppc64le-linux, we get: -... -(gdb) watch global_var^M -warning: Error when detecting the debug register interface. \ - Debug registers will be unavailable.^M -Watchpoint 2: global_var^M -(gdb) FAIL: $exp: all-stop: hardware: watch global_var -FAIL: $exp: all-stop: hardware: watchpoint hit (timeout) -... - -The problem is that ppc_linux_dreg_interface::detect fails to detect the -hardware watchpoint interface, because the calls to ptrace return with errno -set to ESRCH. - -This is a feature of ptrace: if a call is done while the tracee is not -ptrace-stopped, it returns ESRCH. - -Indeed, in the test-case "watch global_var" is executed while the inferior is -running, and that triggers the first call to ppc_linux_dreg_interface::detect. - -And because the detection failure is cached, subsequent attempts at setting -hardware watchpoints will also fail, even if the tracee is ptrace-stopped. - -Fix this by calling target_can_use_hardware_watchpoint from -linux_init_ptrace_procfs, which is called from both: -- linux_nat_target::post_attach, and -- linux_nat_target::post_startup_inferior. - -By fixing this here, we also fix the same problem for arm-linux. - -Tested on ppc64le-linux and arm-linux. - -PR tdep/31834 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31834 -PR tdep/31705 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31705 - -(cherry picked from commit bbc92bfbf25ad42548100e31e491ed3c32fbfa3e) ---- - gdb/linux-nat.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c -index c8991cc3da4..47d74d27e11 100644 ---- a/gdb/linux-nat.c -+++ b/gdb/linux-nat.c -@@ -385,6 +385,18 @@ linux_init_ptrace_procfs (pid_t pid, int attached) - linux_ptrace_init_warnings (); - linux_proc_init_warnings (); - proc_mem_file_is_writable (); -+ -+ /* Some targets (for instance ppc and arm) may call ptrace to answer a -+ target_can_use_hardware_watchpoint query, and cache the result. However, -+ the ptrace call will fail with errno ESRCH if the tracee is not -+ ptrace-stopped, making the query fail. And if the caching mechanism does -+ not disregard an ESRCH result, all subsequent queries will also fail. -+ Call it now, where we known the tracee is ptrace-stopped. -+ -+ Other targets (for instance aarch64) do the relevant ptrace call and -+ caching in their implementation of post_attach and post_startup_inferior, -+ in which case this call is expected to have no effect. */ -+ target_can_use_hardware_watchpoint (bp_hardware_watchpoint, 1, 0); - } - - linux_nat_target::~linux_nat_target () - -base-commit: a6800d9c8145f25001dd39afc3571e3350573e81 --- -2.35.3 - diff --git a/gdb-tdep-fix-gdb.base-watchpoint-unaligned.exp-on-aa.patch b/gdb-tdep-fix-gdb.base-watchpoint-unaligned.exp-on-aa.patch deleted file mode 100644 index aed0238..0000000 --- a/gdb-tdep-fix-gdb.base-watchpoint-unaligned.exp-on-aa.patch +++ /dev/null @@ -1,262 +0,0 @@ -From 3efde6721b362fe0acad348443e4b961d7485717 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 14 Mar 2024 11:25:10 +0100 -Subject: [PATCH 09/48] [gdb/tdep] Fix gdb.base/watchpoint-unaligned.exp on - aarch64 - -On aarch64-linux, with test-case gdb.base/watchpoint-unaligned.exp I run into: -... -(gdb) watch data.u.size8twice[1]^M -Hardware watchpoint 241: data.u.size8twice[1]^M -(gdb) PASS: gdb.base/watchpoint-unaligned.exp: watch data.u.size8twice[1] -continue^M -Continuing.^M -FAIL: gdb.base/watchpoint-unaligned.exp: continue (timeout) -FAIL: gdb.base/watchpoint-unaligned.exp: size8twice write -... - -This happens as follows. - -We start the exec and set an 8-byte hardware watchpoint on -data.u.size8twice[1] at address 0x440048: -... -(gdb) p sizeof (data.u.size8twice[1]) -$1 = 8 -(gdb) p &data.u.size8twice[1] -$2 = (uint64_t *) 0x440048 -... - -We continue execution, and a 16-byte write at address 0x440040 triggers the -hardware watchpoint: -... - 4101c8: a9000801 stp x1, x2, [x0] -... - -When checking whether a watchpoint has triggered in -aarch64_stopped_data_address, we check against address 0x440040 (passed in -parameter addr_trap). This behaviour is documented: -... - /* ADDR_TRAP reports the first address of the memory range - accessed by the CPU, regardless of what was the memory - range watched. ... */ -... -and consequently the matching logic compares against an addr_watch_aligned: -... - && addr_trap >= addr_watch_aligned - && addr_trap < addr_watch + len) -... - -However, the comparison fails: -... -(gdb) p /x addr_watch_aligned -$3 = 0x440048 -(gdb) p addr_trap >= addr_watch_aligned -$4 = false -... - -Consequently, aarch64_stopped_data_address returns false, and -stopped_by_watchpoint returns false, and watchpoints_triggered returns 0, -which make infrun think it's looking at a delayed hardware -breakpoint/watchpoint trap: -... - [infrun] handle_signal_stop: stop_pc=0x4101c8 - [infrun] handle_signal_stop: delayed hardware breakpoint/watchpoint trap, ignoring -... -Infrun then ignores the trap and continues, but runs into the same situation -again and again, causing a hang which then causes the test timeout. - -Fix this by allowing a match 8 bytes below addr_watch_aligned. This -introduces the possibility for false positives, so we only do this for regular -"value changed" watchpoints. - -An earlier version of this patch worked by aligning addr_watch_aligned to 16 -instead of 8: -... -- const CORE_ADDR addr_watch_aligned = align_down (state->dr_addr_wp[i], 8); -+ const CORE_ADDR addr_watch_aligned = align_down (state->dr_addr_wp[i], 16); -... -but while that fixed the test-case, it didn't fix the problem completely, so -extend the test-case to check more scenarios. - -Tested on aarch64-linux. - -Tested-By: Luis Machado -Approved-By: Luis Machado - -PR tdep/29423 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29423 ---- - gdb/aarch64-nat.c | 17 +++- - gdb/testsuite/gdb.base/watchpoint-unaligned.c | 11 +-- - .../gdb.base/watchpoint-unaligned.exp | 78 ++++++++++++------- - 3 files changed, 68 insertions(+), 38 deletions(-) - -diff --git a/gdb/aarch64-nat.c b/gdb/aarch64-nat.c -index 89d1ba6acc6..a173e4e18d5 100644 ---- a/gdb/aarch64-nat.c -+++ b/gdb/aarch64-nat.c -@@ -269,7 +269,7 @@ aarch64_stopped_data_address (const struct aarch64_debug_reg_state *state, - = aarch64_watchpoint_length (state->dr_ctrl_wp[i]); - const CORE_ADDR addr_watch = state->dr_addr_wp[i] + offset; - const CORE_ADDR addr_watch_aligned -- = align_down (state->dr_addr_wp[i], 8); -+ = align_down (state->dr_addr_wp[i], AARCH64_HWP_MAX_LEN_PER_REG); - const CORE_ADDR addr_orig = state->dr_addr_orig_wp[i]; - - /* ADDR_TRAP reports the first address of the memory range -@@ -283,8 +283,19 @@ aarch64_stopped_data_address (const struct aarch64_debug_reg_state *state, - |---- range watched ----| - |----------- range accessed ------------| - -- In this case, ADDR_TRAP will be 4. */ -- if (!(addr_trap >= addr_watch_aligned -+ In this case, ADDR_TRAP will be 4. -+ -+ The access size also can be larger than that of the watchpoint -+ itself. For instance, the access size of an stp instruction is 16. -+ So, if we use stp to store to address p, and set a watchpoint on -+ address p + 8, the reported ADDR_TRAP can be p + 8 (observed on -+ RK3399 SOC). But it also can be p (observed on M1 SOC). Checking -+ for this situation introduces the possibility of false positives, -+ so we only do this for hw_write watchpoints. */ -+ const CORE_ADDR max_access_size = type == hw_write ? 16 : 8; -+ const CORE_ADDR addr_watch_base = addr_watch_aligned - -+ (max_access_size - AARCH64_HWP_MAX_LEN_PER_REG); -+ if (!(addr_trap >= addr_watch_base - && addr_trap < addr_watch + len)) - { - /* Not a match. */ -diff --git a/gdb/testsuite/gdb.base/watchpoint-unaligned.c b/gdb/testsuite/gdb.base/watchpoint-unaligned.c -index b60025a64f4..d854c376be9 100644 ---- a/gdb/testsuite/gdb.base/watchpoint-unaligned.c -+++ b/gdb/testsuite/gdb.base/watchpoint-unaligned.c -@@ -29,7 +29,7 @@ static volatile struct - uint32_t size4[2]; - uint16_t size2[4]; - uint8_t size1[8]; -- uint64_t size8twice[2]; -+ uint64_t size8twice[3]; - } - u; - } data; -@@ -44,13 +44,14 @@ write_size8twice (void) - static const uint64_t second = 2; - - #ifdef __aarch64__ -+ volatile void *p = &data.u.size8twice[offset]; - asm volatile ("stp %1, %2, [%0]" - : /* output */ -- : "r" (data.u.size8twice), "r" (first), "r" (second) /* input */ -+ : "r" (p), "r" (first), "r" (second) /* input */ - : "memory" /* clobber */); - #else -- data.u.size8twice[0] = first; -- data.u.size8twice[1] = second; -+ data.u.size8twice[offset] = first; -+ data.u.size8twice[offset + 1] = second; - #endif - } - -@@ -59,7 +60,7 @@ main (void) - { - volatile uint64_t local; - -- assert (sizeof (data) == 8 + 2 * 8); -+ assert (sizeof (data) == 8 + 3 * 8); - - write_size8twice (); - -diff --git a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp -index d31a9cdc2c8..c58704d033d 100644 ---- a/gdb/testsuite/gdb.base/watchpoint-unaligned.exp -+++ b/gdb/testsuite/gdb.base/watchpoint-unaligned.exp -@@ -151,38 +151,56 @@ foreach wpcount {4 7} { - gdb_assert $got_hit $test - } - --if ![runto_main] { -- return -1 --} --gdb_breakpoint [gdb_get_line_number "final_return"] "Breakpoint $decimal at $hex" "final_return" --set test {watch data.u.size8twice[1]} --set wpnum 0 --gdb_test_multiple $test $test { -- -re "Hardware watchpoint (\[0-9\]+): .*\r\n$gdb_prompt $" { -- set wpnum $expect_out(1,string) -- pass $gdb_test_name -- } -- -re "Watchpoint (\[0-9\]+): .*\r\n$gdb_prompt $" { -- if {[istarget "arm*-*-*"]} { -- untested $gdb_test_name -- } else { -- fail $gdb_test_name -- } -- } --} --if {$wpnum} { -- set test "continue" -- set got_hit 0 -- gdb_test_multiple $test $test { -- -re "\r\nCould not insert hardware watchpoint .*\r\n$gdb_prompt $" { -+# We've got an array with 3 8-byte elements. Do a store of 16 bytes, -+# to: -+# - elements 0 and 1 (offset == 0), and -+# - elements 1 and 2 (offset == 1). -+# For each case, check setting a watchpoint at: -+# - the first written element (index == 0), and -+# - the second element (index == 1). -+foreach_with_prefix offset { 0 1 } { -+ foreach_with_prefix index { 0 1 } { -+ -+ clean_restart $binfile -+ -+ if ![runto_main] { -+ return -1 - } -- -re "Hardware watchpoint $wpnum:.*New value = .*\r\n$gdb_prompt $" { -- set got_hit 1 -- send_gdb "continue\n" -- exp_continue -+ -+ gdb_test_no_output "set var offset = $offset" -+ gdb_breakpoint [gdb_get_line_number "final_return"] \ -+ "Breakpoint $decimal at $hex" "final_return" -+ set watch_index [expr $offset + $index] -+ set test "watch data.u.size8twice\[$watch_index\]" -+ set wpnum 0 -+ gdb_test_multiple $test $test { -+ -re "Hardware watchpoint (\[0-9\]+): .*\r\n$gdb_prompt $" { -+ set wpnum $expect_out(1,string) -+ pass $gdb_test_name -+ } -+ -re "Watchpoint (\[0-9\]+): .*\r\n$gdb_prompt $" { -+ if {[istarget "arm*-*-*"]} { -+ untested $gdb_test_name -+ } else { -+ fail $gdb_test_name -+ } -+ } - } -- -re " final_return .*\r\n$gdb_prompt $" { -+ if {$wpnum} { -+ set test "continue" -+ set got_hit 0 -+ gdb_test_multiple $test $test { -+ -re "\r\nCould not insert hardware watchpoint .*\r\n$gdb_prompt $" { -+ } -+ -re "Hardware watchpoint $wpnum:.*New value = .*\r\n$gdb_prompt $" { -+ set got_hit 1 -+ send_gdb "continue\n" -+ exp_continue -+ } -+ -re " final_return .*\r\n$gdb_prompt $" { -+ } -+ } -+ gdb_assert $got_hit "size8twice write" - } - } -- gdb_assert $got_hit "size8twice write" - } --- -2.35.3 - diff --git a/gdb-tdep-fix-nr-array-elements-in-ppc64_aggregate_ca.patch b/gdb-tdep-fix-nr-array-elements-in-ppc64_aggregate_ca.patch deleted file mode 100644 index 0b91eaf..0000000 --- a/gdb-tdep-fix-nr-array-elements-in-ppc64_aggregate_ca.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 3f0c512dc37dbede372a018732d315726a56d10e Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Wed, 1 Nov 2023 08:07:15 +0100 -Subject: [PATCH] [gdb/tdep] Fix nr array elements in ppc64_aggregate_candidate - -On AlmaLinux 9.2 powerpc64le I run into: -... -(gdb) PASS: gdb.ada/array_return.exp: continuing to Create_Small_Float_Vector -finish^M -Run till exit from #0 pck.create_small_float_vector () at pck.adb:30^M -0x00000000100022d4 in p () at p.adb:25^M -25 Vector := Create_Small_Float_Vector;^M -Value returned is $3 = (2.80259693e-45, 2.80259693e-45)^M -(gdb) FAIL: gdb.ada/array_return.exp: value printed by finish of Create_Small_Float_Vector -... -while this is expected: -... -Value returned is $3 = (4.25, 4.25)^M -... - -The problem is here in ppc64_aggregate_candidate: -... - if (!get_array_bounds (type, &low_bound, &high_bound)) - return -1; - count *= high_bound - low_bound -... - -The array type (containing 2 elements) is: -... - type Small_Float_Vector is array (1 .. 2) of Float; -... -so we have: -... -(gdb) p low_bound -$1 = 1 -(gdb) p high_bound -$2 = 2 -... -but we calculate the number of elements in the array using -"high_bound - low_bound", which is 1. - -Consequently, gdb fails to correctly classify the type as a ELFv2 homogeneous -aggregate. - -Fix this by calculating the number of elements in the array by using -"high_bound - low_bound + 1" instead. - -Furthermore, high_bound can (in general, though perhaps not here) be also be -smaller than low_bound, so to be safe take that into account as well: -... - LONGEST nr_array_elements = (low_bound > high_bound - ? 0 - : (high_bound - low_bound + 1)); - count *= nr_array_elements; -... - -Tested on powerpc64le-linux. - -PR tdep/31015 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31015 ---- - gdb/ppc-sysv-tdep.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c -index 9cea63307e6..dc89201eed2 100644 ---- a/gdb/ppc-sysv-tdep.c -+++ b/gdb/ppc-sysv-tdep.c -@@ -1126,7 +1126,11 @@ ppc64_aggregate_candidate (struct type *type, - - if (!get_array_bounds (type, &low_bound, &high_bound)) - return -1; -- count *= high_bound - low_bound; -+ -+ LONGEST nr_array_elements = (low_bound > high_bound -+ ? 0 -+ : (high_bound - low_bound + 1)); -+ count *= nr_array_elements; - - /* There must be no padding. */ - if (count == 0) - -base-commit: b1136560e772dd4c74f1fbb41f6ba840b92fb9d6 --- -2.35.3 - diff --git a/gdb-tdep-fix-reverse-execution-of-ldr-immediate-t4.patch b/gdb-tdep-fix-reverse-execution-of-ldr-immediate-t4.patch deleted file mode 100644 index 106bb08..0000000 --- a/gdb-tdep-fix-reverse-execution-of-ldr-immediate-t4.patch +++ /dev/null @@ -1,80 +0,0 @@ -From b8a8f319b30149f94823302d9120d83b9eee01a4 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Tue, 13 Feb 2024 09:10:54 +0100 -Subject: [PATCH 23/48] [gdb/tdep] Fix reverse execution of LDR(immediate) T4 - -When running test-case gdb.reverse/func-map-to-same-line.exp on arm-linux with -target board unix/-mthumb, we run into: -... -(gdb) reverse-step -func2 () at func-map-to-same-line.c:26 -26 { -(gdb) FAIL: gdb.reverse/func-map-to-same-line.exp: \ - column_info_flag=column-info: step-test: reverse-step into func2 -... - -The FAIL is caused by incorrect recording of this insn: -... -4f6: f85d 7b04 ldr.w r7, [sp], #4 -... - -The insn updates the sp, but we don't record this: -... -$ gdb -q -batch func-map-to-same-line \ - -ex "b *func2+8" \ - -ex run \ - -ex record \ - -ex "set debug record 2" \ - -ex stepi -Breakpoint 1 at 0x4f6: file func-map-to-same-line.c, line 27. - -Breakpoint 1, 0xaaaaa4f6 in func2 () at func-map-to-same-line.c:27 -27 } /* END FUNC2 */ -Process record: arm_process_record addr = 0xaaaaa4f6 -Process record: add register num = 15 to record list. -Process record: record_full_arch_list_add 0xabc6c460. -Process record: add register num = 7 to record list. -Process record: record_full_arch_list_add 0xabc3b868. -Process record: add register num = 25 to record list. -... -[ Note that sp is r13, and we see here only r15 (pc), r7, and r25 (ps). ] - -The problem is that the specific insn, an LDR(immediate) T4, is not handled in -thumb2_record_ld_word. - -Fix this by detecting the insn in thumb2_record_ld_word, and recording the -updated base register. - -Tested on arm-linux. - -Reported-By: Thiago Jung Bauermann -Approved-By: Luis Machado - -PR tdep/31278 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31278 ---- - gdb/arm-tdep.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c -index 04392115848..3b1682a2aea 100644 ---- a/gdb/arm-tdep.c -+++ b/gdb/arm-tdep.c -@@ -14156,6 +14156,14 @@ thumb2_record_ld_word (arm_insn_decode_record *thumb2_insn_r) - record_buf[1] = ARM_PS_REGNUM; - thumb2_insn_r->reg_rec_count = 2; - -+ if ((thumb2_insn_r->arm_insn & 0xfff00900) == 0xf8500900) -+ { -+ /* Detected LDR(immediate), T4, with write-back bit set. Record Rn -+ update. */ -+ record_buf[2] = bits (thumb2_insn_r->arm_insn, 16, 19); -+ thumb2_insn_r->reg_rec_count++; -+ } -+ - REG_ALLOC (thumb2_insn_r->arm_regs, thumb2_insn_r->reg_rec_count, - record_buf); - return ARM_RECORD_SUCCESS; --- -2.35.3 - diff --git a/gdb-testsuite-add-gdb.dwarf2-backward-spec-inter-cu..patch b/gdb-testsuite-add-gdb.dwarf2-backward-spec-inter-cu..patch deleted file mode 100644 index 85f633f..0000000 --- a/gdb-testsuite-add-gdb.dwarf2-backward-spec-inter-cu..patch +++ /dev/null @@ -1,128 +0,0 @@ -From 088088cf78b937cff973c95ec6da2d86ea173b48 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Sun, 24 Sep 2023 12:30:10 +0200 -Subject: [PATCH 07/13] [gdb/testsuite] Add - gdb.dwarf2/backward-spec-inter-cu.exp - -Add another regression test for PR symtab/30846. - -Tested on x86_64-linux. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30846 ---- - .../gdb.dwarf2/backward-spec-inter-cu.exp | 103 ++++++++++++++++++ - 1 file changed, 103 insertions(+) - create mode 100644 gdb/testsuite/gdb.dwarf2/backward-spec-inter-cu.exp - -diff --git a/gdb/testsuite/gdb.dwarf2/backward-spec-inter-cu.exp b/gdb/testsuite/gdb.dwarf2/backward-spec-inter-cu.exp -new file mode 100644 -index 00000000000..59b3db50dbb ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/backward-spec-inter-cu.exp -@@ -0,0 +1,103 @@ -+# Copyright 2023 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# Check that the DWARF reader works with a a DW_AT_specification that -+# refers to an earlier DIE. Inter-cu variant of forward-spec.exp. -+ -+load_lib dwarf.exp -+ -+# This test can only be run on targets which support DWARF-2 and use gas. -+require dwarf2_support -+ -+standard_testfile main.c -debug.S -+ -+# Set up the DWARF for the test. -+set asm_file [standard_output_file $srcfile2] -+Dwarf::assemble $asm_file { -+ global srcfile -+ -+ declare_labels spec -+ -+ cu {} { -+ DW_TAG_compile_unit { -+ {DW_AT_language @DW_LANG_C_plus_plus} -+ } { -+ declare_labels myint -+ -+ myint: DW_TAG_base_type { -+ {DW_AT_byte_size 4 DW_FORM_sdata} -+ {DW_AT_encoding @DW_ATE_signed} -+ {DW_AT_name myint} -+ } -+ -+ DW_TAG_namespace { -+ {DW_AT_name ns} -+ } { -+ spec: DW_TAG_variable { -+ {DW_AT_name v} -+ {DW_AT_type :$myint} -+ {DW_AT_declaration 1 DW_FORM_flag_present} -+ } -+ } -+ } -+ } -+ -+ cu {} { -+ DW_TAG_compile_unit { -+ {DW_AT_language @DW_LANG_C_plus_plus} -+ } { -+ # The new indexer has special code to compute the full -+ # name of an object that uses a specification that appears -+ # later in the DWARF. -+ DW_TAG_variable { -+ {DW_AT_specification %$spec} -+ {DW_AT_location { -+ DW_OP_const1u 23 -+ DW_OP_stack_value -+ } SPECIAL_expr} -+ } -+ } -+ } -+} -+ -+if {[build_executable "failed to build executable" ${testfile} \ -+ [list $srcfile $asm_file] {nodebug}]} { -+ return -1 -+} -+ -+set eol "\r\n" -+set ws "\[ \t\]" -+ -+set worker_threads_list {} -+ -+# Exercises the intra-shard case. -+lappend worker_threads_list 0 -+ -+# Might exercise the inter-shard case. -+lappend worker_threads_list default -+ -+foreach_with_prefix worker_threads $worker_threads_list { -+ -+ clean_restart -+ -+ if { $worker_threads != "default" } { -+ gdb_test_no_output "maint set worker-threads $worker_threads" -+ } -+ -+ gdb_load $binfile -+ -+ gdb_test "maint print objfiles" "$eol$ws+qualified:$ws+ns::v$eol.*" \ -+ "v has parent ns" -+} --- -2.35.3 - diff --git a/gdb-testsuite-add-gdb.dwarf2-forward-spec-inter-cu.e.patch b/gdb-testsuite-add-gdb.dwarf2-forward-spec-inter-cu.e.patch deleted file mode 100644 index cd0ea71..0000000 --- a/gdb-testsuite-add-gdb.dwarf2-forward-spec-inter-cu.e.patch +++ /dev/null @@ -1,128 +0,0 @@ -From a022afb07305b50fd6372015bef6c51ae461c6a9 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Sun, 24 Sep 2023 12:33:59 +0200 -Subject: [PATCH 06/13] [gdb/testsuite] Add - gdb.dwarf2/forward-spec-inter-cu.exp - -Add a regression test for PR symtab/30846. - -Tested on x86_64-linux. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30846 ---- - .../gdb.dwarf2/forward-spec-inter-cu.exp | 103 ++++++++++++++++++ - 1 file changed, 103 insertions(+) - create mode 100644 gdb/testsuite/gdb.dwarf2/forward-spec-inter-cu.exp - -diff --git a/gdb/testsuite/gdb.dwarf2/forward-spec-inter-cu.exp b/gdb/testsuite/gdb.dwarf2/forward-spec-inter-cu.exp -new file mode 100644 -index 00000000000..d8367b0a162 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/forward-spec-inter-cu.exp -@@ -0,0 +1,103 @@ -+# Copyright 2023 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# Check that the DWARF reader works with a a DW_AT_specification that -+# refers to a later DIE. Inter-cu variant of forward-spec.exp. -+ -+load_lib dwarf.exp -+ -+# This test can only be run on targets which support DWARF-2 and use gas. -+require dwarf2_support -+ -+standard_testfile main.c -debug.S -+ -+# Set up the DWARF for the test. -+set asm_file [standard_output_file $srcfile2] -+Dwarf::assemble $asm_file { -+ global srcfile -+ -+ declare_labels spec -+ -+ cu {} { -+ DW_TAG_compile_unit { -+ {DW_AT_language @DW_LANG_C_plus_plus} -+ } { -+ # The new indexer has special code to compute the full -+ # name of an object that uses a specification that appears -+ # later in the DWARF. -+ DW_TAG_variable { -+ {DW_AT_specification %$spec} -+ {DW_AT_location { -+ DW_OP_const1u 23 -+ DW_OP_stack_value -+ } SPECIAL_expr} -+ } -+ } -+ } -+ -+ cu {} { -+ DW_TAG_compile_unit { -+ {DW_AT_language @DW_LANG_C_plus_plus} -+ } { -+ declare_labels myint -+ -+ myint: DW_TAG_base_type { -+ {DW_AT_byte_size 4 DW_FORM_sdata} -+ {DW_AT_encoding @DW_ATE_signed} -+ {DW_AT_name myint} -+ } -+ -+ DW_TAG_namespace { -+ {DW_AT_name ns} -+ } { -+ spec: DW_TAG_variable { -+ {DW_AT_name v} -+ {DW_AT_type :$myint} -+ {DW_AT_declaration 1 DW_FORM_flag_present} -+ } -+ } -+ } -+ } -+} -+ -+if {[build_executable "failed to build executable" ${testfile} \ -+ [list $srcfile $asm_file] {nodebug}]} { -+ return -1 -+} -+ -+set eol "\r\n" -+set ws "\[ \t\]" -+ -+set worker_threads_list {} -+ -+# Exercises the intra-shard case. -+lappend worker_threads_list 0 -+ -+# Might exercise the inter-shard case. -+lappend worker_threads_list default -+ -+foreach_with_prefix worker_threads $worker_threads_list { -+ -+ clean_restart -+ -+ if { $worker_threads != "default" } { -+ gdb_test_no_output "maint set worker-threads $worker_threads" -+ } -+ -+ gdb_load $binfile -+ -+ gdb_test "maint print objfiles" "$eol$ws+qualified:$ws+ns::v$eol.*" \ -+ "v has parent ns" -+} --- -2.35.3 - diff --git a/gdb-testsuite-add-missing-include-in-gdb.base-ctf-pt.patch b/gdb-testsuite-add-missing-include-in-gdb.base-ctf-pt.patch deleted file mode 100644 index 61dfe6b..0000000 --- a/gdb-testsuite-add-missing-include-in-gdb.base-ctf-pt.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 4e9077b7e451bd87e48e9868519079a5a7070106 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Tue, 2 Apr 2024 16:22:46 +0200 -Subject: [PATCH 29/48] [gdb/testsuite] Add missing include in - gdb.base/ctf-ptype.c - -On fedora rawhide, when running test-case gdb.base/ctf-ptype.exp, I get: -... -gdb compile failed, ctf-ptype.c: In function 'main': -ctf-ptype.c:242:29: error: implicit declaration of function 'malloc' \ - [-Wimplicit-function-declaration] - 242 | v_char_pointer = (char *) malloc (1); - | ^~~~~~ -ctf-ptype.c:1:1: note: include '' or provide a declaration of 'malloc' - +++ |+#include - 1 | /* This test program is part of GDB, the GNU debugger. -... - -Fix this by adding the missing include. - -Tested on aarch64-linux. ---- - gdb/testsuite/gdb.base/ctf-ptype.c | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/gdb/testsuite/gdb.base/ctf-ptype.c b/gdb/testsuite/gdb.base/ctf-ptype.c -index cc4e98a234f..0cea44701b9 100644 ---- a/gdb/testsuite/gdb.base/ctf-ptype.c -+++ b/gdb/testsuite/gdb.base/ctf-ptype.c -@@ -24,6 +24,8 @@ - * First the basic C types. - */ - -+#include -+ - #if !defined (__STDC__) && !defined (_AIX) - #define signed /**/ - #endif -@@ -234,9 +236,6 @@ func_type v_func_type; - - int main () - { -- /* Ensure that malloc is a pointer type; avoid use of "void" and any include files. */ --/* extern char *malloc();*/ -- - /* Some of the tests in ptype.exp require invoking malloc, so make - sure it is linked in to this program. */ - v_char_pointer = (char *) malloc (1); --- -2.35.3 - diff --git a/gdb-testsuite-add-missing-include-in-gdb.base-rtld-s.patch b/gdb-testsuite-add-missing-include-in-gdb.base-rtld-s.patch deleted file mode 100644 index 79b4b4b..0000000 --- a/gdb-testsuite-add-missing-include-in-gdb.base-rtld-s.patch +++ /dev/null @@ -1,47 +0,0 @@ -From a2889f1e3f71589fee9454c0aa772ce1bc540db3 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 28 Mar 2024 06:51:59 +0100 -Subject: [PATCH 35/48] [gdb/testsuite] Add missing include in - gdb.base/rtld-step.exp - -On fedora rawhide, with test-case gdb.base/rtld-step.exp I get: -... -static-pie-static-libc.c: In function '_start':^M -static-pie-static-libc.c:1:22: error: \ - implicit declaration of function '_exit' [-Wimplicit-function-declaration]^M - 1 | void _start (void) { _exit (0); }^M - | ^~~~~^M -compiler exited with status 1 - ... -UNTESTED: gdb.base/rtld-step.exp: failed to compile \ - (-static-pie not supported or static libc missing) -... - -Fix this by adding the missing include. - -Tested on aarch64-linux. - -Approved-by: Kevin Buettner ---- - gdb/testsuite/gdb.base/rtld-step.exp | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.base/rtld-step.exp b/gdb/testsuite/gdb.base/rtld-step.exp -index 9a6c76d191a..bd3f89769b8 100644 ---- a/gdb/testsuite/gdb.base/rtld-step.exp -+++ b/gdb/testsuite/gdb.base/rtld-step.exp -@@ -86,7 +86,10 @@ set rtld_flags [list debug additional_flags=[list -static-pie -fPIE \ - -nostdlib -static -lc]] - - if { ![gdb_can_simple_compile static-pie-static-libc \ -- "void _start (void) { _exit (0); }" \ -+ { -+ #include -+ void _start (void) { _exit (0); } -+ } \ - executable $rtld_flags] } { - set reason "-static-pie not supported or static libc missing" - untested "failed to compile ($reason)" --- -2.35.3 - diff --git a/gdb-testsuite-add-missing-includes-in-gdb.trace-coll.patch b/gdb-testsuite-add-missing-includes-in-gdb.trace-coll.patch deleted file mode 100644 index 6793bce..0000000 --- a/gdb-testsuite-add-missing-includes-in-gdb.trace-coll.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 4a08080ba59f4f66bf062a9015f9e51c765b05b5 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Fri, 29 Mar 2024 07:47:30 +0100 -Subject: [PATCH 31/48] [gdb/testsuite] Add missing includes in - gdb.trace/collection.c - -On fedora rawhide, with test-case gdb.trace/collection.exp, I get: -... -gdb compile failed, collection.c: In function 'strings_test_func': -collection.c:227:13: error: implicit declaration of function 'malloc' \ - [-Wimplicit-function-declaration] - 227 | longloc = malloc(500); - | ^~~~~~ -collection.c:1:1: note: \ - include '' or provide a declaration of 'malloc' - +++ |+#include - 1 | /* This testcase is part of GDB, the GNU debugger. - -collection.c:228:3: error: implicit declaration of function 'strcpy' \ - [-Wimplicit-function-declaration] - 228 | strcpy(longloc, ... ); - | ^~~~~~ -collection.c:1:1: note: include '' or provide a declaration of \ - 'strcpy' - +++ |+#include - 1 | /* This testcase is part of GDB, the GNU debugger. -collection.c:230:8: error: implicit declaration of function 'strlen' \ - [-Wimplicit-function-declaration] - 230 | i += strlen (locstr); - | ^~~~~~ -collection.c:230:8: note: include '' or provide a declaration of \ - 'strlen' -... - -Fix this by adding the missing includes. - -Tested on aarch64-linux. - -Approved-By: John Baldwin ---- - gdb/testsuite/gdb.trace/collection.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/gdb/testsuite/gdb.trace/collection.c b/gdb/testsuite/gdb.trace/collection.c -index 3b5484748af..4ef93a3fa33 100644 ---- a/gdb/testsuite/gdb.trace/collection.c -+++ b/gdb/testsuite/gdb.trace/collection.c -@@ -19,6 +19,9 @@ - * Test program for trace collection - */ - -+#include -+#include -+ - /* - * Typedefs - */ --- -2.35.3 - diff --git a/gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch b/gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch deleted file mode 100644 index b2826a4..0000000 --- a/gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 08ce0d63c343f7db9a504d37de25391a997b46e2 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Mon, 8 Jan 2024 13:01:50 +0100 -Subject: [PATCH] [gdb/testsuite] Add missing -no-prompt-anchor in - gdb.base/vfork-follow-parent.exp - -When running test-case gdb.base/vfork-follow-parent.exp it passes fine, but -when running it with "taskset -c 0" I run into: -... -(gdb) inferior 1^M -[Switching to inferior 1 [process 26606] (vfork-follow-parent-exit)]^M -[Switching to thread 1.1 (process 26606)]^M -(gdb) Reading symbols from vfork-follow-parent-exit...^M -FAIL: $exp: exec_file=vfork-follow-parent-exit: target-non-stop=on: \ - non-stop=off: resolution_method=schedule-multiple: inferior 1 (timeout) -... - -Fix this by using -no-prompt-anchor. - -Tested on x86_64-linux. - -PR testsuite/31166 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31166 ---- - gdb/testsuite/gdb.base/vfork-follow-parent.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.base/vfork-follow-parent.exp b/gdb/testsuite/gdb.base/vfork-follow-parent.exp -index 89c38001dac..ee6f2835d8e 100644 ---- a/gdb/testsuite/gdb.base/vfork-follow-parent.exp -+++ b/gdb/testsuite/gdb.base/vfork-follow-parent.exp -@@ -64,7 +64,7 @@ proc do_test { resolution_method } { - gdb_test "set schedule-multiple on" - gdb_test "continue" "$::inferior_exited_re normally.*" \ - "continue to end of inferior 2" -- gdb_test "inferior 1" ".*Switching to inferior 1.*" -+ gdb_test -no-prompt-anchor "inferior 1" ".*Switching to inferior 1.*" - gdb_test "print unblock_parent = 1" " = 1" - } else { - error "invalid resolution method: $resolution_method" - -base-commit: 19185006cfe0901da907da4f09fbc197aba976a2 --- -2.35.3 - diff --git a/gdb-testsuite-add-pr-gdb-26967-kfail-in-two-more-tes.patch b/gdb-testsuite-add-pr-gdb-26967-kfail-in-two-more-tes.patch deleted file mode 100644 index 1ee0ff4..0000000 --- a/gdb-testsuite-add-pr-gdb-26967-kfail-in-two-more-tes.patch +++ /dev/null @@ -1,167 +0,0 @@ -From fb2b155e33f5a21259c52685ee9b24f75ac66e75 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Wed, 20 Mar 2024 19:23:48 +0100 -Subject: [PATCH 10/48] [gdb/testsuite] Add PR gdb/26967 KFAIL in two more - test-cases - -On aarch64-linux (debian 12), when running test-case -gdb.base/longjmp-until-in-main.exp, I run into: -... -(gdb) until 33^M -warning: Breakpoint address adjusted from 0x70f727c678928489 to 0xfff727c678928489.^M -Warning:^M -Cannot insert breakpoint 0.^M -Cannot access memory at address 0xfff727c678928489^M -^M -0x0000fffff7e3a580 in siglongjmp () from /lib/aarch64-linux-gnu/libc.so.6^M -(gdb) FAIL: gdb.base/longjmp-until-in-main.exp: until $line, in main -... - -This is PR gdb/26967: no longjmp probe is available: -... -(gdb) info probes stap libc ^longjmp$^M -No probes matched.^M -... -and glibc applies pointer mangling which makes it fairly difficult for gdb to -get the longjmp target. - -There's a KFAIL for this in test-case gdb.base/longjmp.exp, added in commit -b5e7cd5cd3d ("[gdb/testsuite] Add KFAILs in gdb.base/longjmp.exp"). - -Factor out new proc have_longjmp_probe, and use it to add similar KFAIL in -this and one more test-case. - -Tested on aarch64-linux. - -Approved-By: Tom Tromey ---- - .../gdb.base/longjmp-until-in-main.exp | 24 ++++++++++++++++--- - gdb/testsuite/gdb.base/longjmp.exp | 11 +-------- - .../premature-dummy-frame-removal.exp | 22 ++++++++++++++++- - gdb/testsuite/lib/gdb.exp | 19 +++++++++++++++ - 4 files changed, 62 insertions(+), 14 deletions(-) - -diff --git a/gdb/testsuite/gdb.base/longjmp-until-in-main.exp b/gdb/testsuite/gdb.base/longjmp-until-in-main.exp -index c0635f23345..6167989319a 100644 ---- a/gdb/testsuite/gdb.base/longjmp-until-in-main.exp -+++ b/gdb/testsuite/gdb.base/longjmp-until-in-main.exp -@@ -35,10 +35,28 @@ if {![runto_main]} { - return - } - -+set have_longjmp_probe [have_longjmp_probe] -+ - delete_breakpoints - - set until_to_line [gdb_get_line_number "until to here"] - --gdb_test "until $until_to_line" \ -- " until to here .*" \ -- "until \$line, in main" -+set re_cannot_insert_bp \ -+ [multi_line \ -+ "Warning:" \ -+ "Cannot insert breakpoint $::decimal\\." \ -+ "Cannot access memory at address $::hex"] -+ -+set test "until \$line, in main" -+gdb_test_multiple "until $until_to_line" $test { -+ -re -wrap "\r\n$re_cannot_insert_bp\r\n.*" { -+ if { $have_longjmp_probe } { -+ fail $gdb_test_name -+ } else { -+ kfail gdb/26967 $gdb_test_name -+ } -+ } -+ -re -wrap " until to here .*" { -+ pass $gdb_test_name -+ } -+} -diff --git a/gdb/testsuite/gdb.base/longjmp.exp b/gdb/testsuite/gdb.base/longjmp.exp -index f74891aa7ca..0420f4df675 100644 ---- a/gdb/testsuite/gdb.base/longjmp.exp -+++ b/gdb/testsuite/gdb.base/longjmp.exp -@@ -62,16 +62,7 @@ proc do_test { with_probes } { - # - # We detect the different failure modes and kfail these. - -- set have_longjmp_probe 0 -- gdb_test_multiple "info probes stap libc ^longjmp$" "" { -- -re -wrap "No probes matched\\." { -- pass $gdb_test_name -- } -- -re -wrap "\r\nstap\[ \t\]+libc\[ \t\]+longjmp\[ \t\]+.*" { -- pass $gdb_test_name -- set have_longjmp_probe 1 -- } -- } -+ set have_longjmp_probe [have_longjmp_probe] - - if { $with_probes } { - if { !$have_longjmp_probe } { -diff --git a/gdb/testsuite/gdb.base/premature-dummy-frame-removal.exp b/gdb/testsuite/gdb.base/premature-dummy-frame-removal.exp -index fe906cefb14..6979345ee45 100644 ---- a/gdb/testsuite/gdb.base/premature-dummy-frame-removal.exp -+++ b/gdb/testsuite/gdb.base/premature-dummy-frame-removal.exp -@@ -49,7 +49,27 @@ if {![runto_main]} { - set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py] - gdb_test_no_output "source ${pyfile}" "load python file" - --gdb_test "p some_func ()" " = 0" -+set have_longjmp_probe [have_longjmp_probe] -+ -+set re_cannot_insert_bp \ -+ [multi_line \ -+ "Warning:" \ -+ "Cannot insert breakpoint $::decimal\\." \ -+ "Cannot access memory at address $::hex"] -+ -+gdb_test_multiple "p some_func ()" "" { -+ -re -wrap "\r\n$re_cannot_insert_bp\r\n.*" { -+ if { $have_longjmp_probe } { -+ fail $gdb_test_name -+ } else { -+ kfail gdb/26967 $gdb_test_name -+ return 0 -+ } -+ } -+ -re -wrap " = 0" { -+ pass $gdb_test_name -+ } -+} - - # When frame debugging is turned on, this test has (previously) - # revealed some crashes due to the Python frame unwinder trying to -diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index 21967550cf6..70c2db4ac84 100644 ---- a/gdb/testsuite/lib/gdb.exp -+++ b/gdb/testsuite/lib/gdb.exp -@@ -4615,6 +4615,25 @@ proc skip_libstdcxx_probe_tests {} { - return [skip_libstdcxx_probe_tests_prompt "$gdb_prompt $"] - } - -+# Return 1 if libc supports the longjmp probe. Note that we're not using -+# gdb_caching_proc because the probe may have been disabled. -+ -+proc have_longjmp_probe {} { -+ set have_probe -1 -+ gdb_test_multiple "info probes stap libc ^longjmp$" "" { -+ -re -wrap "No probes matched\\." { -+ set have_probe 0 -+ } -+ -re -wrap "\r\nstap\[ \t\]+libc\[ \t\]+longjmp\[ \t\]+.*" { -+ set have_probe 1 -+ } -+ } -+ if { $have_probe == -1 } { -+ error "failed to get libc longjmp probe status" -+ } -+ return $have_probe -+} -+ - # Helper for gdb_is_target_* procs. TARGET_NAME is the name of the target - # we're looking for (used to build the test name). TARGET_STACK_REGEXP - # is a regexp that will match the output of "maint print target-stack" if --- -2.35.3 - diff --git a/gdb-testsuite-call-ldd-version-in-gdb.testsuite-dump.patch b/gdb-testsuite-call-ldd-version-in-gdb.testsuite-dump.patch deleted file mode 100644 index a20c617..0000000 --- a/gdb-testsuite-call-ldd-version-in-gdb.testsuite-dump.patch +++ /dev/null @@ -1,39 +0,0 @@ -From dedb6d4ce0478d053b7e786d73f298c8e72f1f99 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 18 Jan 2024 11:14:19 +0100 -Subject: [PATCH 44/48] [gdb/testsuite] Call ldd --version in - gdb.testsuite/dump-system-info.exp - -Once in a while I'm looking at the gdb.log of an entire testsuite run, and I'm -trying to establish what glibc version is used. Sometimes this is possible, -sometimes not. - -Make this easy by calling ldd --version in test-case -gdb.testsuite/dump-system-info.exp, which for instance on openSUSE Leap 15.4 -gives: -... -$ ldd --version -ldd (GNU libc) 2.31 - ... -$ -... - -Tested on x86_64-linux. - -Approved-By: Tom Tromey ---- - gdb/testsuite/gdb.testsuite/dump-system-info.exp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/gdb/testsuite/gdb.testsuite/dump-system-info.exp b/gdb/testsuite/gdb.testsuite/dump-system-info.exp -index 1a28b29b1c7..e3eb9eee73a 100644 ---- a/gdb/testsuite/gdb.testsuite/dump-system-info.exp -+++ b/gdb/testsuite/gdb.testsuite/dump-system-info.exp -@@ -36,3 +36,4 @@ proc dump_info {cmd {what ""}} { - dump_info "cat /proc/cpuinfo" "Cpuinfo" - dump_info "uname -a" - dump_info "lsb_release -a" -+dump_info "ldd --version" --- -2.35.3 - diff --git a/gdb-testsuite-factor-out-proc-get_portnum.patch b/gdb-testsuite-factor-out-proc-get_portnum.patch deleted file mode 100644 index bf62489..0000000 --- a/gdb-testsuite-factor-out-proc-get_portnum.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 2e5c943519de45144a880b8ce0d693dfd13f4650 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Sat, 4 May 2024 10:41:09 +0200 -Subject: [PATCH 16/48] [gdb/testsuite] Factor out proc get_portnum - -In gdbserver_start, we have some code that determines what port number to use: -... - # Port id -- either specified in baseboard file, or managed here. - if [target_info exists gdb,socketport] { - set portnum [target_info gdb,socketport] - } else { - # Bump the port number to avoid conflicts with hung ports. - incr portnum - } -... - -Factor this out into a new proc get_portnum. - -Tested on aarch64-linux. - -Approved-By: Tom Tromey ---- - gdb/testsuite/lib/gdbserver-support.exp | 40 ++++++++++++++++++------- - 1 file changed, 29 insertions(+), 11 deletions(-) - -diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp -index 30d94fd7eb6..8aaca946b7d 100644 ---- a/gdb/testsuite/lib/gdbserver-support.exp -+++ b/gdb/testsuite/lib/gdbserver-support.exp -@@ -129,8 +129,31 @@ proc gdb_target_cmd { args } { - return [expr $res == 0 ? 0 : 1] - } - --global portnum --set portnum "2345" -+# Return a usable port number. -+ -+proc get_portnum {} { -+ if { [target_info exists gdb,socketport] } { -+ # Hard-coded in target board. -+ return [target_info gdb,socketport] -+ } -+ -+ # Not hard-coded in target board. Return increasing port numbers, -+ # starting at $initial_portnum, to avoid conflicts with hung ports. -+ set initial_portnum 2345 -+ -+ # Currently available port number. -+ global portnum -+ -+ # Initialize, if necessary. -+ if { ![info exists portnum] } { -+ set portnum $initial_portnum -+ } -+ -+ # Return currently available port number, and update it. -+ set res $portnum -+ incr portnum -+ return $res -+} - - # Locate the gdbserver binary. Returns "" if gdbserver could not be found. - -@@ -247,16 +270,10 @@ proc gdbserver_default_get_comm_port { port } { - # Returns the target protocol and socket to connect to. - - proc gdbserver_start { options arguments } { -- global portnum - global GDB_TEST_SOCKETHOST - - # Port id -- either specified in baseboard file, or managed here. -- if [target_info exists gdb,socketport] { -- set portnum [target_info gdb,socketport] -- } else { -- # Bump the port number to avoid conflicts with hung ports. -- incr portnum -- } -+ set portnum [get_portnum] - - # Extract the local and remote host ids from the target board struct. - if { [info exists GDB_TEST_SOCKETHOST] } { -@@ -372,10 +389,11 @@ proc gdbserver_start { options arguments } { - -re "Listening on" { } - -re "Can't (bind address|listen on socket): Address already in use\\.\r\n" { - verbose -log "Port $portnum is already in use." -- if ![target_info exists gdb,socketport] { -+ set other_portnum [get_portnum] -+ if { $other_portnum != $portnum } { - # Bump the port number to avoid the conflict. - wait -i $expect_out(spawn_id) -- incr portnum -+ set portnum $other_portnum - continue - } - } --- -2.35.3 - diff --git a/gdb-testsuite-factor-out-proc-lock_dir.patch b/gdb-testsuite-factor-out-proc-lock_dir.patch deleted file mode 100644 index a3aab5c..0000000 --- a/gdb-testsuite-factor-out-proc-lock_dir.patch +++ /dev/null @@ -1,63 +0,0 @@ -From a9cc672af5f81034f4189446aa656c08ea10e2ac Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Sat, 4 May 2024 10:41:09 +0200 -Subject: [PATCH 19/48] [gdb/testsuite] Factor out proc lock_dir - -In lib/rocm.exp we have: -... -set gpu_lock_filename $objdir/gpu-parallel.lock -... - -This decides both the lock file name and directory. - -Factor out a new proc lock_dir that decides on the directory, leaving just: -... -set gpu_lock_filename gpu-parallel.lock -... - -Tested on aarch64-linux. - -Approved-By: Tom Tromey ---- - gdb/testsuite/lib/gdb-utils.exp | 7 +++++++ - gdb/testsuite/lib/rocm.exp | 2 +- - 2 files changed, 8 insertions(+), 1 deletion(-) - -diff --git a/gdb/testsuite/lib/gdb-utils.exp b/gdb/testsuite/lib/gdb-utils.exp -index 3dc4b3a3ebc..63f6b8c3698 100644 ---- a/gdb/testsuite/lib/gdb-utils.exp -+++ b/gdb/testsuite/lib/gdb-utils.exp -@@ -177,10 +177,17 @@ proc lock_file_release {info} { - } - } - -+# Return directory where we keep lock files. -+ -+proc lock_dir {} { -+ return $objdir -+} -+ - # Run body under lock LOCK_FILE. - - proc with_lock { lock_file body } { - if {[info exists ::GDB_PARALLEL]} { -+ set lock_file [file join [lock_dir] $lock_file] - set lock_rc [lock_file_acquire $lock_file] - } - -diff --git a/gdb/testsuite/lib/rocm.exp b/gdb/testsuite/lib/rocm.exp -index 86ec29567da..a6608664f24 100644 ---- a/gdb/testsuite/lib/rocm.exp -+++ b/gdb/testsuite/lib/rocm.exp -@@ -105,7 +105,7 @@ gdb_caching_proc allow_hipcc_tests {} { - - # The lock file used to ensure that only one GDB has access to the GPU - # at a time. --set gpu_lock_filename $objdir/gpu-parallel.lock -+set gpu_lock_filename gpu-parallel.lock - - # Run body under the GPU lock. Also calls gdb_exit before releasing - # the GPU lock. --- -2.35.3 - diff --git a/gdb-testsuite-factor-out-proc-with_lock.patch b/gdb-testsuite-factor-out-proc-with_lock.patch deleted file mode 100644 index 19f606b..0000000 --- a/gdb-testsuite-factor-out-proc-with_lock.patch +++ /dev/null @@ -1,160 +0,0 @@ -From d96f9a0ef44eb3a3f41e2a478b817c1d00e6e0a1 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Sat, 4 May 2024 10:41:09 +0200 -Subject: [PATCH 18/48] [gdb/testsuite] Factor out proc with_lock - -Factor out proc with_lock from with_rocm_gpu_lock, and move required procs -lock_file_acquire and lock_file_release to lib/gdb-utils.exp. - -Tested on aarch64-linux. - -Approved-By: Tom Tromey ---- - gdb/testsuite/lib/gdb-utils.exp | 59 +++++++++++++++++++++++++++++++++ - gdb/testsuite/lib/rocm.exp | 55 +----------------------------- - 2 files changed, 60 insertions(+), 54 deletions(-) - -diff --git a/gdb/testsuite/lib/gdb-utils.exp b/gdb/testsuite/lib/gdb-utils.exp -index a010e14fc04..3dc4b3a3ebc 100644 ---- a/gdb/testsuite/lib/gdb-utils.exp -+++ b/gdb/testsuite/lib/gdb-utils.exp -@@ -138,3 +138,62 @@ proc version_compare { l1 op l2 } { - } - return 1 - } -+ -+# Acquire lock file LOCKFILE. Tries forever until the lock file is -+# successfully created. -+ -+proc lock_file_acquire {lockfile} { -+ verbose -log "acquiring lock file: $::subdir/${::gdb_test_file_name}.exp" -+ while {true} { -+ if {![catch {open $lockfile {WRONLY CREAT EXCL}} rc]} { -+ set msg "locked by $::subdir/${::gdb_test_file_name}.exp" -+ verbose -log "lock file: $msg" -+ # For debugging, put info in the lockfile about who owns -+ # it. -+ puts $rc $msg -+ flush $rc -+ return [list $rc $lockfile] -+ } -+ after 10 -+ } -+} -+ -+# Release a lock file. -+ -+proc lock_file_release {info} { -+ verbose -log "releasing lock file: $::subdir/${::gdb_test_file_name}.exp" -+ -+ if {![catch {fconfigure [lindex $info 0]}]} { -+ if {![catch { -+ close [lindex $info 0] -+ file delete -force [lindex $info 1] -+ } rc]} { -+ return "" -+ } else { -+ return -code error "Error releasing lockfile: '$rc'" -+ } -+ } else { -+ error "invalid lock" -+ } -+} -+ -+# Run body under lock LOCK_FILE. -+ -+proc with_lock { lock_file body } { -+ if {[info exists ::GDB_PARALLEL]} { -+ set lock_rc [lock_file_acquire $lock_file] -+ } -+ -+ set code [catch {uplevel 1 $body} result] -+ -+ if {[info exists ::GDB_PARALLEL]} { -+ lock_file_release $lock_rc -+ } -+ -+ if {$code == 1} { -+ global errorInfo errorCode -+ return -code $code -errorinfo $errorInfo -errorcode $errorCode $result -+ } else { -+ return -code $code $result -+ } -+} -diff --git a/gdb/testsuite/lib/rocm.exp b/gdb/testsuite/lib/rocm.exp -index fcdf665aef9..86ec29567da 100644 ---- a/gdb/testsuite/lib/rocm.exp -+++ b/gdb/testsuite/lib/rocm.exp -@@ -107,68 +107,15 @@ gdb_caching_proc allow_hipcc_tests {} { - # at a time. - set gpu_lock_filename $objdir/gpu-parallel.lock - --# Acquire lock file LOCKFILE. Tries forever until the lock file is --# successfully created. -- --proc lock_file_acquire {lockfile} { -- verbose -log "acquiring lock file: $::subdir/${::gdb_test_file_name}.exp" -- while {true} { -- if {![catch {open $lockfile {WRONLY CREAT EXCL}} rc]} { -- set msg "locked by $::subdir/${::gdb_test_file_name}.exp" -- verbose -log "lock file: $msg" -- # For debugging, put info in the lockfile about who owns -- # it. -- puts $rc $msg -- flush $rc -- return [list $rc $lockfile] -- } -- after 10 -- } --} -- --# Release a lock file. -- --proc lock_file_release {info} { -- verbose -log "releasing lock file: $::subdir/${::gdb_test_file_name}.exp" -- -- if {![catch {fconfigure [lindex $info 0]}]} { -- if {![catch { -- close [lindex $info 0] -- file delete -force [lindex $info 1] -- } rc]} { -- return "" -- } else { -- return -code error "Error releasing lockfile: '$rc'" -- } -- } else { -- error "invalid lock" -- } --} -- - # Run body under the GPU lock. Also calls gdb_exit before releasing - # the GPU lock. - - proc with_rocm_gpu_lock { body } { -- if {[info exists ::GDB_PARALLEL]} { -- set lock_rc [lock_file_acquire $::gpu_lock_filename] -- } -- -- set code [catch {uplevel 1 $body} result] -+ with_lock $::gpu_lock_filename $body - - # In case BODY returned early due to some testcase failing, and - # left GDB running, debugging the GPU. - gdb_exit -- -- if {[info exists ::GDB_PARALLEL]} { -- lock_file_release $lock_rc -- } -- -- if {$code == 1} { -- global errorInfo errorCode -- return -code $code -errorinfo $errorInfo -errorcode $errorCode $result -- } else { -- return -code $code $result -- } - } - - # Return true if all the devices support debugging multiple processes --- -2.35.3 - diff --git a/gdb-testsuite-fix-another-regexp-in-gdb.threads-step.patch b/gdb-testsuite-fix-another-regexp-in-gdb.threads-step.patch new file mode 100644 index 0000000..014bd08 --- /dev/null +++ b/gdb-testsuite-fix-another-regexp-in-gdb.threads-step.patch @@ -0,0 +1,40 @@ +From 210d0ce41454a56ee39ff97d5353c98b38c8ac5f Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 29 Aug 2024 11:39:02 +0200 +Subject: [PATCH 17/37] [gdb/testsuite] Fix another regexp in + gdb.threads/stepi-over-clone.exp + +On openSUSE Tumbleweed, I run into: +... +(gdb) PASS: gdb.threads/stepi-over-clone.exp: catch process syscalls +continue^M +Continuing.^M +^M +Catchpoint 2 (call to syscall clone3), __clone3 () at clone3.S:62^M +(gdb) FAIL: gdb.threads/stepi-over-clone.exp: continue +... + +Fix this by updating another (see commit 8fbf220321d) regexp to also recognize +__clone3. + +Tested on x86_64-linux. +--- + gdb/testsuite/gdb.threads/stepi-over-clone.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.threads/stepi-over-clone.exp b/gdb/testsuite/gdb.threads/stepi-over-clone.exp +index f671fd7b8bd..a9f3cb52fca 100644 +--- a/gdb/testsuite/gdb.threads/stepi-over-clone.exp ++++ b/gdb/testsuite/gdb.threads/stepi-over-clone.exp +@@ -50,7 +50,7 @@ gdb_test_multiple "catch syscall group:process" "catch process syscalls" { + + set re_loc1 "$hex in clone\[23\]? \\(\\)" + set re_loc2 "$decimal\[ \t\]+in \[^\r\n\]+" +-set re_loc3 "clone\[23\]? \\(\\) at \[^:\]+:$decimal" ++set re_loc3 "(__)?clone\[23\]? \\(\\) at \[^:\]+:$decimal" + + gdb_test "continue" \ + "Catchpoint $decimal \\(call to syscall clone\[23\]?\\), ($re_loc1|$re_loc3).*" +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdb.ada-verylong.exp-on-32-bit-tar.patch b/gdb-testsuite-fix-gdb.ada-verylong.exp-on-32-bit-tar.patch deleted file mode 100644 index 807b5f1..0000000 --- a/gdb-testsuite-fix-gdb.ada-verylong.exp-on-32-bit-tar.patch +++ /dev/null @@ -1,84 +0,0 @@ -From d9a17115fbeb8d4c1780677bb57edf0fe8448038 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Tue, 2 Apr 2024 16:14:39 +0200 -Subject: [PATCH 30/48] [gdb/testsuite] Fix gdb.ada/verylong.exp on 32-bit - target - -In an aarch32-linux chroot on an aarch64-linux system, I run into: -... -(gdb) print x^M -$1 = 9223372036854775807^M -(gdb) FAIL: gdb.ada/verylong.exp: print x -... - -A passing version on aarch64-linux looks like: -... -(gdb) print x^M -$1 = 170141183460469231731687303715884105727^M -(gdb) PASS: gdb.ada/verylong.exp: print x -... - -The difference is caused by the size of the type Long_Long_Long_Integer, which -is: -- a 128-bit signed on 64-bit targets, and -- a 64-bit signed on 32-bit target. - -Fix this by detecting the size of the Long_Long_Long_Integer type, and -handling it. - -Tested on aarch64-linux and aarch32-linux. - -Approved-By: Tom Tromey - -PR testsuite/31574 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31574 - -[1] https://gcc.gnu.org/onlinedocs/gnat_rm/Implementation-Defined-Characteristics.html ---- - gdb/testsuite/gdb.ada/verylong.exp | 28 +++++++++++++++++++++------- - 1 file changed, 21 insertions(+), 7 deletions(-) - -diff --git a/gdb/testsuite/gdb.ada/verylong.exp b/gdb/testsuite/gdb.ada/verylong.exp -index d1fa968015b..4b83e0bd467 100644 ---- a/gdb/testsuite/gdb.ada/verylong.exp -+++ b/gdb/testsuite/gdb.ada/verylong.exp -@@ -29,15 +29,29 @@ clean_restart ${testfile} - set bp_location [gdb_get_line_number "START" ${testdir}/prog.adb] - runto "prog.adb:$bp_location" - --gdb_test "print x" " = 170141183460469231731687303715884105727" --gdb_test "print x / 2" " = 85070591730234615865843651857942052863" --gdb_test "print (x / 4) * 2" " = 85070591730234615865843651857942052862" -+set lll_int_size 0 -+gdb_test_multiple "ptype Long_Long_Long_Integer" "" { -+ -re -wrap "type = <8-byte integer>" { -+ set lll_int_size 8 -+ set max 9223372036854775807 -+ } -+ -re -wrap "type = <16-byte integer>" { -+ set lll_int_size 16 -+ set max 170141183460469231731687303715884105727 -+ } -+} -+ -+require {expr $lll_int_size == 8 || $lll_int_size == 16} -+ -+gdb_test "print x" " = $max" -+gdb_test "print x / 2" " = [expr $max / 2]" -+gdb_test "print (x / 4) * 2" " = [expr ($max / 4) * 2]" - gdb_test "print x - x" " = 0" --gdb_test "print x - 99 + 1" " = 170141183460469231731687303715884105629" --gdb_test "print -x" " = -170141183460469231731687303715884105727" --gdb_test "print +x" " = 170141183460469231731687303715884105727" -+gdb_test "print x - 99 + 1" " = [expr $max - 99 + 1]" -+gdb_test "print -x" " = -$max" -+gdb_test "print +x" " = $max" - - gdb_test "print 170141183460469231731687303715884105727" \ - " = 170141183460469231731687303715884105727" --gdb_test "print x = 170141183460469231731687303715884105727" \ -+gdb_test "print x = $max" \ - " = true" --- -2.35.3 - diff --git a/gdb-testsuite-fix-gdb.base-eh_return.exp.patch b/gdb-testsuite-fix-gdb.base-eh_return.exp.patch deleted file mode 100644 index fc0c4df..0000000 --- a/gdb-testsuite-fix-gdb.base-eh_return.exp.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 7ee7b011e0c846a77cb4d1dde3a3c625412f1733 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 25 Jan 2024 16:25:07 +0100 -Subject: [PATCH 11/48] [gdb/testsuite] Fix gdb.base/eh_return.exp - -On Fedora rawhide aarch64, I run into: -... -(gdb) PASS: gdb.base/eh_return.exp: set breakpoint on address -run ^M -Starting program: eh_return ^M -[Thread debugging using libthread_db enabled]^M -Using host libthread_db library "/lib64/libthread_db.so.1".^M -[Inferior 1 (process 1113051) exited normally]^M -(gdb) FAIL: gdb.base/eh_return.exp: hit breakpoint (the program exited) -... - -This happens as follows: the test-case sets a breakpoint on the last -instruction of function eh2: -... -(gdb) break *0x00000000004103ec^M -... -and expects to hit the breakpoint, but instead the "br x6" is taken: -... - 0x00000000004103e0 <+176>: cbz x4, 0x4103ec ^M - 0x00000000004103e4 <+180>: add sp, sp, x5^M - 0x00000000004103e8 <+184>: br x6^M - 0x00000000004103ec <+188>: ret^M -... - -In contrast, with fedora f39 we have: -... - 0x00000000004103bc <+156>: ldp x2, x3, [sp, #48]^M - 0x00000000004103c0 <+160>: ldp x29, x30, [sp, #16]^M - 0x00000000004103c4 <+164>: add sp, sp, #0x50^M - 0x00000000004103c8 <+168>: add sp, sp, x4^M - 0x00000000004103cc <+172>: ret^M - -... -and the breakpoint is reached. - -Fix this by detecting that the breakpoint is not hit, and declaring the test -unsupported. - -Tested on aarch64-linux. - -Approved-By: Tom Tromey - -PR testsuite/31291 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31291 ---- - gdb/testsuite/gdb.base/eh_return.exp | 16 +++++++++++++++- - 1 file changed, 15 insertions(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.base/eh_return.exp b/gdb/testsuite/gdb.base/eh_return.exp -index bced409547b..7d566b1ddc2 100644 ---- a/gdb/testsuite/gdb.base/eh_return.exp -+++ b/gdb/testsuite/gdb.base/eh_return.exp -@@ -79,4 +79,18 @@ gdb_assert [gdb_breakpoint "*$address" no-message] "set breakpoint on address" - # breakpoint, so instead, run to the breakpoint. - gdb_run_cmd - --gdb_test "" "Breakpoint .*" "hit breakpoint" -+set test "hit breakpoint" -+gdb_expect { -+ -re "Breakpoint .*\r\n$gdb_prompt $" { -+ pass $test -+ } -+ -re "$inferior_exited_re normally.*\r\n$gdb_prompt $" { -+ unsupported $test -+ } -+ -re "\r\n$gdb_prompt $" { -+ fail $test -+ } -+ default { -+ fail $test -+ } -+} --- -2.35.3 - diff --git a/gdb-testsuite-fix-gdb.base-ending-run.exp-on-manjaro.patch b/gdb-testsuite-fix-gdb.base-ending-run.exp-on-manjaro.patch deleted file mode 100644 index 26f3954..0000000 --- a/gdb-testsuite-fix-gdb.base-ending-run.exp-on-manjaro.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 5f7c4f7a435571d535c2372b999e1017eefb15c4 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 28 Mar 2024 08:26:31 +0100 -Subject: [PATCH 33/48] [gdb/testsuite] Fix gdb.base/ending-run.exp on manjaro - linux - -On aarch64-linux, using the manjaro linux distro, I run into: -... -(gdb) next^M -32 }^M -(gdb) next^M -0x0000fffff7d67b80 in ?? () from /usr/lib/libc.so.6^M -(gdb) FAIL: gdb.base/ending-run.exp: step out of main -... - -What happens here is described in detail in this clause: -... - -re "0x.*\\?\\? \\(\\) from /lib/powerpc.*$gdb_prompt $" { - # This case occurs on Powerpc when gdb steps out of main and the - # needed debug info files are not loaded on the system, preventing - # GDB to determine which function it reached (__libc_start_call_main). - # Ideally, the target system would have the necessary debugging - # information, but in its absence, GDB's behavior is as expected. - ... - } -... -but the clause only matches for powerpc. - -Fix this by: -- making the regexp generic enough to also match /usr/lib/libc.so.6, and -- updating the comment to not mention powerpc. - -Tested on aarch64-linux. - -PR testsuite/31450 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31450 ---- - gdb/testsuite/gdb.base/ending-run.exp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp -index 070dcc6f190..76701d33e19 100644 ---- a/gdb/testsuite/gdb.base/ending-run.exp -+++ b/gdb/testsuite/gdb.base/ending-run.exp -@@ -206,8 +206,8 @@ gdb_test_multiple "next" "step out of main" { - # This is what happens on system using uClibc. - pass "step out of main" - } -- -re "0x.*\\?\\? \\(\\) from /lib/powerpc.*$gdb_prompt $" { -- # This case occurs on Powerpc when gdb steps out of main and the -+ -re -wrap "$hex in \\?\\? \\(\\) from \[^\r\n\]+" { -+ # This case occurs when gdb steps out of main and the - # needed debug info files are not loaded on the system, preventing - # GDB to determine which function it reached (__libc_start_call_main). - # Ideally, the target system would have the necessary debugging --- -2.35.3 - diff --git a/gdb-testsuite-fix-gdb.base-list-no-debug.exp-on-debi.patch b/gdb-testsuite-fix-gdb.base-list-no-debug.exp-on-debi.patch deleted file mode 100644 index 443bf3e..0000000 --- a/gdb-testsuite-fix-gdb.base-list-no-debug.exp-on-debi.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 2235f362eba0387f0404620676dd29637ff17738 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Sun, 17 Mar 2024 16:48:43 +0100 -Subject: [PATCH 39/48] [gdb/testsuite] Fix gdb.base/list-no-debug.exp on - debian - -On debian 12, aarch64-linux I run into: -... -(gdb) list .^M -No symbol table is loaded. Use the "file" command.^M -(gdb) FAIL: gdb.base/list-nodebug.exp: first 'list .' -... - -The test-case expects some debug info, but none for main. Instead, there's no -debug info at all. - -Fix this by adding another source file to the test-case, and compiling it with -debug info. - -Tested on aarch64-linux. - -Approved-By: Andrew Burgess - -PR testsuite/31290 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31290 ---- - gdb/testsuite/gdb.base/list-nodebug-2.c | 24 ++++++++++++++++++++++++ - gdb/testsuite/gdb.base/list-nodebug.c | 7 +++++-- - gdb/testsuite/gdb.base/list-nodebug.exp | 9 ++++++--- - 3 files changed, 35 insertions(+), 5 deletions(-) - create mode 100644 gdb/testsuite/gdb.base/list-nodebug-2.c - -diff --git a/gdb/testsuite/gdb.base/list-nodebug-2.c b/gdb/testsuite/gdb.base/list-nodebug-2.c -new file mode 100644 -index 00000000000..861e6149071 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/list-nodebug-2.c -@@ -0,0 +1,24 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2024 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+extern int foo (void); -+ -+int -+foo (void) -+{ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.base/list-nodebug.c b/gdb/testsuite/gdb.base/list-nodebug.c -index 078517c011e..d4ae6787310 100644 ---- a/gdb/testsuite/gdb.base/list-nodebug.c -+++ b/gdb/testsuite/gdb.base/list-nodebug.c -@@ -15,7 +15,10 @@ - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - --int main () -+extern int foo (void); -+ -+int -+main (void) - { -- return 0; -+ return foo (); - } -diff --git a/gdb/testsuite/gdb.base/list-nodebug.exp b/gdb/testsuite/gdb.base/list-nodebug.exp -index 08de05423af..942a282083a 100644 ---- a/gdb/testsuite/gdb.base/list-nodebug.exp -+++ b/gdb/testsuite/gdb.base/list-nodebug.exp -@@ -16,10 +16,13 @@ - # Test that using the command "list" in a file with no debug information - # will not crash GDB and will give reasonable output. - --standard_testfile .c -+standard_testfile .c -2.c - --if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ -- {nodebug}]} { -+if { [prepare_for_testing_full "failed to prepare" \ -+ [list \ -+ $testfile {} \ -+ $srcfile {nodebug} \ -+ $srcfile2 {debug}]] } { - return -1 - } - --- -2.35.3 - diff --git a/gdb-testsuite-fix-gdb.cp-namespace.exp-with-read1.patch b/gdb-testsuite-fix-gdb.cp-namespace.exp-with-read1.patch deleted file mode 100644 index 64e0052..0000000 --- a/gdb-testsuite-fix-gdb.cp-namespace.exp-with-read1.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 818f70aa9a6c17ddc79ac33f80c1a3e4df30ea14 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Sun, 14 Jan 2024 09:36:12 +0100 -Subject: [PATCH 46/48] [gdb/testsuite] Fix gdb.cp/namespace.exp with read1 - -With check-read1 we run into: -... -(gdb) break DNE>::DNE^M -Function "DNE>::DNE" not defined.^M -Make breakpoint pending on future shared library load? (y or [n]) y^M -Breakpoint 9 (DNE>::DNE) pending.^M -n^M -(gdb) FAIL: gdb.cp/namespace.exp: br malformed '>' (got interactive prompt) -n^M -... - -The question is supposed to be handled by the question and response arguments -to this gdb_test call: -... -gdb_test "break DNE>::DNE" "" "br malformed \'>\'" \ - "Make breakpoint pending on future shared library load?.*" "y" -... -but both this and the builtin handling in gdb_test_multiple triggers. - -The cause of this is that the question argument regexp is incomplete. - -Fix this by making sure that the entire question is matched in the regexp: -... -set yn_re [string_to_regexp {(y or [n])}] - ... - "Make breakpoint pending on future shared library load\\? $yn_re " "Y" -... - -Tested on x86_64-linux. ---- - gdb/testsuite/gdb.cp/namespace.exp | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/gdb/testsuite/gdb.cp/namespace.exp b/gdb/testsuite/gdb.cp/namespace.exp -index a9de09f087d..b1c7403f2c6 100644 ---- a/gdb/testsuite/gdb.cp/namespace.exp -+++ b/gdb/testsuite/gdb.cp/namespace.exp -@@ -251,8 +251,9 @@ gdb_test "print AAA::ALPHA" "\\$\[0-9\].* = AAA::ALPHA" - gdb_test "whatis ::C::CClass::NestedClass" "type = C::CClass::NestedClass" - gdb_test "whatis ::C::CClass::NestedClass *" "type = C::CClass::NestedClass \\*" - -+set yn_re [string_to_regexp {(y or [n])}] - # Break on functions with a malformed name. - gdb_test "break DNE>::DNE" "" "br malformed \'>\'" \ -- "Make breakpoint pending on future shared library load?.*" "y" -+ "Make breakpoint pending on future shared library load\\? $yn_re " "Y" - gdb_test "break DNE)::DNE" "" "br malformed \')\'" \ -- "Make breakpoint pending on future shared library load?.*" "y" -+ "Make breakpoint pending on future shared library load\\? $yn_re " "Y" --- -2.35.3 - diff --git a/gdb-testsuite-fix-gdb.dwarf2-dw2-gas-workaround.exp.patch b/gdb-testsuite-fix-gdb.dwarf2-dw2-gas-workaround.exp.patch deleted file mode 100644 index 99a0948..0000000 --- a/gdb-testsuite-fix-gdb.dwarf2-dw2-gas-workaround.exp.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 254988c36fe592e89af5d92e1d35a6eb4b09cbb0 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Mon, 6 Nov 2023 08:32:54 +0100 -Subject: [PATCH 2/2] [gdb/testsuite] Fix gdb.dwarf2/dw2-gas-workaround.exp - -Recently added test-case gdb.dwarf2/dw2-gas-workaround.exp: -- passes when gdb is configured using $(cd ../src; pwd)/configure, but -- fails when using ../src/configure. - -Fix this by making the matching more precise: -... -- -re -wrap "$objdir.*" { -+ -re -wrap "name_for_id = $objdir/$srcfile\r\n.*" { -... -such that we only fail on the line: -... -[symtab-create] start_subfile: name = dw2-lines.c, name_for_id = \ - /data/vries/gdb/leap-15-4/build/gdb/testsuite/dw2-lines.c^M -... - -Reported-By: Carl Love ---- - gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp b/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp -index ca2b10f23b3..7d5375a920a 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp -+++ b/gdb/testsuite/gdb.dwarf2/dw2-gas-workaround.exp -@@ -83,7 +83,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \ - - gdb_test_no_output "set debug symtab-create 1" - gdb_test_multiple "ptype bar" "" { -- -re -wrap "$objdir.*" { -+ -re -wrap "name_for_id = $objdir/$srcfile\r\n.*" { - fail $gdb_test_name - } - -re -wrap "" { --- -2.35.3 - diff --git a/gdb-testsuite-fix-gdb.mi-mi-dprintf.exp-with-read1.patch b/gdb-testsuite-fix-gdb.mi-mi-dprintf.exp-with-read1.patch deleted file mode 100644 index 1115c0c..0000000 --- a/gdb-testsuite-fix-gdb.mi-mi-dprintf.exp-with-read1.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 80b0afed39702c7a25d68f6b28427f92c5db6d80 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Sun, 14 Jan 2024 10:21:46 +0100 -Subject: [PATCH 45/48] [gdb/testsuite] Fix gdb.mi/mi-dprintf.exp with read1 - -When running test-case gdb.mi/mi-dprintf.exp with check-read1, I run into: -... -(gdb) ^M -PASS: gdb.mi/mi-dprintf.exp: gdb: mi 2nd dprintf stop --data-evaluate-expression stderr^M -^done,value="0x7ffff7e4a420 <_IO_2_1_stderr_>"^M -(gdb) FAIL: gdb.mi/mi-dprintf.exp: stderr symbol check -... - -The problem is in proc mi_gdb_is_stderr_available: -... -proc mi_gdb_is_stderr_available {} { - set has_stderr_symbol false - gdb_test_multiple "-data-evaluate-expression stderr" "stderr symbol check" { - -re "\\^error,msg=\"'stderr' has unknown type; cast it to its declared type\"\r\n$::mi_gdb_prompt$" { - } - -re "$::mi_gdb_prompt$" { - set has_stderr_symbol true - } - } -... -which uses a gdb_test_multiple that is supposed to use the mi prompt, but -doesn't use -prompt to indicate this. Consequently, the default patterns use -the regular gdb prompt, which trigger earlier than the two custom patterns -which use "$::mi_gdb_prompt$". - -Fix this by adding the missing -prompt "$::mi_gdb_prompt$" arguments. - -While we're at it, make the gdb_test_multiple call a bit more readable by -using variables, and by using -wrap. - -Tested on x86_64-linux, with: -- gcc and clang (to trigger both the has_stderr_symbol true and false cases) -- make check and make check-read1. ---- - gdb/testsuite/lib/mi-support.exp | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - -diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp -index 540eb3371c6..1b702e8a3bb 100644 ---- a/gdb/testsuite/lib/mi-support.exp -+++ b/gdb/testsuite/lib/mi-support.exp -@@ -2956,13 +2956,18 @@ proc foreach_mi_ui_mode { var_name body } { - # Check if GDB has information about the stderr symbol. - proc mi_gdb_is_stderr_available {} { - set has_stderr_symbol false -- gdb_test_multiple "-data-evaluate-expression stderr" "stderr symbol check" { -- -re "\\^error,msg=\"'stderr' has unknown type; cast it to its declared type\"\r\n$::mi_gdb_prompt$" { -+ -+ set cmd "-data-evaluate-expression stderr" -+ set test "stderr symbol check" -+ set msg_re {"'stderr' has unknown type; cast it to its declared type"} -+ gdb_test_multiple $cmd $test -prompt "$::mi_gdb_prompt$" { -+ -re -wrap "\\^error,msg=$msg_re" { - # Default value of false is fine. - } -- -re "$::mi_gdb_prompt$" { -+ -re -wrap "" { - set has_stderr_symbol true - } - } -+ - return $has_stderr_symbol - } --- -2.35.3 - diff --git a/gdb-testsuite-fix-gdb.server-server-connect.exp-for-.patch b/gdb-testsuite-fix-gdb.server-server-connect.exp-for-.patch deleted file mode 100644 index 7606cae..0000000 --- a/gdb-testsuite-fix-gdb.server-server-connect.exp-for-.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 237a0ec8a20cc5e233d630a43d9cacd2774a564d Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Wed, 20 Mar 2024 19:31:24 +0100 -Subject: [PATCH 37/48] [gdb/testsuite] Fix gdb.server/server-connect.exp for - missing ipv6 - -On a system without ipv6 support enabled, when running test-case -gdb.server/server-connect.exp, it takes about 4 minutes, and I get: -... -builtin_spawn gdbserver --once ::1:2347 server-connect^M -Can't open socket: Address family not supported by protocol.^M -Exiting^M -PASS: gdb.server/server-connect.exp: tcp6: start gdbserver -target remote tcp6:::1:2347^M -A program is being debugged already. Kill it? (y or n) y^M -could not connect: Address family not supported by protocol.^M -(gdb) FAIL: gdb.server/server-connect.exp: tcp6: connect to gdbserver using tcp6:::1 -... - -Fix this by: -- recognizing the error message in gdbserver_start, and returning an empty list - to signal unsupported, and -- handling the unsupported response in the test-case. - -This brings testing time down to 2 seconds, and gets me: -... -UNSUPPORTED: gdb.server/server-connect.exp: tcp6: start gdbserver -UNSUPPORTED: gdb.server/server-connect.exp: tcp6-with-brackets: start gdbserver -UNSUPPORTED: gdb.server/server-connect.exp: udp6: start gdbserver -UNSUPPORTED: gdb.server/server-connect.exp: udp6-with-brackets: start gdbserver -... - -Tested on aarch64-linux. - -Approved-By: Tom Tromey - -PR testsuite/31502 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31502 ---- - gdb/testsuite/gdb.server/server-connect.exp | 3 +++ - gdb/testsuite/lib/gdbserver-support.exp | 3 +++ - 2 files changed, 6 insertions(+) - -diff --git a/gdb/testsuite/gdb.server/server-connect.exp b/gdb/testsuite/gdb.server/server-connect.exp -index 1f5b9a27cf4..ffdfaa89154 100644 ---- a/gdb/testsuite/gdb.server/server-connect.exp -+++ b/gdb/testsuite/gdb.server/server-connect.exp -@@ -88,6 +88,9 @@ save_vars { GDB_TEST_SOCKETHOST } { - } else { - if { $gdbserver_should_fail } { - fail "$test: gdbserver should fail but did not" -+ } elseif { [llength $res] == 0 } { -+ unsupported $test -+ continue - } else { - pass "$test" - } -diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp -index a3cccf54a72..d065fb36764 100644 ---- a/gdb/testsuite/lib/gdbserver-support.exp -+++ b/gdb/testsuite/lib/gdbserver-support.exp -@@ -429,6 +429,9 @@ proc gdbserver_start { options arguments } { - -re ".*: cannot resolve name: .*\r\n" { - error "gdbserver cannot resolve name." - } -+ -re "Can't open socket: Address family not supported by protocol." { -+ return {} -+ } - timeout { - error "Timeout waiting for gdbserver response." - } --- -2.35.3 - diff --git a/gdb-testsuite-fix-gdb_py_module_available-for-python.patch b/gdb-testsuite-fix-gdb_py_module_available-for-python.patch new file mode 100644 index 0000000..81b0296 --- /dev/null +++ b/gdb-testsuite-fix-gdb_py_module_available-for-python.patch @@ -0,0 +1,39 @@ +From 7992b582e5a55bf2fd64f2f94b854d335c36c6a5 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 28 Jan 2025 17:44:42 +0100 +Subject: [PATCH] [gdb/testsuite] Fix gdb_py_module_available for python 3.4 + +On SLE-12, I run into: +... +(gdb) python import pygments +Python Exception : No module named 'pygments' +Error occurred in Python: No module named 'pygments' +(gdb) FAIL: gdb.base/style.exp: python import pygments +... + +Fix this by handling the output string in gdb_py_module_available. + +Tested on x86_64-linux. +--- + gdb/testsuite/lib/gdb-python.exp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/gdb/testsuite/lib/gdb-python.exp b/gdb/testsuite/lib/gdb-python.exp +index e27d5c17769..f8141193596 100644 +--- a/gdb/testsuite/lib/gdb-python.exp ++++ b/gdb/testsuite/lib/gdb-python.exp +@@ -64,6 +64,9 @@ proc gdb_py_module_available { name } { + -re -wrap "ImportError: No module named '?${name}'?.*" { + set available false + } ++ -re -wrap "Python Exception : No module named '?${name}'?.*" { ++ set available false ++ } + -re -wrap "python import ${name}" { + set available true + } + +base-commit: 94df6741bbabaa9a51960446b2af4c0bed01b54b +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdbserver-pid-in-gdb.server-server.patch b/gdb-testsuite-fix-gdbserver-pid-in-gdb.server-server.patch deleted file mode 100644 index d96e679..0000000 --- a/gdb-testsuite-fix-gdbserver-pid-in-gdb.server-server.patch +++ /dev/null @@ -1,117 +0,0 @@ -From 7357f73483cfe8f3e8ec2dd9ca2fb3d52206055a Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Wed, 17 Apr 2024 11:45:02 +0200 -Subject: [PATCH 28/48] [gdb/testsuite] Fix gdbserver pid in - gdb.server/server-kill-python.exp - -The commit ed32754a8c7 ("[gdb/testsuite] Fix gdb.server/multi-ui-errors.exp for -remote target") intended to addresss the problem that this command: -... -set gdbserver_pid [exp_pid -i $server_spawn_id] -... -does not return the pid of the gdbserver for remote target, but rather the one -of the ssh client session. - -To fix this, it added another way of getting the gdbserver_pid. - -For the trivial case of non-remote target, the PID found by either method -should be identical, but if we compare those by adding -"puts [exec ps -p $gdbserver_pid]" we get: -... - PID TTY TIME CMD -31711 pts/8 00:00:00 gdbserver - PID TTY TIME CMD -31718 pts/8 00:00:00 server-kill-pyt -... - -The problem is that while the gdbserver PID is supposed to be read from the -result of "gdb.execute ('p server_pid')" in the python script, instead it's -taken from: -... -Process server-kill-python created; pid = 31718^M -... - -Fix this by moving the printing of the gdbserver PID out of the python script. - -Also double-check the two methods against each other, in the cases that they -should match. - -Tested on x86_64-linux. - -PR testsuite/31633 -https://sourceware.org/bugzilla/show_bug.cgi?id=31633 ---- - .../gdb.server/server-kill-python.exp | 37 +++++++++++-------- - 1 file changed, 21 insertions(+), 16 deletions(-) - -diff --git a/gdb/testsuite/gdb.server/server-kill-python.exp b/gdb/testsuite/gdb.server/server-kill-python.exp -index dcb6eddd6eb..778880984ec 100644 ---- a/gdb/testsuite/gdb.server/server-kill-python.exp -+++ b/gdb/testsuite/gdb.server/server-kill-python.exp -@@ -37,7 +37,7 @@ set host_binfile [gdb_remote_download host $binfile] - set res [gdbserver_spawn "${target_binfile}"] - set gdbserver_protocol [lindex $res 0] - set gdbserver_gdbport [lindex $res 1] --set gdbserver_pid [exp_pid -i $server_spawn_id] -+set gdbserver_pid_check [exp_pid -i $server_spawn_id] - - set break_linenr [gdb_get_line_number "@@XX@@ Inferior Starting @@XX@@"] - -@@ -48,9 +48,6 @@ puts $fd \ - "import gdb - - def do_gdb_stuff (): -- gdb.execute ('break $srcfile:$break_linenr') -- gdb.execute ('continue') -- gdb.execute ('p server_pid') - gdb.execute ('continue') - - do_gdb_stuff()" -@@ -68,24 +65,32 @@ if {[gdb_spawn_with_cmdline_opts \ - - gdb_load $binfile - gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport --send_gdb "source $host_file1\n" -+ -+gdb_test "break $srcfile:$break_linenr" - - # Get the gdbserver PID. - set gdbserver_pid 0 -- --# Wait for the inferior to start up. --with_spawn_id $server_spawn_id { -- gdb_test_multiple "" "get gdbserver PID" { -- -re " = ($decimal)\r\n" { -- set gdbserver_pid $expect_out(1,string) -- pass $gdb_test_name -- } -+gdb_test "continue" -+gdb_test_multiple "print server_pid" "get gdbserver PID" { -+ -re -wrap " = ($decimal)" { -+ set gdbserver_pid $expect_out(1,string) -+ pass $gdb_test_name - } -+} - -- if { $gdbserver_pid == 0 } { -- return -- } -+if { $gdbserver_pid == 0 } { -+ return -+} -+ -+if { ![is_remote target] && $gdbserver_pid != $gdbserver_pid_check } { -+ error "Failed to get correct gdbserver pid" -+} - -+send_gdb "source $host_file1\n" -+ -+ -+# Wait for the inferior to start up. -+with_spawn_id $server_spawn_id { - gdb_test_multiple "" "ensure inferior is running" { - -re "@@XX@@ Inferior Starting @@XX@@" { - pass $gdb_test_name --- -2.35.3 - diff --git a/gdb-testsuite-fix-license-text-in-gdb.reverse-map-to.patch b/gdb-testsuite-fix-license-text-in-gdb.reverse-map-to.patch deleted file mode 100644 index 7bbae1c..0000000 --- a/gdb-testsuite-fix-license-text-in-gdb.reverse-map-to.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 5b840a3cb41ada4cee1456d16993809abeb30eda Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 22 Feb 2024 12:09:14 +0100 -Subject: [PATCH 43/48] [gdb/testsuite] Fix license text in - gdb.reverse/map-to-same-line.{c,exp} - -I noticed in gdb.reverse/map-to-same-line.{c,exp} that the license urls are -using some kind of indirection via urldefense.proofpoint.com. - -Fix this by removing this indirection. - -Tested on x86_64-linux. - -PR testsuite/31358 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31358 ---- - gdb/testsuite/gdb.reverse/map-to-same-line.c | 2 +- - gdb/testsuite/gdb.reverse/map-to-same-line.exp | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gdb/testsuite/gdb.reverse/map-to-same-line.c b/gdb/testsuite/gdb.reverse/map-to-same-line.c -index 3086e849231..f6b4f10dbf7 100644 ---- a/gdb/testsuite/gdb.reverse/map-to-same-line.c -+++ b/gdb/testsuite/gdb.reverse/map-to-same-line.c -@@ -11,7 +11,7 @@ - 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 . */ -+ along with this program. If not, see . */ - - /* The purpose of this test is to create a DWARF line table that contains two - or more entries for the same line. When stepping (forwards or backwards), -diff --git a/gdb/testsuite/gdb.reverse/map-to-same-line.exp b/gdb/testsuite/gdb.reverse/map-to-same-line.exp -index 63f8c9c76b3..1510cf98d0c 100644 ---- a/gdb/testsuite/gdb.reverse/map-to-same-line.exp -+++ b/gdb/testsuite/gdb.reverse/map-to-same-line.exp -@@ -11,7 +11,7 @@ - # 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 . -+# along with this program. If not, see . - - # When stepping (forwards or backwards), GDB should step over the entire line - # and not just a particular entry in the line table. This test was added to --- -2.35.3 - diff --git a/gdb-testsuite-fix-missing-return-type-in-gdb.linespe.patch b/gdb-testsuite-fix-missing-return-type-in-gdb.linespe.patch deleted file mode 100644 index 25083c5..0000000 --- a/gdb-testsuite-fix-missing-return-type-in-gdb.linespe.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 3e4d764ebb264f0c9153c6fd3727f67d4454ae9b Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Fri, 29 Mar 2024 07:47:30 +0100 -Subject: [PATCH 32/48] [gdb/testsuite] Fix missing return type in - gdb.linespec/break-asm-file.c - -On fedora rawhide, when running test-case gdb.linespec/break-asm-file.exp, I -get: -... -gdb compile failed, break-asm-file.c:21:8: error: \ - return type defaults to 'int' [-Wimplicit-int] - 21 | static func() - | ^~~~ -... - -Fix this by adding the missing return type. - -Tested on aarch64-linux. - -Approved-By: John Baldwin ---- - gdb/testsuite/gdb.linespec/break-asm-file.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.linespec/break-asm-file.c b/gdb/testsuite/gdb.linespec/break-asm-file.c -index 41f0904fc84..e7bdc26b1ec 100644 ---- a/gdb/testsuite/gdb.linespec/break-asm-file.c -+++ b/gdb/testsuite/gdb.linespec/break-asm-file.c -@@ -18,7 +18,7 @@ - void func3(); - void func2(); - --static func() -+static void func() - { - } - --- -2.35.3 - diff --git a/gdb-testsuite-fix-regexp-in-vgdb_start.patch b/gdb-testsuite-fix-regexp-in-vgdb_start.patch deleted file mode 100644 index 2591fa6..0000000 --- a/gdb-testsuite-fix-regexp-in-vgdb_start.patch +++ /dev/null @@ -1,66 +0,0 @@ -From acc30323a8bc8aa04d404356e96b003a9a30543f Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 25 Jan 2024 16:36:09 +0100 -Subject: [PATCH 06/48] [gdb/testsuite] Fix regexp in vgdb_start - -On Fedora 39 aarch64 I run into: -... -(gdb) target remote | vgdb --wait=2 --max-invoke-ms=2500 --pid=2114437^M -Remote debugging using | vgdb --wait=2 --max-invoke-ms=2500 --pid=2114437^M -relaying data between gdb and process 2114437^M -warning: remote target does not support file transfer, \ - attempting to access files from local filesystem.^M -Reading symbols from /lib/ld-linux-aarch64.so.1...^M -_start () at ../sysdeps/aarch64/dl-start.S:22^M -warning: 22 ../sysdeps/aarch64/dl-start.S: No such file or directory^M -(gdb) FAIL: gdb.base/valgrind-infcall.exp: target remote for vgdb -... - -For contrast, on openSUSE Leap 15.4 x86_64 I have: -... -(gdb) target remote | vgdb --wait=2 --max-invoke-ms=2500 --pid=18797^M -Remote debugging using | vgdb --wait=2 --max-invoke-ms=2500 --pid=18797^M -relaying data between gdb and process 18797^M -warning: remote target does not support file transfer, \ - attempting to access files from local filesystem.^M -Reading symbols from /lib64/ld-linux-x86-64.so.2...^M -(No debugging symbols found in /lib64/ld-linux-x86-64.so.2)^M -0x0000000004002550 in _start () from /lib64/ld-linux-x86-64.so.2^M -(gdb) PASS: gdb.base/valgrind-infcall.exp: target remote for vgdb -... - -The fail happens in vgdb_start because the regexp only matches the -"in _start ()" variant, not the "_start () at": -... - gdb_test "$vgdbcmd" " in \\.?_start .*" "target remote for vgdb" -... -Which variant you get is determined by presence of debug info. - -Fix this by also matching the "_start () at" variant. - -Tested aarch64-linux and x86_64-linux. - -Approved-By: Tom Tromey ---- - gdb/testsuite/lib/valgrind.exp | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/gdb/testsuite/lib/valgrind.exp b/gdb/testsuite/lib/valgrind.exp -index a1cd85a7b09..f9096663509 100644 ---- a/gdb/testsuite/lib/valgrind.exp -+++ b/gdb/testsuite/lib/valgrind.exp -@@ -92,7 +92,10 @@ proc vgdb_start { {active_at_startup 1} } { - set vgdbcmd "target remote | vgdb --wait=2 --max-invoke-ms=2500 --pid=$vgdbpid" - - if { $active_at_startup } { -- gdb_test "$vgdbcmd" " in \\.?_start .*" "target remote for vgdb" -+ set start_re1 " in \\.?_start " -+ set start_re2 "\\.?_start \\(\\) at " -+ gdb_test "$vgdbcmd" "($start_re1|$start_re2).*" \ -+ "target remote for vgdb" - } else { - # Let $binfile run a bit before attaching. This is a bit of a hack, - # in that it lets test-case valgrind-infcall-2.exp run to the point of --- -2.35.3 - diff --git a/gdb-testsuite-fix-spurious-fails-with-examine-backwa.patch b/gdb-testsuite-fix-spurious-fails-with-examine-backwa.patch deleted file mode 100644 index a786701..0000000 --- a/gdb-testsuite-fix-spurious-fails-with-examine-backwa.patch +++ /dev/null @@ -1,221 +0,0 @@ -From 8bf7fdfc16f5d5fd9a94c233c0c41d307ba86cd2 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Tue, 21 Nov 2023 13:15:29 +0100 -Subject: [PATCH 04/48] [gdb/testsuite] Fix spurious FAILs with - examine-backward.exp, again - -Commit 59a561480d5 ("Fix spurious FAILs with examine-backward.exp") describes -the problem that: -... -The test case examine-backward.exp issues the command "x/-s" after the end -of the first string in TestStrings, but without making sure that this -string is preceded by a string terminator. Thus GDB may spuriously print -some random characters from before that string, and then the test fails. -... - -The commit fixes the problem by adding a Barrier variable before the TestStrings -variable: -... -+const char Barrier[] = { 0x0 }; - const char TestStrings[] = { -... - -There is however no guarantee that Barrier is placed immediately before -TestStrings. - -Before recent commit 169fe7ab54b ("Change gdb.base/examine-backwards.exp for -AIX.") on x86_64-linux, I see: -... -0000000000400660 R Barrier -0000000000400680 R TestStrings -... - -So while the Barrier variable is the first before the TestStrings variable, -it's not immediately preceding TestStrings. - -After commit 169fe7ab54b: -... -0000000000402259 B Barrier -0000000000402020 D TestStrings -... -they're not even in the same section anymore. - -Fix this reliably by adding the zero in the array itself: -... -char TestStringsBase[] = { - 0x0, - ... -}; -char *TestStrings = &TestStringsBase[1]; -... -and do likewise for TestStringsH and TestStringsW. - -Tested on x86_64-linux. - -PR testsuite/31064 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31064 ---- - gdb/testsuite/gdb.base/examine-backward.c | 35 ++++++++++++++------- - gdb/testsuite/gdb.base/examine-backward.exp | 18 +++++------ - 2 files changed, 33 insertions(+), 20 deletions(-) - -diff --git a/gdb/testsuite/gdb.base/examine-backward.c b/gdb/testsuite/gdb.base/examine-backward.c -index 354c2e2f323..5549cc20a4a 100644 ---- a/gdb/testsuite/gdb.base/examine-backward.c -+++ b/gdb/testsuite/gdb.base/examine-backward.c -@@ -32,15 +32,12 @@ literals. The content of each array is the same as followings: - }; - */ - --/* This is here just to ensure we have a null character before -- TestStrings, to avoid showing garbage when we look for strings -- backwards from TestStrings. */ -+unsigned char TestStringsBase[] = { -+ /* This is here just to ensure we have a null character before -+ TestStrings, to avoid showing garbage when we look for strings -+ backwards from TestStrings. */ -+ 0x0, - --unsigned char Barrier[] = { -- 0x00, --}; -- --unsigned char TestStrings[] = { - 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, - 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, - 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, -@@ -54,7 +51,14 @@ unsigned char TestStrings[] = { - 0x00 - }; - --short TestStringsH[] = { -+unsigned char *TestStrings = &TestStringsBase[1]; -+ -+short TestStringsHBase[] = { -+ /* This is here just to ensure we have a null character before -+ TestStringsH, to avoid showing garbage when we look for strings -+ backwards from TestStringsH. */ -+ 0x0, -+ - 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, - 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, - 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, -@@ -67,7 +71,14 @@ short TestStringsH[] = { - 0x0000 - }; - --int TestStringsW[] = { -+short *TestStringsH = &TestStringsHBase[1]; -+ -+int TestStringsWBase[] = { -+ /* This is here just to ensure we have a null character before -+ TestStringsW, to avoid showing garbage when we look for strings -+ backwards from TestStringsW. */ -+ 0x0, -+ - 0x00000041, 0x00000042, 0x00000043, 0x00000044, - 0x00000045, 0x00000046, 0x00000047, 0x00000048, - 0x00000049, 0x0000004a, 0x0000004b, 0x0000004c, -@@ -89,11 +100,13 @@ int TestStringsW[] = { - 0x00000000 - }; - -+int *TestStringsW = &TestStringsWBase[1]; -+ - int - main (void) - { - /* Clang++ eliminates the variables if nothing references them. */ -- int dummy = Barrier[0] + TestStrings[0] + TestStringsH[0] + TestStringsW[0]; -+ int dummy = TestStrings[0] + TestStringsH[0] + TestStringsW[0]; - - /* Backward disassemble test requires at least 20 instructions in - this function. Adding a simple bubble sort. */ -diff --git a/gdb/testsuite/gdb.base/examine-backward.exp b/gdb/testsuite/gdb.base/examine-backward.exp -index 7c8a08c0726..4e197d7d725 100644 ---- a/gdb/testsuite/gdb.base/examine-backward.exp -+++ b/gdb/testsuite/gdb.base/examine-backward.exp -@@ -145,7 +145,7 @@ gdb_test_no_output "set charset ASCII" - - with_test_prefix "char-width=1, print-max=20" { - gdb_test_no_output "set print elements 20" -- gdb_test_sequence "x/6s &TestStrings" "take 6 strings forward" { -+ gdb_test_sequence "x/6s TestStrings" "take 6 strings forward" { - "\"ABCDEFGHIJKLMNOPQRST\"\.\.\." - "\"UVWXYZ\"" - "\"\"" -@@ -162,7 +162,7 @@ with_test_prefix "char-width=1, print-max=20" { - "\"[^\"]+\"" - "\"01234567890123456789\"\.\.\." - } -- gdb_test_sequence "x/6s &TestStrings" "take 6 strings forward again" { -+ gdb_test_sequence "x/6s TestStrings" "take 6 strings forward again" { - "\"ABCDEFGHIJKLMNOPQRST\"\.\.\." - "\"UVWXYZ\"" - "\"\"" -@@ -187,7 +187,7 @@ with_test_prefix "char-width=1, print-max=20" { - - with_test_prefix "char-width=2, print-max=20" { - gdb_test_no_output "set print elements 20" -- gdb_test_sequence "x/6sh &TestStringsH" "take 6 strings forward" { -+ gdb_test_sequence "x/6sh TestStringsH" "take 6 strings forward" { - "u\"ABCDEFGHIJKLMNOPQRST\"\.\.\." - "u\"UVWXYZ\"" - "u\"\"" -@@ -204,7 +204,7 @@ with_test_prefix "char-width=2, print-max=20" { - "u\"[^\"]+\"" - "u\"01234567890123456789\"\.\.\." - } -- gdb_test_sequence "x/6sh &TestStringsH" "take 6 strings forward again" { -+ gdb_test_sequence "x/6sh TestStringsH" "take 6 strings forward again" { - "u\"ABCDEFGHIJKLMNOPQRST\"\.\.\." - "u\"UVWXYZ\"" - "u\"\"" -@@ -229,7 +229,7 @@ with_test_prefix "char-width=2, print-max=20" { - - with_test_prefix "char-width=4, print-max=20" { - gdb_test_no_output "set print elements 20" -- gdb_test_sequence "x/6sw &TestStringsW" "take 6 strings forward" { -+ gdb_test_sequence "x/6sw TestStringsW" "take 6 strings forward" { - "U\"ABCDEFGHIJKLMNOPQRST\"\.\.\." - "U\"UVWXYZ\"" - "U\"\"" -@@ -246,7 +246,7 @@ with_test_prefix "char-width=4, print-max=20" { - "U\"[^\"]+\"" - "U\"01234567890123456789\"\.\.\." - } -- gdb_test_sequence "x/6sw &TestStringsW" "take 6 strings forward again" { -+ gdb_test_sequence "x/6sw TestStringsW" "take 6 strings forward again" { - "U\"ABCDEFGHIJKLMNOPQRST\"\.\.\." - "U\"UVWXYZ\"" - "U\"\"" -@@ -271,7 +271,7 @@ with_test_prefix "char-width=4, print-max=20" { - - with_test_prefix "char-width=2, print-max=0" { - gdb_test_no_output "set print elements 0" -- gdb_test_sequence "x/6sh &TestStringsH" "take 6 strings forward" { -+ gdb_test_sequence "x/6sh TestStringsH" "take 6 strings forward" { - "u\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"" - "u\"\"" - "u\"\"" -@@ -289,7 +289,7 @@ with_test_prefix "char-width=2, print-max=0" { - "u\"012345678901234567890123456789\"" - "u\"!!!!!!\"" - } -- gdb_test_sequence "x/6sh &TestStringsH" "take 6 strings forward again" { -+ gdb_test_sequence "x/6sh TestStringsH" "take 6 strings forward again" { - "u\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"" - "u\"\"" - "u\"\"" -@@ -314,7 +314,7 @@ with_test_prefix "char-width=2, print-max=0" { - - with_test_prefix "char-width=1, print-max=4" { - gdb_test_no_output "set print elements 4" -- gdb_test_sequence "x/9s &TestStrings" "take 9 strings forward" { -+ gdb_test_sequence "x/9s TestStrings" "take 9 strings forward" { - "\"ABCD\"\.\.\." - "\"EFGH\"\.\.\." - "\"IJKL\"\.\.\." --- -2.35.3 - diff --git a/gdb-testsuite-fix-test-case-gdb.threads-attach-stopp.patch b/gdb-testsuite-fix-test-case-gdb.threads-attach-stopp.patch deleted file mode 100644 index beef20a..0000000 --- a/gdb-testsuite-fix-test-case-gdb.threads-attach-stopp.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 3596f8119753089d8dd8c0aff800dbf2e283a111 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 28 Mar 2024 08:26:31 +0100 -Subject: [PATCH 34/48] [gdb/testsuite] Fix test-case - gdb.threads/attach-stopped.exp on manjaro linux - -When running test-case gdb.threads/attach-stopped.exp on aarch64-linux, using -the manjaro linux distro, I get: -... - (gdb) thread apply all bt^M - ^M - Thread 2 (Thread 0xffff8d8af120 (LWP 278116) "attach-stopped"):^M - #0 0x0000ffff8d964864 in clock_nanosleep () from /usr/lib/libc.so.6^M - #1 0x0000ffff8d969cac in nanosleep () from /usr/lib/libc.so.6^M - #2 0x0000ffff8d969b68 in sleep () from /usr/lib/libc.so.6^M - #3 0x0000aaaade370828 in func (arg=0x0) at attach-stopped.c:29^M - #4 0x0000ffff8d930aec in ?? () from /usr/lib/libc.so.6^M - #5 0x0000ffff8d99a5dc in ?? () from /usr/lib/libc.so.6^M - ^M - Thread 1 (Thread 0xffff8db62020 (LWP 278111) "attach-stopped"):^M - #0 0x0000ffff8d92d2d8 in ?? () from /usr/lib/libc.so.6^M - #1 0x0000ffff8d9324b8 in ?? () from /usr/lib/libc.so.6^M - #2 0x0000aaaade37086c in main () at attach-stopped.c:45^M - (gdb) FAIL: gdb.threads/attach-stopped.exp: threaded: attach2 to stopped bt -... - -The problem is that the test-case expects to see start_thread: -... - gdb_test "thread apply all bt" ".*sleep.*start_thread.*" \ - "$threadtype: attach2 to stopped bt" -... -but lack of symbols makes that impossible. - -Fix this by allowing " in ?? () from " as well. - -Tested on aarch64-linux. - -PR testsuite/31451 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31451 ---- - gdb/testsuite/gdb.threads/attach-stopped.exp | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite/gdb.threads/attach-stopped.exp -index acdfcb5d8c5..b28fbd1a3d3 100644 ---- a/gdb/testsuite/gdb.threads/attach-stopped.exp -+++ b/gdb/testsuite/gdb.threads/attach-stopped.exp -@@ -54,10 +54,12 @@ proc corefunc { threadtype } { - } - - # ".*sleep.*clone.*" would fail on s390x as bt stops at START_THREAD there. -+ set test "$threadtype: attach2 to stopped bt" - if {[string equal $threadtype threaded]} { -- gdb_test "thread apply all bt" ".*sleep.*start_thread.*" "$threadtype: attach2 to stopped bt" -+ gdb_test "thread apply all bt" \ -+ ".*sleep.*(start_thread| in \\?\\? \\(\\) from ).*" $test - } else { -- gdb_test "bt" ".*sleep.*main.*" "$threadtype: attach2 to stopped bt" -+ gdb_test "bt" ".*sleep.*main.*" $test - } - - gdb_exit --- -2.35.3 - diff --git a/gdb-testsuite-fix-test-in-gdb.python-py-finish-break.patch b/gdb-testsuite-fix-test-in-gdb.python-py-finish-break.patch deleted file mode 100644 index b977f01..0000000 --- a/gdb-testsuite-fix-test-in-gdb.python-py-finish-break.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 7658c4d52562eef199e30fcd2da7da9a56d5d9b3 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Tue, 27 Feb 2024 16:18:32 +0100 -Subject: [PATCH 41/48] [gdb/testsuite] Fix test in - gdb.python/py-finish-breakpoint.exp - -With test-case gdb.python/py-finish-breakpoint.exp, we run into: -... -(gdb) python print (finishbp_default.hit_count) -Traceback (most recent call last): - File "", line 1, in -RuntimeError: Breakpoint 3 is invalid. -Error while executing Python code. -(gdb) PASS: gdb.python/py-finish-breakpoint.exp: normal conditions: \ - check finishBP on default frame has been hit -... - -The test producing the pass is: -... - gdb_test "python print (finishbp_default.hit_count)" "1.*" \ - "check finishBP on default frame has been hit" -... -so the pass is produced because the 1 in "line 1" matches "1.*". - -Temporary breakpoints are removed when hit, and consequently accessing the -hit_count attribute of a temporary python breakpoint (gdb.Breakpoint class) is -not possible, and as per spec we get a RuntimeError. - -So the RuntimeError is correct, and not specific to finish breakpoints. - -The test presumably attempts to match: -... -(gdb) python print (finishbp_default.hit_count) -1 -... -but most likely this output was never produced by any gdb version. - -Fix this by checking whether the finishbp_default breakpoint has hit by -checking that finishbp_default.is_valid() is False. - -Tested on aarch64-linux. - -Approved-By: Tom Tromey - -PR testsuite/31391 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31391 ---- - gdb/testsuite/gdb.python/py-finish-breakpoint.exp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp -index e5a46874afd..687b9ad38cb 100644 ---- a/gdb/testsuite/gdb.python/py-finish-breakpoint.exp -+++ b/gdb/testsuite/gdb.python/py-finish-breakpoint.exp -@@ -73,7 +73,8 @@ with_test_prefix "normal conditions" { - "check MyFinishBreakpoint hit" - gdb_test "python print (finishbp.return_value)" "-5.*" "check return_value" - -- gdb_test "python print (finishbp_default.hit_count)" "1.*" "check finishBP on default frame has been hit" -+ gdb_test "python print (finishbp_default.is_valid())" "False" \ -+ "check finishBP on default frame has been hit" - gdb_test "python print (finishbp.is_valid())" "False.*"\ - "ensure that finish bp is invalid afer normal hit" - --- -2.35.3 - diff --git a/gdb-testsuite-fix-timeouts-in-gdb.threads-step-over-.patch b/gdb-testsuite-fix-timeouts-in-gdb.threads-step-over-.patch new file mode 100644 index 0000000..64ad453 --- /dev/null +++ b/gdb-testsuite-fix-timeouts-in-gdb.threads-step-over-.patch @@ -0,0 +1,103 @@ +From 2723a9ea67f16593591c4db9101e423ff73e6353 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 16 Jan 2025 09:39:55 +0100 +Subject: [PATCH 31/37] [gdb/testsuite] Fix timeouts in + gdb.threads/step-over-thread-exit.exp + +Once in a while, I run into a timeout in test-case +gdb.threads/step-over-thread-exit.exp: +... +(gdb) continue^M +Continuing.^M +[New Thread 0xfffff7cff1a0 (LWP 2874854)]^M +^M +Thread 97 "step-over-threa" hit Breakpoint 2, 0x0000000000410314 in \ + my_exit_syscall () at gdb/testsuite/lib/my-syscalls.S:74^M +74 SYSCALL (my_exit, __NR_exit)^M +(gdb) [Thread 0xfffff7cff1a0 (LWP 2874853) exited]^M +FAIL: $exp: step_over_mode=displaced: non-stop=on: target-non-stop=on: \ + schedlock=off: cmd=continue: ns_stop_all=0: iter 95: continue (timeout) +... + +I can reproduce it more frequently by running with taskset -c . + +Fix this by using -no-prompt-anchor. + +This requires us to add -no-prompt-anchor to proc gdb_test_multiple. + +Tested on aarch64-linux. + +PR testsuite/32489 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32489 +--- + gdb/testsuite/gdb.threads/step-over-thread-exit.exp | 5 +++-- + gdb/testsuite/lib/gdb.exp | 9 ++++++++- + 2 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/gdb/testsuite/gdb.threads/step-over-thread-exit.exp b/gdb/testsuite/gdb.threads/step-over-thread-exit.exp +index 8eb93995657..98cc94e9528 100644 +--- a/gdb/testsuite/gdb.threads/step-over-thread-exit.exp ++++ b/gdb/testsuite/gdb.threads/step-over-thread-exit.exp +@@ -193,7 +193,7 @@ proc test {step_over_mode non-stop target-non-stop schedlock cmd ns_stop_all} { + with_test_prefix "iter $i" { + set ok 0 + set thread "" +- gdb_test_multiple "continue" "" { ++ gdb_test_multiple "continue" "" -no-prompt-anchor { + -re -wrap "Thread ($::decimal) .*hit Breakpoint $::decimal.* my_exit_syscall .*" { + set thread $expect_out(1,string) + set ok 1 +@@ -206,7 +206,8 @@ proc test {step_over_mode non-stop target-non-stop schedlock cmd ns_stop_all} { + } + + if {${non-stop}} { +- gdb_test -nopass "thread $thread" "Switching to thread .*" \ ++ gdb_test -nopass -no-prompt-anchor "thread $thread" \ ++ "Switching to thread .*" \ + "switch to event thread" + } + } +diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp +index c32dccab43e..008c1b83c1e 100644 +--- a/gdb/testsuite/lib/gdb.exp ++++ b/gdb/testsuite/lib/gdb.exp +@@ -977,6 +977,10 @@ proc fill_in_default_prompt {prompt_regexp with_anchor} { + # if one of them matches. If MESSAGE is empty COMMAND will be used. + # -prompt PROMPT_REGEXP specifies a regexp matching the expected prompt + # after the command output. If empty, defaults to "$gdb_prompt $". ++# -no-prompt-anchor specifies that if the default prompt regexp is used, it ++# should not be anchored at the end of the buffer. This means that the ++# pattern can match even if there is stuff output after the prompt. Does not ++# have any effect if -prompt is specified. + # -lbl specifies that line-by-line matching will be used. + # EXPECT_ARGUMENTS will be fed to expect in addition to the standard + # patterns. Pattern elements will be evaluated in the caller's +@@ -1076,6 +1080,7 @@ proc gdb_test_multiple { command message args } { + + set line_by_line 0 + set prompt_regexp "" ++ set prompt_anchor 1 + for {set i 0} {$i < [llength $args]} {incr i} { + set arg [lindex $args $i] + if { $arg == "-prompt" } { +@@ -1083,6 +1088,8 @@ proc gdb_test_multiple { command message args } { + set prompt_regexp [lindex $args $i] + } elseif { $arg == "-lbl" } { + set line_by_line 1 ++ } elseif { $arg == "-no-prompt-anchor" } { ++ set prompt_anchor 0 + } else { + set user_code $arg + break +@@ -1094,7 +1101,7 @@ proc gdb_test_multiple { command message args } { + error "Too few arguments to gdb_test_multiple" + } + +- set prompt_regexp [fill_in_default_prompt $prompt_regexp true] ++ set prompt_regexp [fill_in_default_prompt $prompt_regexp $prompt_anchor] + + if { $message == "" } { + set message $command +-- +2.43.0 + diff --git a/gdb-testsuite-fix-typo-in-gdb.base-catch-syscall.exp.patch b/gdb-testsuite-fix-typo-in-gdb.base-catch-syscall.exp.patch deleted file mode 100644 index 22bd445..0000000 --- a/gdb-testsuite-fix-typo-in-gdb.base-catch-syscall.exp.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 22655d76bc767d938dc9a72e0f50816a2f97f4c0 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Sun, 31 Dec 2023 09:39:45 +0100 -Subject: [PATCH 47/48] [gdb/testsuite] Fix typo in gdb.base/catch-syscall.exp - -On aarch64-linux with a gdb build without libexpat, I run into: -... -(gdb) PASS: gdb.base/catch-syscall.exp: determine pipe syscall: \ - catch syscall 59 -continue -Continuing. - -Catchpoint 5 (call to syscall 59), 0x0000fffff7e04578 in pipe () from \ - /lib64/libc.so.6 -(gdb) FAIL: gdb.base/catch-syscall.exp: determine pipe syscall: continue -... - -In the test-case, this pattern handles either the syscall name or number for -the pipe syscall: -... - -re -wrap "Catchpoint $decimal \\(call to syscall (pipe|$SYS_pipe)\\).*" { -... -but the pattern for the pipe2 syscall mistakenly uses SYS_pipe instead of -SYS_pipe2: -... - -re -wrap "Catchpoint $decimal \\(call to syscall (pipe2|$SYS_pipe)\\).*" { -... -and consequently doesn't handle the pipe2 syscall number. - -Fix the typo by using SYS_pipe2 instead. - -Tested on aarch64-linux. ---- - gdb/testsuite/gdb.base/catch-syscall.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp -index 0588cb35d87..f7d499cb10b 100644 ---- a/gdb/testsuite/gdb.base/catch-syscall.exp -+++ b/gdb/testsuite/gdb.base/catch-syscall.exp -@@ -752,7 +752,7 @@ proc setup_all_syscalls {} { - pass $gdb_test_name - set ok 1 - } -- -re -wrap "Catchpoint $decimal \\(call to syscall (pipe2|$SYS_pipe)\\).*" { -+ -re -wrap "Catchpoint $decimal \\(call to syscall (pipe2|$SYS_pipe2)\\).*" { - lappend all_syscalls pipe2 - pass $gdb_test_name - set ok 1 --- -2.35.3 - diff --git a/gdb-testsuite-fix-valgrind-tests-on-debian.patch b/gdb-testsuite-fix-valgrind-tests-on-debian.patch deleted file mode 100644 index d1453cd..0000000 --- a/gdb-testsuite-fix-valgrind-tests-on-debian.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 489d8a4ff8c5998dad5a55694e346532695c911b Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Tue, 26 Mar 2024 17:32:09 +0100 -Subject: [PATCH 36/48] [gdb/testsuite] Fix valgrind tests on debian - -On debian 12, I run into: -... -(gdb) target remote | vgdb --wait=2 --max-invoke-ms=2500 --pid=618591^M -Remote debugging using | vgdb --wait=2 --max-invoke-ms=2500 --pid=618591^M -relaying data between gdb and process 618591^M -warning: remote target does not support file transfer, \ - attempting to access files from local filesystem.^M -Reading symbols from /lib/ld-linux-aarch64.so.1...^M -(No debugging symbols found in /lib/ld-linux-aarch64.so.1)^M -0x000000000401a980 in ?? () from /lib/ld-linux-aarch64.so.1^M -(gdb) FAIL: gdb.base/valgrind-infcall.exp: target remote for vgdb -... - -The problem is that we're expecting to match either of these regexps: -... - set start_re1 " in \\.?_start " - set start_re2 "\\.?_start \\(\\) at " -... -but there are no dwarf or elf symbols present. - -Fix this by also allowing: -... - set start_re3 "$::hex in \\?\\? \\(\\) from " -... - -Tested on aarch64-linux. - -Approved-By: Tom Tromey ---- - gdb/testsuite/lib/valgrind.exp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/gdb/testsuite/lib/valgrind.exp b/gdb/testsuite/lib/valgrind.exp -index f9096663509..52ef603a803 100644 ---- a/gdb/testsuite/lib/valgrind.exp -+++ b/gdb/testsuite/lib/valgrind.exp -@@ -94,7 +94,8 @@ proc vgdb_start { {active_at_startup 1} } { - if { $active_at_startup } { - set start_re1 " in \\.?_start " - set start_re2 "\\.?_start \\(\\) at " -- gdb_test "$vgdbcmd" "($start_re1|$start_re2).*" \ -+ set start_re3 "$::hex in \\?\\? \\(\\) from " -+ gdb_test "$vgdbcmd" "($start_re1|$start_re2|$start_re3).*" \ - "target remote for vgdb" - } else { - # Let $binfile run a bit before attaching. This is a bit of a hack, --- -2.35.3 - diff --git a/gdb-testsuite-further-handle-long-filenames-in-gdb.b.patch b/gdb-testsuite-further-handle-long-filenames-in-gdb.b.patch deleted file mode 100644 index b21d5a9..0000000 --- a/gdb-testsuite-further-handle-long-filenames-in-gdb.b.patch +++ /dev/null @@ -1,49 +0,0 @@ -From dba128204017c9a12b3b6840bf1e3a6fec83f3e4 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Mon, 26 Feb 2024 15:59:47 +0100 -Subject: [PATCH 42/48] [gdb/testsuite] Further handle long filenames in - gdb.base/startup-with-shell.exp - -In commit 52498004a34 ("gdb/testsuite: handle long filenames in -gdb.base/startup-with-shell.exp") we fixed a FAIL reported by the Linaro CI: -... -(gdb) print argv[1] -$1 = 0xfffed978 "/startup-with-shell/unique-file.unique-e"... -(gdb) FAIL: gdb.base/startup-with-shell.exp: startup_with_shell = on; \ - run_args = *.unique-extension: first argument expanded -... - -PR testsuite/31410 reports a similar failure: -... -(gdb) print argv[1] -$1 = 0xfffeda96 "/startup-with-shell/*.unique-extens"... -(gdb) FAIL: gdb.base/startup-with-shell.exp: startup_with_shell = off; \ - run_args = *.unique-extension: first argument not expanded -... - -Fix this in the same way, using "set print characters unlimited". - -Tested on x86_64-linux. - -Approved-By: Tom Tromey - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31410 ---- - gdb/testsuite/gdb.base/startup-with-shell.exp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/gdb/testsuite/gdb.base/startup-with-shell.exp b/gdb/testsuite/gdb.base/startup-with-shell.exp -index 51b1e4fa922..24135972b72 100644 ---- a/gdb/testsuite/gdb.base/startup-with-shell.exp -+++ b/gdb/testsuite/gdb.base/startup-with-shell.exp -@@ -65,6 +65,7 @@ with_test_prefix "startup_with_shell = on; run_args = *.unique-extension" { - - with_test_prefix "startup_with_shell = off; run_args = *.unique-extension" { - initial_setup_simple "off" "$unique_file_dir/*.unique-extension" -+ gdb_test_no_output "set print characters unlimited" - gdb_test "print argv\[1\]" "\\\$$decimal = $hex \"$unique_file_dir/\\\*\.unique-extension\"" \ - "first argument not expanded" - } --- -2.35.3 - diff --git a/gdb-testsuite-handle-core-without-build-id-in-gdb.ba.patch b/gdb-testsuite-handle-core-without-build-id-in-gdb.ba.patch deleted file mode 100644 index 7969335..0000000 --- a/gdb-testsuite-handle-core-without-build-id-in-gdb.ba.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 163358e7c426183521d34c96e6959f615862ff1f Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Wed, 20 Mar 2024 19:29:18 +0100 -Subject: [PATCH 38/48] [gdb/testsuite] Handle core without build-id in - gdb.base/corefile-buildid.exp - -On aarch64-linux (debian 12), when running test-case gdb.base/corefile-buildid.exp, I get: -... -expecting exec file "debugdir-exec/.build-id/ec/f10ec5d39648774f8c35d3cf757c8db52f5163" -info files^M -Local core dump file:^M - `build-exec/corefile-buildid.core', file type elf64-littleaarch64.^M - 0x0000aaaac1d70000 - 0x0000aaaac1d71000 is load1^M - ... - 0x0000ffffffa8b000 - 0x0000ffffffaac000 is load16^M -(gdb) FAIL: gdb.base/corefile-buildid.exp: exec: info files -... - -The problem is that the test-case expect the build-id to be available in the -core file, while it isn't. - -Fix this by detecting that the build-id isn't available in the core file using eu-readelf, as in -gdb.base/coredump-filter-build-id.exp. - -Tested on aarch64-linux. - -Approved-By: Tom Tromey ---- - gdb/testsuite/gdb.base/corefile-buildid.exp | 14 +++++++++++++- - 1 file changed, 13 insertions(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.base/corefile-buildid.exp b/gdb/testsuite/gdb.base/corefile-buildid.exp -index 3c2702e0cd3..630e812bd6b 100644 ---- a/gdb/testsuite/gdb.base/corefile-buildid.exp -+++ b/gdb/testsuite/gdb.base/corefile-buildid.exp -@@ -217,7 +217,7 @@ proc locate_exec_from_core_build_id {corefile buildid suffix \ - # of shared and/or stripped/.debug executables. - - proc do_corefile_buildid_tests {args} { -- global binfile testfile srcfile execdir sharedir -+ global binfile testfile srcfile execdir sharedir hex - - # Parse options. - parse_args [list {sepdebug} {shared}] -@@ -266,6 +266,18 @@ proc do_corefile_buildid_tests {args} { - } - verbose -log "corefile is $corefile" - -+ if { [catch "exec [gdb_find_eu-unstrip] -n --core $corefile" output] == 0 } { -+ set line [lindex [split $output "\n"] 0] -+ set binfile_re (?:[string_to_regexp $program_to_run]|\\\[(?:exe|pie)\\\]) -+ if { ![regexp "^${hex}\\+${hex} \[a-f0-9\]+@${hex}.*$binfile_re$" $line] } { -+ unsupported "build id for exec" -+ return -+ } -+ } else { -+ unsupported "eu-unstrip execution" -+ return -+ } -+ - # Grab the build-id from the binary, removing ".debug" from the end. - set buildid [build_id_debug_filename_get $program_to_run] - if {$buildid == ""} { --- -2.35.3 - diff --git a/gdb-testsuite-handle-pac-marker.patch b/gdb-testsuite-handle-pac-marker.patch deleted file mode 100644 index b357c75..0000000 --- a/gdb-testsuite-handle-pac-marker.patch +++ /dev/null @@ -1,213 +0,0 @@ -From f70536d3f72601b286967ed3031a3fb1ce0c834f Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 4 Jan 2024 13:42:45 +0100 -Subject: [PATCH 02/48] [gdb/testsuite] Handle PAC marker - -On aarch64-linux, I run into: -... -FAIL: gdb.base/annota1.exp: backtrace from shlibrary (timeout) -... -due to the PAC marker showing up: -... -^Z^Zframe-address^M -0x000000000041025c [PAC]^M -^Z^Zframe-address-end^M -... - -In the docs the marker is documented as follows: -... -When GDB is debugging the AArch64 architecture, and the program is using the -v8.3-A feature Pointer Authentication (PAC), then whenever the link register -$lr is pointing to an PAC function its value will be masked. When GDB prints -a backtrace, any addresses that required unmasking will be postfixed with the -marker [PAC]. When using the MI, this is printed as part of the addr_flags -field. -... - -Update the test-case to allow the PAC marker. - -Likewise in a few other test-cases. - -While we're at it, rewrite the affected pattern pat_begin in annota1.exp into -a more readable form. Likewise for the corresponding pat_end. - -Tested on aarch64-linux. - -Approved-By: Luis Machado - -PR testsuite/31202 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31202 ---- - gdb/testsuite/gdb.base/annota1.exp | 47 ++++++++++++++++++- - gdb/testsuite/gdb.cp/exception.exp | 8 ++-- - .../gdb.dwarf2/entry-value-typedef.exp | 2 +- - .../gdb.mi/mi-catch-cpp-exceptions.exp | 2 +- - gdb/testsuite/gdb.mi/mi-syn-frame.exp | 2 +- - .../gdb.threads/pthread_cond_wait.exp | 2 +- - gdb/testsuite/gdb.threads/tls.exp | 2 +- - 7 files changed, 54 insertions(+), 11 deletions(-) - -diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp -index 3c2bbb43761..d8552b5be85 100644 ---- a/gdb/testsuite/gdb.base/annota1.exp -+++ b/gdb/testsuite/gdb.base/annota1.exp -@@ -286,9 +286,52 @@ gdb_test_multiple "continue" "continue to printf" { - # annotate-frame-address - # annotate-frame-address-end - # --set pat_begin "\r\n\032\032post-prompt\r\n\r\n\032\032frame-begin 0 $hex\r\n.0 \r\n(\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n)*\032\032frame-function-name\r\n.*printf(@.*)?\r\n\032\032frame-args\r\n \\(.*frame-end\r\n\r\n\032\032frame-begin 1 $hex\r\n.1 \r\n\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n" -+set pat_begin \ -+ [list \ -+ "\r\n\032\032post-prompt\r\n" \ -+ "\r\n\032\032frame-begin 0 $hex\r\n" \ -+ ".0 \r\n" \ -+ "(" \ -+ "\032\032frame-address\r\n" \ -+ "${hex}( \\\[PAC\\\])?" \ -+ "\r\n\032\032frame-address-end\r\n" \ -+ " in \r\n" \ -+ ")*" \ -+ "\032\032frame-function-name\r\n" \ -+ ".*printf(@.*)?" \ -+ "\r\n\032\032frame-args\r\n" \ -+ " \\(.*frame-end\r\n" \ -+ "\r\n\032\032frame-begin 1 $hex\r\n" \ -+ ".1 " \ -+ "\r\n\032\032frame-address\r\n" \ -+ "${hex}( \\\[PAC\\\])?" \ -+ "\r\n\032\032frame-address-end\r\n" \ -+ " in " \ -+ "\r\n\032\032frame-function-name\r\n" \ -+ "main" \ -+ "\r\n\032\032frame-args\r\n" \ -+ " \\(\\)" \ -+ "\r\n\032\032frame-source-begin\r\n" \ -+ " at " \ -+ "\r\n\032\032frame-source-file\r\n"] -+ -+set pat_begin [join $pat_begin ""] -+ -+set pat_end \ -+ [list \ -+ "\r\n\032\032frame-source-file-end\r\n" \ -+ ":" \ -+ "\r\n\032\032frame-source-line\r\n" \ -+ ".*" \ -+ "\r\n\032\032frame-source-end\r\n\r\n" \ -+ "\r\n\032\032frame-end\r\n" \ -+ "(" \ -+ "\r\n\032\032frame-begin .*\r\n" \ -+ "\r\n\032\032frame-end\r\n" \ -+ ")*" \ -+ "$gdb_prompt$"] - --set pat_end "\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032frame-end\r\n(\r\n\032\032frame-begin .*\r\n\r\n\032\032frame-end\r\n)*$gdb_prompt$" -+set pat_end [join $pat_end ""] - - gdb_test_multiple "backtrace" "backtrace from shlibrary" { - -re "$pat_begin$escapedsrcfile$pat_end" { -diff --git a/gdb/testsuite/gdb.cp/exception.exp b/gdb/testsuite/gdb.cp/exception.exp -index 2c7ef7793ee..03dd0cb3aeb 100644 ---- a/gdb/testsuite/gdb.cp/exception.exp -+++ b/gdb/testsuite/gdb.cp/exception.exp -@@ -111,7 +111,7 @@ gdb_test "continue" \ - - set name "backtrace after first throw" - gdb_test_multiple "backtrace" $name { -- -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_throw\[\[:>:\]\].*#\[0-9\]+${ws}$hex in foo \\(i=20\\) at .*${srcfile}:\[0-9\]+\r\n#\[0-9\]+${ws}$hex in main \\(.*\\) at .*${srcfile}:\[0-9\]+\r\n$gdb_prompt $" { -+ -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_throw\[\[:>:\]\].*#\[0-9\]+${ws}$hex (\\\[PAC\\\] )?in foo \\(i=20\\) at .*${srcfile}:\[0-9\]+\r\n#\[0-9\]+${ws}$hex in main \\(.*\\) at .*${srcfile}:\[0-9\]+\r\n$gdb_prompt $" { - # Either __cxxabiv1::__cxa_throw or __cxa_throw can be printed - # depending on debug info presence. - pass $name -@@ -129,7 +129,7 @@ gdb_test "continue" \ - - set name "backtrace after first catch" - gdb_test_multiple "backtrace" $name { -- -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_begin_catch\[\[:>:\]\].*#\[0-9\]+${ws}$hex in main \\(.*\\) at .*$srcfile:\[0-9\]+\r\n$gdb_prompt $" { -+ -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_begin_catch\[\[:>:\]\].*#\[0-9\]+${ws}$hex (\\\[PAC\\\] )?in main \\(.*\\) at .*$srcfile:\[0-9\]+\r\n$gdb_prompt $" { - pass $name - } - } -@@ -148,7 +148,7 @@ gdb_test "continue" \ - - set name "backtrace after second throw" - gdb_test_multiple "backtrace" $name { -- -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_throw\[\[:>:\]\].*#\[0-9\]+${ws}$hex in foo \\(i=20\\) at .*${srcfile}:\[0-9\]+\r\n#\[0-9\]+${ws}$hex in main \\(.*\\) at .*${srcfile}:\[0-9\]+\r\n$gdb_prompt $" { -+ -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_throw\[\[:>:\]\].*#\[0-9\]+${ws}$hex (\\\[PAC\\\] )?in foo \\(i=20\\) at .*${srcfile}:\[0-9\]+\r\n#\[0-9\]+${ws}$hex in main \\(.*\\) at .*${srcfile}:\[0-9\]+\r\n$gdb_prompt $" { - pass $name - } - } -@@ -164,7 +164,7 @@ gdb_test "continue" \ - - set name "backtrace after second catch" - gdb_test_multiple "backtrace" $name { -- -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_begin_catch\[\[:>:\]\].*#\[0-9\]+${ws}$hex in main \\(.*\\) at .*$srcfile:\[0-9\]+\r\n$gdb_prompt $" { -+ -re ".*#\[0-9\]+.*\[\[:<:\]\]__cxa_begin_catch\[\[:>:\]\].*#\[0-9\]+${ws}$hex (\\\[PAC\\\] )?in main \\(.*\\) at .*$srcfile:\[0-9\]+\r\n$gdb_prompt $" { - pass $name - } - } -diff --git a/gdb/testsuite/gdb.dwarf2/entry-value-typedef.exp b/gdb/testsuite/gdb.dwarf2/entry-value-typedef.exp -index b56c9ceab6a..3d25e2a50b9 100644 ---- a/gdb/testsuite/gdb.dwarf2/entry-value-typedef.exp -+++ b/gdb/testsuite/gdb.dwarf2/entry-value-typedef.exp -@@ -42,4 +42,4 @@ gdb_test "continue" "Catchpoint $::decimal \\(exception thrown\\).*" - - # Without the corresponding fix, GDB would hit an internal error before - # printing the frame for main. --gdb_test "backtrace" " $::hex in func \\(t=t@entry=@$::hex: 1234\\).* $::hex in main .*" -+gdb_test "backtrace" " $::hex (\\\[PAC\\\] )?in func \\(t=t@entry=@$::hex: 1234\\).* $::hex in main .*" -diff --git a/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp b/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp -index 595ae929e9a..1f119ec3a87 100644 ---- a/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp -+++ b/gdb/testsuite/gdb.mi/mi-catch-cpp-exceptions.exp -@@ -68,7 +68,7 @@ proc continue_to_next_exception { func line testname } { - mi_expect_stop "exception-caught" ".*" ".*" ".*" ".*" \ - {} "run until an exception is caught: $testname" - mi_gdb_test "-stack-list-frames 1 1" \ -- "\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"${func}\",.*,line=\"${line}\".*\}\\\]" \ -+ "\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",(addr_flags=\"PAC\",)?func=\"${func}\",.*,line=\"${line}\".*\}\\\]" \ - "check previous frame: $testname" - } - -diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.exp b/gdb/testsuite/gdb.mi/mi-syn-frame.exp -index 40df312a1cc..dd484cd80fa 100644 ---- a/gdb/testsuite/gdb.mi/mi-syn-frame.exp -+++ b/gdb/testsuite/gdb.mi/mi-syn-frame.exp -@@ -76,7 +76,7 @@ mi_gdb_test "406-data-evaluate-expression have_a_very_merry_interrupt()" \ - # in this next output. - - mi_gdb_test "407-stack-list-frames" \ -- "407\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"handler\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"\"\},.*frame=\{level=\"$decimal\",addr=\"$hex\",func=\"have_a_very_merry_interrupt\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\}.*\\\]" \ -+ "407\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"handler\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"\"\},.*frame=\{level=\"$decimal\",addr=\"$hex\",(addr_flags=\"PAC\",)?func=\"have_a_very_merry_interrupt\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\",arch=\"$any\"\}.*\\\]" \ - "list stack frames, with signal handler and dummy frame" - - -diff --git a/gdb/testsuite/gdb.threads/pthread_cond_wait.exp b/gdb/testsuite/gdb.threads/pthread_cond_wait.exp -index ff3097cb519..b29be9e4191 100644 ---- a/gdb/testsuite/gdb.threads/pthread_cond_wait.exp -+++ b/gdb/testsuite/gdb.threads/pthread_cond_wait.exp -@@ -51,7 +51,7 @@ global decimal - # - # This is a "backtrace break" ("btb"): - # --set btb "\[^\r\n\]+\[\r\n\]+\#${decimal}\[ \t\]+${hex} in " -+set btb "\[^\r\n\]+\[\r\n\]+\#${decimal}\[ \t\]+${hex} (\\\[PAC\\\] )?in " - - # One of the threads is blocked on a call to pthread_cond_wait, and - # we want to verify that we are able to get a sensible backtrace for -diff --git a/gdb/testsuite/gdb.threads/tls.exp b/gdb/testsuite/gdb.threads/tls.exp -index 89f6fb89bac..91a7f80b438 100644 ---- a/gdb/testsuite/gdb.threads/tls.exp -+++ b/gdb/testsuite/gdb.threads/tls.exp -@@ -132,7 +132,7 @@ proc check_thread_stack {number spin_threads spin_threads_level} { - } - send_gdb "where\n" - gdb_expect { -- -re ".*(\[0-9\]+)\[ \t\]+$hex in spin \\(vp=(0x\[0-9a-f\]+).*\r\n$gdb_prompt $" { -+ -re ".*(\[0-9\]+)\[ \t\]+$hex (\\\[PAC\\\] )?in spin \\(vp=(0x\[0-9a-f\]+).*\r\n$gdb_prompt $" { - if {[info exists tarr($number)]} { - fail "backtrace of thread number $number in spin" - } else { --- -2.35.3 - diff --git a/gdb-testsuite-make-gdb.base-solib-search.exp-more-ro.patch b/gdb-testsuite-make-gdb.base-solib-search.exp-more-ro.patch deleted file mode 100644 index 0ce3dc5..0000000 --- a/gdb-testsuite-make-gdb.base-solib-search.exp-more-ro.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 17ab80b7af4c388c44d0981d76de396d85bcba76 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Mon, 8 Jan 2024 10:37:44 +0100 -Subject: [PATCH 05/48] [gdb/testsuite] Make gdb.base/solib-search.exp more - robust - -On aarch64-linux, with gcc 13.2.1, I run into: -... - (gdb) backtrace^M - #0 break_here () at solib-search.c:30^M - #1 0x0000fffff7f20194 in lib2_func4 () at solib-search-lib2.c:50^M - #2 0x0000fffff7f70194 in lib1_func3 () at solib-search-lib1.c:50^M - #3 0x0000fffff7f20174 in lib2_func2 () at solib-search-lib2.c:30^M - #4 0x0000fffff7f70174 in lib1_func1 () at solib-search-lib1.c:30^M - #5 0x00000000004101b4 in main () at solib-search.c:23^M - (gdb) PASS: gdb.base/solib-search.exp: \ - backtrace (with wrong libs) (data collection) - FAIL: gdb.base/solib-search.exp: backtrace (with wrong libs) -... - -The FAIL is generated by this code in the test-case: -... - if { $expect_fail } { - # If the backtrace output is correct the test isn't sufficiently - # testing what it should. - if { $count == $total_expected } { - set fail 1 - } -... - -The test-case: -- builds two versions of two shared libs, a "right" and "wrong" version, the - difference being an additional dummy function (called spacer function), -- uses the "right" version to generate a core file, -- uses the "wrong" version to interpret the core file, and -- generates a backtrace. - -The intent is that the backtrace is incorrect due to using the "wrong" -version, but actually it's correct. This is because the spacer functions -aren't large enough. - -Fix this by increasing the size of the spacer functions by adding a dummy -loop, after which we have, as expected, an incorrect backtrace: -... - (gdb) backtrace^M - #0 break_here () at solib-search.c:30^M - #1 0x0000fffff7f201c0 in ?? ()^M - #2 0x0000fffff7f20174 in lib2_func2 () at solib-search-lib2.c:30^M - #3 0x0000fffff7f20174 in lib2_func2 () at solib-search-lib2.c:30^M - #4 0x0000fffff7f70174 in lib1_func1 () at solib-search-lib1.c:30^M - #5 0x00000000004101b4 in main () at solib-search.c:23^M - (gdb) PASS: gdb.base/solib-search.exp: \ - backtrace (with wrong libs) (data collection) - PASS: gdb.base/solib-search.exp: backtrace (with wrong libs) -... - -Tested on aarch64-linux. ---- - gdb/testsuite/gdb.base/solib-search-lib1.c | 3 +++ - gdb/testsuite/gdb.base/solib-search-lib2.c | 3 +++ - 2 files changed, 6 insertions(+) - -diff --git a/gdb/testsuite/gdb.base/solib-search-lib1.c b/gdb/testsuite/gdb.base/solib-search-lib1.c -index 76338a8e216..6a4cc9aa1a7 100644 ---- a/gdb/testsuite/gdb.base/solib-search-lib1.c -+++ b/gdb/testsuite/gdb.base/solib-search-lib1.c -@@ -39,6 +39,9 @@ lib1_func1 (void) - void - lib1_spacer (void) - { -+ int i; -+ for (i = 0; i < 10; ++i) -+ ; - } - - #endif -diff --git a/gdb/testsuite/gdb.base/solib-search-lib2.c b/gdb/testsuite/gdb.base/solib-search-lib2.c -index bf7c7bd071c..fb004d7377f 100644 ---- a/gdb/testsuite/gdb.base/solib-search-lib2.c -+++ b/gdb/testsuite/gdb.base/solib-search-lib2.c -@@ -39,6 +39,9 @@ lib2_func2 (void) - void - lib2_spacer (void) - { -+ int i; -+ for (i = 0; i < 10; ++i) -+ ; - } - - #endif --- -2.35.3 - diff --git a/gdb-testsuite-make-portnum-a-persistent-global.patch b/gdb-testsuite-make-portnum-a-persistent-global.patch deleted file mode 100644 index 1d264ba..0000000 --- a/gdb-testsuite-make-portnum-a-persistent-global.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 81f752e905f9ef4d0f2e046acf3fabcddf952057 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Sat, 4 May 2024 10:41:09 +0200 -Subject: [PATCH 17/48] [gdb/testsuite] Make portnum a persistent global - -When instrumenting get_portnum using: -... - puts "PORTNUM: $res" -... -and running: -... -$ cd build/gdb -$ make check TESTS=gdb.server/*.exp -... -we get: -... -Running gdb.server/target-exec-file.exp ... -PORTNUM: 2345 -Running gdb.server/stop-reply-no-thread-multi.exp ... -PORTNUM: 2345 -PORTNUM: 2346 -PORTNUM: 2347 -PORTNUM: 2348 -PORTNUM: 2349 -PORTNUM: 2350 -... - -So, while get_portnum does return increasing numbers in a single test-case, it -restarts at each test-case. - -This is a regression since the introduction of persistent globals. - -Fix this by using "gdb_persistent_global portnum", such that we get: -... -Running gdb.server/target-exec-file.exp ... -PORTNUM: 2345 -Running gdb.server/stop-reply-no-thread-multi.exp ... -PORTNUM: 2346 -PORTNUM: 2347 -PORTNUM: 2348 -PORTNUM: 2349 -PORTNUM: 2350 -PORTNUM: 2351 -... - -Tested on aarch64-linux. - -Approved-By: Tom Tromey ---- - gdb/testsuite/lib/gdbserver-support.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp -index 8aaca946b7d..4f7effaacf7 100644 ---- a/gdb/testsuite/lib/gdbserver-support.exp -+++ b/gdb/testsuite/lib/gdbserver-support.exp -@@ -142,7 +142,7 @@ proc get_portnum {} { - set initial_portnum 2345 - - # Currently available port number. -- global portnum -+ gdb_persistent_global portnum - - # Initialize, if necessary. - if { ![info exists portnum] } { --- -2.35.3 - diff --git a/gdb-testsuite-move-gpu-parallel.lock-to-cache-dir.patch b/gdb-testsuite-move-gpu-parallel.lock-to-cache-dir.patch deleted file mode 100644 index 604a3c8..0000000 --- a/gdb-testsuite-move-gpu-parallel.lock-to-cache-dir.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 40ffee49122d3856292d2374c25f619805f76f1f Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Sat, 4 May 2024 10:41:09 +0200 -Subject: [PATCH 20/48] [gdb/testsuite] Move gpu-parallel.lock to cache dir - -The lock directory returned by lock_dir is currently $objdir. - -It seems possible to leave a stale lock file that blocks progress in a -following run. - -Fix this by using a directory that is guaranteed to be initially empty when -using GDB_PARALLEL, like temp or cache. - -In gdb/testsuite/README I found: -... -cache in particular is used to share data across invocations of runtest -... -which seems appropriate, so let's use cache for this. - -Tested on aarch64-linux. - -Approved-By: Tom Tromey ---- - gdb/testsuite/lib/gdb-utils.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/lib/gdb-utils.exp b/gdb/testsuite/lib/gdb-utils.exp -index 63f6b8c3698..cfaa7905997 100644 ---- a/gdb/testsuite/lib/gdb-utils.exp -+++ b/gdb/testsuite/lib/gdb-utils.exp -@@ -180,7 +180,7 @@ proc lock_file_release {info} { - # Return directory where we keep lock files. - - proc lock_dir {} { -- return $objdir -+ return [make_gdb_parallel_path cache] - } - - # Run body under lock LOCK_FILE. --- -2.35.3 - diff --git a/gdb-testsuite-remove-spurious-in-save_vars.patch b/gdb-testsuite-remove-spurious-in-save_vars.patch deleted file mode 100644 index 63cdf99..0000000 --- a/gdb-testsuite-remove-spurious-in-save_vars.patch +++ /dev/null @@ -1,53 +0,0 @@ -From d3fbb4d91ba2784df267fe1ac2e9ec42581a6fac Mon Sep 17 00:00:00 2001 -From: Simon Marchi -Date: Mon, 15 Jan 2024 16:23:42 +0000 -Subject: [PATCH] gdb/testsuite: remove spurious $ in save_vars - -I noticed that running the whole testsuite in serial mode (which means -all the .exp files are ran in the same TCL environment, one after the -other) with the native-extended-gdbserver board caused some weird -failures, for instance a lot of internal errors in the reverse tests, -like: - - continue^M - Continuing.^M - /home/jenkins/workspace/binutils-gdb_master_linuxbuild/platform/deb12-amd64/target_board/native-extended-gdbserver/src/binutils-gdb/gdb/remot e.c:6922: internal-error: resume: Assertion `scope_ptid == inferior_ptid' failed.^M - A problem internal to GDB has been detected,^M - further debugging may prove unreliable.^M - ----- Backtrace -----^M - FAIL: gdb.reverse/break-precsave.exp: run to end of main (GDB internal error) - -This only happens after running gdb.multi/attach-while-running.exp. -That test does not restore GDBFLAGS properly when it's done, it leaves -`-ex \"maint set target-non-stop on\""` in there, which breaks some -subsequent tests. The problem is that this line: - - save_vars { $::GDBFLAGS } { - -should not use a `$` before the variable name. Passes the content of -`::GDBFLAGS` to save_vars, which is not what we want. We want to pass -the `::GDBFLAGS` string. Fix that. - -Change-Id: I5ad32c527795fd10d0d94020e4fd15cebaca3a77 ---- - gdb/testsuite/gdb.multi/attach-while-running.exp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.multi/attach-while-running.exp b/gdb/testsuite/gdb.multi/attach-while-running.exp -index d3e0d462413..8fce34eaa65 100644 ---- a/gdb/testsuite/gdb.multi/attach-while-running.exp -+++ b/gdb/testsuite/gdb.multi/attach-while-running.exp -@@ -46,7 +46,7 @@ if { [build_executable "failed to prepare" ${testfile} ${srcfile}] } { - } - - proc do_test {} { -- save_vars { $::GDBFLAGS } { -+ save_vars { ::GDBFLAGS } { - append ::GDBFLAGS " -ex \"maint set target-non-stop on\"" - clean_restart $::binfile - } - -base-commit: 08ce0d63c343f7db9a504d37de25391a997b46e2 --- -2.35.3 - diff --git a/gdb-testsuite-reset-errcnt-and-warncnt-in-default_gd.patch b/gdb-testsuite-reset-errcnt-and-warncnt-in-default_gd.patch deleted file mode 100644 index 68f087e..0000000 --- a/gdb-testsuite-reset-errcnt-and-warncnt-in-default_gd.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 37b67fd94ed38959fecc67847666b758b29fe31c Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Tue, 27 Feb 2024 16:24:15 +0100 -Subject: [PATCH 40/48] [gdb/testsuite] Reset errcnt and warncnt in - default_gdb_init - -Say we do: -... -$ make check RUNTESTFLAGS="gdb.dap/ada-nested.exp gdb.dap/pause.exp" -... -and add a perror at the end of pause.exp: -... - dap_shutdown -+ -+perror "foo" -... - -We run into: -... -UNRESOLVED: gdb.dap/ada-nested.exp: compilation prog.adb -... - -This happens because the perror increases the errcnt, which is not reset at -the end of the test-case, and consequently the first pass in the following -test-case is changed into an unresolved. - -Version 1.6.3 of dejagnu contains a fix which produces an unresolved at the -end of the test-case, which does reset the errcnt, but this is with version -1.6.1. - -Furthermore, we reset the errcnt in clean_restart, but the pass is produced -before, so that doesn't help either. - -Fix this by resetting errcnt and warncnt in default_gdb_init. - -Tested on x86_64-linux. - -Approved-By: Tom Tromey - -PR testsuite/31351 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31351 ---- - gdb/testsuite/lib/gdb.exp | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index 70c2db4ac84..990d0c8a70f 100644 ---- a/gdb/testsuite/lib/gdb.exp -+++ b/gdb/testsuite/lib/gdb.exp -@@ -6851,6 +6851,15 @@ proc default_gdb_init { test_file_name } { - return [uplevel 1 ::gdb_tcl_unknown $args] - } - } -+ -+ # Dejagnu version 1.6.3 and later produce an unresolved at the end of a -+ # testcase if an error triggered, resetting errcnt and warncnt to 0, in -+ # order to avoid errors in one test-case influencing the following -+ # test-case. Do this manually here, to support older versions. -+ global errcnt -+ global warncnt -+ set errcnt 0 -+ set warncnt 0 - } - - # Return a path using GDB_PARALLEL. --- -2.35.3 - diff --git a/gdb-testsuite-simplify-gdb.server-server-kill-python.patch b/gdb-testsuite-simplify-gdb.server-server-kill-python.patch deleted file mode 100644 index 3156050..0000000 --- a/gdb-testsuite-simplify-gdb.server-server-kill-python.patch +++ /dev/null @@ -1,65 +0,0 @@ -From afab95df8ff5b3bc57e3cacca813df987ce84af2 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Wed, 17 Apr 2024 11:45:02 +0200 -Subject: [PATCH 27/48] [gdb/testsuite] Simplify - gdb.server/server-kill-python.exp - -In test-case gdb.server/server-kill-python.exp we have: -... -if {[gdb_spawn_with_cmdline_opts \ - "-quiet -iex \"set height 0\" -iex \"set width 0\" -ex \"source $host_file1\""] != 0} { - fail "spawn" - return -} -... - -I reproduced the problem by reverting the fix at the commit adding both the -fix and the test-case, and the reproduced the same problem using: -... -(gdb) source $host_file1 -... -so there doesn't seem to be a specific need to source the python file using -"-ex". - -Simplify the test-case by sourcing the python file using send_gdb. - -This also allow us to simplify the python script. - -Tested on x86_64-linux. ---- - gdb/testsuite/gdb.server/server-kill-python.exp | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/gdb/testsuite/gdb.server/server-kill-python.exp b/gdb/testsuite/gdb.server/server-kill-python.exp -index ae85791c770..dcb6eddd6eb 100644 ---- a/gdb/testsuite/gdb.server/server-kill-python.exp -+++ b/gdb/testsuite/gdb.server/server-kill-python.exp -@@ -48,8 +48,6 @@ puts $fd \ - "import gdb - - def do_gdb_stuff (): -- gdb.execute ('file $host_binfile') -- gdb.execute ('target $gdbserver_protocol $gdbserver_gdbport') - gdb.execute ('break $srcfile:$break_linenr') - gdb.execute ('continue') - gdb.execute ('p server_pid') -@@ -63,11 +61,15 @@ set host_file1 [gdb_remote_download host $file1] - # Now start GDB, sourcing the python command file we generated above. - # Set the height and width so we don't end up at a paging prompt. - if {[gdb_spawn_with_cmdline_opts \ -- "-quiet -iex \"set height 0\" -iex \"set width 0\" -ex \"source $host_file1\""] != 0} { -+ "-quiet -iex \"set height 0\" -iex \"set width 0\""] != 0} { - fail "spawn" - return - } - -+gdb_load $binfile -+gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport -+send_gdb "source $host_file1\n" -+ - # Get the gdbserver PID. - set gdbserver_pid 0 - --- -2.35.3 - diff --git a/gdb-testsuite-use-find_gnatmake-instead-of-gdb_find_.patch b/gdb-testsuite-use-find_gnatmake-instead-of-gdb_find_.patch deleted file mode 100644 index f25dcd8..0000000 --- a/gdb-testsuite-use-find_gnatmake-instead-of-gdb_find_.patch +++ /dev/null @@ -1,139 +0,0 @@ -From 6914ab446b7eb9b284b6bfef8d04c3bacafcaa97 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 18 Apr 2024 17:02:13 +0200 -Subject: [PATCH 26/48] [gdb/testsuite] Use find_gnatmake instead of - gdb_find_gnatmake - -On SLE-11, with an older dejagnu version, I ran into: -... -Running gdb.ada/mi_prot.exp ... -UNRESOLVED: gdb.ada/mi_prot.exp: \ - testcase aborted due to invalid command name: gdb_find_gnatmake -ERROR: tcl error sourcing gdb.ada/mi_prot.exp. -ERROR: invalid command name "gdb_find_gnatmake" - while executing -"::gdb_tcl_unknown gdb_find_gnatmake" - ("uplevel" body line 1) - invoked from within -"uplevel 1 ::gdb_tcl_unknown $args" - (procedure "::unknown" line 5) - invoked from within -"gdb_find_gnatmake" - (procedure "gnatmake_version_at_least" line 2) - invoked from within -... - -Proc gdb_find_gnatmake is actually a backup for find_gnatmake: -... -if {[info procs find_gnatmake] == ""} { - rename gdb_find_gnatmake find_gnatmake -... -so gnatmake_version_at_least should use find_gnatmake instead. - -For a recent dejagnu with find_gnatmake, gdb_find_gnatmake is kept, and we -don't run into this error. - -For an older dejagnu without find_gnatmake, gdb_find_gnatmake is renamed to -find_gnatmake, and we do run into the error. - -It's confusing that we're using the gdb_ prefix for gdb_find_gnatmake, it -seems something legitimate to use. Maybe we should use future_ or gdb_future_ -prefix instead to make this more clear, but I've left that alone for now. - -Fix this by: -- triggering the same error with a recent dejagnu by removing - gdb_find_gnatmake unless used (and likewise for other procs in future.exp), - and -- using find_gnatmake in gnatmake_version_at_least. - -Tested on x86_64-linux. - -Approved-By: Tom Tromey - -PR testsuite/31647 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31647 ---- - gdb/testsuite/lib/ada.exp | 2 +- - gdb/testsuite/lib/future.exp | 15 +++++++++++++++ - 2 files changed, 16 insertions(+), 1 deletion(-) - -diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp -index d45d75994dd..4bf1368f29f 100644 ---- a/gdb/testsuite/lib/ada.exp -+++ b/gdb/testsuite/lib/ada.exp -@@ -151,7 +151,7 @@ proc find_ada_tool {tool} { - # Return 1 if gnatmake is at least version $MAJOR.x.x - - proc gnatmake_version_at_least { major } { -- set gnatmake [gdb_find_gnatmake] -+ set gnatmake [find_gnatmake] - set gnatmake [lindex [split $gnatmake] 0] - if {[catch {exec $gnatmake --version} output]} { - return 0 -diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp -index 807053b8f94..204e11effa4 100644 ---- a/gdb/testsuite/lib/future.exp -+++ b/gdb/testsuite/lib/future.exp -@@ -694,12 +694,16 @@ if {[info procs find_gnatmake] == ""} { - rename gdb_find_gnatmake find_gnatmake - set use_gdb_compile(ada) 1 - gdb_note [join [list $note_prefix "Ada" $note_suffix] ""] -+} else { -+ rename gdb_find_gnatmake "" - } - - if {[info procs find_gfortran] == ""} { - rename gdb_find_gfortran find_gfortran - set use_gdb_compile(fortran) 1 - gdb_note [join [list $note_prefix "Fortran" $note_suffix] ""] -+} else { -+ rename gdb_find_gfortran "" - } - - if {[info procs find_go_linker] == ""} { -@@ -707,24 +711,33 @@ if {[info procs find_go_linker] == ""} { - rename gdb_find_go_linker find_go_linker - set use_gdb_compile(go) 1 - gdb_note [join [list $note_prefix "Go" $note_suffix] ""] -+} else { -+ rename gdb_find_go "" -+ rename gdb_find_go_linker "" - } - - if {[info procs find_gdc] == ""} { - rename gdb_find_gdc find_gdc - set use_gdb_compile(d) 1 - gdb_note [join [list $note_prefix "D" $note_suffix] ""] -+} else { -+ rename gdb_find_gdc "" - } - - if {[info procs find_rustc] == ""} { - rename gdb_find_rustc find_rustc - set use_gdb_compile(rust) 1 - gdb_note [join [list $note_prefix "Rust" $note_suffix] ""] -+} else { -+ rename gdb_find_rustc "" - } - - if {[info procs find_hipcc] == ""} { - rename gdb_find_hipcc find_hipcc - set use_gdb_compile(hip) 1 - gdb_note [join [list $note_prefix "HIP" $note_suffix] ""] -+} else { -+ rename gdb_find_hipcc "" - } - - # If dejagnu's default_target_compile is missing support for any language, -@@ -732,6 +745,8 @@ if {[info procs find_hipcc] == ""} { - if { [array size use_gdb_compile] != 0 } { - catch {rename default_target_compile dejagnu_default_target_compile} - rename gdb_default_target_compile default_target_compile -+} else { -+ rename gdb_default_target_compile "" - } - - --- -2.35.3 - diff --git a/gdb-testsuite-use-more-progbits-for-arm.patch b/gdb-testsuite-use-more-progbits-for-arm.patch deleted file mode 100644 index bba4283..0000000 --- a/gdb-testsuite-use-more-progbits-for-arm.patch +++ /dev/null @@ -1,858 +0,0 @@ -From d9951c3c9ea2e542d071710e9706ed505046fe36 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Fri, 24 Nov 2023 15:41:22 +0100 -Subject: [PATCH 48/48] [gdb/testsuite] Use more %progbits for arm - -On pinebook I ran into: -... -Running gdb.tui/tui-layout-asm-short-prog.exp ... -gdb compile failed, gdb.tui/tui-layout-asm-short-prog.S: Assembler messages: -gdb.tui/tui-layout-asm-short-prog.S:23: Error: \ - junk at end of line, first unrecognized character is `,' -... - -Fix this by using %progbits instead of @progbits for arm. - -Approved-by: Luis Machado - -Tested on x86_64-linux and pinebook. ---- - gdb/testsuite/gdb.arch/pr25124.S | 2 +- - gdb/testsuite/gdb.base/dup-sect.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dup-psym.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-bad-elf-other.S | 8 ++++++++ - gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-basic.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S | 4 ++++ - .../gdb.dwarf2/dw2-case-insensitive-debug.S | 8 ++++++++ - gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-compressed.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-const.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-cu-size.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-entry-value.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-filename.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-icycle.S | 12 ++++++++++++ - gdb/testsuite/gdb.dwarf2/dw2-inheritance.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-inline-param.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-intercu.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-intermix.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-noloc.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-op-call.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-param-error.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-producer.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-strp.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-unresolved.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/fission-reread.S | 4 ++++ - .../gdb.dwarf2/frame-inlined-in-outer-frame.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/mac-fileno.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/pr11465.S | 4 ++++ - gdb/testsuite/gdb.dwarf2/pr13961.S | 4 ++++ - gdb/testsuite/gdb.linespec/break-asm-file.exp | 4 ++-- - .../{break-asm-file0.s => break-asm-file0.S} | 12 ++++++++---- - .../{break-asm-file1.s => break-asm-file1.S} | 8 ++++++-- - gdb/testsuite/gdb.mi/dw2-ref-missing-frame.S | 4 ++++ - gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S | 4 ++++ - 59 files changed, 253 insertions(+), 9 deletions(-) - rename gdb/testsuite/gdb.linespec/{break-asm-file0.s => break-asm-file0.S} (96%) - rename gdb/testsuite/gdb.linespec/{break-asm-file1.s => break-asm-file1.S} (97%) - -diff --git a/gdb/testsuite/gdb.arch/pr25124.S b/gdb/testsuite/gdb.arch/pr25124.S -index a7ed1a02472..27b4e683488 100644 ---- a/gdb/testsuite/gdb.arch/pr25124.S -+++ b/gdb/testsuite/gdb.arch/pr25124.S -@@ -33,4 +33,4 @@ main: - mov r0, #0 - bx lr - .size main, .-main -- .section .note.GNU-stack,"",@progbits -+ .section .note.GNU-stack,"",%progbits -diff --git a/gdb/testsuite/gdb.base/dup-sect.S b/gdb/testsuite/gdb.base/dup-sect.S -index e374d578dc0..c51bc91d6d8 100644 ---- a/gdb/testsuite/gdb.base/dup-sect.S -+++ b/gdb/testsuite/gdb.base/dup-sect.S -@@ -20,4 +20,8 @@ var1: .byte 1 - - .section sect2, "a" - var2: .byte 2 -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dup-psym.S b/gdb/testsuite/gdb.dwarf2/dup-psym.S -index ec180e65080..4e50c0fe885 100644 ---- a/gdb/testsuite/gdb.dwarf2/dup-psym.S -+++ b/gdb/testsuite/gdb.dwarf2/dup-psym.S -@@ -197,4 +197,8 @@ func_cu1: - .byte 1 - - .Lline1_end: -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S -index f0276adf3be..e1fccd1979f 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S -@@ -149,4 +149,8 @@ LELTP: - .uleb128 0x1 - .byte 0x1 - LELT: -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S -index 59dd26c3c85..2ff445e36a4 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S -@@ -149,4 +149,8 @@ LELTP: - .uleb128 0x1 - .byte 0x1 - LELT: -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.S b/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.S -index 960a97c39a8..d58c8bfedf8 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.S -@@ -53,4 +53,8 @@ debug_end: - .byte 0x0 - .byte 0x0 - .byte 0x0 -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.S b/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.S -index 2c62b613c57..dc6b86648bd 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.S -@@ -375,4 +375,8 @@ - - .section .debug_line - .Ldebug_line0: -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.S b/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.S -index 8b88ba6d1ef..45cd7c42fb8 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.S -@@ -246,4 +246,8 @@ func_cu2: - .byte 1 - - .Lline1_end: -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-elf-other.S b/gdb/testsuite/gdb.dwarf2/dw2-bad-elf-other.S -index d90d4e2b4ac..192bfac844f 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-bad-elf-other.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-elf-other.S -@@ -15,7 +15,11 @@ - - .section ".other", "x" - .global some_func, some_func_end -+#ifdef __arm__ -+ .type some_func, %function -+#else - .type some_func, @function -+#endif - nop - nop - nop -@@ -27,4 +31,8 @@ some_func: - .size some_func,.-some_func - some_func_end: - nop -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.S b/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.S -index d7654bb1c14..10ea1ae24cb 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.S -@@ -71,4 +71,8 @@ debug_end: - .byte 0x0 - .byte 0x0 - .byte 0x0 -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-basic.S b/gdb/testsuite/gdb.dwarf2/dw2-basic.S -index 372ab23cb3b..7b37162b037 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-basic.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-basic.S -@@ -197,4 +197,8 @@ func_cu1: - .byte 1 - - .Lline1_end: -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S b/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S -index 39e462b7149..ffe29d17a3a 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-canonicalize-type.S -@@ -154,4 +154,8 @@ debug_end: - .byte 0x0 - .byte 0x0 - .byte 0x0 -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S -index 1059ace3b3e..84e6ee9a485 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S -@@ -60,7 +60,11 @@ - /* The .debug_names-based index support depends on - .debug_aranges generated by GCC. (.gdb_index includes a - gdb-generated map instead.) */ -+#ifdef __arm__ -+ .section .debug_aranges,"",%progbits -+#else - .section .debug_aranges,"",@progbits -+#endif - .4byte .Laranges_end - .Laranges_start // Length of Address Ranges Info - .Laranges_start: - .2byte 0x2 // DWARF Version -@@ -126,4 +130,8 @@ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S b/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S -index 8a8ecfc397b..4d626817f1a 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-compdir-oldgcc.S -@@ -239,4 +239,8 @@ gcc43: .globl gcc43 - .uleb128 1 - .byte 1 - .Lgcc43_end: -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-compressed.S b/gdb/testsuite/gdb.dwarf2/dw2-compressed.S -index 509fbea4a3b..14cf286f393 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-compressed.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-compressed.S -@@ -218,4 +218,8 @@ func_cu1: - .byte 0x9c - .byte 0x00 - .byte 0x92 -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-const.S b/gdb/testsuite/gdb.dwarf2/dw2-const.S -index dfc882ac530..ff81c18732d 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-const.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-const.S -@@ -249,4 +249,8 @@ func_cu1: - .byte 1 - - .Lline1_end: -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.S b/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.S -index 070f24b407d..e217c736dd8 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.S -@@ -113,4 +113,8 @@ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-cu-size.S b/gdb/testsuite/gdb.dwarf2/dw2-cu-size.S -index 99465e2c015..b6f8a2117b3 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-cu-size.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-cu-size.S -@@ -107,4 +107,8 @@ - - .byte 0x0 /* Terminator .debug_abbrev - section. */ -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S b/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S -index d0bdce9ef8b..e4d13a8cd04 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-dos-drive.S -@@ -74,4 +74,8 @@ dieb: - .byte 0x0 - - .byte 0x0 -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.S b/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.S -index 973d5020342..d4fdb1d3077 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.S -@@ -617,4 +617,8 @@ - .byte 0x0 - .byte 0x0 - -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.S b/gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.S -index 781b87e7115..f44db05f266 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-dummy-cu.S -@@ -31,4 +31,8 @@ main_end: - .section .debug_abbrev - .Ldebug_abbrev0: - .byte 0x0 -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.S b/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.S -index d78b7e87ff5..5e08776ba39 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.S -@@ -106,4 +106,8 @@ var: .4byte 1 - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+#ifdef __arm__ -+ .type some_func, %function -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.S b/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.S -index ea8dd092cb0..e4678d86695 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.S -@@ -80,4 +80,8 @@ dieb: - .byte 0x0 - - .byte 0x0 -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-entry-value.S b/gdb/testsuite/gdb.dwarf2/dw2-entry-value.S -index 82d4549b8b5..5fdfeecbb09 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-entry-value.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-entry-value.S -@@ -102,4 +102,8 @@ loclist: - .byte 0x0 - .byte 0x0 - .byte 0x0 -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-filename.S b/gdb/testsuite/gdb.dwarf2/dw2-filename.S -index 1cdd94a12f5..a1f0867aed5 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-filename.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-filename.S -@@ -51,4 +51,8 @@ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.S b/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.S -index f954c4f7cc7..67ba8a47d37 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-icc-opaque.S -@@ -252,4 +252,8 @@ debug_info_seg3_end: - .byte 0x08 /* DW_FORM_string. */ - .2byte 0x0000 /* End abbrev. */ - .byte 0x00 /* End abbrev table. */ -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-icycle.S b/gdb/testsuite/gdb.dwarf2/dw2-icycle.S -index 8856eb6e5d3..e432f629cae 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-icycle.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-icycle.S -@@ -18,7 +18,11 @@ - .text - - .Ltext0: -+#ifdef __arm__ -+ .type p__top__middle__inside.3062, %function -+#else - .type p__top__middle__inside.3062, @function -+#endif - p__top__middle__inside.3062: - .LFB4: - .file 1 "p.adb" -@@ -26,7 +30,11 @@ p__top__middle__inside.3062: - .LBE6: - - .globl p__top -+#ifdef __arm__ -+ .type p__top, %function -+#else - .type p__top, @function -+#endif - p__top: - .LFB2: - .4byte 0 -@@ -246,4 +254,8 @@ p__top: - .Lline1_begin: - .byte 0 - -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inheritance.S b/gdb/testsuite/gdb.dwarf2/dw2-inheritance.S -index f83762503ac..1585d8ac576 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-inheritance.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-inheritance.S -@@ -96,4 +96,8 @@ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-param.S b/gdb/testsuite/gdb.dwarf2/dw2-inline-param.S -index 540bbb38342..c460dddb732 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-inline-param.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-param.S -@@ -150,4 +150,8 @@ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intercu.S b/gdb/testsuite/gdb.dwarf2/dw2-intercu.S -index a068ba116f9..2cdc3049bc0 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-intercu.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-intercu.S -@@ -314,4 +314,8 @@ func_cu1: - .byte 1 - - .Lline1_end: -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intermix.S b/gdb/testsuite/gdb.dwarf2/dw2-intermix.S -index a9a474e2b7c..010bdb22454 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-intermix.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-intermix.S -@@ -198,4 +198,8 @@ func_cu1: - .byte 1 - - .Lline1_end: -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.S b/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.S -index aa3ec9d486c..8a16022bd8f 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.S -@@ -132,4 +132,8 @@ c: .4byte 0 - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S b/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S -index 4169f720837..cbc1c87bb91 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.S -@@ -115,4 +115,8 @@ func2: - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.S b/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.S -index 82236a7091a..6289c36f01e 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.S -@@ -121,4 +121,8 @@ die221: - .string "GNU Modula-2 0.78 (20100402) grafted onto GCC 4.1.2" - .LASF2: - .string "" -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-noloc.S b/gdb/testsuite/gdb.dwarf2/dw2-noloc.S -index 4b742437b56..d9e31d30ed9 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-noloc.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-noloc.S -@@ -324,4 +324,8 @@ resolvable: - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S -index 93abcf6e09a..57c58123fb8 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-inner.S -@@ -178,4 +178,8 @@ inner: - .byte 1 - - .Lline1_end: -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S -index 6031ad26d93..99ff8c1151e 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-objfile-overlap-outer.S -@@ -209,4 +209,8 @@ outer_after: - .byte 1 - - .Lline1_end: -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-op-call.S b/gdb/testsuite/gdb.dwarf2/dw2-op-call.S -index 2ae7bae9a4b..e5bba2cf053 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-op-call.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-op-call.S -@@ -166,4 +166,8 @@ loclist: - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.S b/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.S -index 003732618b2..6983f0ed675 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.S -@@ -130,4 +130,8 @@ aa551234: .byte 0xaa, 0x55, 0x12, 0x34 - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-param-error.S b/gdb/testsuite/gdb.dwarf2/dw2-param-error.S -index 3c7ca3c8ad3..a8b8155b966 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-param-error.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-param-error.S -@@ -106,4 +106,8 @@ debug_end: - .byte 0x0 - .byte 0x0 - .byte 0x0 -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-producer.S b/gdb/testsuite/gdb.dwarf2/dw2-producer.S -index ca63697e90d..30338ebd652 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-producer.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-producer.S -@@ -198,4 +198,8 @@ func_cu1: - .byte 1 - - .Lline1_end: -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.S b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.S -index 1091dbc895e..3e3502a441b 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.S -@@ -149,4 +149,8 @@ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.S b/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.S -index f199994bcdf..5844ebe4f6d 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.S -@@ -167,4 +167,8 @@ d: - .string "sizetype" - .LASF1: - .string "char" -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S b/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S -index d19ee72ebf3..c94147430c3 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S -@@ -397,4 +397,8 @@ loclist: - .byte 1 - - .Lline1_end: -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.S b/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.S -index 8ea03b126ac..6d4a7be3834 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.S -@@ -66,4 +66,8 @@ debug_end: - .byte 0x0 - .byte 0x0 - .byte 0x0 -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-strp.S b/gdb/testsuite/gdb.dwarf2/dw2-strp.S -index dd4eb4fe46a..e0e27ce7548 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-strp.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-strp.S -@@ -176,4 +176,8 @@ - .string "hello world!\n" - .Lemptyname: - .string "" -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unresolved.S b/gdb/testsuite/gdb.dwarf2/dw2-unresolved.S -index c52852d7463..2a0a8de6793 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-unresolved.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-unresolved.S -@@ -178,4 +178,8 @@ SYMBOL(var): .byte 2 - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.S b/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.S -index f2fb3c39a23..2abb4f7ee25 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-var-zero-addr.S -@@ -90,4 +90,8 @@ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.S b/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.S -index d4b4bb64a3c..4678c0fe0f2 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.S -+++ b/gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.S -@@ -85,4 +85,8 @@ types_start: - .byte 0x0 - .byte 0x0 - .byte 0x0 -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/fission-reread.S b/gdb/testsuite/gdb.dwarf2/fission-reread.S -index bdb20e76330..6171453c4a5 100644 ---- a/gdb/testsuite/gdb.dwarf2/fission-reread.S -+++ b/gdb/testsuite/gdb.dwarf2/fission-reread.S -@@ -460,4 +460,8 @@ SYMBOL(main): - .Ldebug_addr0: - .4byte .LFB0 /* DW_AT_low_pc */ - .4byte SYMBOL(baz) /* DW_AT_location */ -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S -index 7e5971c50c9..a41b2851394 100644 ---- a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S -+++ b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S -@@ -164,4 +164,8 @@ __start_high_pc: - - .global __cu_high_pc - __cu_high_pc: -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/mac-fileno.S b/gdb/testsuite/gdb.dwarf2/mac-fileno.S -index 77730401515..71401bc81c7 100644 ---- a/gdb/testsuite/gdb.dwarf2/mac-fileno.S -+++ b/gdb/testsuite/gdb.dwarf2/mac-fileno.S -@@ -209,4 +209,8 @@ func_cu1: - .uleb128 0x0 /* Included from line number 0 */ - .uleb128 0x0 /* Filename we just started (bug: number too small) */ - .byte 0x0 /* end of CU's macro information */ -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/pr11465.S b/gdb/testsuite/gdb.dwarf2/pr11465.S -index 5308abebee0..b974f0e9c63 100644 ---- a/gdb/testsuite/gdb.dwarf2/pr11465.S -+++ b/gdb/testsuite/gdb.dwarf2/pr11465.S -@@ -360,4 +360,8 @@ die149: .uleb128 0x16 /* DW_TAG_variable */ - .LASF4: - .string "GNU C++ 4.4.2" - .ident "GCC: (GNU) 4.4.2" -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.dwarf2/pr13961.S b/gdb/testsuite/gdb.dwarf2/pr13961.S -index fc9d7afa838..4c1162591c3 100644 ---- a/gdb/testsuite/gdb.dwarf2/pr13961.S -+++ b/gdb/testsuite/gdb.dwarf2/pr13961.S -@@ -378,4 +378,8 @@ SYMBOL(main): - .LASF3: - .string "main" - -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.S b/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.S -index 684b9d93541..e37b04a4219 100644 ---- a/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.S -+++ b/gdb/testsuite/gdb.mi/dw2-ref-missing-frame.S -@@ -163,4 +163,8 @@ - - .byte 0x0 /* Terminator */ - .byte 0x0 /* Terminator */ -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif -diff --git a/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S b/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S -index d577804e4bb..461e322628a 100644 ---- a/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S -+++ b/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S -@@ -20,4 +20,8 @@ _start: - .rept 5 - nop - .endr -+#ifdef __arm__ -+ .section .note.GNU-stack,"",%progbits -+#else - .section .note.GNU-stack,"",@progbits -+#endif --- -2.35.3 - diff --git a/gdb-testsuite-use-unique-portnum-in-parallel-testing-check-slash-slash-case.patch b/gdb-testsuite-use-unique-portnum-in-parallel-testing-check-slash-slash-case.patch deleted file mode 100644 index fb67c05..0000000 --- a/gdb-testsuite-use-unique-portnum-in-parallel-testing-check-slash-slash-case.patch +++ /dev/null @@ -1,95 +0,0 @@ -From f24d498c972be365c72c99f14ada42e3a300b3c4 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Sat, 4 May 2024 10:41:09 +0200 -Subject: [PATCH 22/48] [gdb/testsuite] Use unique portnum in parallel testing - (check//% case) - -Make target check//% is the gdb variant of a similar gcc make target [1]. - -When running tests using check//%: -... -$ cd build/gdb -$ make check//unix/{-fPIE/-pie,-fno-PIE/-no-pie} -j2 TESTS=gdb.server/*.exp -... -we get: -... -$ cat build/gdb/testsuite.unix.-fPIE.-pie/cache/portnum -2427 -$ cat build/gdb/testsuite.unix.-fno-PIE.-no-pie/cache/portnum -2423 -... - -The problem is that there are two portnum files used in parallel. - -Fix this by: -- creating a common lockdir build/gdb/testsuite.lockdir for make target - check//%, -- passing this down to the runtests invocations using variable GDB_LOCK_DIR, - and -- using GDB_LOCK_DIR in lock_dir. - -Tested on aarch64-linux. - -Approved-By: Tom Tromey - -PR testsuite/31632 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31632 - -[1] https://gcc.gnu.org/install/test.html ---- - gdb/Makefile.in | 8 ++++++-- - gdb/testsuite/lib/gdb-utils.exp | 5 +++++ - 2 files changed, 11 insertions(+), 2 deletions(-) - -diff --git a/gdb/Makefile.in b/gdb/Makefile.in -index 68e10cf47d8..f742eb5d009 100644 ---- a/gdb/Makefile.in -+++ b/gdb/Makefile.in -@@ -1971,6 +1971,10 @@ check-parallel: force - $(MAKE) $(TARGET_FLAGS_TO_PASS) check-parallel; \ - else true; fi - -+testsuite.lockdir: force -+ rm -rf $@ -+ mkdir -p $@ -+ - # The idea is to parallelize testing of multilibs, for example: - # make -j3 check//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu} - # will run 3 concurrent sessions of check, eventually testing all 10 -@@ -1979,7 +1983,7 @@ check-parallel: force - # used, this rule will harmlessly fail to match. Used FORCE_PARALLEL to - # prevent serialized checking due to the passed RUNTESTFLAGS. - # FIXME: use config.status --config not --version, when available. --check//%: force -+check//%: force testsuite.lockdir - @if [ -f testsuite/config.status ]; then \ - rootme=`pwd`; export rootme; \ - rootsrc=`cd $(srcdir); pwd`; export rootsrc; \ -@@ -1997,7 +2001,7 @@ check//%: force - ); \ - else :; fi && cd $$testdir && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) \ -- RUNTESTFLAGS="--target_board=$$variant $(RUNTESTFLAGS)" \ -+ RUNTESTFLAGS="GDB_LOCK_DIR=$$rootme/testsuite.lockdir --target_board=$$variant $(RUNTESTFLAGS)" \ - FORCE_PARALLEL=$(if $(FORCE_PARALLEL),1,$(if $(RUNTESTFLAGS),,1)) \ - "$$target"; \ - else true; fi -diff --git a/gdb/testsuite/lib/gdb-utils.exp b/gdb/testsuite/lib/gdb-utils.exp -index cfaa7905997..7fd613e0b8f 100644 ---- a/gdb/testsuite/lib/gdb-utils.exp -+++ b/gdb/testsuite/lib/gdb-utils.exp -@@ -180,6 +180,11 @@ proc lock_file_release {info} { - # Return directory where we keep lock files. - - proc lock_dir {} { -+ if { [info exists ::GDB_LOCK_DIR] } { -+ # When using check//. -+ return $::GDB_LOCK_DIR -+ } -+ - return [make_gdb_parallel_path cache] - } - --- -2.35.3 - diff --git a/gdb-testsuite-use-unique-portnum-in-parallel-testing.patch b/gdb-testsuite-use-unique-portnum-in-parallel-testing.patch deleted file mode 100644 index c9b5ee4..0000000 --- a/gdb-testsuite-use-unique-portnum-in-parallel-testing.patch +++ /dev/null @@ -1,102 +0,0 @@ -From c8bf6704e64be92816527e9f3f3b582046e214c9 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Sat, 4 May 2024 10:41:09 +0200 -Subject: [PATCH 21/48] [gdb/testsuite] Use unique portnum in parallel testing - -When instrumenting get_portnum using: -... -puts "PORTNUM: $res" -... -and running: -... -$ cd build/gdb -$ make check-parallel -j2 TESTS=gdb.server/*.exp -... -we run into: -... -Running gdb.server/abspath.exp ... -PORTNUM: 2345 -... -and: -... -Running gdb.server/bkpt-other-inferior.exp ... -PORTNUM: 2345 -... - -This is because the test-cases are run in independent runtest invocations. - -Fix this by handling the parallel case in get_portnum using: -- a file $objdir/cache/portnum to keep the portnum variable, and -- a file $objdir/cache/portnum.lock to serialize access to it. - -Tested on aarch64-linux. - -Approved-By: Tom Tromey ---- - gdb/testsuite/lib/gdbserver-support.exp | 47 ++++++++++++++++++++----- - 1 file changed, 38 insertions(+), 9 deletions(-) - -diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp -index 4f7effaacf7..a3cccf54a72 100644 ---- a/gdb/testsuite/lib/gdbserver-support.exp -+++ b/gdb/testsuite/lib/gdbserver-support.exp -@@ -141,18 +141,47 @@ proc get_portnum {} { - # starting at $initial_portnum, to avoid conflicts with hung ports. - set initial_portnum 2345 - -- # Currently available port number. -- gdb_persistent_global portnum -+ if { ![info exists ::GDB_PARALLEL] } { -+ # Sequential case. - -- # Initialize, if necessary. -- if { ![info exists portnum] } { -- set portnum $initial_portnum -+ # Currently available port number. -+ gdb_persistent_global portnum -+ -+ # Initialize, if necessary. -+ if { ![info exists portnum] } { -+ set portnum $initial_portnum -+ } -+ -+ # Return currently available port number, and update it. -+ set res $portnum -+ incr portnum -+ return $res -+ } -+ -+ # Parallel case. -+ with_lock portnum.lock { -+ # Keep portnum file alongside the lock that guards it. -+ set portnum_file [lock_dir]/portnum -+ -+ if { [file exists $portnum_file] } { -+ set fd [open $portnum_file r] -+ set portnum [read $fd] -+ close $fd -+ -+ set portnum [string trim $portnum] -+ } else { -+ # Initialize. -+ set portnum $initial_portnum -+ } -+ -+ set next_portnum [expr $portnum + 1] -+ -+ set fd [open $portnum_file w] -+ puts $fd $next_portnum -+ close $fd - } - -- # Return currently available port number, and update it. -- set res $portnum -- incr portnum -- return $res -+ return $portnum - } - - # Locate the gdbserver binary. Returns "" if gdbserver could not be found. --- -2.35.3 - diff --git a/gdb-tui-allow-command-window-of-1-or-2-lines.patch b/gdb-tui-allow-command-window-of-1-or-2-lines.patch deleted file mode 100644 index c67b949..0000000 --- a/gdb-tui-allow-command-window-of-1-or-2-lines.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 02616ce7c5571e5b2680cad52f8c58b27f77b2a5 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 9 Nov 2023 09:04:39 +0100 -Subject: [PATCH 4/6] [gdb/tui] Allow command window of 1 or 2 lines - -When starting TUI in a terminal with 2 lines (likewise with 1 line): -... -$ echo $LINES -2 -$ gdb -q -tui -... -we run into this assert in tui_apply_current_layout: -... - /* This should always be made visible by a layout. */ - gdb_assert (TUI_CMD_WIN != nullptr); -... - -The problem is that for the command window: -- the minimum height is 3 (the default), but -- the maximum height is only 2 because there are only 2 lines. - -This discrepancy eventually leads to a call to newwin in make_window with: -... -(gdb) p height -$1 = 3 -(gdb) p width -$2 = 66 -(gdb) p y -$3 = -1 -(gdb) p x -$4 = 0 -(gdb) -... -which results in a nullptr, which eventually triggers the assert. - -The easiest way to fix this is to change the minimum height of the command -window to 1. However, that would also change behaviour for the case that the -screen size is 3 lines or more. For instance, in gdb.tui/winheight.exp the -number of lines in the terminal is 24, and the test-case checks that the user -cannot increase the source window height to the point that the command window -height would be less than 3. - -Fix this by calculating the minimum height of the command window as follows: -- the default (3) if max_height () allows it, and -- max_height () otherwise. - -Tested on x86_64-linux. - -PR tui/31044 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31044 ---- - gdb/tui/tui-command.h | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/gdb/tui/tui-command.h b/gdb/tui/tui-command.h -index f6842880bb2..e8c96ecee30 100644 ---- a/gdb/tui/tui-command.h -+++ b/gdb/tui/tui-command.h -@@ -57,6 +57,18 @@ struct tui_cmd_window : public tui_win_info - /* The command window can't be made invisible. */ - } - -+ /* Compute the minimum height of this window. */ -+ virtual int min_height () const override -+ { -+ int preferred_min = tui_win_info::min_height (); -+ int max = max_height (); -+ /* If there is enough space to accommodate the preferred minimum height, -+ use it. Otherwise, use as much as possible. */ -+ return (preferred_min <= max -+ ? preferred_min -+ : max); -+ } -+ - int start_line = 0; - - protected: --- -2.35.3 - diff --git a/gdb-tui-fix-resizing-of-terminal-to-1-or-2-lines.patch b/gdb-tui-fix-resizing-of-terminal-to-1-or-2-lines.patch deleted file mode 100644 index d5a084b..0000000 --- a/gdb-tui-fix-resizing-of-terminal-to-1-or-2-lines.patch +++ /dev/null @@ -1,147 +0,0 @@ -From c55a452eaf9390d5659d3205f762aa2cb84511e1 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 9 Nov 2023 09:05:01 +0100 -Subject: [PATCH 6/6] [gdb/tui] Fix resizing of terminal to 1 or 2 lines - -When starting TUI in a terminal with 3 lines: -... -$ echo $LINES -3 -$ gdb -q -tui -... -and resizing the terminal to 2 lines we run into a segfault. - -The problem is that for the source window: -- the minimum height is 3 (the default), but -- the maximum height is only 2 because there are only 2 lines. - -This discrepancy eventually leads to a call to newwin in make_window with: -... -(gdb) p height -$1 = 3 -(gdb) p width -$2 = 56 -(gdb) p y -$3 = -1 -(gdb) p x -$4 = 0 -... -which results in a nullptr. - -This violates the assumption here in tui_apply_current_layout: -.... - /* Get the new list of currently visible windows. */ - std::vector new_tui_windows; - applied_layout->get_windows (&new_tui_windows); -... -that get_windows only returns visible windows, which leads to tui_windows -holding a dangling pointer, which results in the segfault. - -Fix this by: -- making sure get_windows only returns visible windows, and -- detecting the situation and dropping windows from the layout if - there's no room for them. - -Tested on x86_64-linux. - -PR tui/31044 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31044 ---- - gdb/testsuite/gdb.tui/resize.exp | 9 +++++++++ - gdb/tui/tui-layout.c | 22 ++++++++++++++++++++-- - gdb/tui/tui-layout.h | 6 +++++- - 3 files changed, 34 insertions(+), 3 deletions(-) - -diff --git a/gdb/testsuite/gdb.tui/resize.exp b/gdb/testsuite/gdb.tui/resize.exp -index 60d5116886b..e15f8a2f507 100644 ---- a/gdb/testsuite/gdb.tui/resize.exp -+++ b/gdb/testsuite/gdb.tui/resize.exp -@@ -39,3 +39,12 @@ Term::check_contents "source at startup" "\\|.*21 *return 0" - - Term::resize 40 90 - Term::check_box "source box after resize" 0 0 90 26 -+ -+# Check that resizing to less than 3 lines doesn't cause problems. -+foreach lines { 2 1 } { -+ with_test_prefix lines=$lines { -+ Term::resize $lines 90 0 -+ Term::wait_for "" -+ Term::check_region_contents "has prompt" 0 0 90 $lines "$gdb_prompt" -+ } -+} -diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c -index 27abee02087..362c1447910 100644 ---- a/gdb/tui/tui-layout.c -+++ b/gdb/tui/tui-layout.c -@@ -442,6 +442,13 @@ tui_layout_window::apply (int x_, int y_, int width_, int height_, - width = width_; - height = height_; - gdb_assert (m_window != nullptr); -+ if (width == 0 || height == 0) -+ { -+ /* The window was dropped, so it's going to be deleted, reset the -+ soon to be dangling pointer. */ -+ m_window = nullptr; -+ return; -+ } - m_window->resize (height, width, x, y); - } - -@@ -823,6 +830,7 @@ tui_layout_split::apply (int x_, int y_, int width_, int height_, - int available_size = m_vertical ? height : width; - int last_index = -1; - int total_weight = 0; -+ int prev = -1; - for (int i = 0; i < m_splits.size (); ++i) - { - bool cmd_win_already_exists = TUI_CMD_WIN != nullptr; -@@ -854,6 +862,14 @@ tui_layout_split::apply (int x_, int y_, int width_, int height_, - info[i].max_size = info[i].min_size; - } - -+ if (info[i].min_size > info[i].max_size) -+ { -+ /* There is not enough room for this window, drop it. */ -+ info[i].min_size = 0; -+ info[i].max_size = 0; -+ continue; -+ } -+ - if (info[i].min_size == info[i].max_size) - available_size -= info[i].min_size; - else -@@ -864,10 +880,12 @@ tui_layout_split::apply (int x_, int y_, int width_, int height_, - - /* Two adjacent boxed windows will share a border, making a bit - more size available. */ -- if (i > 0 -- && m_splits[i - 1].layout->last_edge_has_border_p () -+ if (prev != -1 -+ && m_splits[prev].layout->last_edge_has_border_p () - && m_splits[i].layout->first_edge_has_border_p ()) - info[i].share_box = true; -+ -+ prev = i; - } - - /* If last_index is set then we have a window that is not of a fixed -diff --git a/gdb/tui/tui-layout.h b/gdb/tui/tui-layout.h -index 206f1117445..ec013a3f051 100644 ---- a/gdb/tui/tui-layout.h -+++ b/gdb/tui/tui-layout.h -@@ -185,7 +185,11 @@ class tui_layout_window : public tui_layout_base - /* See tui_layout_base::get_windows. */ - void get_windows (std::vector *windows) override - { -- windows->push_back (m_window); -+ if (m_window != nullptr && m_window->is_visible ()) -+ { -+ /* Only get visible windows. */ -+ windows->push_back (m_window); -+ } - } - - protected: --- -2.35.3 - diff --git a/gdb-tui-fix-wmaybe-uninitialized-in-tui_find_disasse.patch b/gdb-tui-fix-wmaybe-uninitialized-in-tui_find_disasse.patch deleted file mode 100644 index 01738b0..0000000 --- a/gdb-tui-fix-wmaybe-uninitialized-in-tui_find_disasse.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 0f2bdd8648e47e10334f8cc8e47b277d4064d0a2 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Mon, 13 Nov 2023 09:31:20 +0100 -Subject: [PATCH 3/6] [gdb/tui] Fix Wmaybe-uninitialized in - tui_find_disassembly_address -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When building gdb with -O2, we run into: -... -gdb/tui/tui-disasm.c: In function ‘CORE_ADDR tui_find_disassembly_address \ - (gdbarch*, CORE_ADDR, int)’: -gdb/tui/tui-disasm.c:293:7: warning: ‘last_addr’ may be used uninitialized \ - in this function [-Wmaybe-uninitialized] - if (last_addr < pc) - ^~ -... - -The warning triggers since commit 72535eb14bd ("[gdb/tui] Fix segfault in -tui_find_disassembly_address"). - -Fix the warning by ensuring that last_addr is initialized at the point of -use: -... -+ last_addr = asm_lines.back ().addr; - if (last_addr < pc) -... - -Tested on x86_64-linux. ---- - gdb/tui/tui-disasm.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c -index 03c78aa1291..bbbc92c8183 100644 ---- a/gdb/tui/tui-disasm.c -+++ b/gdb/tui/tui-disasm.c -@@ -281,7 +281,6 @@ tui_find_disassembly_address (struct gdbarch *gdbarch, CORE_ADDR pc, int from) - /* Take the best possible match we have. */ - new_low = *possible_new_low; - next_addr = tui_disassemble (gdbarch, asm_lines, new_low, max_lines); -- last_addr = asm_lines.back ().addr; - gdb_assert (asm_lines.size () >= max_lines); - } - -@@ -290,6 +289,7 @@ tui_find_disassembly_address (struct gdbarch *gdbarch, CORE_ADDR pc, int from) - We keep the disassembled instructions in the 'lines' window - and shift it downward (increasing its addresses). */ - int pos = max_lines - 1; -+ last_addr = asm_lines.back ().addr; - if (last_addr < pc) - do - { --- -2.35.3 - diff --git a/gdb.changes b/gdb.changes index c425e12..98c745b 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,143 @@ +------------------------------------------------------------------- +Mon Jan 27 06:00:38 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ a8e0b3d (gdb 15.1). +- Use gcc-9 for SLE-12 (default gcc 4.8.5 doesn't support C++17). +- Maintenance script qa-local.sh: + * Update version to 15.1. +- Maintenance script qa.sh: + * Add kfails due to gcc 4.8.5 DW_TAG_lexical_block oddity. + * Extend PR24845 kfails. + * Add PR31721 and PR32608 kfails. +- Patches added: + * gdb-guile-use-scm_debug_typing_strictness-0.patch + * gdb-doc-fix-gdb.unwinder-docs.patch + * gdb-doc-fix-qisaddresstagged-anchor.patch + * gdb-doc-fix-standard-replies-xref.patch + * gdb-testsuite-fix-gdb_py_module_available-for-python.patch + * gdb-testsuite-fix-another-regexp-in-gdb.threads-step.patch + * gdb-testsuite-fix-timeouts-in-gdb.threads-step-over-.patch +- Patches updated: + * gdb-6.3-gstack-20050411.patch + * gdb-6.6-buildid-locate-solib-missing-ids.patch + * gdb-6.6-buildid-locate.patch + * gdb-add-rpm-suggestion-script.patch + * gdb-gcore-bash.patch + * gdb-python-avoid-depending-on-the-curses-library.patch + * gdb-python-finishbreakpoint-update.patch +- Patches dropped: + * gdb-add-missing-debug-ext-lang-hook.patch + * gdb-add-missing-debug-info-python-hook.patch + * gdb-do-not-import-py-curses-ascii-module.patch + * gdb-ftbs-swapped-calloc-args.patch + * gdb-handle-no-python-gdb-module.patch + * gdb-merge-debug-symbol-lookup.patch + * gdb-refactor-find-and-add-separate-symbol-file.patch + * gdb-reformat-missing-debug-py-file.patch + * gdb-remove-path-in-test-name.patch + * gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch + * gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch + * gdb-rhbz-2232086-generate-gdb-index-consistently.patch + * gdb-rhbz-2232086-reduce-size-of-gdb-index.patch + * gdb-rhbz2232086-refactor-selftest-support.patch + * gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch + * gdb-rhbz2250652-gdbpy_gil.patch + * gdb-rhbz2261580-intrusive_list-assertion-fix.patch + * gdb-rhbz2277160-apx-disasm.patch + * gdb-rhel2295897-pre-read-DWZ-file-in-DWARF-reader.patch + * gdb-sync-coffread-with-elfread.patch + * gdb-remove-use-of-py-isascii + * change-gdb.base-examine-backwards.exp-for-aix.patch + * fix-regression-on-aarch64-linux-gdbserver.patch + * fix-the-gdb.ada-inline-section-gc.exp-test.patch + * fixup-powerpc-and-aarch64-fix-reverse-stepping-failu.patch + * gdb-arm-fix-epilogue-frame-id.patch + * gdb-arm-remove-thumb-bit-in-arm_adjust_breakpoint_ad.patch + * gdb-arm-remove-tpidruro-register-from-non-freebsd-ta.patch + * gdb-build-fix-gdbserver-linux-aarch64-low.cc-build.patch + * gdb-exp-fix-cast-handling-for-indirection.patch + * gdb-exp-fix-printing-of-out-of-bounds-struct-members.patch + * gdb-exp-redo-cast-handling-for-indirection.patch + * gdb-fix-heap-use-after-free-in-select_event_lwp.patch + * gdb-fix-segfault-in-for_each_block-part-1.patch + * gdb-fix-segfault-in-for_each_block-part-2.patch + * gdb-python-fix-gdb.python-py-disasm.exp-on-arm-linux.patch + * gdb-python-make-gdb.unwindinfo.add_saved_register-mo-fixup.patch + * gdb-python-make-gdb.unwindinfo.add_saved_register-mo.patch + * gdb-remote-fix-abort-on-remote_close_error.patch + * gdb-s390-add-arch14-record-replay-support.patch + * gdb-symtab-add-producer_is_gas.patch + * gdb-symtab-don-t-defer-backward-refs-inter-cu-intra-.patch + * gdb-symtab-factor-out-m_deferred_entries-usage.patch + * gdb-symtab-factor-out-m_die_range_map-usage.patch + * gdb-symtab-fix-dw_tag_inlined_subroutine-entries-in-.patch + * gdb-symtab-handle-nullptr-parent-in-parent_map-set_p.patch + * gdb-symtab-keep-track-of-all-parents-for-cooked-inde.patch + * gdb-symtab-keep-track-of-processed-dies-in-shard.patch + * gdb-symtab-refactor-condition-in-scan_attributes.patch + * gdb-symtab-resolve-deferred-entries-inter-shard-case.patch + * gdb-symtab-resolve-deferred-entries-intra-shard-case.patch + * gdb-symtab-work-around-gas-pr28629.patch + * gdb-symtab-work-around-pr-gas-29517-dwarf2-case.patch + * gdb-symtab-work-around-pr-gas-29517.patch + * gdb-symtab-workaround-pr-gas-31115.patch + * gdb-tdep-fix-catching-syscall-execve-exit-for-arm.patch + * gdb-tdep-fix-gdb.base-watch-bitfields.exp-on-aarch64.patch + * gdb-tdep-fix-gdb.base-watchpoint-running-on-arm-ppc6.patch + * gdb-tdep-fix-gdb.base-watchpoint-unaligned.exp-on-aa.patch + * gdb-tdep-fix-nr-array-elements-in-ppc64_aggregate_ca.patch + * gdb-tdep-fix-reverse-execution-of-ldr-immediate-t4.patch + * gdb-testsuite-add-gdb.dwarf2-backward-spec-inter-cu..patch + * gdb-testsuite-add-gdb.dwarf2-forward-spec-inter-cu.e.patch + * gdb-testsuite-add-missing-include-in-gdb.base-ctf-pt.patch + * gdb-testsuite-add-missing-include-in-gdb.base-rtld-s.patch + * gdb-testsuite-add-missing-includes-in-gdb.trace-coll.patch + * gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch + * gdb-testsuite-add-pr-gdb-26967-kfail-in-two-more-tes.patch + * gdb-testsuite-call-ldd-version-in-gdb.testsuite-dump.patch + * gdb-testsuite-factor-out-proc-get_portnum.patch + * gdb-testsuite-factor-out-proc-lock_dir.patch + * gdb-testsuite-factor-out-proc-with_lock.patch + * gdb-testsuite-fix-gdb.ada-verylong.exp-on-32-bit-tar.patch + * gdb-testsuite-fix-gdb.base-eh_return.exp.patch + * gdb-testsuite-fix-gdb.base-ending-run.exp-on-manjaro.patch + * gdb-testsuite-fix-gdb.base-list-no-debug.exp-on-debi.patch + * gdb-testsuite-fix-gdb.cp-namespace.exp-with-read1.patch + * gdb-testsuite-fix-gdb.dwarf2-dw2-gas-workaround.exp.patch + * gdb-testsuite-fix-gdb.mi-mi-dprintf.exp-with-read1.patch + * gdb-testsuite-fix-gdbserver-pid-in-gdb.server-server.patch + * gdb-testsuite-fix-gdb.server-server-connect.exp-for-.patch + * gdb-testsuite-fix-license-text-in-gdb.reverse-map-to.patch + * gdb-testsuite-fix-missing-return-type-in-gdb.linespe.patch + * gdb-testsuite-fix-regexp-in-vgdb_start.patch + * gdb-testsuite-fix-spurious-fails-with-examine-backwa.patch + * gdb-testsuite-fix-test-case-gdb.threads-attach-stopp.patch + * gdb-testsuite-fix-test-in-gdb.python-py-finish-break.patch + * gdb-testsuite-fix-typo-in-gdb.base-catch-syscall.exp.patch + * gdb-testsuite-fix-valgrind-tests-on-debian.patch + * gdb-testsuite-further-handle-long-filenames-in-gdb.b.patch + * gdb-testsuite-handle-core-without-build-id-in-gdb.ba.patch + * gdb-testsuite-handle-pac-marker.patch + * gdb-testsuite-make-gdb.base-solib-search.exp-more-ro.patch + * gdb-testsuite-make-portnum-a-persistent-global.patch + * gdb-testsuite-move-gpu-parallel.lock-to-cache-dir.patch + * gdb-testsuite-remove-spurious-in-save_vars.patch + * gdb-testsuite-reset-errcnt-and-warncnt-in-default_gd.patch + * gdb-testsuite-simplify-gdb.server-server-kill-python.patch + * gdb-testsuite-use-find_gnatmake-instead-of-gdb_find_.patch + * gdb-testsuite-use-more-progbits-for-arm.patch + * gdb-testsuite-use-unique-portnum-in-parallel-testing-check-slash-slash-case.patch + * gdb-testsuite-use-unique-portnum-in-parallel-testing.patch + * gdb-tui-allow-command-window-of-1-or-2-lines.patch + * gdb-tui-fix-resizing-of-terminal-to-1-or-2-lines.patch + * gdb-tui-fix-wmaybe-uninitialized-in-tui_find_disasse.patch + * make-pascal_language-print_type-handle-varstring-nul.patch + * powerpc-and-aarch64-fix-reverse-stepping-failure.patch + * powerpc-fix-test-gdb.ada-finish-large.exp.patch + * riscv-lrsc.patch + * rs6000-unwind-on-each-instruction-fix.patch + * s390-provide-ibm-z16-arch14-instruction-descriptions.patch + ------------------------------------------------------------------- Sat Jan 25 09:24:00 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 41866d1..ca93532 100644 --- a/gdb.spec +++ b/gdb.spec @@ -69,7 +69,7 @@ Group: Development/Languages/C and C++ %endif Name: gdb%{name_suffix} -Version: 14.2 +Version: 15.1 Release: 0 # The release always contains a leading reserved number, start it at 1. @@ -191,28 +191,7 @@ Patch21: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch Patch24: gdb-rhbz1149205-catch-syscall-after-fork-test.patch Patch25: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch Patch26: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch28: gdb-rhbz2232086-refactor-selftest-support.patch -Patch29: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch -Patch30: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch -Patch31: gdb-rhbz-2232086-generate-gdb-index-consistently.patch -Patch32: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch -Patch33: gdb-rhbz2250652-gdbpy_gil.patch -Patch34: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch -Patch35: gdb-ftbs-swapped-calloc-args.patch -Patch36: gdb-rhbz2261580-intrusive_list-assertion-fix.patch -Patch37: gdb-sync-coffread-with-elfread.patch -Patch38: gdb-merge-debug-symbol-lookup.patch -Patch39: gdb-refactor-find-and-add-separate-symbol-file.patch -Patch40: gdb-add-missing-debug-ext-lang-hook.patch -Patch41: gdb-add-missing-debug-info-python-hook.patch -Patch42: gdb-remove-use-of-py-isascii -Patch43: gdb-remove-path-in-test-name.patch -Patch44: gdb-do-not-import-py-curses-ascii-module.patch -Patch45: gdb-reformat-missing-debug-py-file.patch -Patch46: gdb-handle-no-python-gdb-module.patch -Patch47: gdb-add-rpm-suggestion-script.patch -Patch48: gdb-rhbz2277160-apx-disasm.patch -Patch49: gdb-rhel2295897-pre-read-DWZ-file-in-DWARF-reader.patch +Patch29: gdb-add-rpm-suggestion-script.patch #Fedora Packages end # Fedora patches fixup @@ -257,93 +236,13 @@ Patch1504: fix-gdb.mi-new-ui-mi-sync.exp.patch Patch1505: gdb-testsuite-fix-gdb.base-step-over-syscall.exp-with-m32-amd-case.patch # https://sourceware.org/bugzilla/show_bug.cgi?id=32590 Patch1506: gdb-cli-print-at_hwcap3-and-at_hwcap4.patch +# Work around SCM_UNPACK Werror=sequence-point in libguile v2.0.9 (SLE-12). +Patch1507: gdb-guile-use-scm_debug_typing_strictness-0.patch +# SLE-12 specific fix, hard to reproduce with trunk. +Patch1508: gdb-testsuite-fix-gdb_py_module_available-for-python.patch -# Backports from current release branch (GDB 14). +# Backports from master, available in GDB 16. -# - -# Backports from master, available in next release (GDB 15). - -Patch2000: gdb-symtab-work-around-pr-gas-29517.patch -Patch2001: gdb-symtab-add-producer_is_gas.patch -Patch2002: gdb-symtab-work-around-gas-pr28629.patch -Patch2003: gdb-tdep-fix-nr-array-elements-in-ppc64_aggregate_ca.patch -Patch2004: gdb-tui-fix-wmaybe-uninitialized-in-tui_find_disasse.patch -Patch2005: gdb-testsuite-add-missing-no-prompt-anchor-in-gdb.ba.patch -Patch2006: gdb-testsuite-remove-spurious-in-save_vars.patch -Patch2007: make-pascal_language-print_type-handle-varstring-nul.patch -Patch2008: gdb-symtab-work-around-pr-gas-29517-dwarf2-case.patch -Patch2010: fix-the-gdb.ada-inline-section-gc.exp-test.patch -Patch2011: gdb-testsuite-handle-pac-marker.patch -Patch2012: change-gdb.base-examine-backwards.exp-for-aix.patch -Patch2013: gdb-testsuite-fix-spurious-fails-with-examine-backwa.patch -Patch2014: gdb-testsuite-make-gdb.base-solib-search.exp-more-ro.patch -Patch2015: gdb-testsuite-fix-regexp-in-vgdb_start.patch -Patch2016: powerpc-and-aarch64-fix-reverse-stepping-failure.patch -Patch2017: gdb-tdep-fix-gdb.base-watch-bitfields.exp-on-aarch64.patch -Patch2018: gdb-tdep-fix-gdb.base-watchpoint-unaligned.exp-on-aa.patch -Patch2019: gdb-testsuite-add-pr-gdb-26967-kfail-in-two-more-tes.patch -Patch2020: gdb-testsuite-fix-gdb.base-eh_return.exp.patch -Patch2021: fixup-powerpc-and-aarch64-fix-reverse-stepping-failu.patch -Patch2022: gdb-exp-fix-printing-of-out-of-bounds-struct-members.patch -Patch2023: gdb-fix-heap-use-after-free-in-select_event_lwp.patch -Patch2024: fix-regression-on-aarch64-linux-gdbserver.patch -Patch2025: gdb-testsuite-factor-out-proc-get_portnum.patch -Patch2026: gdb-testsuite-make-portnum-a-persistent-global.patch -Patch2027: gdb-testsuite-factor-out-proc-with_lock.patch -Patch2028: gdb-testsuite-factor-out-proc-lock_dir.patch -Patch2029: gdb-testsuite-move-gpu-parallel.lock-to-cache-dir.patch -Patch2030: gdb-testsuite-use-unique-portnum-in-parallel-testing.patch -Patch2031: gdb-testsuite-use-unique-portnum-in-parallel-testing-check-slash-slash-case.patch -Patch2032: gdb-tdep-fix-reverse-execution-of-ldr-immediate-t4.patch -Patch2033: gdb-exp-fix-cast-handling-for-indirection.patch -Patch2034: gdb-remote-fix-abort-on-remote_close_error.patch -Patch2035: gdb-testsuite-use-find_gnatmake-instead-of-gdb_find_.patch -Patch2036: gdb-testsuite-simplify-gdb.server-server-kill-python.patch -Patch2037: gdb-testsuite-fix-gdbserver-pid-in-gdb.server-server.patch -Patch2038: gdb-testsuite-add-missing-include-in-gdb.base-ctf-pt.patch -Patch2039: gdb-testsuite-fix-gdb.ada-verylong.exp-on-32-bit-tar.patch -Patch2040: gdb-testsuite-add-missing-includes-in-gdb.trace-coll.patch -Patch2041: gdb-testsuite-fix-missing-return-type-in-gdb.linespe.patch -Patch2042: gdb-testsuite-fix-gdb.base-ending-run.exp-on-manjaro.patch -Patch2043: gdb-testsuite-fix-test-case-gdb.threads-attach-stopp.patch -Patch2044: gdb-testsuite-add-missing-include-in-gdb.base-rtld-s.patch -Patch2045: gdb-testsuite-fix-valgrind-tests-on-debian.patch -Patch2046: gdb-testsuite-fix-gdb.server-server-connect.exp-for-.patch -Patch2047: gdb-testsuite-handle-core-without-build-id-in-gdb.ba.patch -Patch2048: gdb-testsuite-fix-gdb.base-list-no-debug.exp-on-debi.patch -Patch2049: gdb-testsuite-reset-errcnt-and-warncnt-in-default_gd.patch -Patch2050: gdb-testsuite-fix-test-in-gdb.python-py-finish-break.patch -Patch2051: gdb-testsuite-further-handle-long-filenames-in-gdb.b.patch -Patch2052: gdb-testsuite-fix-license-text-in-gdb.reverse-map-to.patch -Patch2053: gdb-testsuite-call-ldd-version-in-gdb.testsuite-dump.patch -Patch2054: gdb-testsuite-fix-gdb.mi-mi-dprintf.exp-with-read1.patch -Patch2055: gdb-testsuite-fix-gdb.cp-namespace.exp-with-read1.patch -Patch2056: gdb-testsuite-fix-typo-in-gdb.base-catch-syscall.exp.patch -Patch2057: gdb-testsuite-use-more-progbits-for-arm.patch -Patch2058: gdb-testsuite-fix-gdb.dwarf2-dw2-gas-workaround.exp.patch -Patch2059: gdb-fix-segfault-in-for_each_block-part-1.patch -Patch2060: gdb-fix-segfault-in-for_each_block-part-2.patch -Patch2061: gdb-tui-allow-command-window-of-1-or-2-lines.patch -Patch2062: gdb-tui-fix-resizing-of-terminal-to-1-or-2-lines.patch -Patch2063: gdb-symtab-workaround-pr-gas-31115.patch -Patch2064: gdb-arm-remove-tpidruro-register-from-non-freebsd-ta.patch -Patch2065: gdb-tdep-fix-catching-syscall-execve-exit-for-arm.patch -Patch2066: gdb-arm-fix-epilogue-frame-id.patch -Patch2070: rs6000-unwind-on-each-instruction-fix.patch -Patch2071: gdb-python-make-gdb.unwindinfo.add_saved_register-mo.patch -Patch2072: gdb-arm-remove-thumb-bit-in-arm_adjust_breakpoint_ad.patch -Patch2073: gdb-build-fix-gdbserver-linux-aarch64-low.cc-build.patch -Patch2074: powerpc-fix-test-gdb.ada-finish-large.exp.patch -Patch2075: gdb-python-make-gdb.unwindinfo.add_saved_register-mo-fixup.patch -Patch2076: gdb-exp-redo-cast-handling-for-indirection.patch -Patch2077: s390-provide-ibm-z16-arch14-instruction-descriptions.patch -Patch2078: gdb-s390-add-arch14-record-replay-support.patch -Patch2079: riscv-lrsc.patch - -# Backports from master, not yet available in next release (GDB 16). - -Patch2090: gdb-python-fix-gdb.python-py-disasm.exp-on-arm-linux.patch Patch2091: gdb-testsuite-fix-gdb.fortran-array-bounds.exp-on-ar.patch Patch2092: gdb-symtab-return-correct-reader-for-top-level-cu-in.patch Patch2093: gdb-tdep-s390-add-arch15-record-replay-support.patch @@ -353,38 +252,30 @@ Patch2095: gdb-python-avoid-depending-on-the-curses-library.patch # Backports from master, available in GDB 17. Patch2096: gdb-testsuite-record-less-in-gdb.reverse-time-revers.patch +Patch2097: gdb-doc-fix-gdb.unwinder-docs.patch +Patch2098: gdb-doc-fix-qisaddresstagged-anchor.patch +Patch2099: gdb-testsuite-fix-another-regexp-in-gdb.threads-step.patch +Patch2100: gdb-testsuite-fix-timeouts-in-gdb.threads-step-over-.patch # # Backport from gdb-patches # https://sourceware.org/pipermail/gdb-patches/2021-September/182226.html -Patch2100: gdb-python-finishbreakpoint-update.patch +Patch3000: gdb-python-finishbreakpoint-update.patch # https://sourceware.org/pipermail/gdb-patches/2021-October/182444.html -Patch2101: gdb-testsuite-prevent-compilation-fails-with-unix-fpie-pie.patch +Patch3001: gdb-testsuite-prevent-compilation-fails-with-unix-fpie-pie.patch # https://sourceware.org/pipermail/gdb-patches/2021-May/178990.html -Patch2102: gdb-cli-add-ignore-errors-command.patch +Patch3002: gdb-cli-add-ignore-errors-command.patch # https://sourceware.org/pipermail/gdb-patches/2024-May/209469.html -Patch2103: gdb-testsuite-fix-error-in-gdb.server-server-kill-py.patch +Patch3003: gdb-testsuite-fix-error-in-gdb.server-server-kill-py.patch # https://sourceware.org/pipermail/gdb-patches/2024-May/209504.html -Patch2104: gdb-testsuite-fix-timeout-in-gdb.tui-resize-2.exp.patch -# https://sourceware.org/pipermail/gdb-patches/2024-June/209736.html -Patch2105: gdb-tdep-fix-gdb.base-watchpoint-running-on-arm-ppc6.patch +Patch3004: gdb-testsuite-fix-timeout-in-gdb.tui-resize-2.exp.patch +# https://sourceware.org/pipermail/gdb-patches/2025-January/214982.html +Patch3005: gdb-doc-fix-standard-replies-xref.patch # https://sourceware.org/pipermail/gdb-patches/2023-December/205054.html -Patch2120: gdb-symtab-refactor-condition-in-scan_attributes.patch -Patch2121: gdb-symtab-factor-out-m_die_range_map-usage.patch -Patch2122: gdb-symtab-handle-nullptr-parent-in-parent_map-set_p.patch -Patch2123: gdb-symtab-factor-out-m_deferred_entries-usage.patch -Patch2124: gdb-symtab-resolve-deferred-entries-inter-shard-case.patch -Patch2125: gdb-testsuite-add-gdb.dwarf2-forward-spec-inter-cu.e.patch -Patch2126: gdb-testsuite-add-gdb.dwarf2-backward-spec-inter-cu..patch -Patch2127: gdb-symtab-keep-track-of-processed-dies-in-shard.patch -Patch2128: gdb-symtab-resolve-deferred-entries-intra-shard-case.patch -Patch2129: gdb-symtab-don-t-defer-backward-refs-inter-cu-intra-.patch -Patch2130: gdb-symtab-recurse-into-c-dw_tag_subprogram-dies-for.patch -Patch2131: gdb-symtab-keep-track-of-all-parents-for-cooked-inde.patch -Patch2132: gdb-symtab-fix-dw_tag_inlined_subroutine-entries-in-.patch +Patch3006: gdb-symtab-recurse-into-c-dw_tag_subprogram-dies-for.patch # Debug patches. @@ -403,11 +294,12 @@ BuildRequires: aaa_base-yama-enable-ptrace BuildRequires: bison BuildRequires: flex -%if 0%{suse_version} > 1110 +%if 0%{suse_version} > 1315 BuildRequires: gcc-c++ %else -BuildRequires: gcc48 -BuildRequires: gcc48-c++ +# SLE-12. +BuildRequires: gcc9 +BuildRequires: gcc9-c++ %endif BuildRequires: gettext BuildRequires: glibc-devel @@ -724,28 +616,7 @@ find -name "*.info*"|xargs rm -f %patch -P 24 -p1 %patch -P 25 -p1 %patch -P 26 -p1 -%patch -P 28 -p1 %patch -P 29 -p1 -%patch -P 30 -p1 -%patch -P 31 -p1 -%patch -P 32 -p1 -%patch -P 33 -p1 -%patch -P 34 -p1 -%patch -P 35 -p1 -%patch -P 36 -p1 -%patch -P 37 -p1 -%patch -P 38 -p1 -%patch -P 39 -p1 -%patch -P 40 -p1 -%patch -P 41 -p1 -%patch -P 42 -p1 -%patch -P 43 -p1 -%patch -P 44 -p1 -%patch -P 45 -p1 -%patch -P 46 -p1 -%patch -P 47 -p1 -%patch -P 48 -p1 -%patch -P 49 -p1 #Fedora patching end %patch -P 1004 -p1 @@ -766,112 +637,27 @@ find -name "*.info*"|xargs rm -f %patch -P 1504 -p1 %patch -P 1505 -p1 %patch -P 1506 -p1 +%patch -P 1507 -p1 +%patch -P 1508 -p1 -%patch -P 2000 -p1 -%patch -P 2001 -p1 -%patch -P 2002 -p1 -%patch -P 2003 -p1 -%patch -P 2004 -p1 -%patch -P 2005 -p1 -%patch -P 2006 -p1 -%patch -P 2007 -p1 -%patch -P 2008 -p1 -%patch -P 2010 -p1 -%patch -P 2011 -p1 -%patch -P 2012 -p1 -%patch -P 2013 -p1 -%patch -P 2014 -p1 -%patch -P 2015 -p1 -%patch -P 2016 -p1 -%patch -P 2017 -p1 -%patch -P 2018 -p1 -%patch -P 2019 -p1 -%patch -P 2020 -p1 -%patch -P 2021 -p1 -%patch -P 2022 -p1 -%patch -P 2023 -p1 -%patch -P 2024 -p1 -%patch -P 2025 -p1 -%patch -P 2026 -p1 -%patch -P 2027 -p1 -%patch -P 2028 -p1 -%patch -P 2029 -p1 -%patch -P 2030 -p1 -%patch -P 2031 -p1 -%patch -P 2032 -p1 -%patch -P 2033 -p1 -%patch -P 2034 -p1 -%patch -P 2035 -p1 -%patch -P 2036 -p1 -%patch -P 2037 -p1 -%patch -P 2038 -p1 -%patch -P 2039 -p1 -%patch -P 2040 -p1 -%patch -P 2041 -p1 -%patch -P 2042 -p1 -%patch -P 2043 -p1 -%patch -P 2044 -p1 -%patch -P 2045 -p1 -%patch -P 2046 -p1 -%patch -P 2047 -p1 -%patch -P 2048 -p1 -%patch -P 2049 -p1 -%patch -P 2050 -p1 -%patch -P 2051 -p1 -%patch -P 2052 -p1 -%patch -P 2053 -p1 -%patch -P 2054 -p1 -%patch -P 2055 -p1 -%patch -P 2056 -p1 -%patch -P 2057 -p1 -%patch -P 2058 -p1 -%patch -P 2059 -p1 -%patch -P 2060 -p1 -%patch -P 2061 -p1 -%patch -P 2062 -p1 -%patch -P 2063 -p1 -%patch -P 2064 -p1 -%patch -P 2065 -p1 -%patch -P 2066 -p1 -%patch -P 2070 -p1 -%patch -P 2071 -p1 -%patch -P 2072 -p1 -%patch -P 2073 -p1 -%patch -P 2074 -p1 -%patch -P 2075 -p1 -%patch -P 2076 -p1 -%patch -P 2077 -p1 -%patch -P 2078 -p1 -%patch -P 2079 -p1 - -%patch -P 2090 -p1 %patch -P 2091 -p1 %patch -P 2092 -p1 %patch -P 2093 -p1 %patch -P 2094 -p1 %patch -P 2095 -p1 %patch -P 2096 -p1 - +%patch -P 2097 -p1 +%patch -P 2098 -p1 +%patch -P 2099 -p1 %patch -P 2100 -p1 -%patch -P 2101 -p1 -%patch -P 2102 -p1 -%patch -P 2103 -p1 -%patch -P 2104 -p1 -%patch -P 2105 -p1 -%patch -P 2120 -p1 -%patch -P 2121 -p1 -%patch -P 2122 -p1 -%patch -P 2123 -p1 -%patch -P 2124 -p1 -%patch -P 2125 -p1 -%patch -P 2126 -p1 -%patch -P 2127 -p1 -%patch -P 2128 -p1 -%patch -P 2129 -p1 -%patch -P 2130 -p1 -%patch -P 2131 -p1 -%patch -P 2132 -p1 +%patch -P 3000 -p1 +%patch -P 3001 -p1 +%patch -P 3002 -p1 +%patch -P 3003 -p1 +%patch -P 3004 -p1 +%patch -P 3005 -p1 +%patch -P 3006 -p1 #unpack libipt %if 0%{have_libipt} @@ -909,12 +695,13 @@ do mkdir %{gdb_build}$fprofile cd %{gdb_build}$fprofile -%if 0%{suse_version} > 1110 +%if 0%{suse_version} > 1315 CC=gcc CXX=g++ %else -CC=gcc-4.8 -CXX=g++-4.8 +# SLE-12. +CC=gcc-9 +CXX=g++-9 %endif export CC export CXX diff --git a/make-pascal_language-print_type-handle-varstring-nul.patch b/make-pascal_language-print_type-handle-varstring-nul.patch deleted file mode 100644 index c838c98..0000000 --- a/make-pascal_language-print_type-handle-varstring-nul.patch +++ /dev/null @@ -1,43 +0,0 @@ -From f27cc602d85c46b46f5b02d6f584a1d872e098e3 Mon Sep 17 00:00:00 2001 -From: Tom Tromey -Date: Wed, 27 Mar 2024 10:34:46 -0600 -Subject: [PATCH] Make pascal_language::print_type handle varstring==nullptr - -PR gdb/31524 points out a crash when pascal_language::print_type is -called with varstring==nullptr. This crash is a regression arising -from the printf/pager rewrite -- that indirectly removed a NULL check -from gdb's "puts". - -This patch instead fixes the problem by adding a check to print_type. -Passing nullptr here seems to be expected in other places (e.g., there -is a call to type_print like this in expprint.c), and other -implementations of this method (or related helpers) explicitly check -for NULL. - -I didn't write a test case for this because it seemed like overkill -for a Pascal bug that only occurs with -i=mi. However, if you want -one, let me know and I will do it. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31524 -Approved-By: John Baldwin ---- - gdb/p-typeprint.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c -index e8542d6845a..68a94a65f64 100644 ---- a/gdb/p-typeprint.c -+++ b/gdb/p-typeprint.c -@@ -55,7 +55,8 @@ pascal_language::print_type (struct type *type, const char *varstring, - type_print_varspec_prefix (type, stream, show, 0, flags); - } - /* first the name */ -- gdb_puts (varstring, stream); -+ if (varstring != nullptr) -+ gdb_puts (varstring, stream); - - if ((varstring != NULL && *varstring != '\0') - && !(code == TYPE_CODE_FUNC --- -2.35.3 - diff --git a/powerpc-and-aarch64-fix-reverse-stepping-failure.patch b/powerpc-and-aarch64-fix-reverse-stepping-failure.patch deleted file mode 100644 index b1d37b7..0000000 --- a/powerpc-and-aarch64-fix-reverse-stepping-failure.patch +++ /dev/null @@ -1,478 +0,0 @@ -From b826313e55938c8cf83b0889e2f6bdf8129bc004 Mon Sep 17 00:00:00 2001 -From: Carl Love -Date: Tue, 2 Jan 2024 17:46:02 -0500 -Subject: [PATCH 07/48] PowerPC and aarch64: Fix reverse stepping failure - -When running GDB's testsuite on aarch64-linux/Ubuntu 20.04 (also spotted on -the ppc backend), there are failures in gdb.reverse/solib-precsave.exp and -gdb.reverse/solib-reverse.exp. - -The failure happens around the following code: - -38 b[1] = shr2(17); /* middle part two */ -40 b[0] = 6; b[1] = 9; /* generic statement, end part two */ -42 shr1 ("message 1\n"); /* shr1 one */ - -Normal execution: - -- step from line 38 will land on line 40. -- step from line 40 will land on line 42. - -Reverse execution: -- step from line 42 will land on line 40. -- step from line 40 will land on line 40. -- step from line 40 will land on line 38. - -The problem here is that line 40 contains two contiguous but distinct -PC ranges in the line table, like so: - -Line 40 - [0x7ec ~ 0x7f4] -Line 40 - [0x7f4 ~ 0x7fc] - -The two distinct ranges are generated because GCC started outputting source -column information, which GDB doesn't take into account at the moment. - -When stepping forward from line 40, we skip both of these ranges and land on -line 42. When stepping backward from line 42, we stop at the start PC of the -second (or first, going backwards) range of line 40. - -Since we've reached ecs->event_thread->control.step_range_start, we stop -stepping backwards. - -The above issues were fixed by introducing a new function that looks for -adjacent PC ranges for the same line, until we notice a line change. Then -we take that as the start PC of the range. The new start PC for the range -is used for the control.step_range_start when setting up a step range. - -The test case gdb.reverse/map-to-same-line.exp is added to test the fix -for the above reverse step issues. - -Patch has been tested on PowerPC, X86 and AArch64 with no regressions. ---- - gdb/infrun.c | 57 +++++++ - gdb/symtab.c | 50 ++++++ - gdb/symtab.h | 17 ++ - gdb/testsuite/gdb.reverse/map-to-same-line.c | 58 +++++++ - .../gdb.reverse/map-to-same-line.exp | 153 ++++++++++++++++++ - 5 files changed, 335 insertions(+) - create mode 100644 gdb/testsuite/gdb.reverse/map-to-same-line.c - create mode 100644 gdb/testsuite/gdb.reverse/map-to-same-line.exp - -diff --git a/gdb/infrun.c b/gdb/infrun.c -index 4730d290442..069ef144a76 100644 ---- a/gdb/infrun.c -+++ b/gdb/infrun.c -@@ -114,6 +114,8 @@ static struct async_event_handler *infrun_async_inferior_event_token; - /* Stores whether infrun_async was previously enabled or disabled. - Starts off as -1, indicating "never enabled/disabled". */ - static int infrun_is_async = -1; -+static CORE_ADDR update_line_range_start (CORE_ADDR pc, -+ struct execution_control_state *ecs); - - /* See infrun.h. */ - -@@ -6886,6 +6888,27 @@ handle_signal_stop (struct execution_control_state *ecs) - process_event_stop_test (ecs); - } - -+/* Return the address for the beginning of the line. */ -+ -+CORE_ADDR -+update_line_range_start (CORE_ADDR pc, struct execution_control_state *ecs) -+{ -+ /* The line table may have multiple entries for the same source code line. -+ Given the PC, check the line table and return the PC that corresponds -+ to the line table entry for the source line that PC is in. */ -+ CORE_ADDR start_line_pc = ecs->event_thread->control.step_range_start; -+ std::optional real_range_start; -+ -+ /* Call find_line_range_start to get the smallest address in the -+ linetable for multiple Line X entries in the line table. */ -+ real_range_start = find_line_range_start (pc); -+ -+ if (real_range_start.has_value ()) -+ start_line_pc = *real_range_start; -+ -+ return start_line_pc; -+} -+ - /* Come here when we've got some debug event / signal we can explain - (IOW, not a random signal), and test whether it should cause a - stop, or whether we should resume the inferior (transparently). -@@ -7687,6 +7710,29 @@ process_event_stop_test (struct execution_control_state *ecs) - - if (stop_pc_sal.is_stmt) - { -+ if (execution_direction == EXEC_REVERSE) -+ { -+ /* We are stepping backwards make sure we have reached the -+ beginning of the line. */ -+ CORE_ADDR stop_pc = ecs->event_thread->stop_pc (); -+ CORE_ADDR start_line_pc -+ = update_line_range_start (stop_pc, ecs); -+ -+ if (stop_pc != start_line_pc) -+ { -+ /* Have not reached the beginning of the source code line. -+ Set a step range. Execution should stop in any function -+ calls we execute back into before reaching the beginning -+ of the line. */ -+ ecs->event_thread->control.step_range_start -+ = start_line_pc; -+ ecs->event_thread->control.step_range_end = stop_pc; -+ set_step_info (ecs->event_thread, frame, stop_pc_sal); -+ keep_going (ecs); -+ return; -+ } -+ } -+ - /* We are at the start of a statement. - - So stop. Note that we don't stop if we step into the middle of a -@@ -7749,6 +7795,17 @@ process_event_stop_test (struct execution_control_state *ecs) - set_step_info (ecs->event_thread, frame, stop_pc_sal); - - infrun_debug_printf ("keep going"); -+ -+ if (execution_direction == EXEC_REVERSE) -+ { -+ CORE_ADDR stop_pc = ecs->event_thread->stop_pc (); -+ -+ /* Make sure the stop_pc is set to the beginning of the line. */ -+ if (stop_pc != ecs->event_thread->control.step_range_start) -+ ecs->event_thread->control.step_range_start -+ = update_line_range_start (stop_pc, ecs); -+ } -+ - keep_going (ecs); - } - -diff --git a/gdb/symtab.c b/gdb/symtab.c -index e9bc7b2c933..ef63ec93c5a 100644 ---- a/gdb/symtab.c -+++ b/gdb/symtab.c -@@ -73,6 +73,7 @@ - #include "gdbsupport/gdb_string_view.h" - #include "gdbsupport/pathstuff.h" - #include "gdbsupport/common-utils.h" -+#include - - /* Forward declarations for local functions. */ - -@@ -3311,6 +3312,55 @@ find_pc_line (CORE_ADDR pc, int notcurrent) - return sal; - } - -+/* Compare two symtab_and_line entries. Return true if both have -+ the same line number and the same symtab pointer. That means we -+ are dealing with two entries from the same line and from the same -+ source file. -+ -+ Return false otherwise. */ -+ -+static bool -+sal_line_symtab_matches_p (const symtab_and_line &sal1, -+ const symtab_and_line &sal2) -+{ -+ return sal1.line == sal2.line && sal1.symtab == sal2.symtab; -+} -+ -+/* See symtah.h. */ -+ -+std::optional -+find_line_range_start (CORE_ADDR pc) -+{ -+ struct symtab_and_line current_sal = find_pc_line (pc, 0); -+ -+ if (current_sal.line == 0) -+ return {}; -+ -+ struct symtab_and_line prev_sal = find_pc_line (current_sal.pc - 1, 0); -+ -+ /* If the previous entry is for a different line, that means we are already -+ at the entry with the start PC for this line. */ -+ if (!sal_line_symtab_matches_p (prev_sal, current_sal)) -+ return current_sal.pc; -+ -+ /* Otherwise, keep looking for entries for the same line but with -+ smaller PC's. */ -+ bool done = false; -+ CORE_ADDR prev_pc; -+ while (!done) -+ { -+ prev_pc = prev_sal.pc; -+ -+ prev_sal = find_pc_line (prev_pc - 1, 0); -+ -+ /* Did we notice a line change? If so, we are done searching. */ -+ if (!sal_line_symtab_matches_p (prev_sal, current_sal)) -+ done = true; -+ } -+ -+ return prev_pc; -+} -+ - /* See symtab.h. */ - - struct symtab * -diff --git a/gdb/symtab.h b/gdb/symtab.h -index 365743384e1..e17d15c595b 100644 ---- a/gdb/symtab.h -+++ b/gdb/symtab.h -@@ -38,6 +38,7 @@ - #include "gdb-demangle.h" - #include "split-name.h" - #include "frame.h" -+#include - - /* Opaque declarations. */ - struct ui_file; -@@ -2362,6 +2363,22 @@ extern struct symtab_and_line find_pc_line (CORE_ADDR, int); - extern struct symtab_and_line find_pc_sect_line (CORE_ADDR, - struct obj_section *, int); - -+/* Given PC, and assuming it is part of a range of addresses that is part of -+ a line, go back through the linetable and find the starting PC of that -+ line. -+ -+ For example, suppose we have 3 PC ranges for line X: -+ -+ Line X - [0x0 - 0x8] -+ Line X - [0x8 - 0x10] -+ Line X - [0x10 - 0x18] -+ -+ If we call the function with PC == 0x14, we want to return 0x0, as that is -+ the starting PC of line X, and the ranges are contiguous. -+*/ -+ -+extern std::optional find_line_range_start (CORE_ADDR pc); -+ - /* Wrapper around find_pc_line to just return the symtab. */ - - extern struct symtab *find_pc_line_symtab (CORE_ADDR); -diff --git a/gdb/testsuite/gdb.reverse/map-to-same-line.c b/gdb/testsuite/gdb.reverse/map-to-same-line.c -new file mode 100644 -index 00000000000..3086e849231 ---- /dev/null -+++ b/gdb/testsuite/gdb.reverse/map-to-same-line.c -@@ -0,0 +1,58 @@ -+/* Copyright 2023 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+/* The purpose of this test is to create a DWARF line table that contains two -+ or more entries for the same line. When stepping (forwards or backwards), -+ GDB should step over the entire line and not just a particular entry in -+ the line table. */ -+ -+int -+main (void) -+{ /* TAG: main prologue */ -+ asm ("main_label: .globl main_label"); -+ int i = 1, j = 2, k; -+ float f1 = 2.0, f2 = 4.1, f3; -+ const char *str_1 = "foo", *str_2 = "bar", *str_3; -+ -+ asm ("line1: .globl line1"); -+ k = i; f3 = f1; str_3 = str_1; /* TAG: line 1 */ -+ -+ asm ("line2: .globl line2"); -+ k = j; f3 = f2; str_3 = str_2; /* TAG: line 2 */ -+ -+ asm ("line3: .globl line3"); -+ k = i; f3 = f1; str_3 = str_1; /* TAG: line 3 */ -+ -+ asm ("line4: .globl line4"); -+ k = j; f3 = f2; str_3 = str_2; /* TAG: line 4 */ -+ -+ asm ("line5: .globl line5"); -+ k = i; f3 = f1; str_3 = str_1; /* TAG: line 5 */ -+ -+ asm ("line6: .globl line6"); -+ k = j; f3 = f2; str_3 = str_2; /* TAG: line 6 */ -+ -+ asm ("line7: .globl line7"); -+ k = i; f3 = f1; str_3 = str_1; /* TAG: line 7 */ -+ -+ asm ("line8: .globl line8"); -+ k = j; f3 = f2; str_3 = str_2; /* TAG: line 8 */ -+ -+ asm ("main_return: .globl main_return"); -+ k = j; f3 = f2; str_3 = str_2; /* TAG: main return */ -+ -+ asm ("end_of_sequence: .globl end_of_sequence"); -+ return 0; /* TAG: main return */ -+} -diff --git a/gdb/testsuite/gdb.reverse/map-to-same-line.exp b/gdb/testsuite/gdb.reverse/map-to-same-line.exp -new file mode 100644 -index 00000000000..63f8c9c76b3 ---- /dev/null -+++ b/gdb/testsuite/gdb.reverse/map-to-same-line.exp -@@ -0,0 +1,153 @@ -+# Copyright 2023 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# When stepping (forwards or backwards), GDB should step over the entire line -+# and not just a particular entry in the line table. This test was added to -+# verify the find_line_range_start function properly sets the step range for a -+# line that consists of multiple statements, i.e. multiple entries in the line -+# table. This test creates a DWARF line table that contains two entries for -+# the same line to do the needed testing. -+ -+# This test can only be run on targets which support DWARF-2 and use gas. -+load_lib dwarf.exp -+require dwarf2_support -+ -+# The DWARF assembler requires the gcc compiler. -+require is_c_compiler_gcc -+ -+# This test suitable only for process that can do reverse execution -+require supports_reverse -+ -+standard_testfile .c .S -+ -+if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { -+ return -1 -+} -+ -+set asm_file [standard_output_file $srcfile2] -+Dwarf::assemble $asm_file { -+ global srcdir subdir srcfile -+ declare_labels integer_label L -+ -+ # Find start address and length of program -+ lassign [function_range main [list ${srcdir}/${subdir}/$srcfile]] \ -+ main_start main_len -+ set main_end "$main_start + $main_len" -+ -+ cu {} { -+ compile_unit { -+ {language @DW_LANG_C} -+ {name map-to-same-line.c} -+ {stmt_list $L DW_FORM_sec_offset} -+ {low_pc 0 addr} -+ } { -+ subprogram { -+ {external 1 flag} -+ {name main} -+ {low_pc $main_start addr} -+ {high_pc $main_len DW_FORM_data4} -+ } -+ } -+ } -+ -+ lines {version 2 default_is_stmt 1} L { -+ include_dir "${srcdir}/${subdir}" -+ file_name "$srcfile" 1 -+ -+ # Generate the line table program with distinct source lines being -+ # mapped to the same line entry. Line 1, 5 and 8 contain 1 statement -+ # each. Line 2 contains 2 statements. Line 3 contains 3 statements. -+ program { -+ DW_LNE_set_address $main_start -+ line [gdb_get_line_number "TAG: main prologue"] -+ DW_LNS_copy -+ DW_LNE_set_address line1 -+ line [gdb_get_line_number "TAG: line 1" ] -+ DW_LNS_copy -+ DW_LNE_set_address line2 -+ line [gdb_get_line_number "TAG: line 2" ] -+ DW_LNS_copy -+ DW_LNE_set_address line3 -+ line [gdb_get_line_number "TAG: line 2" ] -+ DW_LNS_copy -+ DW_LNE_set_address line4 -+ line [gdb_get_line_number "TAG: line 3" ] -+ DW_LNS_copy -+ DW_LNE_set_address line5 -+ line [gdb_get_line_number "TAG: line 3" ] -+ DW_LNS_copy -+ DW_LNE_set_address line6 -+ line [gdb_get_line_number "TAG: line 3" ] -+ DW_LNS_copy -+ DW_LNE_set_address line7 -+ line [gdb_get_line_number "TAG: line 5" ] -+ DW_LNS_copy -+ DW_LNE_set_address line8 -+ line [gdb_get_line_number "TAG: line 8" ] -+ DW_LNS_copy -+ DW_LNE_set_address main_return -+ line [gdb_get_line_number "TAG: main return"] -+ DW_LNS_copy -+ DW_LNE_set_address end_of_sequence -+ DW_LNE_end_sequence -+ } -+ } -+} -+ -+if { [prepare_for_testing "failed to prepare" ${testfile} \ -+ [list $srcfile $asm_file] {nodebug} ] } { -+ return -1 -+} -+ -+if { ![runto_main] } { -+ return -+} -+ -+# Print the line table -+gdb_test_multiple "maint info line-table ${testfile}" "" { -+ -re "\r\n$decimal\[ \t\]+$decimal\[ \t\]+($hex)\[ \t\]+Y\[^\r\n\]*" { -+ lappend is_stmt $expect_out(1,string) -+ exp_continue -+ } -+ -re -wrap "" { -+ } -+} -+ -+# Do the reverse-step and reverse-next tests -+foreach_with_prefix cmd {step next} { -+ gdb_test_no_output "record" "turn on process record, test $cmd" -+ -+ set bp_main_return [gdb_get_line_number "TAG: main return" $srcfile] -+ gdb_breakpoint $srcfile:$bp_main_return -+ gdb_continue_to_breakpoint "run to end of main, reverse-$cmd test" ".*$srcfile:$bp_main_return.*" -+ gdb_test "display \$pc" ".*pc =.*" "display pc, reverse-$cmd test" -+ -+ # At this point, GDB has already recorded the execution up until the return -+ # statement. Reverse and test if GDB transitions between lines in the -+ # expected order. It should reverse-step or reverse-next across lines 8, -+ # 5, 3, 2 and 1. -+ foreach line {8 5 3 2 1} { -+ gdb_test "reverse-$cmd" ".*TAG: line $line.*" "reverse $cmd to line $line" -+ } -+ -+ if {$cmd =="step"} { -+ ## Clean restart, test reverse-next command -+ clean_restart ${testfile} -+ -+ if { ![runto_main] } { -+ return -+ } -+ } -+} --- -2.35.3 - diff --git a/powerpc-fix-test-gdb.ada-finish-large.exp.patch b/powerpc-fix-test-gdb.ada-finish-large.exp.patch deleted file mode 100644 index ef9899b..0000000 --- a/powerpc-fix-test-gdb.ada-finish-large.exp.patch +++ /dev/null @@ -1,49 +0,0 @@ -From d95be7a5210b69ad879c86d23efaa2cd7dcda94a Mon Sep 17 00:00:00 2001 -From: Carl Love -Date: Mon, 20 Nov 2023 11:13:22 -0500 -Subject: [PATCH] PowerPC: Fix test gdb.ada/finish-large.exp - -Function Create_large returns a large data structure. On PowerPC, register -r3 contains the address of where the data structure to be returned is to -be stored. However, on exit the ABI does not guarantee that r3 has not -been changed. The GDB finish command prints the return value of the -function at the end of the function. GDB needs to use the -DW_TAG_call_site information to determine the value of r3 on entry to -the function to correctly print the return value at the end of the -function. The test must be compiled with -fvar-tracking for the -DW_TAG_call_site information to be included in the executable file. - -This patch adds the -fvar-tracking option to the compile line if the -option is supported. - -The patch fixes the one regression error for the test on PowerPC. - -The patch has been tested on Power 10 and X86-64 with no regressions. ---- - gdb/testsuite/gdb.ada/finish-large.exp | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/gdb/testsuite/gdb.ada/finish-large.exp b/gdb/testsuite/gdb.ada/finish-large.exp -index 5661d132a18..6c8b1b2648d 100644 ---- a/gdb/testsuite/gdb.ada/finish-large.exp -+++ b/gdb/testsuite/gdb.ada/finish-large.exp -@@ -19,7 +19,13 @@ require allow_ada_tests - - standard_ada_testfile p - --if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != ""} { -+set flags {debug} -+ -+if {[have_fvar_tracking]} { -+ lappend flags "additional_flags=-fvar-tracking" -+} -+ -+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $flags] != ""} { - return -1 - } - - -base-commit: 0397481ff25b76d43b123f3d51828982ceb92834 --- -2.35.3 - diff --git a/qa-local.sh b/qa-local.sh index a41d7ea..307d0ee 100644 --- a/qa-local.sh +++ b/qa-local.sh @@ -20,7 +20,7 @@ SLFO archs="x86_64 i586" -version=14.2 +version=15.1 usage () { diff --git a/qa.sh b/qa.sh index 1e95056..9bd33f7 100644 --- a/qa.sh +++ b/qa.sh @@ -139,13 +139,20 @@ report_sum () kfail=( + # https://sourceware.org/bugzilla/show_bug.cgi?id=32608 + "FAIL: gdb.threads/step-over-thread-exit-while-stop-all-threads.exp: displaced-stepping=auto: target-non-stop=on: iter .*: continue" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=31721 + "FAIL: gdb.base/list-dot-nodebug.exp: debug=none: print before start" + "FAIL: gdb.base/list-dot-nodebug.exp: debug=some: print before start" + # https://sourceware.org/bugzilla/show_bug.cgi?id=26971 "FAIL: gdb.arch/amd64-init-x87-values.exp: check_x87_regs_around_init: check post FLD1 value of .fop" "FAIL: gdb.arch/amd64-init-x87-values.exp: check_x87_regs_around_init: check post FLD1 value of .fioff" # https://sourceware.org/bugzilla/show_bug.cgi?id=24845 - "FAIL: gdb.base/step-over-syscall.exp: clone: displaced=off: single step over clone" - "FAIL: gdb.base/step-over-syscall.exp: clone: displaced=off: continue to marker \(clone\)" + "FAIL: gdb.base/step-over-syscall.exp: clone: displaced=(off|on): single step over clone" + "FAIL: gdb.base/step-over-syscall.exp: clone: displaced=(off|on): continue to marker \(clone\)" # https://sourceware.org/bugzilla/show_bug.cgi?id=19436#c1 "FAIL: gdb.cp/no-dmgl-verbose.exp: setting breakpoint at 'f\(std::string\)'" @@ -434,6 +441,10 @@ kfail_sle12=( "FAIL: gdb.threads/clone-thread_db.exp: continue to clone_fn \(the program exited\)" "FAIL: gdb.threads/clone-thread_db.exp: continue to end \(the program is no longer running\)" + # FAILs due to gcc 4.8.5 DW_TAG_lexical_block oddity. + "FAIL: gdb.python/py-type.exp: lang_cpp: test_fields: python print \(gdb.lookup_type \('main\(\)::IntType'\)\)" + "FAIL: gdb.python/py-type.exp: lang_cpp: test_fields: python print \(gdb.lookup_type \('main\(\)::IntType'\).target \(\)\)" + ) # kfail_sle12 kfail_sle11=( diff --git a/riscv-lrsc.patch b/riscv-lrsc.patch deleted file mode 100644 index 83ea87c..0000000 --- a/riscv-lrsc.patch +++ /dev/null @@ -1,380 +0,0 @@ -From b273287f4e7f111c1bb667267c6bde4fdd8418c7 Mon Sep 17 00:00:00 2001 -From: Yang Liu -Date: Sun, 14 Jan 2024 01:20:59 +0800 -Subject: [PATCH] gdb: RISC-V: Refine lr/sc sequence support - -Per RISC-V spec, the lr/sc sequence can consist of up to 16 instructions, and we -cannot insert breakpoints in the middle of this sequence. Before this, we only -detected a specific pattern (the most common one). This patch improves this part -and now supports more complex pattern detection. - -Signed-off-by: Yang Liu -Approved-By: Andrew Burgess -Reviewed-by: Palmer Dabbelt ---- - gdb/riscv-tdep.c | 290 ++++++++++++++++++++++++++++++++++++++++------- - 1 file changed, 251 insertions(+), 39 deletions(-) - -diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c -index 55d21cc4ac5..9a7cfa35afd 100644 ---- a/gdb/riscv-tdep.c -+++ b/gdb/riscv-tdep.c -@@ -1578,8 +1578,34 @@ class riscv_insn - BLTU, - BGEU, - /* These are needed for stepping over atomic sequences. */ -- LR, -- SC, -+ SLTI, -+ SLTIU, -+ XORI, -+ ORI, -+ ANDI, -+ SLLI, -+ SLLIW, -+ SRLI, -+ SRLIW, -+ SRAI, -+ SRAIW, -+ SUB, -+ SUBW, -+ SLL, -+ SLLW, -+ SLT, -+ SLTU, -+ XOR, -+ SRL, -+ SRLW, -+ SRA, -+ SRAW, -+ OR, -+ AND, -+ LR_W, -+ LR_D, -+ SC_W, -+ SC_D, - /* This instruction is used to do a syscall. */ - ECALL, - -@@ -1768,6 +1794,13 @@ class riscv_insn - m_imm.s = EXTRACT_CBTYPE_IMM (ival); - } - -+ void decode_ca_type_insn (enum opcode opcode, ULONGEST ival) -+ { -+ m_opcode = opcode; -+ m_rs1 = decode_register_index_short (ival, OP_SH_CRS1S); -+ m_rs2 = decode_register_index_short (ival, OP_SH_CRS2S); -+ } -+ - /* Fetch instruction from target memory at ADDR, return the content of - the instruction, and update LEN with the instruction length. */ - static ULONGEST fetch_instruction (struct gdbarch *gdbarch, -@@ -1882,14 +1915,62 @@ riscv_insn::decode (struct gdbarch *gdbarch, CORE_ADDR pc) - decode_b_type_insn (BLTU, ival); - else if (is_bgeu_insn (ival)) - decode_b_type_insn (BGEU, ival); -+ else if (is_slti_insn(ival)) -+ decode_i_type_insn (SLTI, ival); -+ else if (is_sltiu_insn(ival)) -+ decode_i_type_insn (SLTIU, ival); -+ else if (is_xori_insn(ival)) -+ decode_i_type_insn (XORI, ival); -+ else if (is_ori_insn(ival)) -+ decode_i_type_insn (ORI, ival); -+ else if (is_andi_insn(ival)) -+ decode_i_type_insn (ANDI, ival); -+ else if (is_slli_insn(ival)) -+ decode_i_type_insn (SLLI, ival); -+ else if (is_slliw_insn(ival)) -+ decode_i_type_insn (SLLIW, ival); -+ else if (is_srli_insn(ival)) -+ decode_i_type_insn (SRLI, ival); -+ else if (is_srliw_insn(ival)) -+ decode_i_type_insn (SRLIW, ival); -+ else if (is_srai_insn(ival)) -+ decode_i_type_insn (SRAI, ival); -+ else if (is_sraiw_insn(ival)) -+ decode_i_type_insn (SRAIW, ival); -+ else if (is_sub_insn(ival)) -+ decode_r_type_insn (SUB, ival); -+ else if (is_subw_insn(ival)) -+ decode_r_type_insn (SUBW, ival); -+ else if (is_sll_insn(ival)) -+ decode_r_type_insn (SLL, ival); -+ else if (is_sllw_insn(ival)) -+ decode_r_type_insn (SLLW, ival); -+ else if (is_slt_insn(ival)) -+ decode_r_type_insn (SLT, ival); -+ else if (is_sltu_insn(ival)) -+ decode_r_type_insn (SLTU, ival); -+ else if (is_xor_insn(ival)) -+ decode_r_type_insn (XOR, ival); -+ else if (is_srl_insn(ival)) -+ decode_r_type_insn (SRL, ival); -+ else if (is_srlw_insn(ival)) -+ decode_r_type_insn (SRLW, ival); -+ else if (is_sra_insn(ival)) -+ decode_r_type_insn (SRA, ival); -+ else if (is_sraw_insn(ival)) -+ decode_r_type_insn (SRAW, ival); -+ else if (is_or_insn(ival)) -+ decode_r_type_insn (OR, ival); -+ else if (is_and_insn(ival)) -+ decode_r_type_insn (AND, ival); - else if (is_lr_w_insn (ival)) -- decode_r_type_insn (LR, ival); -+ decode_r_type_insn (LR_W, ival); - else if (is_lr_d_insn (ival)) -- decode_r_type_insn (LR, ival); -+ decode_r_type_insn (LR_D, ival); - else if (is_sc_w_insn (ival)) -- decode_r_type_insn (SC, ival); -+ decode_r_type_insn (SC_W, ival); - else if (is_sc_d_insn (ival)) -- decode_r_type_insn (SC, ival); -+ decode_r_type_insn (SC_D, ival); - else if (is_ecall_insn (ival)) - decode_i_type_insn (ECALL, ival); - else if (is_ld_insn (ival)) -@@ -1944,6 +2025,24 @@ riscv_insn::decode (struct gdbarch *gdbarch, CORE_ADDR pc) - m_rd = decode_register_index (ival, OP_SH_CRS1S); - m_imm.s = EXTRACT_CITYPE_LUI_IMM (ival); - } -+ else if (is_c_srli_insn (ival)) -+ decode_cb_type_insn (SRLI, ival); -+ else if (is_c_srai_insn (ival)) -+ decode_cb_type_insn (SRAI, ival); -+ else if (is_c_andi_insn (ival)) -+ decode_cb_type_insn (ANDI, ival); -+ else if (is_c_sub_insn (ival)) -+ decode_ca_type_insn (SUB, ival); -+ else if (is_c_xor_insn (ival)) -+ decode_ca_type_insn (XOR, ival); -+ else if (is_c_or_insn (ival)) -+ decode_ca_type_insn (OR, ival); -+ else if (is_c_and_insn (ival)) -+ decode_ca_type_insn (AND, ival); -+ else if (is_c_subw_insn (ival)) -+ decode_ca_type_insn (SUBW, ival); -+ else if (is_c_addw_insn (ival)) -+ decode_ca_type_insn (ADDW, ival); - else if (is_c_li_insn (ival)) - decode_ci_type_insn (LI, ival); - /* C_SD and C_FSW have the same opcode. C_SD is RV64 and RV128 only, -@@ -4405,51 +4504,164 @@ riscv_next_pc (struct regcache *regcache, CORE_ADDR pc) - return next_pc; - } - -+/* Return true if INSN is not a control transfer instruction and is allowed to -+ appear in the middle of the lr/sc sequence. */ -+ -+static bool -+riscv_insn_is_non_cti_and_allowed_in_atomic_sequence -+ (const struct riscv_insn &insn) -+{ -+ switch (insn.opcode ()) -+ { -+ case riscv_insn::LUI: -+ case riscv_insn::AUIPC: -+ case riscv_insn::ADDI: -+ case riscv_insn::ADDIW: -+ case riscv_insn::SLTI: -+ case riscv_insn::SLTIU: -+ case riscv_insn::XORI: -+ case riscv_insn::ORI: -+ case riscv_insn::ANDI: -+ case riscv_insn::SLLI: -+ case riscv_insn::SLLIW: -+ case riscv_insn::SRLI: -+ case riscv_insn::SRLIW: -+ case riscv_insn::SRAI: -+ case riscv_insn::ADD: -+ case riscv_insn::ADDW: -+ case riscv_insn::SRAIW: -+ case riscv_insn::SUB: -+ case riscv_insn::SUBW: -+ case riscv_insn::SLL: -+ case riscv_insn::SLLW: -+ case riscv_insn::SLT: -+ case riscv_insn::SLTU: -+ case riscv_insn::XOR: -+ case riscv_insn::SRL: -+ case riscv_insn::SRLW: -+ case riscv_insn::SRA: -+ case riscv_insn::SRAW: -+ case riscv_insn::OR: -+ case riscv_insn::AND: -+ return true; -+ } -+ -+ return false; -+} -+ -+/* Return true if INSN is a direct branch instruction. */ -+ -+static bool -+riscv_insn_is_direct_branch (const struct riscv_insn &insn) -+{ -+ switch (insn.opcode ()) -+ { -+ case riscv_insn::BEQ: -+ case riscv_insn::BNE: -+ case riscv_insn::BLT: -+ case riscv_insn::BGE: -+ case riscv_insn::BLTU: -+ case riscv_insn::BGEU: -+ case riscv_insn::JAL: -+ return true; -+ } -+ -+ return false; -+} -+ - /* We can't put a breakpoint in the middle of a lr/sc atomic sequence, so look - for the end of the sequence and put the breakpoint there. */ - --static bool --riscv_next_pc_atomic_sequence (struct regcache *regcache, CORE_ADDR pc, -- CORE_ADDR *next_pc) -+static std::vector -+riscv_deal_with_atomic_sequence (struct regcache *regcache, CORE_ADDR pc) - { - struct gdbarch *gdbarch = regcache->arch (); - struct riscv_insn insn; -- CORE_ADDR cur_step_pc = pc; -- CORE_ADDR last_addr = 0; -+ CORE_ADDR cur_step_pc = pc, next_pc; -+ std::vector next_pcs; -+ bool found_valid_atomic_sequence = false; -+ enum riscv_insn::opcode lr_opcode; - - /* First instruction has to be a load reserved. */ - insn.decode (gdbarch, cur_step_pc); -- if (insn.opcode () != riscv_insn::LR) -- return false; -- cur_step_pc = cur_step_pc + insn.length (); -+ lr_opcode = insn.opcode (); -+ if (lr_opcode != riscv_insn::LR_D && lr_opcode != riscv_insn::LR_W) -+ return {}; -+ -+ /* The loop comprises only an LR/SC sequence and code to retry the sequence in -+ the case of failure, and must comprise at most 16 instructions placed -+ sequentially in memory. While our code tries to follow these restrictions, -+ it has the following limitations: -+ -+ (a) We expect the loop to start with an LR and end with a BNE. -+ Apparently this does not cover all cases for a valid sequence. -+ (b) The atomic limitations only apply to the code that is actually -+ executed, so here again it's overly restrictive. -+ (c) The lr/sc are required to be for the same target address, but this -+ information is only known at runtime. Same as (b), in order to check -+ this we will end up needing to simulate the sequence, which is more -+ complicated than what we're doing right now. -+ -+ Also note that we only expect a maximum of (16-2) instructions in the for -+ loop as we have assumed the presence of LR and BNE at the beginning and end -+ respectively. */ -+ for (int insn_count = 0; insn_count < 16 - 2; ++insn_count) -+ { -+ cur_step_pc += insn.length (); -+ insn.decode (gdbarch, cur_step_pc); - -- /* Next instruction should be branch to exit. */ -- insn.decode (gdbarch, cur_step_pc); -- if (insn.opcode () != riscv_insn::BNE) -- return false; -- last_addr = cur_step_pc + insn.imm_signed (); -- cur_step_pc = cur_step_pc + insn.length (); -+ /* The dynamic code executed between lr/sc can only contain instructions -+ from the base I instruction set, excluding loads, stores, backward -+ jumps, taken backward branches, JALR, FENCE, FENCE.I, and SYSTEM -+ instructions. If the C extension is supported, then compressed forms -+ of the aforementioned I instructions are also permitted. */ - -- /* Next instruction should be store conditional. */ -- insn.decode (gdbarch, cur_step_pc); -- if (insn.opcode () != riscv_insn::SC) -- return false; -- cur_step_pc = cur_step_pc + insn.length (); -+ if (riscv_insn_is_non_cti_and_allowed_in_atomic_sequence (insn)) -+ continue; -+ /* Look for a conditional branch instruction, check if it's taken forward -+ or not. */ -+ else if (riscv_insn_is_direct_branch (insn)) -+ { -+ if (insn.imm_signed () > 0) -+ { -+ next_pc = cur_step_pc + insn.imm_signed (); -+ next_pcs.push_back (next_pc); -+ } -+ else -+ break; -+ } -+ /* Look for a paired SC instruction which closes the atomic sequence. */ -+ else if ((insn.opcode () == riscv_insn::SC_D -+ && lr_opcode == riscv_insn::LR_D) -+ || (insn.opcode () == riscv_insn::SC_W -+ && lr_opcode == riscv_insn::LR_W)) -+ found_valid_atomic_sequence = true; -+ else -+ break; -+ } -+ -+ if (!found_valid_atomic_sequence) -+ return {}; - - /* Next instruction should be branch to start. */ - insn.decode (gdbarch, cur_step_pc); - if (insn.opcode () != riscv_insn::BNE) -- return false; -+ return {}; - if (pc != (cur_step_pc + insn.imm_signed ())) -- return false; -- cur_step_pc = cur_step_pc + insn.length (); -+ return {}; -+ cur_step_pc += insn.length (); - -- /* We should now be at the end of the sequence. */ -- if (cur_step_pc != last_addr) -- return false; -+ /* Remove all PCs that jump within the sequence. */ -+ auto matcher = [cur_step_pc] (const CORE_ADDR addr) -> bool -+ { -+ return addr < cur_step_pc; -+ }; -+ auto it = std::remove_if (next_pcs.begin (), next_pcs.end (), matcher); -+ next_pcs.erase (it, next_pcs.end ()); - -- *next_pc = cur_step_pc; -- return true; -+ next_pc = cur_step_pc; -+ next_pcs.push_back (next_pc); -+ return next_pcs; - } - - /* This is called just before we want to resume the inferior, if we want to -@@ -4459,14 +4671,14 @@ riscv_next_pc_atomic_sequence (struct regcache *regcache, CORE_ADDR pc, - std::vector - riscv_software_single_step (struct regcache *regcache) - { -- CORE_ADDR pc, next_pc; -- -- pc = regcache_read_pc (regcache); -+ CORE_ADDR cur_pc = regcache_read_pc (regcache), next_pc; -+ std::vector next_pcs -+ = riscv_deal_with_atomic_sequence (regcache, cur_pc); - -- if (riscv_next_pc_atomic_sequence (regcache, pc, &next_pc)) -- return {next_pc}; -+ if (!next_pcs.empty ()) -+ return next_pcs; - -- next_pc = riscv_next_pc (regcache, pc); -+ next_pc = riscv_next_pc (regcache, cur_pc); - - return {next_pc}; - } --- -2.48.0 - diff --git a/rs6000-unwind-on-each-instruction-fix.patch b/rs6000-unwind-on-each-instruction-fix.patch deleted file mode 100644 index 75d1ff3..0000000 --- a/rs6000-unwind-on-each-instruction-fix.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 6d21f33bb8f63d1d9aeda88ca815e442da0dc160 Mon Sep 17 00:00:00 2001 -From: Carl Love -Date: Tue, 23 Jan 2024 17:12:34 -0500 -Subject: [PATCH 1/2] rs6000, unwind-on-each-instruction fix. - -The function rs6000_epilogue_frame_cache assumes the LR and gprs have been -restored. In fact register r31 and the link register, lr, may not have -been restored yet. This patch adds support to store the lr and gpr -register unrolling rules in the cache. The LR and GPR values can now be -unrolled correctly. - -Patch fixes all 10 regresion test failures for the unwind-on-each-insn.exp. ---- - gdb/rs6000-tdep.c | 53 +++++++++++++++++++++++++++++++++++++++++------ - 1 file changed, 47 insertions(+), 6 deletions(-) - -diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c -index 23397d037ae..ecc8766d319 100644 ---- a/gdb/rs6000-tdep.c -+++ b/gdb/rs6000-tdep.c -@@ -3805,6 +3805,8 @@ rs6000_epilogue_frame_cache (frame_info_ptr this_frame, void **this_cache) - struct rs6000_frame_cache *cache; - struct gdbarch *gdbarch = get_frame_arch (this_frame); - ppc_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); -+ struct rs6000_framedata fdata; -+ int wordsize = tdep->wordsize; - - if (*this_cache) - return (struct rs6000_frame_cache *) *this_cache; -@@ -3815,17 +3817,56 @@ rs6000_epilogue_frame_cache (frame_info_ptr this_frame, void **this_cache) - - try - { -- /* At this point the stack looks as if we just entered the -- function, and the return address is stored in LR. */ -- CORE_ADDR sp, lr; -+ /* At this point the stack looks as if we just entered the function. -+ The SP (r1) has been restored but the LR and r31 may not have been -+ restored yet. Need to update the register unrolling information in -+ the cache for the LR and the saved gprs. */ -+ CORE_ADDR sp; -+ CORE_ADDR func = 0, pc = 0; - -- sp = get_frame_register_unsigned (this_frame, gdbarch_sp_regnum (gdbarch)); -- lr = get_frame_register_unsigned (this_frame, tdep->ppc_lr_regnum); -+ func = get_frame_func (this_frame); -+ cache->pc = func; -+ pc = get_frame_pc (this_frame); -+ skip_prologue (gdbarch, func, pc, &fdata); -+ -+ /* SP is in r1 and it has been restored. Get the current value. */ -+ sp = get_frame_register_unsigned (this_frame, -+ gdbarch_sp_regnum (gdbarch)); - - cache->base = sp; - cache->initial_sp = sp; - -- cache->saved_regs[gdbarch_pc_regnum (gdbarch)].set_value (lr); -+ /* Store the unwinding rules for the gpr registers that have not been -+ restored yet, specifically r31. -+ -+ if != -1, fdata.saved_gpr is the smallest number of saved_gpr. -+ All gpr's from saved_gpr to gpr31 are saved (except during the -+ prologue). */ -+ -+ if (fdata.saved_gpr >= 0) -+ { -+ int i; -+ CORE_ADDR gpr_addr = cache->base + fdata.gpr_offset; -+ -+ for(i = fdata.saved_gpr; i < ppc_num_gprs; i++) -+ { -+ if (fdata.gpr_mask & (1U << i)) -+ cache->saved_regs[tdep->ppc_gp0_regnum + i].set_addr (gpr_addr); -+ gpr_addr += wordsize; -+ } -+ } -+ -+ /* Store the lr unwinding rules. */ -+ if (fdata.lr_offset != 0) -+ cache->saved_regs[tdep->ppc_lr_regnum].set_addr (cache->base -+ + fdata.lr_offset); -+ -+ else if (fdata.lr_register != -1) -+ cache->saved_regs[tdep->ppc_lr_regnum].set_realreg (fdata.lr_register); -+ -+ /* The PC is found in the link register. */ -+ cache->saved_regs[gdbarch_pc_regnum (gdbarch)] -+ = cache->saved_regs[tdep->ppc_lr_regnum]; - } - catch (const gdb_exception_error &ex) - { - -base-commit: 800e56a120419b457ebda18c5478ebfea99f9b3a --- -2.35.3 - diff --git a/s390-provide-ibm-z16-arch14-instruction-descriptions.patch b/s390-provide-ibm-z16-arch14-instruction-descriptions.patch deleted file mode 100644 index e4307e7..0000000 --- a/s390-provide-ibm-z16-arch14-instruction-descriptions.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 789e5514da246a792a78ce5f61a6c286f874b03c Mon Sep 17 00:00:00 2001 -From: Jens Remus -Date: Wed, 20 Dec 2023 11:16:38 +0100 -Subject: [PATCH 1/2] s390: Provide IBM z16 (arch14) instruction descriptions - -Provide descriptions for instructions introduced with commit ba2b480f103 -("IBM Z: Implement instruction set extensions"). This complements commit -69341966def ("IBM zSystems: Add support for z16 as CPU name."). Use -instruction names from IBM z/Architecture Principles of Operation [1] as -instruction description. - -[1]: IBM z/Architecture Principles of Operation, SA22-7832-13, IBM z16, - https://publibfp.dhe.ibm.com/epubs/pdf/a227832d.pdf - -opcodes/ - * s390-opc.txt: Add descriptions for IBM z16 (arch14) - instructions. - -Signed-off-by: Jens Remus -Reviewed-by: Andreas Krebbel ---- - opcodes/s390-opc.txt | 66 +++++++++++++++++++++++++------------------- - 1 file changed, 38 insertions(+), 28 deletions(-) - -diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt -index b7efa813e47..b33ee34ea8f 100644 ---- a/opcodes/s390-opc.txt -+++ b/opcodes/s390-opc.txt -@@ -2018,31 +2018,41 @@ e60000000052 vcvbg VRR_RV0UU "vector convert to binary 64 bit" arch13 zarch optp - b93a kdsa RRE_RR "compute digital signature authentication" arch13 zarch - - --# arch14 instructions -- --e60000000074 vschp VRR_VVV0U0U " " arch14 zarch --e60000002074 vschsp VRR_VVV0U0 " " arch14 zarch --e60000003074 vschdp VRR_VVV0U0 " " arch14 zarch --e60000004074 vschxp VRR_VVV0U0 " " arch14 zarch --e6000000007c vscshp VRR_VVV " " arch14 zarch --e6000000007d vcsph VRR_VVV0U0 " " arch14 zarch --e60000000051 vclzdp VRR_VV0U2 " " arch14 zarch --e60000000070 vpkzr VRI_VVV0UU2 " " arch14 zarch --e60000000072 vsrpr VRI_VVV0UU2 " " arch14 zarch --e60000000054 vupkzh VRR_VV0U2 " " arch14 zarch --e6000000005c vupkzl VRR_VV0U2 " " arch14 zarch -- --b93b nnpa RRE_00 " " arch14 zarch --e60000000056 vclfnh VRR_VV0UU2 " " arch14 zarch --e6000000005e vclfnl VRR_VV0UU2 " " arch14 zarch --e60000000075 vcrnf VRR_VVV0UU " " arch14 zarch --e6000000005d vcfn VRR_VV0UU2 " " arch14 zarch --e60000000055 vcnf VRR_VV0UU2 " " arch14 zarch -- --b98B rdp RRF_RURR2 " " arch14 zarch optparm -- --eb0000000071 lpswey SIY_RD " " arch14 zarch --b200 lbear S_RD " " arch14 zarch --b201 stbear S_RD " " arch14 zarch -- --b28f qpaci S_RD " " arch14 zarch -+# arch14 (z16) instructions -+ -+# Vector-Packed-Decimal-Enhancement Facility 2 -+ -+e60000000074 vschp VRR_VVV0U0U "decimal scale and convert to hfp" arch14 zarch -+e60000002074 vschsp VRR_VVV0U0 "decimal scale and convert to short hfp" arch14 zarch -+e60000003074 vschdp VRR_VVV0U0 "decimal scale and convert to long hfp" arch14 zarch -+e60000004074 vschxp VRR_VVV0U0 "decimal scale and convert to extended hfp" arch14 zarch -+e6000000007c vscshp VRR_VVV "decimal scale and convert and split to hfp" arch14 zarch -+e6000000007d vcsph VRR_VVV0U0 "vector convert hfp to scaled decimal" arch14 zarch -+e60000000051 vclzdp VRR_VV0U2 "vector count leading zero digits" arch14 zarch -+e60000000070 vpkzr VRI_VVV0UU2 "vector pack zoned register" arch14 zarch -+e60000000072 vsrpr VRI_VVV0UU2 "vector shift and round decimal register" arch14 zarch -+e60000000054 vupkzh VRR_VV0U2 "vector unpack zoned high" arch14 zarch -+e6000000005c vupkzl VRR_VV0U2 "vector unpack zoned low" arch14 zarch -+ -+# Neural-Network-Processing-Assist Facility -+ -+b93b nnpa RRE_00 "neural network processing assist" arch14 zarch -+e60000000056 vclfnh VRR_VV0UU2 "vector fp convert and lengthen from nnp high" arch14 zarch -+e6000000005e vclfnl VRR_VV0UU2 "vector fp convert and lengthen from nnp low" arch14 zarch -+e60000000075 vcrnf VRR_VVV0UU "vector fp convert and round to nnp" arch14 zarch -+e6000000005d vcfn VRR_VV0UU2 "vector fp convert from nnp" arch14 zarch -+e60000000055 vcnf VRR_VV0UU2 "vector fp convert to nnp" arch14 zarch -+ -+# Reset-DAT-Protection Facility -+ -+b98B rdp RRF_RURR2 "reset dat protection" arch14 zarch optparm -+ -+# BEAR-Enhancement Facility -+ -+eb0000000071 lpswey SIY_RD "load PSW extended" arch14 zarch -+b200 lbear S_RD "load bear" arch14 zarch -+b201 stbear S_RD "store bear" arch14 zarch -+ -+# Processor-Activity-Instrumentation Facility -+ -+b28f qpaci S_RD "query processor activity counter information" arch14 zarch - -base-commit: 84b9218d98eb2ac242fe3afc81598206279f7b13 --- -2.35.3 - From eac537eb715fd5a6fc7401f251450bb864f5ec6e6f462571e60809a84498e499 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 30 Jan 2025 09:01:17 +0000 Subject: [PATCH 21/34] - Maintenance script qa.sh: * Extend SLE-12 -static unix/-fPIE/-fpie kfails. * Extend ppc64le watchpoint kfail. * Extend PR29405 kfail. - Patches added: * gdb-testsuite-fix-gdb.threads-leader-exit-attach.exp.patch * gdb-testsuite-use-c-flag-in-c-test-cases.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=426 --- ...x-gdb.threads-leader-exit-attach.exp.patch | 80 +++ ...testsuite-use-c-flag-in-c-test-cases.patch | 454 ++++++++++++++++++ gdb.changes | 10 + gdb.spec | 45 +- qa.sh | 13 +- 5 files changed, 580 insertions(+), 22 deletions(-) create mode 100644 gdb-testsuite-fix-gdb.threads-leader-exit-attach.exp.patch create mode 100644 gdb-testsuite-use-c-flag-in-c-test-cases.patch diff --git a/gdb-testsuite-fix-gdb.threads-leader-exit-attach.exp.patch b/gdb-testsuite-fix-gdb.threads-leader-exit-attach.exp.patch new file mode 100644 index 0000000..5f9d9e2 --- /dev/null +++ b/gdb-testsuite-fix-gdb.threads-leader-exit-attach.exp.patch @@ -0,0 +1,80 @@ +From e0c1db6156fa8ee35661a9964062eeb69a963576 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 29 Jul 2024 14:05:52 +0200 +Subject: [PATCH] [gdb/testsuite] Fix gdb.threads/leader-exit-attach.exp with + check-read1 + +With test-case gdb.threads/leader-exit-attach.exp and check-read1, I run into: +... +(gdb) attach 18591^M +Attaching to program: leader-exit-attach, process 18591^M +warning: process 18591 is a zombie - the process has already terminatedKFAIL: $exp: attach (PRMS: gdb/31555) +^M +ptrace: Operation not permitted.^M +(gdb) FAIL: $exp: get valueof "$_inferior_thread_count" +... + +The problem is that the gdb_test_multiple in the test-case doesn't consume the +prompt in all clauses: +... +gdb_test_multiple "attach $testpid" "attach" { + -re "Attaching to process $testpid failed.*" { + # GNU/Linux gdbserver. Linux ptrace does not let you attach + # to zombie threads. + setup_kfail "gdb/31555" *-*-linux* + fail $gdb_test_name + } + -re "warning: process $testpid is a zombie - the process has already terminated.*" { + # Native GNU/Linux. Linux ptrace does not let you attach to + # zombie threads. + setup_kfail "gdb/31555" *-*-linux* + fail $gdb_test_name + } + -re "Attaching to program: $escapedbinfile, process $testpid.*$gdb_prompt $" { + pass $gdb_test_name + set attached 1 + } +} +... + +Fix this by using -wrap in the first two clauses. + +While we're at it, also use -wrap in the third clause. + +Tested on x86_64-linux. +--- + gdb/testsuite/gdb.threads/leader-exit-attach.exp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/gdb/testsuite/gdb.threads/leader-exit-attach.exp b/gdb/testsuite/gdb.threads/leader-exit-attach.exp +index c1ed1baaa67..a1bc2d470d5 100644 +--- a/gdb/testsuite/gdb.threads/leader-exit-attach.exp ++++ b/gdb/testsuite/gdb.threads/leader-exit-attach.exp +@@ -41,19 +41,19 @@ set is_gdbserver [target_is_gdbserver] + set attached 0 + + gdb_test_multiple "attach $testpid" "attach" { +- -re "Attaching to process $testpid failed.*" { ++ -re -wrap "Attaching to process $testpid failed.*" { + # GNU/Linux gdbserver. Linux ptrace does not let you attach + # to zombie threads. + setup_kfail "gdb/31555" *-*-linux* + fail $gdb_test_name + } +- -re "warning: process $testpid is a zombie - the process has already terminated.*" { ++ -re -wrap "warning: process $testpid is a zombie - the process has already terminated.*" { + # Native GNU/Linux. Linux ptrace does not let you attach to + # zombie threads. + setup_kfail "gdb/31555" *-*-linux* + fail $gdb_test_name + } +- -re "Attaching to program: $escapedbinfile, process $testpid.*$gdb_prompt $" { ++ -re -wrap "Attaching to program: $escapedbinfile, process $testpid.*" { + pass $gdb_test_name + set attached 1 + } + +base-commit: 6d7adb1f1e6ecad5a6b94319e4d272a82be16277 +-- +2.43.0 + diff --git a/gdb-testsuite-use-c-flag-in-c-test-cases.patch b/gdb-testsuite-use-c-flag-in-c-test-cases.patch new file mode 100644 index 0000000..afdce17 --- /dev/null +++ b/gdb-testsuite-use-c-flag-in-c-test-cases.patch @@ -0,0 +1,454 @@ +From e20cbb7c969752fb039c7ecfba5d7c3211e3238b Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 24 Apr 2023 16:15:48 +0200 +Subject: [PATCH] [gdb/testsuite] Use c++ flag in c++ test-cases + +In some cases, test-cases use c++, but don't add "c++" to the compilation +flags. This can cause problems with some compilers. + +Fix this in some test-cases. + +PR testsuite/30380 +https://sourceware.org/bugzilla/show_bug.cgi?id=30380 +--- + gdb/testsuite/gdb.arch/amd64-entry-value.exp | 4 +++- + gdb/testsuite/gdb.arch/amd64-tailcall-cxx.exp | 4 +++- + .../gdb.base/condbreak-multi-context.exp | 6 +++++- + gdb/testsuite/gdb.base/main-psymtab.exp | 6 +++++- + gdb/testsuite/gdb.base/persistent-lang.exp | 6 +++++- + gdb/testsuite/gdb.base/skipcxx.exp | 6 +++++- + gdb/testsuite/gdb.base/start-cpp.exp | 6 +++++- + gdb/testsuite/gdb.cp/call-method-register.exp | 15 +++++++++++---- + gdb/testsuite/gdb.cp/empty-enum.exp | 1 + + .../gdb.cp/incomplete-type-overload.exp | 15 ++++++++++++--- + gdb/testsuite/gdb.cp/main-cp.exp | 6 +++++- + gdb/testsuite/gdb.cp/method-call-in-c.exp | 1 + + gdb/testsuite/gdb.cp/minsym-fallback.exp | 14 +++++++++++--- + gdb/testsuite/gdb.cp/vla-cxx.exp | 6 +++++- + gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp | 1 + + gdb/testsuite/gdb.dwarf2/method-ptr.exp | 2 +- + .../missing-type-name-for-templates.exp | 16 ++++++++++++++-- + gdb/testsuite/gdb.dwarf2/subrange.exp | 2 +- + gdb/testsuite/gdb.guile/types-module.exp | 6 +++++- + gdb/testsuite/gdb.linespec/cpcompletion.exp | 4 ++++ + gdb/testsuite/gdb.linespec/cpls-ops.exp | 6 +++++- + 21 files changed, 108 insertions(+), 25 deletions(-) + +diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value.exp b/gdb/testsuite/gdb.arch/amd64-entry-value.exp +index 4a28b7ed1fd..3d119d07219 100644 +--- a/gdb/testsuite/gdb.arch/amd64-entry-value.exp ++++ b/gdb/testsuite/gdb.arch/amd64-entry-value.exp +@@ -19,7 +19,9 @@ set opts {nopie} + if [info exists COMPILE] { + # make check RUNTESTFLAGS="gdb.arch/amd64-entry-value.exp COMPILE=1" + set srcfile ${testfile}.cc +- lappend opts debug optimize=-O2 ++ lappend opts debug ++ lappend opts optimize=-O2 ++ lappend opts c++ + } else { + require is_x86_64_m64_target + } +diff --git a/gdb/testsuite/gdb.arch/amd64-tailcall-cxx.exp b/gdb/testsuite/gdb.arch/amd64-tailcall-cxx.exp +index 8bd26c4611b..24d99450f06 100644 +--- a/gdb/testsuite/gdb.arch/amd64-tailcall-cxx.exp ++++ b/gdb/testsuite/gdb.arch/amd64-tailcall-cxx.exp +@@ -19,7 +19,9 @@ standard_testfile amd64-tailcall-cxx1.S amd64-tailcall-cxx2.S + if [info exists COMPILE] { + # make check RUNTESTFLAGS="gdb.arch/amd64-tailcall-cxx.exp COMPILE=1" + standard_testfile amd64-tailcall-cxx1.cc amd64-tailcall-cxx2.cc +- lappend opts debug optimize=-O2 ++ lappend opts debug ++ lappend opts optimize=-O2 ++ lappend opts c++ + } else { + require is_x86_64_m64_target + } +diff --git a/gdb/testsuite/gdb.base/condbreak-multi-context.exp b/gdb/testsuite/gdb.base/condbreak-multi-context.exp +index 3af37081e44..3a4fe37317b 100644 +--- a/gdb/testsuite/gdb.base/condbreak-multi-context.exp ++++ b/gdb/testsuite/gdb.base/condbreak-multi-context.exp +@@ -18,7 +18,11 @@ + + standard_testfile .cc + +-if {[prepare_for_testing "failed to prepare" ${binfile} ${srcfile}]} { ++set flags {} ++lappend flags debug ++lappend flags c++ ++ ++if {[prepare_for_testing "failed to prepare" ${binfile} ${srcfile} $flags]} { + return + } + +diff --git a/gdb/testsuite/gdb.base/main-psymtab.exp b/gdb/testsuite/gdb.base/main-psymtab.exp +index 2cd0d6145bf..cc0ca65ef89 100644 +--- a/gdb/testsuite/gdb.base/main-psymtab.exp ++++ b/gdb/testsuite/gdb.base/main-psymtab.exp +@@ -15,7 +15,11 @@ + + standard_testfile persistent-lang.cc + +-if {[build_executable "failed to prepare" $testfile $srcfile debug]} { ++set flags {} ++lappend flags debug ++lappend flags c++ ++ ++if {[build_executable "failed to prepare" $testfile $srcfile $flags]} { + return -1 + } + +diff --git a/gdb/testsuite/gdb.base/persistent-lang.exp b/gdb/testsuite/gdb.base/persistent-lang.exp +index f8139159a4f..d3bedae1007 100644 +--- a/gdb/testsuite/gdb.base/persistent-lang.exp ++++ b/gdb/testsuite/gdb.base/persistent-lang.exp +@@ -15,7 +15,11 @@ + + standard_testfile .cc + +-if {[build_executable "failed to prepare" $testfile $srcfile debug]} { ++set flags {} ++lappend flags debug ++lappend flags c++ ++ ++if {[build_executable "failed to prepare" $testfile $srcfile $flags]} { + return -1 + } + +diff --git a/gdb/testsuite/gdb.base/skipcxx.exp b/gdb/testsuite/gdb.base/skipcxx.exp +index 60b8fa19cd5..73beed8bb75 100644 +--- a/gdb/testsuite/gdb.base/skipcxx.exp ++++ b/gdb/testsuite/gdb.base/skipcxx.exp +@@ -15,7 +15,11 @@ + + standard_testfile .cc + +-if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { ++set flags {} ++lappend flags debug ++lappend flags c++ ++ ++if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} { + return -1 + } + +diff --git a/gdb/testsuite/gdb.base/start-cpp.exp b/gdb/testsuite/gdb.base/start-cpp.exp +index b4a036eac28..330c6ea9a67 100644 +--- a/gdb/testsuite/gdb.base/start-cpp.exp ++++ b/gdb/testsuite/gdb.base/start-cpp.exp +@@ -17,7 +17,11 @@ require !use_gdb_stub + + standard_testfile .cc + +-if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { ++set flags {} ++lappend flags debug ++lappend flags c++ ++ ++if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags]} { + return -1 + } + +diff --git a/gdb/testsuite/gdb.cp/call-method-register.exp b/gdb/testsuite/gdb.cp/call-method-register.exp +index 1019d4fd8f3..b06620fcb2d 100644 +--- a/gdb/testsuite/gdb.cp/call-method-register.exp ++++ b/gdb/testsuite/gdb.cp/call-method-register.exp +@@ -23,8 +23,15 @@ load_lib dwarf.exp + + standard_testfile .cc -dw.S + +-if {[prepare_for_testing "failed to prepare" $testfile $srcfile \ +- {debug c++}]} { ++set flags_debug {} ++lappend flags_debug debug ++lappend flags_debug c++ ++ ++set flags_nodebug {} ++lappend flags_nodebug nodebug ++lappend flags_nodebug c++ ++ ++if {[prepare_for_testing "failed to prepare" $testfile $srcfile $flags_debug]} { + return -1 + } + +@@ -32,7 +39,7 @@ set asm_file [standard_output_file $srcfile2] + Dwarf::assemble $asm_file { + + set main_result \ +- [function_range main ${::srcdir}/${::subdir}/${::srcfile}] ++ [function_range main ${::srcdir}/${::subdir}/${::srcfile} $::flags_debug] + set main_start [lindex $main_result 0] + set main_length [lindex $main_result 1] + +@@ -97,7 +104,7 @@ Dwarf::assemble $asm_file { + } + + if { [prepare_for_testing "failed to prepare" ${testfile} \ +- [list $srcfile $asm_file] {nodebug}] } { ++ [list $srcfile $asm_file] $::flags_nodebug] } { + return -1 + } + +diff --git a/gdb/testsuite/gdb.cp/empty-enum.exp b/gdb/testsuite/gdb.cp/empty-enum.exp +index 6acae551845..2a0f695a35a 100644 +--- a/gdb/testsuite/gdb.cp/empty-enum.exp ++++ b/gdb/testsuite/gdb.cp/empty-enum.exp +@@ -31,6 +31,7 @@ standard_testfile .cc + + set opts {} + lappend opts debug ++lappend opts c++ + lappend opts additional_flags=-std=c++11 + + if {[prepare_for_testing "failed to prepare" $testfile $srcfile $opts]} { +diff --git a/gdb/testsuite/gdb.cp/incomplete-type-overload.exp b/gdb/testsuite/gdb.cp/incomplete-type-overload.exp +index 1f94c3e6bc7..83f09282df4 100644 +--- a/gdb/testsuite/gdb.cp/incomplete-type-overload.exp ++++ b/gdb/testsuite/gdb.cp/incomplete-type-overload.exp +@@ -25,7 +25,15 @@ require dwarf2_support allow_cplus_tests + standard_testfile .cc .S + set asm_file [standard_output_file ${srcfile2}] + +-if [prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}] { ++set flags_debug {} ++lappend flags_debug debug ++lappend flags_debug c++ ++ ++set flags_nodebug {} ++lappend flags_nodebug nodebug ++lappend flags_nodebug c++ ++ ++if [prepare_for_testing "failed to prepare" $testfile $srcfile $flags_debug] { + return + } + +@@ -38,7 +46,7 @@ set int_size [get_sizeof "int" -1] + set addr_size [get_sizeof "void *" -1] + set struct_base_size [get_sizeof "base" 4] + set struct_complete_size [get_sizeof "complete" 4] +-get_func_info foo ++get_func_info foo $flags_debug + + # Create fake DWARF for the .cc file. + # This is the best way to ensure we have an incomplete type. +@@ -159,7 +167,8 @@ Dwarf::assemble ${asm_file} { + } + } + +-if [prepare_for_testing "failed to prepare" $testfile [list $asm_file $srcfile] {}] { ++if [prepare_for_testing "failed to prepare" $testfile \ ++ [list $asm_file $srcfile] $flags_nodebug] { + return + } + +diff --git a/gdb/testsuite/gdb.cp/main-cp.exp b/gdb/testsuite/gdb.cp/main-cp.exp +index 6c247e9d22f..98024bf3664 100644 +--- a/gdb/testsuite/gdb.cp/main-cp.exp ++++ b/gdb/testsuite/gdb.cp/main-cp.exp +@@ -20,7 +20,11 @@ standard_testfile main.cc + + require !readnow + +-if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { ++set opts {} ++lappend opts debug ++lappend opts c++ ++ ++if { [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] } { + return -1 + } + +diff --git a/gdb/testsuite/gdb.cp/method-call-in-c.exp b/gdb/testsuite/gdb.cp/method-call-in-c.exp +index 4676a1b06c6..1c2b432c142 100644 +--- a/gdb/testsuite/gdb.cp/method-call-in-c.exp ++++ b/gdb/testsuite/gdb.cp/method-call-in-c.exp +@@ -22,6 +22,7 @@ standard_testfile .cc + + set opts {} + lappend opts debug ++lappend opts c++ + lappend opts additional_flags=-std=c++11 + + if { [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] } { +diff --git a/gdb/testsuite/gdb.cp/minsym-fallback.exp b/gdb/testsuite/gdb.cp/minsym-fallback.exp +index 19ff264893a..6d8fd485840 100644 +--- a/gdb/testsuite/gdb.cp/minsym-fallback.exp ++++ b/gdb/testsuite/gdb.cp/minsym-fallback.exp +@@ -21,13 +21,21 @@ standard_testfile .cc minsym-fallback-main.cc + + include_file minsym-fallback.h + ++set debug_flags {} ++lappend debug_flags debug ++lappend debug_flags c++ ++ ++set nodebug_flags {} ++lappend nodebug_flags nodebug ++lappend nodebug_flags c++ ++ + set executable $testfile + set objfile [standard_output_file ${testfile}.o] + set objmainfile [standard_output_file ${testfile}-main.o] + +-if {[gdb_compile $srcdir/$subdir/$srcfile $objfile object {}] != "" +- || [gdb_compile $srcdir/$subdir/$srcfile2 $objmainfile object {debug}] != "" +- || [gdb_compile "$objfile $objmainfile" $binfile executable {c++}] != ""} { ++if {[gdb_compile $srcdir/$subdir/$srcfile $objfile object $nodebug_flags] != "" ++ || [gdb_compile $srcdir/$subdir/$srcfile2 $objmainfile object $debug_flags] != "" ++ || [gdb_compile "$objfile $objmainfile" $binfile executable $debug_flags] != ""} { + untested "failed to compile" + return -1 + } +diff --git a/gdb/testsuite/gdb.cp/vla-cxx.exp b/gdb/testsuite/gdb.cp/vla-cxx.exp +index bf3ca792d58..4303383d8f4 100644 +--- a/gdb/testsuite/gdb.cp/vla-cxx.exp ++++ b/gdb/testsuite/gdb.cp/vla-cxx.exp +@@ -15,7 +15,11 @@ + + standard_testfile .cc + +-if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { ++set flags {} ++lappend flags debug ++lappend flags c++ ++ ++if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $flags] } { + return -1 + } + +diff --git a/gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp b/gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp +index a62de7b1c72..7083ab7be17 100644 +--- a/gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp ++++ b/gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp +@@ -19,6 +19,7 @@ standard_testfile index.cc + + set opts {} + lappend opts debug ++lappend opts c++ + lappend opts additional_flags=-std=c++11 + + if {[prepare_for_testing "failed to prepare" "${testfile}" \ +diff --git a/gdb/testsuite/gdb.dwarf2/method-ptr.exp b/gdb/testsuite/gdb.dwarf2/method-ptr.exp +index 4b4c2229fc2..9bb477681af 100644 +--- a/gdb/testsuite/gdb.dwarf2/method-ptr.exp ++++ b/gdb/testsuite/gdb.dwarf2/method-ptr.exp +@@ -76,7 +76,7 @@ Dwarf::assemble $asm_file { + } + + if { [prepare_for_testing "failed to prepare" ${testfile} \ +- [list $srcfile $asm_file] {nodebug}] } { ++ [list $srcfile $asm_file] {nodebug c++}] } { + return -1 + } + +diff --git a/gdb/testsuite/gdb.dwarf2/missing-type-name-for-templates.exp b/gdb/testsuite/gdb.dwarf2/missing-type-name-for-templates.exp +index 06bd896c56a..869b29f09f6 100644 +--- a/gdb/testsuite/gdb.dwarf2/missing-type-name-for-templates.exp ++++ b/gdb/testsuite/gdb.dwarf2/missing-type-name-for-templates.exp +@@ -25,6 +25,17 @@ require dwarf2_support + + standard_testfile .cc .S + ++set debug_flags {} ++lappend debug_flags debug ++lappend debug_flags c++ ++ ++set nodebug_flags {} ++lappend nodebug_flags nodebug ++lappend nodebug_flags c++ ++ ++get_func_info main $debug_flags ++ ++ + set asm_file [standard_output_file $srcfile2] + Dwarf::assemble $asm_file { + cu {} { +@@ -47,7 +58,8 @@ Dwarf::assemble $asm_file { + + DW_TAG_subprogram { + {DW_AT_name "main"} +- {MACRO_AT_range "main"} ++ {DW_AT_low_pc $::main_start DW_FORM_addr} ++ {DW_AT_high_pc $::main_end DW_FORM_addr} + {DW_AT_type :$int} + {DW_AT_external 1 DW_FORM_flag} + } { +@@ -141,7 +153,7 @@ Dwarf::assemble $asm_file { + } + + if { [prepare_for_testing "failed to prepare" ${testfile} \ +- [list $srcfile $asm_file] {nodebug c++}] } { ++ [list $srcfile $asm_file] $nodebug_flags] } { + return -1 + } + +diff --git a/gdb/testsuite/gdb.dwarf2/subrange.exp b/gdb/testsuite/gdb.dwarf2/subrange.exp +index 2671f829fe8..d384fb6d491 100644 +--- a/gdb/testsuite/gdb.dwarf2/subrange.exp ++++ b/gdb/testsuite/gdb.dwarf2/subrange.exp +@@ -102,7 +102,7 @@ Dwarf::assemble $asm_file { + } + + if { [prepare_for_testing "failed to prepare" ${testfile} \ +- [list $srcfile $asm_file] {nodebug}] } { ++ [list $srcfile $asm_file] {nodebug c++}] } { + return -1 + } + +diff --git a/gdb/testsuite/gdb.guile/types-module.exp b/gdb/testsuite/gdb.guile/types-module.exp +index d95ff21df5e..0da28ad0506 100644 +--- a/gdb/testsuite/gdb.guile/types-module.exp ++++ b/gdb/testsuite/gdb.guile/types-module.exp +@@ -22,7 +22,11 @@ require allow_guile_tests + + standard_testfile .cc + +-if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { ++set flags {} ++lappend flags debug ++lappend flags c++ ++ ++if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $flags] } { + return -1 + } + +diff --git a/gdb/testsuite/gdb.linespec/cpcompletion.exp b/gdb/testsuite/gdb.linespec/cpcompletion.exp +index 480e03406f2..355a05dd014 100644 +--- a/gdb/testsuite/gdb.linespec/cpcompletion.exp ++++ b/gdb/testsuite/gdb.linespec/cpcompletion.exp +@@ -22,8 +22,12 @@ standard_testfile cpls.cc cpls2.cc cpls-hyphen.cc + + set opts {} + lappend opts debug ++lappend opts c++ + lappend opts additional_flags=-std=c++11 + ++set flags {} ++lappend flags debug ++ + if {[prepare_for_testing "failed to prepare" $testfile \ + [list $srcfile $srcfile2 $srcfile3] $opts]} { + return -1 +diff --git a/gdb/testsuite/gdb.linespec/cpls-ops.exp b/gdb/testsuite/gdb.linespec/cpls-ops.exp +index 22428da905f..7ffcc5c768e 100644 +--- a/gdb/testsuite/gdb.linespec/cpls-ops.exp ++++ b/gdb/testsuite/gdb.linespec/cpls-ops.exp +@@ -19,8 +19,12 @@ load_lib completion-support.exp + + standard_testfile cpls-ops.cc + ++set flags {} ++lappend flags debug ++lappend flags c++ ++ + if {[prepare_for_testing "failed to prepare" $testfile \ +- [list $srcfile] {debug}]} { ++ [list $srcfile] $flags]} { + return -1 + } + + +base-commit: e0c1db6156fa8ee35661a9964062eeb69a963576 +-- +2.43.0 + diff --git a/gdb.changes b/gdb.changes index 98c745b..479a7a9 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,4 +1,14 @@ ------------------------------------------------------------------- +Wed Jan 29 10:52:26 UTC 2025 - Tom de Vries + +- Maintenance script qa.sh: + * Extend SLE-12 -static unix/-fPIE/-fpie kfails. + * Extend ppc64le watchpoint kfail. + * Extend PR29405 kfail. +- Patches added: + * gdb-testsuite-fix-gdb.threads-leader-exit-attach.exp.patch + * gdb-testsuite-use-c-flag-in-c-test-cases.patch +------------------------------------------------------------------- Mon Jan 27 06:00:38 UTC 2025 - Tom de Vries - Update to fedora rawhide @ a8e0b3d (gdb 15.1). diff --git a/gdb.spec b/gdb.spec index ca93532..084eaf3 100644 --- a/gdb.spec +++ b/gdb.spec @@ -243,19 +243,20 @@ Patch1508: gdb-testsuite-fix-gdb_py_module_available-for-python.patch # Backports from master, available in GDB 16. -Patch2091: gdb-testsuite-fix-gdb.fortran-array-bounds.exp-on-ar.patch -Patch2092: gdb-symtab-return-correct-reader-for-top-level-cu-in.patch -Patch2093: gdb-tdep-s390-add-arch15-record-replay-support.patch -Patch2094: gdb-testsuite-avoid-intermittent-failures-on-a-debug.patch -Patch2095: gdb-python-avoid-depending-on-the-curses-library.patch +Patch2000: gdb-testsuite-fix-gdb.fortran-array-bounds.exp-on-ar.patch +Patch2001: gdb-symtab-return-correct-reader-for-top-level-cu-in.patch +Patch2002: gdb-tdep-s390-add-arch15-record-replay-support.patch +Patch2003: gdb-testsuite-avoid-intermittent-failures-on-a-debug.patch +Patch2004: gdb-python-avoid-depending-on-the-curses-library.patch +Patch2005: gdb-testsuite-fix-gdb.threads-leader-exit-attach.exp.patch # Backports from master, available in GDB 17. -Patch2096: gdb-testsuite-record-less-in-gdb.reverse-time-revers.patch -Patch2097: gdb-doc-fix-gdb.unwinder-docs.patch -Patch2098: gdb-doc-fix-qisaddresstagged-anchor.patch -Patch2099: gdb-testsuite-fix-another-regexp-in-gdb.threads-step.patch -Patch2100: gdb-testsuite-fix-timeouts-in-gdb.threads-step-over-.patch +Patch2100: gdb-testsuite-record-less-in-gdb.reverse-time-revers.patch +Patch2101: gdb-doc-fix-gdb.unwinder-docs.patch +Patch2102: gdb-doc-fix-qisaddresstagged-anchor.patch +Patch2103: gdb-testsuite-fix-another-regexp-in-gdb.threads-step.patch +Patch2104: gdb-testsuite-fix-timeouts-in-gdb.threads-step-over-.patch # @@ -273,9 +274,10 @@ Patch3003: gdb-testsuite-fix-error-in-gdb.server-server-kill-py.patch Patch3004: gdb-testsuite-fix-timeout-in-gdb.tui-resize-2.exp.patch # https://sourceware.org/pipermail/gdb-patches/2025-January/214982.html Patch3005: gdb-doc-fix-standard-replies-xref.patch - # https://sourceware.org/pipermail/gdb-patches/2023-December/205054.html Patch3006: gdb-symtab-recurse-into-c-dw_tag_subprogram-dies-for.patch +# https://sourceware.org/bugzilla/show_bug.cgi?id=30380#c1 +Patch3007: gdb-testsuite-use-c-flag-in-c-test-cases.patch # Debug patches. @@ -640,16 +642,18 @@ find -name "*.info*"|xargs rm -f %patch -P 1507 -p1 %patch -P 1508 -p1 -%patch -P 2091 -p1 -%patch -P 2092 -p1 -%patch -P 2093 -p1 -%patch -P 2094 -p1 -%patch -P 2095 -p1 -%patch -P 2096 -p1 -%patch -P 2097 -p1 -%patch -P 2098 -p1 -%patch -P 2099 -p1 +%patch -P 2000 -p1 +%patch -P 2001 -p1 +%patch -P 2002 -p1 +%patch -P 2003 -p1 +%patch -P 2004 -p1 +%patch -P 2005 -p1 + %patch -P 2100 -p1 +%patch -P 2101 -p1 +%patch -P 2102 -p1 +%patch -P 2103 -p1 +%patch -P 2104 -p1 %patch -P 3000 -p1 %patch -P 3001 -p1 @@ -658,6 +662,7 @@ find -name "*.info*"|xargs rm -f %patch -P 3004 -p1 %patch -P 3005 -p1 %patch -P 3006 -p1 +%patch -P 3007 -p1 #unpack libipt %if 0%{have_libipt} diff --git a/qa.sh b/qa.sh index 9bd33f7..a40a102 100644 --- a/qa.sh +++ b/qa.sh @@ -358,6 +358,9 @@ kfail=( # https://sourceware.org/bugzilla/show_bug.cgi?id=32439 "FAIL: gdb.base/step-over-syscall.exp: (fork|vfork): displaced=on: check_pc_after_cross_syscall: single step over (fork|vfork) final pc" + # https://sourceware.org/bugzilla/show_bug.cgi?id=32619 + "FAIL: gdb.dap/eof.exp: exceptions in log file" + ) # kfail kfail_sle12=( @@ -427,6 +430,7 @@ kfail_sle12=( "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: step back into foo" "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: step into bar" "FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: step into foo" + "FAIL: gdb.base/list-dot-nodebug.exp: debug=none: runto: run to bar" # Fails on both i586 and s390x/-m31 for SLE-12-SP3, but does not reproduce # on s390x/-m31 for SLE-12-SP5 with trunk. @@ -539,8 +543,8 @@ kfail_factory=( kfail_aarch64=( # https://sourceware.org/bugzilla/show_bug.cgi?id=29405 - "FAIL: gdb.base/step-over-syscall.exp: (fork|vfork): displaced=(on|off): pc after stepi matches insn addr after syscall" - "FAIL: gdb.base/step-over-syscall.exp: (fork|vfork): displaced=(on|off): check_pc_after_cross_syscall: single step over fork final pc" + "FAIL: gdb.base/step-over-syscall.exp: (clone|fork|vfork): displaced=(on|off): pc after stepi matches insn addr after syscall" + "FAIL: gdb.base/step-over-syscall.exp: (clone|fork|vfork): displaced=(on|off): check_pc_after_cross_syscall: single step over (clone|fork|vfork) final pc" # https://sourceware.org/bugzilla/show_bug.cgi?id=29423 "FAIL: gdb.base/watchpoint-unaligned.exp: continue \(timeout\)" @@ -641,6 +645,11 @@ kfail_powerpc64le=( "FAIL: gdb.python/py-breakpoint.exp: test_watchpoints: Test watchpoint write \(the program exited\)" "FAIL: gdb.python/py-breakpoint.exp: test_bkpt_internal: Test watchpoint write \(the program exited\)" "FAIL: gdb.python/py-breakpoint.exp: test_bkpt_eval_funcs: Test watchpoint write \(the program exited\)" + "FAIL: gdb.base/memops-watchpoint.exp: continue until memcpy watchpoint hits" + "FAIL: gdb.base/memops-watchpoint.exp: continue until memmove watchpoint hits" + "FAIL: gdb.base/memops-watchpoint.exp: continue until memset watchpoint hits" + "FAIL: gdb.base/watchpoint-running.exp: all-stop: hardware: watchpoint hit" + "FAIL: gdb.base/watchpoint-running.exp: non-stop: hardware: watchpoint hit" # https://sourceware.org/bugzilla/show_bug.cgi?id=31004 "FAIL: gdb.base/run-control-while-bg-execution.exp: action1=.*: action2=run: run" From 8686faa338477ce5d1015002924a68fd773f69a60e191de8a67c4095f778e681 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 30 Jan 2025 12:47:05 +0000 Subject: [PATCH 22/34] - Always BuildRequire gcc-c++ to fix missing testing compiler on SLE-12. - Patches added: * gdb-testsuite-handle-unordered-dict-in-gdb.python-py.patch - Maintenance script qa.sh: * Add PR32167 kfail. OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=427 --- ...ndle-unordered-dict-in-gdb.python-py.patch | 65 +++++++++++++++++++ gdb.changes | 10 +++ gdb.spec | 8 ++- qa.sh | 3 + 4 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 gdb-testsuite-handle-unordered-dict-in-gdb.python-py.patch diff --git a/gdb-testsuite-handle-unordered-dict-in-gdb.python-py.patch b/gdb-testsuite-handle-unordered-dict-in-gdb.python-py.patch new file mode 100644 index 0000000..8df3593 --- /dev/null +++ b/gdb-testsuite-handle-unordered-dict-in-gdb.python-py.patch @@ -0,0 +1,65 @@ +From 83fafbe970614f89e7e106542bdb9181b0568f0f Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 30 Jan 2025 13:21:56 +0100 +Subject: [PATCH] [gdb/testsuite] Handle unordered dict in + gdb.python/py-mi-notify.exp + +With test-case gdb.python/py-mi-notify.exp and python 3.4, I occasionally run +into: +... +python gdb.notify_mi('-test-notification', { 'data1' : 1 , 'data2' : 2 }) +&"python gdb.notify_mi('-test-notification', { 'data1' : 1 , 'data2' : 2 })\n" +=-test-notification,data2="2",data1="1" +^done +(gdb) +FAIL: $exp: python notification, with additional data (unexpected output) +... + +In contrast, a passing version looks like: +... +python gdb.notify_mi('-test-notification', { 'data1' : 1 , 'data2' : 2 }) +&"python gdb.notify_mi('-test-notification', { 'data1' : 1 , 'data2' : 2 })\n" +=-test-notification,data1="1",data2="2" +^done +(gdb) +PASS: gdb.python/py-mi-notify.exp: python notification, with additional data +... + +The python method "gdb.notify_mi(name, data)" has parameter data which is a +dictionary, and it iterates over that dictionary. + +The problem is that dictionaries are only guaranteed to be iterating in +insertion order starting python 3.7 (though cpython does this starting python +3.6). + +Fix this in the same way as in commit 362a867f2ac ("[gdb/testsuite] Handle +unordered dict in gdb.python/py-mi-cmd.exp"): by allowing the alternative +order. + +Tested on x86_64-linux. +--- + gdb/testsuite/gdb.python/py-mi-notify.exp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.python/py-mi-notify.exp b/gdb/testsuite/gdb.python/py-mi-notify.exp +index f808fb2502e..7776976613e 100644 +--- a/gdb/testsuite/gdb.python/py-mi-notify.exp ++++ b/gdb/testsuite/gdb.python/py-mi-notify.exp +@@ -42,8 +42,11 @@ mi_gdb_test "python gdb.notify_mi('-test-notification', None)" \ + ".*=-test-notification\r\n\\^done" \ + "python notification, no additional data" + ++set re_data1 {data1="1"} ++set re_data2 {data2="2"} ++set re_data1_data2 ($re_data1,$re_data2|$re_data2,$re_data1) + mi_gdb_test "python gdb.notify_mi('-test-notification', \{ 'data1' : 1 , 'data2' : 2 })" \ +- ".*=-test-notification,data1=\"1\",data2=\"2\"\r\n\\^done" \ ++ ".*=-test-notification,$re_data1_data2\r\n\\^done" \ + "python notification, with additional data" + + mi_gdb_test "python gdb.notify_mi('-test-notification', 1)" \ + +base-commit: 625cadfb85ae46901ee8cbed08638ed3be8d96f5 +-- +2.43.0 + diff --git a/gdb.changes b/gdb.changes index 479a7a9..46ab3b6 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Thu Jan 30 12:32:38 UTC 2025 - Tom de Vries + +- Always BuildRequire gcc-c++ to fix missing testing compiler on + SLE-12. +- Patches added: + * gdb-testsuite-handle-unordered-dict-in-gdb.python-py.patch +- Maintenance script qa.sh: + * Add PR32167 kfail. + ------------------------------------------------------------------- Wed Jan 29 10:52:26 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 084eaf3..12c2b50 100644 --- a/gdb.spec +++ b/gdb.spec @@ -257,6 +257,7 @@ Patch2101: gdb-doc-fix-gdb.unwinder-docs.patch Patch2102: gdb-doc-fix-qisaddresstagged-anchor.patch Patch2103: gdb-testsuite-fix-another-regexp-in-gdb.threads-step.patch Patch2104: gdb-testsuite-fix-timeouts-in-gdb.threads-step-over-.patch +Patch2105: gdb-testsuite-handle-unordered-dict-in-gdb.python-py.patch # @@ -443,11 +444,11 @@ BuildRequires: gcc-ada-32bit %if 0%{suse_version} > 1110 BuildRequires: gcc-c++-32bit -%else -# Use system g++ for testing for SLE-11. -BuildRequires: gcc-c++ %endif +# Use system g++ for testing SLE-12. +BuildRequires: gcc-c++ + %if 0%{suse_version} >= 1210 && 0%{suse_version} != 1315 BuildRequires: glibc-devel-static-32bit %endif @@ -654,6 +655,7 @@ find -name "*.info*"|xargs rm -f %patch -P 2102 -p1 %patch -P 2103 -p1 %patch -P 2104 -p1 +%patch -P 2105 -p1 %patch -P 3000 -p1 %patch -P 3001 -p1 diff --git a/qa.sh b/qa.sh index a40a102..2582c8b 100644 --- a/qa.sh +++ b/qa.sh @@ -449,6 +449,9 @@ kfail_sle12=( "FAIL: gdb.python/py-type.exp: lang_cpp: test_fields: python print \(gdb.lookup_type \('main\(\)::IntType'\)\)" "FAIL: gdb.python/py-type.exp: lang_cpp: test_fields: python print \(gdb.lookup_type \('main\(\)::IntType'\).target \(\)\)" + # https://sourceware.org/bugzilla/show_bug.cgi?id=32167 + "FAIL: gdb.base/bp-cmds-continue-ctrl-c.exp: attach: stop with control-c" + ) # kfail_sle12 kfail_sle11=( From 2bf571b3699541677f96a5e65fb07ca66115aa843e6aa2da5ae9b108bc214edb Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 30 Jan 2025 15:23:43 +0000 Subject: [PATCH 23/34] - Update to fedora rawhide @ a93b826. - Patches dropped: * gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch - Maintenance script import-fedora.sh: * Add gdb-remove-use-of-py-isascii to skip_patches. * Remove gdb-6.7-ppc-clobbered-registers-O2-test.patch from skip_patches. OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=428 --- ...dvar-assertion-frame-failed-testcase.patch | 147 ------------------ gdb.changes | 11 ++ gdb.spec | 38 +++-- import-fedora.sh | 4 +- 4 files changed, 31 insertions(+), 169 deletions(-) delete mode 100644 gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch diff --git a/gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch b/gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch deleted file mode 100644 index c4b1a01..0000000 --- a/gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +++ /dev/null @@ -1,147 +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-rhbz947564-findvar-assertion-frame-failed-testcase.patch - -;; Import regression test for `gdb/findvar.c:417: internal-error: -;; read_var_value: Assertion `frame' failed.' (RH BZ 947564) from RHEL 6.5. -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.threads/tls-rhbz947564.cc b/gdb/testsuite/gdb.threads/tls-rhbz947564.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.threads/tls-rhbz947564.cc -@@ -0,0 +1,53 @@ -+#include -+#include -+ -+class x -+ { -+ public: -+ int n; -+ -+ x() : n(0) {} -+ }; -+ -+class y -+ { -+ public: -+ int v; -+ -+ y() : v(0) {} -+ static __thread x *xp; -+ }; -+ -+__thread x *y::xp; -+ -+static void -+foo (y *yp) -+{ -+ yp->v = 1; /* foo_marker */ -+} -+ -+static void * -+bar (void *unused) -+{ -+ x xinst; -+ y::xp= &xinst; -+ -+ y yy; -+ foo(&yy); -+ -+ return NULL; -+} -+ -+int -+main(int argc, char *argv[]) -+{ -+ pthread_t t[2]; -+ -+ pthread_create (&t[0], NULL, bar, NULL); -+ pthread_create (&t[1], NULL, bar, NULL); -+ -+ pthread_join (t[0], NULL); -+ pthread_join (t[1], NULL); -+ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.threads/tls-rhbz947564.exp b/gdb/testsuite/gdb.threads/tls-rhbz947564.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.threads/tls-rhbz947564.exp -@@ -0,0 +1,75 @@ -+# Copyright (C) 2013 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . */ -+ -+set testfile tls-rhbz947564 -+set srcfile ${testfile}.cc -+set binfile [standard_output_file ${testfile}] -+ -+if [istarget "*-*-linux"] then { -+ set target_cflags "-D_MIT_POSIX_THREADS" -+} else { -+ set target_cflags "" -+} -+ -+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list c++ debug]] != "" } { -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+ -+gdb_load ${binfile} -+ -+if { ![runto_main] } { -+ fail "Can't run to function main" -+ return 0 -+} -+ -+gdb_breakpoint "foo" -+gdb_continue_to_breakpoint "foo" ".* foo_marker .*" -+ -+proc get_xp_val {try} { -+ global expect_out -+ global gdb_prompt -+ global hex -+ -+ set xp_val "" -+ gdb_test_multiple "print *yp" "print yp value" { -+ -re { = \{v = 0, static xp = (0x[0-9a-f]+)\}.* } { -+ pass "print $try value of *yp" -+ set xp_val $expect_out(1,string) -+ } -+ -re "$gdb_prompt $" { -+ fail "print $try value of *yp" -+ } -+ timeout { -+ fail "print $try value of *yp (timeout)" -+ } -+ } -+ return $xp_val -+} -+ -+set first_run [get_xp_val "first"] -+ -+gdb_test "continue" "Breakpoint \[0-9\]+, foo \\\(yp=$hex\\\) at.*" -+ -+set second_run [get_xp_val "second"] -+ -+if { $first_run != $second_run } { -+ pass "different values for TLS variable" -+} else { -+ fail "different values for TLS variable" -+} diff --git a/gdb.changes b/gdb.changes index 46ab3b6..e5ea5f5 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Thu Jan 30 15:20:59 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ a93b826. +- Patches dropped: + * gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +- Maintenance script import-fedora.sh: + * Add gdb-remove-use-of-py-isascii to skip_patches. + * Remove gdb-6.7-ppc-clobbered-registers-O2-test.patch from + skip_patches. + ------------------------------------------------------------------- Thu Jan 30 12:32:38 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 12c2b50..f72f641 100644 --- a/gdb.spec +++ b/gdb.spec @@ -178,20 +178,19 @@ Patch6: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch Patch7: gdb-6.5-bz243845-stale-testing-zombie-test.patch Patch8: gdb-6.6-buildid-locate.patch Patch9: gdb-6.6-buildid-locate-solib-missing-ids.patch -Patch11: gdb-6.5-gcore-buffer-limit-test.patch -Patch12: gdb-6.3-mapping-zero-inode-test.patch -Patch13: gdb-6.5-section-num-fixup-test.patch -Patch15: gdb-simultaneous-step-resume-breakpoint-test.patch -Patch16: gdb-archer-next-over-throw-cxx-exec.patch -Patch17: gdb-test-bt-cfi-without-die.patch -Patch18: gdb-test-dw2-aranges.patch -Patch19: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch20: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch -Patch21: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch -Patch24: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -Patch25: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -Patch26: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch29: gdb-add-rpm-suggestion-script.patch +Patch10: gdb-6.5-gcore-buffer-limit-test.patch +Patch11: gdb-6.3-mapping-zero-inode-test.patch +Patch12: gdb-6.5-section-num-fixup-test.patch +Patch14: gdb-simultaneous-step-resume-breakpoint-test.patch +Patch15: gdb-archer-next-over-throw-cxx-exec.patch +Patch16: gdb-test-bt-cfi-without-die.patch +Patch17: gdb-test-dw2-aranges.patch +Patch18: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch19: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +Patch22: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch23: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch24: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch27: gdb-add-rpm-suggestion-script.patch #Fedora Packages end # Fedora patches fixup @@ -606,20 +605,19 @@ find -name "*.info*"|xargs rm -f %patch -P 7 -p1 %patch -P 8 -p1 %patch -P 9 -p1 +%patch -P 10 -p1 %patch -P 11 -p1 %patch -P 12 -p1 -%patch -P 13 -p1 +%patch -P 14 -p1 %patch -P 15 -p1 %patch -P 16 -p1 %patch -P 17 -p1 %patch -P 18 -p1 %patch -P 19 -p1 -%patch -P 20 -p1 -%patch -P 21 -p1 +%patch -P 22 -p1 +%patch -P 23 -p1 %patch -P 24 -p1 -%patch -P 25 -p1 -%patch -P 26 -p1 -%patch -P 29 -p1 +%patch -P 27 -p1 #Fedora patching end %patch -P 1004 -p1 diff --git a/import-fedora.sh b/import-fedora.sh index 999f322..65cf374 100644 --- a/import-fedora.sh +++ b/import-fedora.sh @@ -12,8 +12,8 @@ skip_patches=( # Fragile test-case, requires glibc to fail in a certain way. gdb-rhbz1156192-recursive-dlopen-test.patch - # Obsolete. - gdb-6.7-ppc-clobbered-registers-O2-test.patch + # No longer needed. + gdb-remove-use-of-py-isascii ) usage () From 9842821ab11cce5f19299c6eea0606728099f7cedd71394271f16efbbf34af7a Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 30 Jan 2025 15:27:43 +0000 Subject: [PATCH 24/34] - Update to fedora rawhide @ d8b64d9. - Patches dropped: * gdb-6.6-bz229517-gcore-without-terminal.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=429 --- gdb-6.6-bz229517-gcore-without-terminal.patch | 188 ------------------ gdb.changes | 7 + gdb.spec | 44 ++-- 3 files changed, 28 insertions(+), 211 deletions(-) delete mode 100644 gdb-6.6-bz229517-gcore-without-terminal.patch diff --git a/gdb-6.6-bz229517-gcore-without-terminal.patch b/gdb-6.6-bz229517-gcore-without-terminal.patch deleted file mode 100644 index 863f615..0000000 --- a/gdb-6.6-bz229517-gcore-without-terminal.patch +++ /dev/null @@ -1,188 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.6-bz229517-gcore-without-terminal.patch - -;; Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517). -;;=fedoratest - -2007-04-22 Jan Kratochvil - - * gdb_gcore.sh: Redirect GDB from ` - - * gdb.base/gcorebg.exp, gdb.base/gcorebg.c: New files. - -diff --git a/gdb/testsuite/gdb.base/gcorebg.c b/gdb/testsuite/gdb.base/gcorebg.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/gcorebg.c -@@ -0,0 +1,49 @@ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+int main (int argc, char **argv) -+{ -+ pid_t pid = 0; -+ pid_t ppid; -+ char buf[1024*2 + 500]; -+ int gotint; -+ -+ if (argc != 4) -+ { -+ fprintf (stderr, "Syntax: %s {standard|detached} \n", -+ argv[0]); -+ exit (1); -+ } -+ -+ pid = fork (); -+ -+ switch (pid) -+ { -+ case 0: -+ if (strcmp (argv[1], "detached") == 0) -+ setpgrp (); -+ ppid = getppid (); -+ gotint = snprintf (buf, sizeof (buf), "sh %s -o %s %d", argv[2], argv[3], (int) ppid); -+ assert (gotint < sizeof (buf)); -+ system (buf); -+ fprintf (stderr, "Killing parent PID %d\n", ppid); -+ kill (ppid, SIGTERM); -+ break; -+ -+ case -1: -+ perror ("fork err\n"); -+ exit (1); -+ break; -+ -+ default: -+ fprintf (stderr,"Sleeping as PID %d\n", getpid ()); -+ sleep (60); -+ } -+ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.base/gcorebg.exp b/gdb/testsuite/gdb.base/gcorebg.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/gcorebg.exp -@@ -0,0 +1,113 @@ -+# Copyright 2007 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ -+# Please email any bugs, comments, and/or additions to this file to: -+# bug-gdb@prep.ai.mit.edu -+ -+# This file was written by Jan Kratochvil . -+# This is a test for `gdb_gcore.sh' functionality. -+# It also tests a regression with `gdb_gcore.sh' being run without its -+# accessible terminal. -+ -+if ![info exists GCORE] { -+ set GCORE "[standard_output_file ../../../../gcore]" -+} -+verbose "using GCORE = $GCORE" 2 -+ -+set testfile "gcorebg" -+set srcfile ${testfile}.c -+set binfile [standard_output_file ${testfile}] -+set corefile [standard_output_file ${testfile}.test] -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ untested gcorebg.exp -+ return -1 -+} -+ -+# Cleanup. -+ -+proc core_clean {} { -+ global corefile -+ -+ foreach file [glob -nocomplain [join [list $corefile *] ""]] { -+ verbose "Delete file $file" 1 -+ remote_file target delete $file -+ } -+} -+core_clean -+remote_file target delete "./gdb" -+ -+# Generate the core file. -+ -+# Provide `./gdb' for `gdb_gcore.sh' running it as a bare `gdb' command. -+# Setup also `$PATH' appropriately. -+# If GDB was not found let `gdb_gcore.sh' to find the system GDB by `$PATH'. -+if {$GDB != "gdb"} { -+ file link ./gdb $GDB -+} -+global env -+set oldpath $env(PATH) -+set env(PATH) [join [list . $env(PATH)] ":"] -+verbose "PATH = $env(PATH)" 2 -+ -+# Test file body. -+# $detached == "standard" || $detached == "detached" -+ -+proc test_body { detached } { -+ global binfile -+ global GCORE -+ global corefile -+ -+ set res [remote_spawn target "$binfile $detached $GCORE $corefile"] -+ if { $res < 0 || $res == "" } { -+ fail "Spawning $detached gcore" -+ return 1 -+ } -+ pass "Spawning $detached gcore" -+ remote_expect target 20 { -+ timeout { -+ fail "Spawned $detached gcore finished (timeout)" -+ remote_exec target "kill -9 -[exp_pid -i $res]" -+ return 1 -+ } -+ "Saved corefile .*\r\nKilling parent PID " { -+ pass "Spawned $detached gcore finished" -+ remote_wait target 20 -+ } -+ } -+ -+ if {1 == [llength [glob -nocomplain [join [list $corefile *] ""]]]} { -+ pass "Core file generated by $detached gcore" -+ } else { -+ fail "Core file generated by $detached gcore" -+ } -+ core_clean -+} -+ -+# First a general `gdb_gcore.sh' spawn with its controlling terminal available. -+ -+test_body standard -+ -+# And now `gdb_gcore.sh' spawn without its controlling terminal available. -+# It is spawned through `gcorebg.c' using setpgrp (). -+ -+test_body detached -+ -+ -+# Cleanup. -+ -+set env(PATH) $oldpath -+remote_file target delete "./gdb" diff --git a/gdb.changes b/gdb.changes index e5ea5f5..5f64c31 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jan 30 15:25:52 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ d8b64d9. +- Patches dropped: + * gdb-6.6-bz229517-gcore-without-terminal.patch + ------------------------------------------------------------------- Thu Jan 30 15:20:59 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index f72f641..06172bc 100644 --- a/gdb.spec +++ b/gdb.spec @@ -172,25 +172,24 @@ NoSource: 20 #Fedora Packages begin Patch2: gdb-6.3-gstack-20050411.patch Patch3: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch -Patch4: gdb-6.6-bz229517-gcore-without-terminal.patch -Patch5: gdb-6.6-testsuite-timeouts.patch -Patch6: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch -Patch7: gdb-6.5-bz243845-stale-testing-zombie-test.patch -Patch8: gdb-6.6-buildid-locate.patch -Patch9: gdb-6.6-buildid-locate-solib-missing-ids.patch -Patch10: gdb-6.5-gcore-buffer-limit-test.patch -Patch11: gdb-6.3-mapping-zero-inode-test.patch -Patch12: gdb-6.5-section-num-fixup-test.patch -Patch14: gdb-simultaneous-step-resume-breakpoint-test.patch -Patch15: gdb-archer-next-over-throw-cxx-exec.patch -Patch16: gdb-test-bt-cfi-without-die.patch -Patch17: gdb-test-dw2-aranges.patch -Patch18: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch19: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch -Patch22: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -Patch23: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -Patch24: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch27: gdb-add-rpm-suggestion-script.patch +Patch4: gdb-6.6-testsuite-timeouts.patch +Patch5: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch +Patch6: gdb-6.5-bz243845-stale-testing-zombie-test.patch +Patch7: gdb-6.6-buildid-locate.patch +Patch8: gdb-6.6-buildid-locate-solib-missing-ids.patch +Patch9: gdb-6.5-gcore-buffer-limit-test.patch +Patch10: gdb-6.3-mapping-zero-inode-test.patch +Patch11: gdb-6.5-section-num-fixup-test.patch +Patch13: gdb-simultaneous-step-resume-breakpoint-test.patch +Patch14: gdb-archer-next-over-throw-cxx-exec.patch +Patch15: gdb-test-bt-cfi-without-die.patch +Patch16: gdb-test-dw2-aranges.patch +Patch17: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch18: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +Patch21: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch22: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch23: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch26: gdb-add-rpm-suggestion-script.patch #Fedora Packages end # Fedora patches fixup @@ -607,17 +606,16 @@ find -name "*.info*"|xargs rm -f %patch -P 9 -p1 %patch -P 10 -p1 %patch -P 11 -p1 -%patch -P 12 -p1 +%patch -P 13 -p1 %patch -P 14 -p1 %patch -P 15 -p1 %patch -P 16 -p1 %patch -P 17 -p1 %patch -P 18 -p1 -%patch -P 19 -p1 +%patch -P 21 -p1 %patch -P 22 -p1 %patch -P 23 -p1 -%patch -P 24 -p1 -%patch -P 27 -p1 +%patch -P 26 -p1 #Fedora patching end %patch -P 1004 -p1 From 6817e1b56f2d7a40503176e8eea78799773c46d3b20163d5464d55ba962d36a6 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 31 Jan 2025 07:18:36 +0000 Subject: [PATCH 25/34] - Update to fedora rawhide @ 4b0a2e1. - Patches added: * gdb-catchpoint-re-set.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=430 --- gdb-catchpoint-re-set.patch | 575 ++++++++++++++++++++++++++++++++++++ gdb.changes | 7 + gdb.spec | 2 + 3 files changed, 584 insertions(+) create mode 100644 gdb-catchpoint-re-set.patch diff --git a/gdb-catchpoint-re-set.patch b/gdb-catchpoint-re-set.patch new file mode 100644 index 0000000..b8e9eda --- /dev/null +++ b/gdb-catchpoint-re-set.patch @@ -0,0 +1,575 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Wed, 14 Aug 2024 15:16:46 +0100 +Subject: gdb-catchpoint-re-set.patch + + ;; Backport upstream commit a92e943014f to fix rhbz2304296. + +gdb: implement ::re_set method for catchpoint class + +It is possible to attach a condition to a catchpoint. This can't be +done when the catchpoint is created, but can be done with the +'condition' command, this is documented in the GDB manual: + + You can also use the 'if' keyword with the 'watch' command. The + 'catch' command does not recognize the 'if' keyword; 'condition' is the + only way to impose a further condition on a catchpoint. + +A GDB crash was reported against Fedora GDB where a user had attached +a condition to a catchpoint and then restarted the inferior. When the +catchpoint was hit GDB would immediately segfault. I was able to +reproduce the failure on upstream GDB: + + (gdb) file ./some/binary + (gdb) catch syscall write + (gdb) run + ... + Catchpoint 1 (returned from syscall write), 0x00007ffff7b594a7 in write () from /lib64/libc.so.6 + (gdb) condition 1 $_streq((char *) $rsi, "foobar") == 0 + (gdb) run + ... + Fatal signal: Segmentation fault + ... + +What happened here is that on the system in question we had debug +information available for both the main application and also for +libc. + +When the condition was attached GDB was stopped inside libc and as the +debug information was available GDB found a reference to the 'char' +type (for the cast) inside libc's debug information. + +When the inferior is restarted GDB discards all of the objfiles +associated with shared libraries, and this includes libc. As such the +'char' type, which is objfile owned, is discarded and the reference to +it from the catchpoint's condition expression becomes invalid. + +Now, if it were a breakpoint instead of a catchpoint, what would +happen is that after the shared library objfiles had been discarded +we'd call the virtual breakpoint::re_set method on the breakpoint, and +this would update the breakpoint's condition expression. This is +because user breakpoints are actually instances of the code_breakpoint +class and the code_breakpoint::re_set method contains the code to +recompute the breakpoint's condition expression. + +However, catchpoints are instances of the catchpoint class which +inherits from the base breakpoint class. The catchpoint class does +not override breakpoint::re_set, and breakpoint::re_set is empty! + +The consequence of this is that catchpoint condition expressions are +never recomputed, and the dangling pointer to the now deleted, objfile +owned type 'char' is left around, and, when the catchpoint is hit, the +invalid pointer is used when GDB tries to evaluate the condition +expression. + +In this commit I have implemented catchpoint::re_set. This is pretty +simple and just recomputes the condition expression as you'd expect. +If the condition doesn't evaluate then the catchpoint is marked as +disabled_by_cond. + +I have also made breakpoint::re_set pure virtual. With the addition +of catchpoint::re_set every sub-class of breakpoint now implements the +::re_set method, and if new sub-classes are added in the future I +think that they _must_ implement ::re_set in order to avoid this +problem. As such falling back to an empty breakpoint::re_set doesn't +seem helpful. + +For testing I have not relied on stopping in libc and having libc +debug information available, this doesn't seem like a good idea for +the GDB testsuite. Instead I create a (rather pointless) condition +check that uses a type defined only within a shared library. When the +inferior is restarted the catchpoint will temporarily be marked as +disabled_by_cond (due to the type not being available), but once the +shared library is loaded again the catchpoint will be re-enabled. +Without the fixes above then the same crashing behaviour can be +observed. + +One point of note: the dangling pointer of course exposes undefined +behaviour, with no guarantee of a crash. Though a crash is what I +usually see I have see GDB throw random errors from the expression +evaluation code, and once, I saw no problem at all! If you recompile +GDB with the address sanitizer, or run under valgrind, then the bug +will be exposed every time. + +After fixing this bug I checked bugzilla and found PR gdb/29960 which +is the same bug. I was able to reproduce the bug before this commit, +and after this commit GDB is no longer crashing. + +Before: + + (gdb) file /tmp/hello.x + Reading symbols from /tmp/hello.x... + (gdb) run + Starting program: /tmp/hello.x + Hello World + [Inferior 1 (process 1101855) exited normally] + (gdb) catch syscall 1 + Catchpoint 1 (syscall 'write' [1]) + (gdb) condition 1 write.fd == 1 + (gdb) run + Starting program: /tmp/hello.x + + Fatal signal: Segmentation fault + ... + +And after: + + (gdb) file /tmp/hello.x + Reading symbols from /tmp/hello.x... + (gdb) run + Starting program: /tmp/hello.x + Hello World + Args: ( 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ) + [Inferior 1 (process 1102373) exited normally] + (gdb) catch syscall 1 + Catchpoint 1 (syscall 'write' [1]) + (gdb) condition 1 write.fd == 1 + (gdb) r + Starting program: /tmp/hello.x + Error in testing condition for breakpoint 1: + Attempt to extract a component of a value that is not a structure. + + Catchpoint 1 (call to syscall write), 0x00007ffff7eb94a7 in write () + from /lib64/libc.so.6 + (gdb) ptype write + type = () + (gdb) + +Notice we get the error now when the condition fails to evaluate. +This seems reasonable given that 'write' will be a function, and +indeed the final 'ptype' shows that it's a function, not a struct. + +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29960 + +Reviewed-By: Tom de Vries + +diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c +--- a/gdb/breakpoint.c ++++ b/gdb/breakpoint.c +@@ -8146,6 +8146,60 @@ catchpoint::catchpoint (struct gdbarch *gdbarch, bool temp, + pspace = current_program_space; + } + ++/* See breakpoint.h. */ ++ ++void ++catchpoint::re_set () ++{ ++ /* All catchpoints are associated with a specific program_space. */ ++ gdb_assert (pspace != nullptr); ++ ++ /* Catchpoints have a single dummy location. */ ++ gdb_assert (locations ().size () == 1); ++ bp_location &bl = m_locations.front (); ++ ++ if (cond_string == nullptr) ++ { ++ /* It shouldn't be possible to have a parsed condition expression ++ cached on this location if the catchpoint doesn't have a condition ++ string set. */ ++ gdb_assert (bl.cond == nullptr); ++ ++ /* Nothing to re-compute, and the catchpoint cannot change. */ ++ return; ++ } ++ ++ bool previous_disabled_by_cond = bl.disabled_by_cond; ++ ++ /* Start by marking the location disabled and discarding the previously ++ computed condition expression. Now if we get an exception, even if ++ it's a quit exception, we'll leave the location disabled and there ++ will be no (possibly invalid) expression cached. */ ++ bl.disabled_by_cond = true; ++ bl.cond = nullptr; ++ ++ const char *s = cond_string.get (); ++ try ++ { ++ switch_to_program_space_and_thread (pspace); ++ ++ bl.cond = parse_exp_1 (&s, bl.address, block_for_pc (bl.address), ++ nullptr); ++ bl.disabled_by_cond = false; ++ } ++ catch (const gdb_exception_error &e) ++ { ++ /* Any exception thrown must be from either the parse_exp_1 or ++ earlier in the try block. As such the following two asserts ++ should be true. */ ++ gdb_assert (bl.disabled_by_cond); ++ gdb_assert (bl.cond == nullptr); ++ } ++ ++ if (previous_disabled_by_cond != bl.disabled_by_cond) ++ notify_breakpoint_modified (this); ++} ++ + /* Notify interpreters and observers that breakpoint B was created. */ + + static void +diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h +--- a/gdb/breakpoint.h ++++ b/gdb/breakpoint.h +@@ -702,11 +702,10 @@ struct breakpoint : public intrusive_list_node + + /* Reevaluate a breakpoint. This is necessary after symbols change + (e.g., an executable or DSO was loaded, or the inferior just +- started). */ +- virtual void re_set () +- { +- /* Nothing to re-set. */ +- } ++ started). This is pure virtual as, at a minimum, each sub-class must ++ recompute any cached condition expressions based off of the ++ cond_string member variable. */ ++ virtual void re_set () = 0; + + /* Insert the breakpoint or watchpoint or activate the catchpoint. + Return 0 for success, 1 if the breakpoint, watchpoint or +@@ -1120,6 +1119,10 @@ struct catchpoint : public breakpoint + catchpoint (struct gdbarch *gdbarch, bool temp, const char *cond_string); + + ~catchpoint () override = 0; ++ ++ /* If the catchpoint has a condition set then recompute the cached ++ expression within the single dummy location. */ ++ void re_set () override; + }; + + +diff --git a/gdb/testsuite/gdb.base/reset-catchpoint-cond-lib.c b/gdb/testsuite/gdb.base/reset-catchpoint-cond-lib.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/reset-catchpoint-cond-lib.c +@@ -0,0 +1,76 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2024 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* This type is used by GDB. */ ++struct lib_type ++{ ++ int a; ++ int b; ++ int c; ++}; ++ ++/* Ensure the type above is used. */ ++volatile struct lib_type global_lib_object = { 1, 2, 3 }; ++ ++/* This pointer is checked by GDB. */ ++volatile void *opaque_ptr = 0; ++ ++void ++lib_func_test_syscall (void) ++{ ++ puts ("Inside library\n"); ++ fflush (stdout); ++} ++ ++static void ++sig_handler (int signo) ++{ ++ /* Nothing. */ ++} ++ ++void ++lib_func_test_signal (void) ++{ ++ signal (SIGUSR1, sig_handler); ++ ++ kill (getpid (), SIGUSR1); ++} ++ ++void ++lib_func_test_fork (void) ++{ ++ pid_t pid = fork (); ++ assert (pid != -1); ++ ++ if (pid == 0) ++ { ++ /* Child: just exit. */ ++ exit (0); ++ } ++ ++ /* Parent. */ ++ waitpid (pid, NULL, 0); ++} +diff --git a/gdb/testsuite/gdb.base/reset-catchpoint-cond.c b/gdb/testsuite/gdb.base/reset-catchpoint-cond.c +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/reset-catchpoint-cond.c +@@ -0,0 +1,50 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2024 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++extern void lib_func_test_syscall (void); ++extern void lib_func_test_signal (void); ++extern void lib_func_test_fork (void); ++ ++/* We use this to perform some filler work. */ ++volatile int global_var = 0; ++ ++/* Just somewhere for GDB to put a breakpoint. */ ++void ++breakpt_before_exit (void) ++{ ++ /* Nothing. */ ++} ++ ++int ++main (void) ++{ ++#if defined TEST_SYSCALL ++ lib_func_test_syscall (); ++#elif defined TEST_SIGNAL ++ lib_func_test_signal (); ++#elif defined TEST_FORK ++ lib_func_test_fork (); ++#else ++# error compile with suitable -DTEST_xxx macro defined ++#endif ++ ++ ++global_var; ++ ++ breakpt_before_exit (); ++ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.base/reset-catchpoint-cond.exp b/gdb/testsuite/gdb.base/reset-catchpoint-cond.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/reset-catchpoint-cond.exp +@@ -0,0 +1,169 @@ ++# Copyright 2024 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# Test that the condition for a catchpoint is correctly reset after ++# shared libraries are unloaded, as happens when an inferior is ++# restarted. ++# ++# If this is not done then, when the catchpoint is hit on the second ++# run, we'll evaluate the parsed expression from the first run, which ++# might include references to types owned by the now deleted objfile ++# (for the shared library loaded in the first run). ++# ++# This scripts tests a number of different catchpoint types. Inside ++# GDB these are all sub-classes of the 'catchpoint' type, which is ++# where the fix for the above issue resides, so all catchpoint types ++# should work correctly. ++ ++standard_testfile .c -lib.c ++ ++set libfile $binfile-lib.so ++ ++set pyfile [gdb_remote_download host ${srcdir}/${subdir}/${testfile}.py] ++ ++if {[build_executable "build shared library" $libfile $srcfile2 \ ++ {debug shlib}] == -1} { ++ return ++} ++ ++# Depending on whether or not libc debug info is installed, when we ++# hit a syscall catchpoint inside libc there might be a source line ++# included in the output. ++# ++# This regexp will match an optional line and can be added to the ++# expected catchpoint output to ignore the (possibly missing) source ++# line. ++set libc_src_line_re "(?:\r\n\[^\r\n\]+)?" ++ ++# Check the Python bp_modified_list and then reset the list back to ++# empty. TESTNAME is just a string. BP_NUM is a list of breakpoint ++# numbers that are expected to appear (in the given order) in the ++# bp_modified_list. ++ ++proc check_modified_bp_list { testname bp_num } { ++ if { [allow_python_tests] } { ++ set expected [join $bp_num ", "] ++ ++ gdb_test "python print(bp_modified_list)" "\\\[$expected\\\]" \ ++ $testname ++ gdb_test_no_output -nopass "python bp_modified_list=\[\]" \ ++ "reset bp_modified_list after $testname" ++ } ++} ++ ++# Build an executable and run tests on 'catch MODE'. ++ ++proc run_test { mode } { ++ set exec_name ${::binfile}-${mode} ++ ++ set macro TEST_[string toupper $mode] ++ ++ if {[build_executable "build test executable" $exec_name $::srcfile \ ++ [list debug shlib=$::libfile additional_flags=-D${macro}]] == -1} { ++ return ++ } ++ ++ clean_restart $exec_name ++ gdb_load_shlib $::libfile ++ ++ if {![runto_main]} { ++ return ++ } ++ ++ if { $mode eq "syscall" } { ++ gdb_test "catch syscall write" \ ++ "Catchpoint $::decimal \\(syscall 'write' \[^)\]+\\)" ++ set catch_re "call to syscall write" ++ } elseif { $mode eq "signal" } { ++ gdb_test "catch signal SIGUSR1" \ ++ "Catchpoint $::decimal \\(signal SIGUSR1\\)" ++ set catch_re "signal SIGUSR1" ++ } elseif { $mode eq "fork" } { ++ gdb_test "catch fork" \ ++ "Catchpoint $::decimal \\(fork\\)" ++ set catch_re "forked process $::decimal" ++ } else { ++ error "unknown mode $mode" ++ } ++ set cp_num [get_integer_valueof "\$bpnum" "*UNKNOWN*"] ++ ++ gdb_breakpoint "breakpt_before_exit" ++ ++ gdb_test "continue" \ ++ "Catchpoint ${cp_num} \[^\r\n\]+$::libc_src_line_re" ++ ++ if { [allow_python_tests] } { ++ gdb_test_no_output "source $::pyfile" "import python scripts" ++ check_modified_bp_list \ ++ "check b/p modified observer has not yet triggered" {} ++ } ++ ++ with_test_prefix "with false condition" { ++ gdb_test_no_output "condition $cp_num ((struct lib_type *) opaque_ptr) != 0" \ ++ "set catchpoint condition" ++ ++ check_modified_bp_list \ ++ "catchpoint modified once by setting condition" \ ++ [list $cp_num] ++ ++ gdb_run_cmd ++ gdb_test "" [multi_line \ ++ "Breakpoint $::decimal, main \\(\\) \[^\r\n\]+" \ ++ "$::decimal\\s+\[^\r\n\]+"] ++ ++ check_modified_bp_list "catchpoint modified twice at startup" \ ++ [list $cp_num $cp_num "$::decimal"] ++ ++ gdb_test "continue" \ ++ [multi_line \ ++ "Breakpoint $::decimal, breakpt_before_exit \\(\\) at \[^\r\n\]+" \ ++ "$::decimal\\s+\[^\r\n\]+"] \ ++ "continue to breakpt_before_exit" ++ } ++ ++ # Check the bp_modified_list against '.*'. We don't care at this ++ # point what's in the list (nothing relevant has happened since we ++ # last checked), but this has the side effect of clearing the list. ++ check_modified_bp_list "clear bp modified list" { .* } ++ ++ with_test_prefix "with true condition" { ++ gdb_test_no_output "condition $cp_num ((struct lib_type *) opaque_ptr) == 0" \ ++ "set catchpoint condition" ++ ++ check_modified_bp_list \ ++ "catchpoint modified once by setting condition" \ ++ [list $cp_num] ++ ++ gdb_run_cmd ++ gdb_test "" [multi_line \ ++ "Breakpoint $::decimal, main \\(\\) \[^\r\n\]+" \ ++ "$::decimal\\s+\[^\r\n\]+"] ++ ++ check_modified_bp_list "catchpoint modified twice at startup" \ ++ [list $cp_num $cp_num "$::decimal"] ++ ++ gdb_test "continue" \ ++ "Catchpoint $cp_num \\($catch_re\\), \[^\r\n\]+$::libc_src_line_re" \ ++ "continue until catchpoint hit" ++ ++ check_modified_bp_list "catchpoint modified again when hit" \ ++ [list $cp_num] ++ } ++} ++ ++# Run the tests. ++foreach_with_prefix mode { syscall signal fork } { ++ run_test $mode ++} +diff --git a/gdb/testsuite/gdb.base/reset-catchpoint-cond.py b/gdb/testsuite/gdb.base/reset-catchpoint-cond.py +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/reset-catchpoint-cond.py +@@ -0,0 +1,21 @@ ++# Copyright (C) 2024 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++bp_modified_list = [] ++ ++def bp_modified(bp): ++ bp_modified_list.append (bp.number) ++ ++gdb.events.breakpoint_modified.connect(bp_modified) diff --git a/gdb.changes b/gdb.changes index 5f64c31..033398b 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jan 30 15:31:30 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ 4b0a2e1. +- Patches added: + * gdb-catchpoint-re-set.patch + ------------------------------------------------------------------- Thu Jan 30 15:25:52 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 06172bc..71d8298 100644 --- a/gdb.spec +++ b/gdb.spec @@ -190,6 +190,7 @@ Patch21: gdb-rhbz1149205-catch-syscall-after-fork-test.patch Patch22: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch Patch23: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch Patch26: gdb-add-rpm-suggestion-script.patch +Patch27: gdb-catchpoint-re-set.patch #Fedora Packages end # Fedora patches fixup @@ -616,6 +617,7 @@ find -name "*.info*"|xargs rm -f %patch -P 22 -p1 %patch -P 23 -p1 %patch -P 26 -p1 +%patch -P 27 -p1 #Fedora patching end %patch -P 1004 -p1 From dda65804ef3186d55b0c964bbb6b115fff7ae0c3dcf9acd5b3c8e0163b416300 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 31 Jan 2025 17:36:56 +0000 Subject: [PATCH 26/34] - Update to fedora rawhide @ 926c064 (gdb 15.2). - Patches dropped: * gdb-6.5-section-num-fixup-test.patch * gdb-rhbz1007614-memleak-infpy_read_memory-test.patch - Maintenance script qa-local.sh: * Update version to 15.2. OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=431 --- gdb-15.1.tar.bz2 | 3 - gdb-15.2.tar.bz2 | 3 + gdb-6.5-section-num-fixup-test.patch | 127 ------------- ...07614-memleak-infpy_read_memory-test.patch | 174 ------------------ gdb.changes | 10 + gdb.spec | 36 ++-- qa-local.sh | 2 +- 7 files changed, 30 insertions(+), 325 deletions(-) delete mode 100644 gdb-15.1.tar.bz2 create mode 100644 gdb-15.2.tar.bz2 delete mode 100644 gdb-6.5-section-num-fixup-test.patch delete mode 100644 gdb-rhbz1007614-memleak-infpy_read_memory-test.patch diff --git a/gdb-15.1.tar.bz2 b/gdb-15.1.tar.bz2 deleted file mode 100644 index 172cb96..0000000 --- a/gdb-15.1.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:21b05dad63d20bebec2c89505c40402f1bee509b732b2521bbb9723c2334d1d7 -size 32257814 diff --git a/gdb-15.2.tar.bz2 b/gdb-15.2.tar.bz2 new file mode 100644 index 0000000..6bcc2a0 --- /dev/null +++ b/gdb-15.2.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:843d09d5a24cbf7b75ee26016ba7f5428b35172e4479fcdbeb55f49e19443b5d +size 32259376 diff --git a/gdb-6.5-section-num-fixup-test.patch b/gdb-6.5-section-num-fixup-test.patch deleted file mode 100644 index 3382769..0000000 --- a/gdb-6.5-section-num-fixup-test.patch +++ /dev/null @@ -1,127 +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-6.5-section-num-fixup-test.patch - -;; Test a crash on libraries missing the .text section. -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.base/datalib-lib.c b/gdb/testsuite/gdb.base/datalib-lib.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/datalib-lib.c -@@ -0,0 +1,22 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2008 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@prep.ai.mit.edu */ -+ -+int var; -diff --git a/gdb/testsuite/gdb.base/datalib-main.c b/gdb/testsuite/gdb.base/datalib-main.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/datalib-main.c -@@ -0,0 +1,26 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2008 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@prep.ai.mit.edu */ -+ -+int -+main (void) -+{ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.base/datalib.exp b/gdb/testsuite/gdb.base/datalib.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/datalib.exp -@@ -0,0 +1,56 @@ -+# Copyright 2008 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ -+if {[use_gdb_stub]} { -+ untested "skipping test because of use_gdb_stub" -+ return -1 -+} -+ -+set testfile datalib -+set srcfilemain ${testfile}-main.c -+set srcfilelib ${testfile}-lib.c -+set libfile [standard_output_file ${testfile}-lib.so] -+set binfile [standard_output_file ${testfile}-main] -+if { [gdb_compile "${srcdir}/${subdir}/${srcfilelib}" "${libfile}" executable [list debug {additional_flags=-shared -nostdlib}]] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+if { [gdb_compile "${srcdir}/${subdir}/${srcfilemain}" "${binfile} ${libfile}" executable {debug}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+# Get things started. -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+# We must use a separate library as the main executable is compiled to the -+# address 0 by default and it would get fixed up already at the end of -+# INIT_OBJFILE_SECT_INDICES. We also cannot PRELINK it as PRELINK is missing -+# on ia64. The library must be NOSTDLIB as otherwise some stub code would -+# create the `.text' section there. Also DEBUG option is useful as some of -+# the crashes occur in dwarf2read.c. -+ -+# FAIL case: -+# ../../gdb/ia64-tdep.c:2838: internal-error: sect_index_text not initialized -+# A problem internal to GDB has been detected, -+ -+gdb_test "start" \ -+ "main \\(\\) at .*${srcfilemain}.*" \ -+ "start" diff --git a/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch b/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch deleted file mode 100644 index 5e40eaf..0000000 --- a/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +++ /dev/null @@ -1,174 +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-rhbz1007614-memleak-infpy_read_memory-test.patch - -;; Fix 'memory leak in infpy_read_memory()' (RH BZ 1007614) -;;=fedoratest - -Original message by Tom Tromey: - - - Message-ID: <871uoc1va3.fsf@fleche.redhat.com> - -Comment from Sergio Durigan Junior: - - In order to correctly test this patch, I wrote a testcase based on Jan - Kratochvil's . The - testcase, which can be seen below, tests GDB in order to see if the - amount of memory being leaked is minimal, as requested in the bugzilla. - It is hard to define what "minimum" is, so I ran the testcase on all - supported RHEL architectures and came up with an average. - -commit cc0265cdda9dc7e8665e8bfcf5b4477489daf27c -Author: Tom Tromey -Date: Wed Mar 28 17:38:08 2012 +0000 - - * python/py-inferior.c (infpy_read_memory): Remove cleanups and - explicitly free 'buffer' on exit paths. Decref 'membuf_object' - before returning. - -diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c -@@ -0,0 +1,27 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2014 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+static struct x -+ { -+ char unsigned u[4096]; -+ } x, *px = &x; -+ -+int -+main (int argc, char *argv[]) -+{ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp -@@ -0,0 +1,72 @@ -+# 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 . -+ -+load_lib gdb-python.exp -+ -+require allow_python_tests -+ -+set testfile py-gdb-rhbz1007614-memleak-infpy_read_memory -+set srcfile ${testfile}.c -+set binfile [standard_output_file ${testfile}] -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { -+ return -1 -+} -+ -+set pid_of_gdb [exp_pid -i [board_info host fileid]] -+ -+proc memory_v_pages_get {} { -+ global pid_of_gdb -+ set fd [open "/proc/$pid_of_gdb/statm"] -+ gets $fd line -+ close $fd -+ # number of pages of virtual memory -+ scan $line "%d" drs -+ return $drs -+} -+ -+if { ![runto_main] } { -+ untested $testfile.exp -+ return -1 -+} -+ -+set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py] -+ -+gdb_test "source ${remote_python_file}" "" -+ -+gdb_test "hello-world" "" \ -+ "first hello-world test" -+ -+set kbytes_before [memory_v_pages_get] -+verbose -log "kbytes_before = $kbytes_before" -+ -+gdb_test "hello-world" "" \ -+ "second hello-world test" -+ -+set kbytes_after [memory_v_pages_get] -+verbose -log "kbytes_after = $kbytes_after" -+ -+set kbytes_diff [expr $kbytes_after - $kbytes_before] -+verbose -log "kbytes_diff = $kbytes_diff" -+ -+# The value "1000" was calculated by running a few GDB sessions with this -+# testcase, and seeing how much (in average) the memory consumption -+# increased after the "hello-world" command issued above. The average -+# was around 500 bytes, so I chose 1000 as a high estimate. -+if { $kbytes_diff > 1000 } { -+ fail "there is a memory leak on GDB (RHBZ 1007614)" -+} else { -+ pass "there is not a memory leak on GDB (RHBZ 1007614)" -+} -diff --git a/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py -@@ -0,0 +1,30 @@ -+# Copyright (C) 2014 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+class HelloWorld (gdb.Command): -+ """Greet the whole world.""" -+ -+ def __init__ (self): -+ super (HelloWorld, self).__init__ ("hello-world", -+ gdb.COMMAND_OBSCURE) -+ -+ def invoke (self, arg, from_tty): -+ px = gdb.parse_and_eval("px") -+ core = gdb.inferiors()[0] -+ for i in range(256 * 1024): -+ chunk = core.read_memory(px, 4096) -+ print "Hello, World!" -+ -+HelloWorld () diff --git a/gdb.changes b/gdb.changes index 033398b..bb0b515 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Fri Jan 31 15:07:27 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ 926c064 (gdb 15.2). +- Patches dropped: + * gdb-6.5-section-num-fixup-test.patch + * gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +- Maintenance script qa-local.sh: + * Update version to 15.2. + ------------------------------------------------------------------- Thu Jan 30 15:31:30 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 71d8298..08e1c88 100644 --- a/gdb.spec +++ b/gdb.spec @@ -69,7 +69,7 @@ Group: Development/Languages/C and C++ %endif Name: gdb%{name_suffix} -Version: 15.1 +Version: 15.2 Release: 0 # The release always contains a leading reserved number, start it at 1. @@ -179,18 +179,16 @@ Patch7: gdb-6.6-buildid-locate.patch Patch8: gdb-6.6-buildid-locate-solib-missing-ids.patch Patch9: gdb-6.5-gcore-buffer-limit-test.patch Patch10: gdb-6.3-mapping-zero-inode-test.patch -Patch11: gdb-6.5-section-num-fixup-test.patch -Patch13: gdb-simultaneous-step-resume-breakpoint-test.patch -Patch14: gdb-archer-next-over-throw-cxx-exec.patch -Patch15: gdb-test-bt-cfi-without-die.patch -Patch16: gdb-test-dw2-aranges.patch -Patch17: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch18: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch -Patch21: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -Patch22: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -Patch23: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch26: gdb-add-rpm-suggestion-script.patch -Patch27: gdb-catchpoint-re-set.patch +Patch12: gdb-simultaneous-step-resume-breakpoint-test.patch +Patch13: gdb-archer-next-over-throw-cxx-exec.patch +Patch14: gdb-test-bt-cfi-without-die.patch +Patch15: gdb-test-dw2-aranges.patch +Patch16: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch19: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch20: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch21: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch24: gdb-add-rpm-suggestion-script.patch +Patch25: gdb-catchpoint-re-set.patch #Fedora Packages end # Fedora patches fixup @@ -606,18 +604,16 @@ find -name "*.info*"|xargs rm -f %patch -P 8 -p1 %patch -P 9 -p1 %patch -P 10 -p1 -%patch -P 11 -p1 +%patch -P 12 -p1 %patch -P 13 -p1 %patch -P 14 -p1 %patch -P 15 -p1 %patch -P 16 -p1 -%patch -P 17 -p1 -%patch -P 18 -p1 +%patch -P 19 -p1 +%patch -P 20 -p1 %patch -P 21 -p1 -%patch -P 22 -p1 -%patch -P 23 -p1 -%patch -P 26 -p1 -%patch -P 27 -p1 +%patch -P 24 -p1 +%patch -P 25 -p1 #Fedora patching end %patch -P 1004 -p1 diff --git a/qa-local.sh b/qa-local.sh index 307d0ee..9e91ddd 100644 --- a/qa-local.sh +++ b/qa-local.sh @@ -20,7 +20,7 @@ SLFO archs="x86_64 i586" -version=15.1 +version=15.2 usage () { From cad97b34fded3d253dd8c67264bf285f701d630dee5460e3565456df44639f36 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 6 Feb 2025 08:01:43 +0000 Subject: [PATCH 27/34] - Update to fedora rawhide @ 2294280. - Patches dropped: * gdb-simultaneous-step-resume-breakpoint-test.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=432 --- ...ltaneous-step-resume-breakpoint-test.patch | 162 ------------------ gdb.changes | 7 + gdb.spec | 24 ++- 3 files changed, 18 insertions(+), 175 deletions(-) delete mode 100644 gdb-simultaneous-step-resume-breakpoint-test.patch diff --git a/gdb-simultaneous-step-resume-breakpoint-test.patch b/gdb-simultaneous-step-resume-breakpoint-test.patch deleted file mode 100644 index ad4a1f2..0000000 --- a/gdb-simultaneous-step-resume-breakpoint-test.patch +++ /dev/null @@ -1,162 +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-simultaneous-step-resume-breakpoint-test.patch - -;; New test for step-resume breakpoint placed in multiple threads at once. -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c -@@ -0,0 +1,79 @@ -+/* Copyright 2009 Free Software Foundation, Inc. -+ -+ Written by Fred Fish of Cygnus Support -+ Contributed by Cygnus Support -+ -+ This file is part of GDB. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+/* Test multiple threads stepping into a .debug_line-less function with -+ a breakpoint placed on its return-to-caller point. */ -+ -+#include -+#include -+#include -+#include -+#include -+ -+#define THREADS 3 -+ -+static void * -+func (void *unused) -+{ -+ int i; -+ -+ errno = 0; -+ i = 0xdeadf00d; -+ i = sleep (THREADS); /* sleep-call */ -+ if (errno != 0) /* sleep-after */ -+ perror ("sleep"); -+ -+ /* The GDB bug with forgotten step-resume breakpoint could leave stale -+ breakpoint on the I assignment making it a nop. */ -+ if (i == 0xdeadf00d) -+ assert (0); -+ -+ assert (i == 0); -+ -+ pthread_exit (NULL); -+} -+ -+int -+main (void) -+{ -+ pthread_t threads[THREADS]; -+ int threadi; -+ -+ for (threadi = 0; threadi < THREADS; threadi++) -+ { -+ int i; -+ -+ i = pthread_create (&threads[threadi], NULL, func, NULL); -+ assert (i == 0); -+ -+ i = sleep (1); -+ assert (i == 0); -+ } -+ -+ for (threadi = 0; threadi < THREADS; threadi++) -+ { -+ int i; -+ -+ i = pthread_join (threads[threadi], NULL); -+ assert (i == 0); -+ } -+ -+ return 0; /* final-exit */ -+} -diff --git a/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp -@@ -0,0 +1,65 @@ -+# Copyright (C) 2009 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . */ -+ -+# Test multiple threads stepping into a .debug_line-less function with -+# a breakpoint placed on its return-to-caller point. -+ -+set testfile simultaneous-step-resume-breakpoint -+set srcfile ${testfile}.c -+set binfile [standard_output_file ${testfile}] -+ -+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+ -+# Ensure we have no debuginfo for the `sleep' call itself (=for libc). -+gdb_test "set debug-file-directory /DoesNotExist" -+ -+gdb_load ${binfile} -+if ![runto_main] { -+ return -1 -+} -+ -+# Red Hat vendor patch does set it to "step" by default. -+gdb_test "set scheduler-locking off" -+ -+gdb_breakpoint [gdb_get_line_number "final-exit"] -+ -+gdb_breakpoint [gdb_get_line_number "sleep-call"] -+gdb_continue_to_breakpoint "sleep-call" -+ -+gdb_test "step" "sleep-call.*" "step thread 1" -+gdb_test "step" "sleep-call.*" "step thread 2" -+gdb_test "step" "sleep-after.*" "step thread 3" -+ -+set test "first continue" -+gdb_test_multiple "continue" $test { -+ -re "final-exit.*$gdb_prompt $" { -+ # gdb-7.0. -+ pass $test -+ return -+ } -+ -re "sleep-after.*$gdb_prompt $" { -+ # Fedora/RHEL branch. -+ pass $test -+ } -+} -+ -+gdb_test "continue" "sleep-after.*" "second continue" -+gdb_test "continue" "final-exit.*" "third continue" diff --git a/gdb.changes b/gdb.changes index bb0b515..86226bd 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Feb 6 07:59:02 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ 2294280. +- Patches dropped: + * gdb-simultaneous-step-resume-breakpoint-test.patch + ------------------------------------------------------------------- Fri Jan 31 15:07:27 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 08e1c88..333db82 100644 --- a/gdb.spec +++ b/gdb.spec @@ -179,16 +179,15 @@ Patch7: gdb-6.6-buildid-locate.patch Patch8: gdb-6.6-buildid-locate-solib-missing-ids.patch Patch9: gdb-6.5-gcore-buffer-limit-test.patch Patch10: gdb-6.3-mapping-zero-inode-test.patch -Patch12: gdb-simultaneous-step-resume-breakpoint-test.patch -Patch13: gdb-archer-next-over-throw-cxx-exec.patch -Patch14: gdb-test-bt-cfi-without-die.patch -Patch15: gdb-test-dw2-aranges.patch -Patch16: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch19: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -Patch20: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -Patch21: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch24: gdb-add-rpm-suggestion-script.patch -Patch25: gdb-catchpoint-re-set.patch +Patch12: gdb-archer-next-over-throw-cxx-exec.patch +Patch13: gdb-test-bt-cfi-without-die.patch +Patch14: gdb-test-dw2-aranges.patch +Patch15: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch18: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch19: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch20: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch23: gdb-add-rpm-suggestion-script.patch +Patch24: gdb-catchpoint-re-set.patch #Fedora Packages end # Fedora patches fixup @@ -608,12 +607,11 @@ find -name "*.info*"|xargs rm -f %patch -P 13 -p1 %patch -P 14 -p1 %patch -P 15 -p1 -%patch -P 16 -p1 +%patch -P 18 -p1 %patch -P 19 -p1 %patch -P 20 -p1 -%patch -P 21 -p1 +%patch -P 23 -p1 %patch -P 24 -p1 -%patch -P 25 -p1 #Fedora patching end %patch -P 1004 -p1 From cced140f8c1daba9b6f90f8adefdf7b89c09cd0330d311c9e41bdd83f5403fe3 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 6 Feb 2025 08:07:24 +0000 Subject: [PATCH 28/34] - Update to fedora rawhide @ 7c66c1c. - Patches dropped: * gdb-6.6-testsuite-timeouts.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=433 --- gdb-6.6-testsuite-timeouts.patch | 32 --------------------------- gdb.changes | 7 ++++++ gdb.spec | 38 +++++++++++++++----------------- 3 files changed, 25 insertions(+), 52 deletions(-) delete mode 100644 gdb-6.6-testsuite-timeouts.patch diff --git a/gdb-6.6-testsuite-timeouts.patch b/gdb-6.6-testsuite-timeouts.patch deleted file mode 100644 index 64102fa..0000000 --- a/gdb-6.6-testsuite-timeouts.patch +++ /dev/null @@ -1,32 +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-6.6-testsuite-timeouts.patch - -;; Avoid too long timeouts on failing cases of "annota1.exp annota3.exp". -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp ---- a/gdb/testsuite/gdb.base/annota1.exp -+++ b/gdb/testsuite/gdb.base/annota1.exp -@@ -37,6 +37,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb - - clean_restart ${binfile} - -+gdb_test "set breakpoint pending off" "" "Avoid lockup on nonexisting functions" -+ - # The commands we test here produce many lines of output; disable "press - # to continue" prompts. - gdb_test_no_output "set height 0" -diff --git a/gdb/testsuite/gdb.base/annota3.exp b/gdb/testsuite/gdb.base/annota3.exp ---- a/gdb/testsuite/gdb.base/annota3.exp -+++ b/gdb/testsuite/gdb.base/annota3.exp -@@ -36,6 +36,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb - - clean_restart ${binfile} - -+gdb_test "set breakpoint pending off" "" "Avoid lockup on nonexisting functions" -+ - # The commands we test here produce many lines of output; disable "press - # to continue" prompts. - gdb_test_no_output "set height 0" diff --git a/gdb.changes b/gdb.changes index 86226bd..b53a5e8 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Feb 6 08:04:34 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ 7c66c1c. +- Patches dropped: + * gdb-6.6-testsuite-timeouts.patch + ------------------------------------------------------------------- Thu Feb 6 07:59:02 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 333db82..4c1c918 100644 --- a/gdb.spec +++ b/gdb.spec @@ -172,22 +172,21 @@ NoSource: 20 #Fedora Packages begin Patch2: gdb-6.3-gstack-20050411.patch Patch3: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch -Patch4: gdb-6.6-testsuite-timeouts.patch -Patch5: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch -Patch6: gdb-6.5-bz243845-stale-testing-zombie-test.patch -Patch7: gdb-6.6-buildid-locate.patch -Patch8: gdb-6.6-buildid-locate-solib-missing-ids.patch -Patch9: gdb-6.5-gcore-buffer-limit-test.patch -Patch10: gdb-6.3-mapping-zero-inode-test.patch -Patch12: gdb-archer-next-over-throw-cxx-exec.patch -Patch13: gdb-test-bt-cfi-without-die.patch -Patch14: gdb-test-dw2-aranges.patch -Patch15: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch18: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -Patch19: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -Patch20: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch23: gdb-add-rpm-suggestion-script.patch -Patch24: gdb-catchpoint-re-set.patch +Patch4: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch +Patch5: gdb-6.5-bz243845-stale-testing-zombie-test.patch +Patch6: gdb-6.6-buildid-locate.patch +Patch7: gdb-6.6-buildid-locate-solib-missing-ids.patch +Patch8: gdb-6.5-gcore-buffer-limit-test.patch +Patch9: gdb-6.3-mapping-zero-inode-test.patch +Patch11: gdb-archer-next-over-throw-cxx-exec.patch +Patch12: gdb-test-bt-cfi-without-die.patch +Patch13: gdb-test-dw2-aranges.patch +Patch14: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch17: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch18: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch19: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch22: gdb-add-rpm-suggestion-script.patch +Patch23: gdb-catchpoint-re-set.patch #Fedora Packages end # Fedora patches fixup @@ -602,16 +601,15 @@ find -name "*.info*"|xargs rm -f %patch -P 7 -p1 %patch -P 8 -p1 %patch -P 9 -p1 -%patch -P 10 -p1 +%patch -P 11 -p1 %patch -P 12 -p1 %patch -P 13 -p1 %patch -P 14 -p1 -%patch -P 15 -p1 +%patch -P 17 -p1 %patch -P 18 -p1 %patch -P 19 -p1 -%patch -P 20 -p1 +%patch -P 22 -p1 %patch -P 23 -p1 -%patch -P 24 -p1 #Fedora patching end %patch -P 1004 -p1 From a41233f7ca10c4793ff4cce70e02122cbbd74cedba44c9e416f7d35932d12bd7 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 6 Feb 2025 08:12:17 +0000 Subject: [PATCH 29/34] - Update to fedora rawhide @ 1116b36. - Patches dropped: * gdb-test-dw2-aranges.patch * fixup-gdb-test-dw2-aranges.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=434 --- fixup-gdb-test-dw2-aranges.patch | 21 --- gdb-test-dw2-aranges.patch | 220 ------------------------------- gdb.changes | 8 ++ gdb.spec | 20 ++- 4 files changed, 16 insertions(+), 253 deletions(-) delete mode 100644 fixup-gdb-test-dw2-aranges.patch delete mode 100644 gdb-test-dw2-aranges.patch diff --git a/fixup-gdb-test-dw2-aranges.patch b/fixup-gdb-test-dw2-aranges.patch deleted file mode 100644 index 6438276..0000000 --- a/fixup-gdb-test-dw2-aranges.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 81a7585502092b3c133534ac6ecb34fd56d05337 Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Thu, 16 Feb 2023 12:56:41 +0100 -Subject: [PATCH 09/11] fixup gdb-test-dw2-aranges.patch - ---- - gdb/testsuite/gdb.dwarf2/dw2-aranges.S | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.S b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S -index d5b9ca5a3c6..b811f6644cb 100644 ---- a/gdb/testsuite/gdb.dwarf2/dw2-aranges.S -+++ b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S -@@ -138,3 +138,4 @@ main: - .byte 0 /* aranges segment_size */ - - .Laranges_end: -+ .section .note.GNU-stack,"",@progbits --- -2.35.3 - diff --git a/gdb-test-dw2-aranges.patch b/gdb-test-dw2-aranges.patch deleted file mode 100644 index d88d3f4..0000000 --- a/gdb-test-dw2-aranges.patch +++ /dev/null @@ -1,220 +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-test-dw2-aranges.patch - -;; [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp. -;;=fedoratest - -[archer-tromey-delayed-symfile] - -commit 77fa7778a37b0d28a7e4e5235f074a10ecf1815d -Author: Jan Kratochvil -Date: Sat Aug 15 15:05:54 2009 +0200 - - Test for "handle incorrect aranges". - - readelf: - Contents of the .debug_aranges section: - - Length: 8 - Version: 2 - Offset into .debug_info: 0x0 - Pointer Size: 0 - Segment Size: 0 - - Address Length - Floating point exception - - * gdb.dwarf2/dw2-aranges.exp, gdb.dwarf2/dw2-aranges.S: New files. - -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.S b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S -@@ -0,0 +1,140 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2004, 2007, 2008, 2009 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+/* Test .debug_aranges containing zero address_size. */ -+ -+/* Dummy function to provide debug information for. */ -+ -+ .text -+.Lbegin_text1: -+ .globl main -+ .type main, %function -+main: -+.Lbegin_main: -+ .int 0 -+.Lend_main: -+ .size main, .-main -+.Lend_text1: -+ -+/* Debug information */ -+ -+ .section .debug_info -+.Lcu1_begin: -+ /* CU header */ -+ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */ -+.Lcu1_start: -+ .2byte 2 /* DWARF Version */ -+ .4byte .Labbrev1_begin /* Offset into abbrev section */ -+ .byte 4 /* Pointer size */ -+ -+ /* CU die */ -+ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */ -+ .4byte .Lend_text1 /* DW_AT_high_pc */ -+ .4byte .Lbegin_text1 /* DW_AT_low_pc */ -+ .ascii "file1.txt\0" /* DW_AT_name */ -+ .ascii "GNU C 3.3.3\0" /* DW_AT_producer */ -+ .byte 1 /* DW_AT_language (C) */ -+ -+ /* main */ -+ .uleb128 2 /* Abbrev: DW_TAG_subprogram */ -+ .byte 1 /* DW_AT_external */ -+ .byte 1 /* DW_AT_decl_file */ -+ .byte 2 /* DW_AT_decl_line */ -+ .ascii "main\0" /* DW_AT_name */ -+ .4byte .Ltype_int-.Lcu1_begin /* DW_AT_type */ -+ .4byte .Lbegin_main /* DW_AT_low_pc */ -+ .4byte .Lend_main /* DW_AT_high_pc */ -+ .byte 1 /* DW_AT_frame_base: length */ -+ .byte 0x55 /* DW_AT_frame_base: DW_OP_reg5 */ -+ -+.Ltype_int: -+ .uleb128 3 /* Abbrev: DW_TAG_base_type */ -+ .ascii "int\0" /* DW_AT_name */ -+ .byte 4 /* DW_AT_byte_size */ -+ .byte 5 /* DW_AT_encoding */ -+ -+ .byte 0 /* End of children of CU */ -+ -+.Lcu1_end: -+ -+/* Abbrev table */ -+ .section .debug_abbrev -+.Labbrev1_begin: -+ .uleb128 1 /* Abbrev code */ -+ .uleb128 0x11 /* DW_TAG_compile_unit */ -+ .byte 1 /* has_children */ -+ .uleb128 0x12 /* DW_AT_high_pc */ -+ .uleb128 0x1 /* DW_FORM_addr */ -+ .uleb128 0x11 /* DW_AT_low_pc */ -+ .uleb128 0x1 /* DW_FORM_addr */ -+ .uleb128 0x3 /* DW_AT_name */ -+ .uleb128 0x8 /* DW_FORM_string */ -+ .uleb128 0x25 /* DW_AT_producer */ -+ .uleb128 0x8 /* DW_FORM_string */ -+ .uleb128 0x13 /* DW_AT_language */ -+ .uleb128 0xb /* DW_FORM_data1 */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .uleb128 2 /* Abbrev code */ -+ .uleb128 0x2e /* DW_TAG_subprogram */ -+ .byte 0 /* has_children */ -+ .uleb128 0x3f /* DW_AT_external */ -+ .uleb128 0xc /* DW_FORM_flag */ -+ .uleb128 0x3a /* DW_AT_decl_file */ -+ .uleb128 0xb /* DW_FORM_data1 */ -+ .uleb128 0x3b /* DW_AT_decl_line */ -+ .uleb128 0xb /* DW_FORM_data1 */ -+ .uleb128 0x3 /* DW_AT_name */ -+ .uleb128 0x8 /* DW_FORM_string */ -+ .uleb128 0x49 /* DW_AT_type */ -+ .uleb128 0x13 /* DW_FORM_ref4 */ -+ .uleb128 0x11 /* DW_AT_low_pc */ -+ .uleb128 0x1 /* DW_FORM_addr */ -+ .uleb128 0x12 /* DW_AT_high_pc */ -+ .uleb128 0x1 /* DW_FORM_addr */ -+ .uleb128 0x40 /* DW_AT_frame_base */ -+ .uleb128 0xa /* DW_FORM_block1 */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .uleb128 3 /* Abbrev code */ -+ .uleb128 0x24 /* DW_TAG_base_type */ -+ .byte 0 /* has_children */ -+ .uleb128 0x3 /* DW_AT_name */ -+ .uleb128 0x8 /* DW_FORM_string */ -+ .uleb128 0xb /* DW_AT_byte_size */ -+ .uleb128 0xb /* DW_FORM_data1 */ -+ .uleb128 0x3e /* DW_AT_encoding */ -+ .uleb128 0xb /* DW_FORM_data1 */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+/* aranges table */ -+ .section .debug_aranges -+ .long .Laranges_end - 1f -+1: -+ .2byte 2 /* aranges Version */ -+ .4byte .Lcu1_begin - .debug_info /* Offset into .debug_info section */ -+ /* The GDB crasher is this zero value. */ -+ .byte 0 /* aranges address_size */ -+ .byte 0 /* aranges segment_size */ -+ -+.Laranges_end: -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp b/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp -@@ -0,0 +1,40 @@ -+# Copyright 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# Test .debug_aranges containing zero address_size. -+ -+# This test can only be run on targets which support DWARF-2 and use gas. -+# For now pick a sampling of likely targets. -+if {![istarget *-*-linux*] -+ && ![istarget *-*-gnu*] -+ && ![istarget *-*-elf*] -+ && ![istarget *-*-openbsd*] -+ && ![istarget arm-*-eabi*] -+ && ![istarget powerpc-*-eabi*]} { -+ return 0 -+} -+ -+set testfile "dw2-aranges" -+set srcfile ${testfile}.S -+set binfile [standard_output_file ${testfile}] -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {nodebug}] != "" } { -+ return -1 -+} -+ -+clean_restart $testfile -+ -+# Failed gdb_load would abort the testcase execution earlier. -+pass "file loaded" diff --git a/gdb.changes b/gdb.changes index b53a5e8..af2785b 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Feb 6 08:08:52 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ 1116b36. +- Patches dropped: + * gdb-test-dw2-aranges.patch + * fixup-gdb-test-dw2-aranges.patch + ------------------------------------------------------------------- Thu Feb 6 08:04:34 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 4c1c918..5292b6d 100644 --- a/gdb.spec +++ b/gdb.spec @@ -180,13 +180,12 @@ Patch8: gdb-6.5-gcore-buffer-limit-test.patch Patch9: gdb-6.3-mapping-zero-inode-test.patch Patch11: gdb-archer-next-over-throw-cxx-exec.patch Patch12: gdb-test-bt-cfi-without-die.patch -Patch13: gdb-test-dw2-aranges.patch -Patch14: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch17: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -Patch18: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -Patch19: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch22: gdb-add-rpm-suggestion-script.patch -Patch23: gdb-catchpoint-re-set.patch +Patch13: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch16: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch17: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch18: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch21: gdb-add-rpm-suggestion-script.patch +Patch22: gdb-catchpoint-re-set.patch #Fedora Packages end # Fedora patches fixup @@ -195,7 +194,6 @@ Patch23: gdb-catchpoint-re-set.patch Patch1004: fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch Patch1005: fixup-gdb-test-bt-cfi-without-die.patch -Patch1007: fixup-gdb-test-dw2-aranges.patch Patch1012: fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch # openSUSE specific @@ -604,17 +602,15 @@ find -name "*.info*"|xargs rm -f %patch -P 11 -p1 %patch -P 12 -p1 %patch -P 13 -p1 -%patch -P 14 -p1 +%patch -P 16 -p1 %patch -P 17 -p1 %patch -P 18 -p1 -%patch -P 19 -p1 +%patch -P 21 -p1 %patch -P 22 -p1 -%patch -P 23 -p1 #Fedora patching end %patch -P 1004 -p1 %patch -P 1005 -p1 -%patch -P 1007 -p1 %patch -P 1012 -p1 %patch -P 1100 -p1 From 3825d1b07bef935978bd0277dbffd18ec1a3b363dee62c880e693f4669d3b8cc Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 6 Feb 2025 08:46:11 +0000 Subject: [PATCH 30/34] - Patches dropped: * gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch * gdb-test-bt-cfi-without-die.patch * fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch * fixup-gdb-test-bt-cfi-without-die.patch - Maintenance script import-fedora.sh: * Add gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch and gdb-test-bt-cfi-without-die.patch to skip_patches. - Update to fedora rawhide @ a2f2e9e. - Patches dropped: * gdb-6.5-bz243845-stale-testing-zombie-test.patch * fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=435 --- ...5-bz243845-stale-testing-zombie-test.patch | 35 --- ...61564-aarch64-hw-watchpoint-test.pat.patch | 43 ---- fixup-gdb-test-bt-cfi-without-die.patch | 38 ---- ...5-bz243845-stale-testing-zombie-test.patch | 89 -------- ...bz1261564-aarch64-hw-watchpoint-test.patch | 104 --------- gdb-test-bt-cfi-without-die.patch | 214 ------------------ gdb.changes | 20 ++ gdb.spec | 40 ++-- import-fedora.sh | 6 +- 9 files changed, 38 insertions(+), 551 deletions(-) delete mode 100644 fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch delete mode 100644 fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch delete mode 100644 fixup-gdb-test-bt-cfi-without-die.patch delete mode 100644 gdb-6.5-bz243845-stale-testing-zombie-test.patch delete mode 100644 gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch delete mode 100644 gdb-test-bt-cfi-without-die.patch diff --git a/fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch b/fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch deleted file mode 100644 index d15ce01..0000000 --- a/fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch +++ /dev/null @@ -1,35 +0,0 @@ -Fixup gdb.base/tracefork-zombie.exp - -Fix ERROR: -... -PASS: gdb.base/tracefork-zombie.exp: attach -ERROR: tcl error sourcing gdb/testsuite/gdb.base/tracefork-zombie.exp. -ERROR: tcl error code POSIX ESRCH {no such process} -ERROR: error reading "file12": no such process - while executing -"read $statusfi" - ("foreach" body line 5) - invoked from within -... - ---- - gdb/testsuite/gdb.base/tracefork-zombie.exp | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/gdb/testsuite/gdb.base/tracefork-zombie.exp b/gdb/testsuite/gdb.base/tracefork-zombie.exp -index 03f790d4c5d..3e2e5517d46 100644 ---- a/gdb/testsuite/gdb.base/tracefork-zombie.exp -+++ b/gdb/testsuite/gdb.base/tracefork-zombie.exp -@@ -58,8 +58,10 @@ foreach procpid [glob -directory /proc -type d {[0-9]*}] { - if {[catch {open $procpid/status} statusfi]} { - continue - } -- set status [read $statusfi] -- close $statusfi -+ if {[catch {read $statusfi} status]} { -+ continue -+ } -+ catch {close $statusfi} - if {1 - && [regexp -line {^Name:\tgdb$} $status] - && [regexp -line {^PPid:\t1$} $status] diff --git a/fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch b/fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch deleted file mode 100644 index 7ee17b2..0000000 --- a/fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch +++ /dev/null @@ -1,43 +0,0 @@ -From e452307ba07f5d798edad73631182e137265da7d Mon Sep 17 00:00:00 2001 -From: Tom de Vries -Date: Tue, 13 Jun 2023 17:58:42 +0200 -Subject: [PATCH 9/9] fixup gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch - ---- - .../rhbz1261564-aarch64-watchpoint.exp | 18 ++++++++++++++---- - 1 file changed, 14 insertions(+), 4 deletions(-) - -diff --git a/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp -index b1cf7115663..42ebc25cc49 100644 ---- a/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp -+++ b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp -@@ -20,12 +20,22 @@ if { [prepare_for_testing rhbz1261564-aarch64-watchpoint.exp "rhbz1261564-aarch6 - if { ! [ runto main ] } then { return 0 } - - set test "rwatch aligned.var4" --if [istarget "s390*-*-*"] { -- gdb_test $test {Target does not support this type of hardware watchpoint\.} -- untested "s390* does not support hw read watchpoint" -+ -+set supported 1 -+gdb_test_multiple $test "" { -+ -re -wrap "Hardware read watchpoint \[0-9\]+: aligned.var4" { -+ pass $gdb_test_name -+ } -+ -re -wrap "Target does not support this type of hardware watchpoint\\." { -+ set supported 0 -+ } -+} -+ -+if { !$supported } { -+ unsupported $test - return - } --gdb_test $test "Hardware read watchpoint \[0-9\]+: aligned.var4" -+ - - proc checkvar { address } { - global gdb_prompt --- -2.35.3 - diff --git a/fixup-gdb-test-bt-cfi-without-die.patch b/fixup-gdb-test-bt-cfi-without-die.patch deleted file mode 100644 index f68da30..0000000 --- a/fixup-gdb-test-bt-cfi-without-die.patch +++ /dev/null @@ -1,38 +0,0 @@ -fixup-gdb-test-bt-cfi-without-die.patch - ---- - gdb/testsuite/gdb.base/cfi-without-die.exp | 13 ++++++++----- - 1 file changed, 8 insertions(+), 5 deletions(-) - -diff --git a/gdb/testsuite/gdb.base/cfi-without-die.exp b/gdb/testsuite/gdb.base/cfi-without-die.exp -index 5880d46f6d2..db1726646f8 100644 ---- a/gdb/testsuite/gdb.base/cfi-without-die.exp -+++ b/gdb/testsuite/gdb.base/cfi-without-die.exp -@@ -37,19 +37,22 @@ if ![runto callback] then { - fail "verify unwinding: Can't run to callback" - return 0 - } --set test "verify unwinding breaks without CFI" --gdb_test_multiple "bt" $test { -+ -+set as_expected 1 -+gdb_test_multiple "bt" "" { - -re " in \[?\]\[?\] .*\r\n$gdb_prompt $" { - # It may backtrace through some random frames even to main(). -- pass $test - } - -re " in main .*\r\n$gdb_prompt $" { -- fail $test -+ set as_expected 0 - } - -re "\r\n$gdb_prompt $" { -- pass $test - } - } -+if { ! $as_expected } { -+ untested ${testfile}.exp -+ return -1 -+} - - if { [gdb_compile "${srcdir}/${subdir}/${srccallerfile}" ${objcallerfile} \ - object [list {additional_flags=-fomit-frame-pointer -funwind-tables -fasynchronous-unwind-tables}]] != "" diff --git a/gdb-6.5-bz243845-stale-testing-zombie-test.patch b/gdb-6.5-bz243845-stale-testing-zombie-test.patch deleted file mode 100644 index 77d274a..0000000 --- a/gdb-6.5-bz243845-stale-testing-zombie-test.patch +++ /dev/null @@ -1,89 +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-6.5-bz243845-stale-testing-zombie-test.patch - -;; Test leftover zombie process (BZ 243845). -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.base/tracefork-zombie.exp b/gdb/testsuite/gdb.base/tracefork-zombie.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/tracefork-zombie.exp -@@ -0,0 +1,76 @@ -+# Copyright 2007 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -+ -+# are we on a target board -+if {[use_gdb_stub]} { -+ untested "skipping test because of use_gdb_stub" -+ return -1 -+} -+ -+# Start the program running and then wait for a bit, to be sure -+# that it can be attached to. -+ -+gdb_exit -+gdb_start -+gdb_load sleep -+ -+set gdb_pid [exp_pid -i [board_info host fileid]] -+set test "identified the child GDB" -+if {$gdb_pid != "" && $gdb_pid > 0} { -+ pass $test -+ verbose -log "Child GDB PID $gdb_pid" -+} else { -+ fail $test -+} -+ -+set testpid [eval exec sleep 10 &] -+exec sleep 2 -+ -+set test "attach" -+gdb_test_multiple "attach $testpid" "$test" { -+ -re "Attaching to program.*`?.*'?, process $testpid..*$gdb_prompt $" { -+ pass "$test" -+ } -+ -re "Attaching to program.*`?.*\.exe'?, process $testpid.*\[Switching to thread $testpid\..*\].*$gdb_prompt $" { -+ # Response expected on Cygwin -+ pass "$test" -+ } -+} -+ -+# Some time to let GDB spawn its testing child. -+exec sleep 2 -+ -+set found none -+foreach procpid [glob -directory /proc -type d {[0-9]*}] { -+ if {[catch {open $procpid/status} statusfi]} { -+ continue -+ } -+ set status [read $statusfi] -+ close $statusfi -+ if {1 -+ && [regexp -line {^Name:\tgdb$} $status] -+ && [regexp -line {^PPid:\t1$} $status] -+ && [regexp -line "^TracerPid:\t$gdb_pid$" $status]} { -+ set found $procpid -+ verbose -log "Found linux_test_for_tracefork zombie PID $procpid" -+ } -+} -+set test "linux_test_for_tracefork leaves no zombie" -+if {$found eq {none}} { -+ pass $test -+} else { -+ fail $test -+} diff --git a/gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch b/gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch deleted file mode 100644 index 3a5e2d4..0000000 --- a/gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +++ /dev/null @@ -1,104 +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-rhbz1261564-aarch64-hw-watchpoint-test.patch - -;; [aarch64] Fix hardware watchpoints (RH BZ 1261564). -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.c -@@ -0,0 +1,33 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2016 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+__attribute__((aligned(16))) struct -+{ -+ int var0, var4, var8; -+} aligned; -+ -+int -+main (void) -+{ -+ aligned.var0 = 1; -+ aligned.var4 = 2; -+ aligned.var8 = 3; -+ -+ aligned.var4 = aligned.var0; -+ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/rhbz1261564-aarch64-watchpoint.exp -@@ -0,0 +1,53 @@ -+# Copyright (C) 2016 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+if { [prepare_for_testing rhbz1261564-aarch64-watchpoint.exp "rhbz1261564-aarch64-watchpoint"] } { -+ return -1 -+} -+ -+if { ! [ runto main ] } then { return 0 } -+ -+set test "rwatch aligned.var4" -+if [istarget "s390*-*-*"] { -+ gdb_test $test {Target does not support this type of hardware watchpoint\.} -+ untested "s390* does not support hw read watchpoint" -+ return -+} -+gdb_test $test "Hardware read watchpoint \[0-9\]+: aligned.var4" -+ -+proc checkvar { address } { -+ global gdb_prompt -+ -+ set test "p &aligned.var$address" -+ gdb_test_multiple $test $test { -+ -re " = \\(int \\*\\) 0x\[0-9a-f\]+$address \r\n$gdb_prompt $" { -+ pass $test -+ } -+ -re "\r\n$gdb_prompt $" { -+ untested "$test (unexpected ELF layout)" -+ return 0 -+ } -+ } -+ return 1 -+} -+if ![checkvar "0"] { return } -+if ![checkvar "4"] { return } -+if ![checkvar "8"] { return } -+ -+# Assumes: PPC_PTRACE_GETHWDBGINFO::data_bp_alignment == 8 -+# 'lwz' does read only 4 bytes but the hw watchpoint is 8 bytes wide. -+setup_xfail "powerpc*-*-*" -+ -+gdb_continue_to_end diff --git a/gdb-test-bt-cfi-without-die.patch b/gdb-test-bt-cfi-without-die.patch deleted file mode 100644 index 29b6bc0..0000000 --- a/gdb-test-bt-cfi-without-die.patch +++ /dev/null @@ -1,214 +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-test-bt-cfi-without-die.patch - -;; [delayed-symfile] Test a backtrace regression on CFIs without DIE (BZ 614604). -;;=fedoratest - -http://sourceware.org/ml/archer/2010-q3/msg00028.html - -On Wed, 25 Feb 2009 00:14:29 +0100, Jan Kratochvil wrote: -> commit 6a37c2b9962258ecf9299cc34a650e64a06acaa5 -> -> There was a regression on gdb.base/savedregs.exp. -> -> quick_addrmap/require_partial_symbols should be used even for the unwind debug -> info checking as its load has been also delayed by this branch. -[...] -> --- a/gdb/dwarf2-frame.c -> +++ b/gdb/dwarf2-frame.c -[...] -> @@ -1499,6 +1500,14 @@ dwarf2_frame_find_fde (CORE_ADDR *pc) -> struct dwarf2_fde *fde; -> CORE_ADDR offset; -> -> + if (objfile->quick_addrmap) -> + { -> + if (!addrmap_find (objfile->quick_addrmap, *pc)) -> + continue; -> + } -> + /* FIXME: Read-in only .debug_frame/.eh_frame without .debug_info? */ -> + require_partial_symbols (objfile); -> + - -but this has caused a different regression (as discussed in the confcall). - -QUICK_ADDRMAP is built only from .debug_aranges. But we can have existing -built .debug_aranges for CUs in OBJFILE but still some CUs do not need to have -DWARF at all while they can feature CFIs (.eh_frame or .debug_frame). -It has been described by Daniel Jacobowitz at: - Re: [2/4] RFC: check psymtabs_addrmap before reading FDEs - http://sourceware.org/ml/gdb-patches/2010-07/msg00012.html - -Sorry for this regression by me (in that fix of a different regression). - -Fixed it the "slow way" as this branch is now obsoleted by .gdb-index. - -No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu. - -Checked-in. - -Thanks, -Jan - -eb8df8566acc1ed963e3e9b77c13b9c2c3db03fb - -Test CFI is parsed even for range (function) not described by any DIE. - -https://bugzilla.redhat.com/show_bug.cgi?id=614028 - -gdb/ - * dwarf2-frame.c (dwarf2_frame_find_fde): Remove the - OBJFILE->QUICK_ADDRMAP check. New comment why. - -gdb/testsuite/ - * gdb.base/cfi-without-die.exp, gdb.base/cfi-without-die-main.c, - gdb.base/cfi-without-die-caller.c: New files. - -diff --git a/gdb/testsuite/gdb.base/cfi-without-die-caller.c b/gdb/testsuite/gdb.base/cfi-without-die-caller.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/cfi-without-die-caller.c -@@ -0,0 +1,28 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+typedef int (*callback_t) (void); -+ -+int -+caller (callback_t callback) -+{ -+ /* Ensure some frame content to push away the return address. */ -+ volatile const long one = 1; -+ -+ /* Modify the return value to prevent any tail-call optimization. */ -+ return (*callback) () - one; -+} -diff --git a/gdb/testsuite/gdb.base/cfi-without-die-main.c b/gdb/testsuite/gdb.base/cfi-without-die-main.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/cfi-without-die-main.c -@@ -0,0 +1,32 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+typedef int (*callback_t) (void); -+ -+extern int caller (callback_t callback); -+ -+int -+callback (void) -+{ -+ return 1; -+} -+ -+int -+main (void) -+{ -+ return caller (callback); -+} -diff --git a/gdb/testsuite/gdb.base/cfi-without-die.exp b/gdb/testsuite/gdb.base/cfi-without-die.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/cfi-without-die.exp -@@ -0,0 +1,71 @@ -+# Copyright 2010 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# Test CFI is parsed even for range (function) not described by any DIE. -+ -+set testfile cfi-without-die -+set srcmainfile ${testfile}-main.c -+set srccallerfile ${testfile}-caller.c -+set executable ${testfile} -+set objmainfile [standard_output_file ${testfile}-main.o] -+set objcallerfile [standard_output_file ${testfile}-caller.o] -+set binfile [standard_output_file ${executable}] -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srccallerfile}" ${objcallerfile} \ -+ object [list {additional_flags=-fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables}]] != "" -+ || [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" ${objmainfile} object {debug}] != "" -+ || [gdb_compile "${objmainfile} ${objcallerfile}" ${binfile} executable {}] != "" } { -+ untested ${testfile}.exp -+ return -1 -+} -+ -+clean_restart $executable -+ -+if ![runto callback] then { -+ fail "verify unwinding: Can't run to callback" -+ return 0 -+} -+set test "verify unwinding breaks without CFI" -+gdb_test_multiple "bt" $test { -+ -re " in \[?\]\[?\] .*\r\n$gdb_prompt $" { -+ # It may backtrace through some random frames even to main(). -+ pass $test -+ } -+ -re " in main .*\r\n$gdb_prompt $" { -+ fail $test -+ } -+ -re "\r\n$gdb_prompt $" { -+ pass $test -+ } -+} -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srccallerfile}" ${objcallerfile} \ -+ object [list {additional_flags=-fomit-frame-pointer -funwind-tables -fasynchronous-unwind-tables}]] != "" -+ || [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" ${objmainfile} object {debug}] != "" -+ || [gdb_compile "${objmainfile} ${objcallerfile}" ${binfile} executable {}] != "" } { -+ untested ${testfile}.exp -+ return -1 -+} -+ -+clean_restart $executable -+ -+if ![runto callback] then { -+ fail "test CFI without DIEs: Can't run to callback" -+ return 0 -+} -+# #0 callback () at ... -+# #1 0x00000000004004e9 in caller () -+# #2 0x00000000004004cd in main () at ... -+gdb_test "bt" "#0 +callback \[^\r\n\]+\r\n#1 \[^\r\n\]+ in caller \[^\r\n\]+\r\n#2 \[^\r\n\]+ in main \[^\r\n\]+" "verify unwindin works for CFI without DIEs" diff --git a/gdb.changes b/gdb.changes index af2785b..69c4ff7 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,23 @@ +------------------------------------------------------------------- +Thu Feb 6 08:35:47 UTC 2025 - Tom de Vries + +- Patches dropped: + * gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch + * gdb-test-bt-cfi-without-die.patch + * fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch + * fixup-gdb-test-bt-cfi-without-die.patch +- Maintenance script import-fedora.sh: + * Add gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch and + gdb-test-bt-cfi-without-die.patch to skip_patches. + +------------------------------------------------------------------- +Thu Feb 6 08:14:25 UTC 2025 - Tom de Vries + +- Update to fedora rawhide @ a2f2e9e. +- Patches dropped: + * gdb-6.5-bz243845-stale-testing-zombie-test.patch + * fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch + ------------------------------------------------------------------- Thu Feb 6 08:08:52 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 5292b6d..6587252 100644 --- a/gdb.spec +++ b/gdb.spec @@ -173,28 +173,23 @@ NoSource: 20 Patch2: gdb-6.3-gstack-20050411.patch Patch3: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch Patch4: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch -Patch5: gdb-6.5-bz243845-stale-testing-zombie-test.patch -Patch6: gdb-6.6-buildid-locate.patch -Patch7: gdb-6.6-buildid-locate-solib-missing-ids.patch -Patch8: gdb-6.5-gcore-buffer-limit-test.patch -Patch9: gdb-6.3-mapping-zero-inode-test.patch -Patch11: gdb-archer-next-over-throw-cxx-exec.patch -Patch12: gdb-test-bt-cfi-without-die.patch -Patch13: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch16: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -Patch17: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -Patch18: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch21: gdb-add-rpm-suggestion-script.patch -Patch22: gdb-catchpoint-re-set.patch +Patch5: gdb-6.6-buildid-locate.patch +Patch6: gdb-6.6-buildid-locate-solib-missing-ids.patch +Patch7: gdb-6.5-gcore-buffer-limit-test.patch +Patch8: gdb-6.3-mapping-zero-inode-test.patch +Patch10: gdb-archer-next-over-throw-cxx-exec.patch +Patch12: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch15: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch16: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch20: gdb-add-rpm-suggestion-script.patch +Patch21: gdb-catchpoint-re-set.patch #Fedora Packages end # Fedora patches fixup # These need a number with at least four digits, otherwise patchlist.pl removes # them when upgrading. -Patch1004: fixup-gdb-6.5-bz243845-stale-testing-zombie-test.patch -Patch1005: fixup-gdb-test-bt-cfi-without-die.patch -Patch1012: fixup-gdb-rhbz1261564-aarch64-hw-watchpoint-test.pat.patch +# # openSUSE specific @@ -598,21 +593,14 @@ find -name "*.info*"|xargs rm -f %patch -P 6 -p1 %patch -P 7 -p1 %patch -P 8 -p1 -%patch -P 9 -p1 -%patch -P 11 -p1 +%patch -P 10 -p1 %patch -P 12 -p1 -%patch -P 13 -p1 +%patch -P 15 -p1 %patch -P 16 -p1 -%patch -P 17 -p1 -%patch -P 18 -p1 +%patch -P 20 -p1 %patch -P 21 -p1 -%patch -P 22 -p1 #Fedora patching end -%patch -P 1004 -p1 -%patch -P 1005 -p1 -%patch -P 1012 -p1 - %patch -P 1100 -p1 %patch -P 1101 -p1 diff --git a/import-fedora.sh b/import-fedora.sh index 65cf374..536f5d0 100644 --- a/import-fedora.sh +++ b/import-fedora.sh @@ -9,9 +9,11 @@ skip_patches=( gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch gdb-6.8-bz466901-backtrace-full-prelinked.patch - # Fragile test-case, requires glibc to fail in a certain way. + # Dropped by fedora. gdb-rhbz1156192-recursive-dlopen-test.patch - + gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch + gdb-test-bt-cfi-without-die.patch + # No longer needed. gdb-remove-use-of-py-isascii ) From 5d7d95a04ba0d049d972cd84639ce4bae5b916ab47aacdf536d1ff52de0dcb84 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 11 Feb 2025 17:54:19 +0000 Subject: [PATCH 31/34] - Maintenance script qa.sh: * Add kfail for PR32678. * Add kfail for missing g++ on SLE-12. * Drop Leap 15.5, add 16.0. * Move PR32167 kfail from kfail_sle12 to kfail, and extend pattern. - Use gcc 11 instead gcc 9 for SLE-12. - Maintenance script qa-local.sh: * Drop Leap 15.5, add 16.0. OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=436 --- gdb.changes | 13 +++++++++++++ gdb.spec | 8 ++++---- qa-local.sh | 6 +++--- qa.sh | 16 +++++++++++----- 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/gdb.changes b/gdb.changes index 69c4ff7..f4fc348 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Tue Feb 11 12:25:44 UTC 2025 - Tom de Vries + +- Maintenance script qa.sh: + * Add kfail for PR32678. + * Add kfail for missing g++ on SLE-12. + * Drop Leap 15.5, add 16.0. + * Move PR32167 kfail from kfail_sle12 to kfail, and extend + pattern. +- Use gcc 11 instead gcc 9 for SLE-12. +- Maintenance script qa-local.sh: + * Drop Leap 15.5, add 16.0. + ------------------------------------------------------------------- Thu Feb 6 08:35:47 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 6587252..eaa9dbd 100644 --- a/gdb.spec +++ b/gdb.spec @@ -289,8 +289,8 @@ BuildRequires: flex BuildRequires: gcc-c++ %else # SLE-12. -BuildRequires: gcc9 -BuildRequires: gcc9-c++ +BuildRequires: gcc11 +BuildRequires: gcc11-c++ %endif BuildRequires: gettext BuildRequires: glibc-devel @@ -681,8 +681,8 @@ CC=gcc CXX=g++ %else # SLE-12. -CC=gcc-9 -CXX=g++-9 +CC=gcc-11 +CXX=g++-11 %endif export CC export CXX diff --git a/qa-local.sh b/qa-local.sh index 9e91ddd..d845054 100644 --- a/qa-local.sh +++ b/qa-local.sh @@ -10,11 +10,11 @@ pkgs=$root/pkgs configs=" openSUSE_Leap_15.6 -openSUSE_Leap_15.5 openSUSE_Factory openSUSE_Factory_LegacyX86 SLE-15 SLE-12 +16.0 SLFO " @@ -83,7 +83,7 @@ have_combo () if [ "$arch" = "i586" ]; then case " $c " in - " openSUSE_Factory "|" SLFO ") + " openSUSE_Factory "|" SLFO "|" 16.0 ") # Doesn't have i586. return 1 ;; @@ -227,7 +227,7 @@ case "$n" in fi echo "CONFIG: $c $arch" case $c in - openSUSE_Factory|openSUSE_Factory_LegacyX86|SLFO) + openSUSE_Factory|openSUSE_Factory_LegacyX86|SLFO|16.0) bash qa.sh -local -$arch -factory $pkgs/gdb-testresults.$c.$arch ;; SLE-12) diff --git a/qa.sh b/qa.sh index 2582c8b..97ab74b 100644 --- a/qa.sh +++ b/qa.sh @@ -361,6 +361,9 @@ kfail=( # https://sourceware.org/bugzilla/show_bug.cgi?id=32619 "FAIL: gdb.dap/eof.exp: exceptions in log file" + # https://sourceware.org/bugzilla/show_bug.cgi?id=32167 + "FAIL: gdb.base/bp-cmds-continue-ctrl-c.exp: (attach|run): stop with control-c" + ) # kfail kfail_sle12=( @@ -449,8 +452,8 @@ kfail_sle12=( "FAIL: gdb.python/py-type.exp: lang_cpp: test_fields: python print \(gdb.lookup_type \('main\(\)::IntType'\)\)" "FAIL: gdb.python/py-type.exp: lang_cpp: test_fields: python print \(gdb.lookup_type \('main\(\)::IntType'\).target \(\)\)" - # https://sourceware.org/bugzilla/show_bug.cgi?id=32167 - "FAIL: gdb.base/bp-cmds-continue-ctrl-c.exp: attach: stop with control-c" + # SLE-12, aarch64, ppc64le, g++ missing. + "FAIL: gdb.dwarf2/missing-type-name-for-templates.exp:" ) # kfail_sle12 @@ -764,6 +767,9 @@ kfail_i586=( "FAIL: gdb.base/valgrind-disp-step.exp:" "FAIL: gdb.base/valgrind-infcall-2.exp:" "FAIL: gdb.base/valgrind-infcall.exp:" + + # https://sourceware.org/bugzilla/show_bug.cgi?id=32678 + "FAIL: gdb.reverse/time-reverse.exp: mode=c:" ) kfail_arm=( @@ -892,8 +898,8 @@ case $n in 4) for id in SLE-12 \ SLE-15 \ + 16.0 \ SLFO \ - openSUSE_Leap_15.5 \ openSUSE_Leap_15.6 \ openSUSE_Factory; \ do @@ -906,11 +912,11 @@ case $n in config=$id.$arch case $config in - SLE-15.i586|SLE-12.i586|SLFO.i586) + SLE-15.i586|SLE-12.i586|SLFO.i586|16.0.i586) # No such config. continue ;; - SLFO.ppc64le|openSUSE_Factory.ppc64le|*.s390x) + SLFO.ppc64le|16.0.ppc64le|openSUSE_Factory.ppc64le|*.s390x) # Not cleaned up yet. continue ;; From f61a679e8ef30b571d877e683e5c7deab374fc5a6468a061381489f9e5f27ee2 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 13 Feb 2025 14:36:11 +0000 Subject: [PATCH 32/34] - Maintenance script qa.sh: * Fix 16.0 handling. - Patches added: * gdb-testsuite-fix-gdb.python-py-format-string.exp-wi.patch * gdb-testsuite-fix-gdb.python-py-mi-cmd.exp-with-pyth.patch * gdb-testsuite-fix-gdb.ada-mi_task_arg.exp-on-arm-lin.patch * gdb-testsuite-fix-regexp-in-gdb.ada-mi_var_access.ex.patch * gdb-testsuite-check-gnatmake-version-in-gdb.ada-scal.patch * gdb-testsuite-fix-gdb.arch-arm-pseudo-unwind.exp-wit.patch * gdb-symtab-fix-target-type-of-complex-long-double-on.patch * gdb-testsuite-don-t-use-set-auto-solib-add-off.patch * gdb-tdep-fix-arm-thumb2-hw-breakpoint.patch * gdb-testsuite-fix-gdb.cp-m-static.exp-on-arm.patch * gdb-testsuite-fix-gdb.dwarf2-dw2-fixed-point.exp-on-.patch * gdb-testsuite-fix-gdb.dwarf2-dw2-lines.exp-on-arm-li.patch * gdb-exp-fix-gdb.fortran-intrinsics.exp-fail-on-arm.patch * gdb-tdep-handle-sycall-statx-for-arm-linux.patch * gdb-tdep-fix-recording-of-t1-push.patch * gdb-tdep-handle-syscall-clock_gettime64-for-arm-linu.patch * fix-gdb.dwarf2-shortpiece.exp-on-s390x.patch * handle-address-class-annotation-for-s390x-in-some-te.patch * fix-gdb.dap-step-out.exp-on-s390x.patch * use-setvariable-in-gdb.dap-scopes.exp.patch * fix-gdb.base-finish-pretty.exp-on-s390x.patch * fix-gdb.base-readnever.exp-on-s390x.patch * add-dwarf_expr_piece.op.patch * add-gdbarch_dwarf2_reg_piece_offset-hook.patch * fix-gdb.base-store.exp-on-s390x.patch * fix-gdb.ada-o2_float_param.exp-on-s390x-linux.patch * gdb-testsuite-fix-gdb.base-branch-to-self.exp-on-arm.patch * gdb-tdep-fix-gdb.cp-non-trivial-retval.exp-on-riscv6.patch * gdb-testsuite-fix-gdb.cp-non-trivial-retval.exp-on-a.patch * gdb-testsuite-fix-gdb.rust-completion.exp-timeout-on.patch * gdb-testsuite-require-supports_process_record-in-gdb.patch * gdb-testsuite-fix-regexp-in-gdb.arch-i386-disp-step-.patch * gdb-testsuite-fix-gdb.arch-arm-single-step-kernel-he.patch * gdb-testsuite-fix-gdb.python-py-format-address.exp-o.patch * gdb-testsuite-fix-gdb.arch-riscv-tdesc-regs.exp.patch * gdb-testsuite-fix-gdb.base-list-dot-nodebug-and-make.patch * gdb-testsuite-fix-gdb.base-list-dot-nodebug.exp-on-o.patch * gdb-testsuite-fix-gdb.base-empty-host-env-vars.exp.patch * gdb-prune-inferior-after-switching-inferior.patch * gdb-testsuite-use-nostdlib-in-gdb.base-list-dot-node.patch * gdb-testsuite-fix-timeout-in-gdb.mi-mi-multi-command.patch * gdb-testsuite-require-can_spawn_for_attach-in-gdb.ba.patch * fixup-gdb-6.5-gcore-buffer-limit-test.patch * gdb-testsuite-fix-gdb.ada-big_packed_array.exp-on-s3.patch * gdb-testsuite-fix-gdb.ada-convvar_comp.exp-on-s390x-.patch * gdb-testsuite-fix-regexp-in-gdb.threads-stepi-over-c.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=437 --- add-dwarf_expr_piece.op.patch | 100 ++++++ ...gdbarch_dwarf2_reg_piece_offset-hook.patch | 220 ++++++++++++ ...da-o2_float_param.exp-on-s390x-linux.patch | 144 ++++++++ fix-gdb.base-finish-pretty.exp-on-s390x.patch | 188 ++++++++++ fix-gdb.base-readnever.exp-on-s390x.patch | 187 ++++++++++ fix-gdb.base-store.exp-on-s390x.patch | 143 ++++++++ fix-gdb.dap-step-out.exp-on-s390x.patch | 97 +++++ fix-gdb.dwarf2-shortpiece.exp-on-s390x.patch | 56 +++ fixup-gdb-6.5-gcore-buffer-limit-test.patch | 25 ++ ...b.fortran-intrinsics.exp-fail-on-arm.patch | 232 ++++++++++++ ...ne-inferior-after-switching-inferior.patch | 130 +++++++ ...arget-type-of-complex-long-double-on.patch | 337 ++++++++++++++++++ gdb-tdep-fix-arm-thumb2-hw-breakpoint.patch | 264 ++++++++++++++ ....cp-non-trivial-retval.exp-on-riscv6.patch | 191 ++++++++++ gdb-tdep-fix-recording-of-t1-push.patch | 69 ++++ ...ep-handle-sycall-statx-for-arm-linux.patch | 46 +++ ...syscall-clock_gettime64-for-arm-linu.patch | 80 +++++ ...eck-gnatmake-version-in-gdb.ada-scal.patch | 48 +++ ...ite-don-t-use-set-auto-solib-add-off.patch | 274 ++++++++++++++ ...x-another-regexp-in-gdb.threads-step.patch | 8 +- ...x-gdb.ada-big_packed_array.exp-on-s3.patch | 62 ++++ ...x-gdb.ada-convvar_comp.exp-on-s390x-.patch | 113 ++++++ ...x-gdb.ada-mi_task_arg.exp-on-arm-lin.patch | 70 ++++ ...x-gdb.arch-arm-pseudo-unwind.exp-wit.patch | 88 +++++ ...x-gdb.arch-arm-single-step-kernel-he.patch | 79 ++++ ...te-fix-gdb.arch-riscv-tdesc-regs.exp.patch | 84 +++++ ...x-gdb.base-branch-to-self.exp-on-arm.patch | 96 +++++ ...fix-gdb.base-empty-host-env-vars.exp.patch | 132 +++++++ ...x-gdb.base-list-dot-nodebug-and-make.patch | 83 +++++ ...x-gdb.base-list-dot-nodebug.exp-on-o.patch | 60 ++++ ...suite-fix-gdb.cp-m-static.exp-on-arm.patch | 88 +++++ ...x-gdb.cp-non-trivial-retval.exp-on-a.patch | 99 +++++ ...x-gdb.dwarf2-dw2-fixed-point.exp-on-.patch | 54 +++ ...x-gdb.dwarf2-dw2-lines.exp-on-arm-li.patch | 279 +++++++++++++++ ...x-gdb.python-py-format-address.exp-o.patch | 88 +++++ ...x-gdb.python-py-format-string.exp-wi.patch | 65 ++++ ...x-gdb.python-py-mi-cmd.exp-with-pyth.patch | 154 ++++++++ ...x-gdb.rust-completion.exp-timeout-on.patch | 70 ++++ ...x-regexp-in-gdb.ada-mi_var_access.ex.patch | 50 +++ ...x-regexp-in-gdb.arch-i386-disp-step-.patch | 71 ++++ ...x-regexp-in-gdb.threads-stepi-over-c.patch | 42 +++ ...x-timeout-in-gdb.mi-mi-multi-command.patch | 69 ++++ ...quire-can_spawn_for_attach-in-gdb.ba.patch | 40 +++ ...quire-supports_process_record-in-gdb.patch | 36 ++ ...e-nostdlib-in-gdb.base-list-dot-node.patch | 172 +++++++++ gdb.changes | 53 +++ gdb.spec | 96 ++++- ...lass-annotation-for-s390x-in-some-te.patch | 125 +++++++ qa.sh | 2 +- use-setvariable-in-gdb.dap-scopes.exp.patch | 64 ++++ 50 files changed, 5415 insertions(+), 8 deletions(-) create mode 100644 add-dwarf_expr_piece.op.patch create mode 100644 add-gdbarch_dwarf2_reg_piece_offset-hook.patch create mode 100644 fix-gdb.ada-o2_float_param.exp-on-s390x-linux.patch create mode 100644 fix-gdb.base-finish-pretty.exp-on-s390x.patch create mode 100644 fix-gdb.base-readnever.exp-on-s390x.patch create mode 100644 fix-gdb.base-store.exp-on-s390x.patch create mode 100644 fix-gdb.dap-step-out.exp-on-s390x.patch create mode 100644 fix-gdb.dwarf2-shortpiece.exp-on-s390x.patch create mode 100644 fixup-gdb-6.5-gcore-buffer-limit-test.patch create mode 100644 gdb-exp-fix-gdb.fortran-intrinsics.exp-fail-on-arm.patch create mode 100644 gdb-prune-inferior-after-switching-inferior.patch create mode 100644 gdb-symtab-fix-target-type-of-complex-long-double-on.patch create mode 100644 gdb-tdep-fix-arm-thumb2-hw-breakpoint.patch create mode 100644 gdb-tdep-fix-gdb.cp-non-trivial-retval.exp-on-riscv6.patch create mode 100644 gdb-tdep-fix-recording-of-t1-push.patch create mode 100644 gdb-tdep-handle-sycall-statx-for-arm-linux.patch create mode 100644 gdb-tdep-handle-syscall-clock_gettime64-for-arm-linu.patch create mode 100644 gdb-testsuite-check-gnatmake-version-in-gdb.ada-scal.patch create mode 100644 gdb-testsuite-don-t-use-set-auto-solib-add-off.patch create mode 100644 gdb-testsuite-fix-gdb.ada-big_packed_array.exp-on-s3.patch create mode 100644 gdb-testsuite-fix-gdb.ada-convvar_comp.exp-on-s390x-.patch create mode 100644 gdb-testsuite-fix-gdb.ada-mi_task_arg.exp-on-arm-lin.patch create mode 100644 gdb-testsuite-fix-gdb.arch-arm-pseudo-unwind.exp-wit.patch create mode 100644 gdb-testsuite-fix-gdb.arch-arm-single-step-kernel-he.patch create mode 100644 gdb-testsuite-fix-gdb.arch-riscv-tdesc-regs.exp.patch create mode 100644 gdb-testsuite-fix-gdb.base-branch-to-self.exp-on-arm.patch create mode 100644 gdb-testsuite-fix-gdb.base-empty-host-env-vars.exp.patch create mode 100644 gdb-testsuite-fix-gdb.base-list-dot-nodebug-and-make.patch create mode 100644 gdb-testsuite-fix-gdb.base-list-dot-nodebug.exp-on-o.patch create mode 100644 gdb-testsuite-fix-gdb.cp-m-static.exp-on-arm.patch create mode 100644 gdb-testsuite-fix-gdb.cp-non-trivial-retval.exp-on-a.patch create mode 100644 gdb-testsuite-fix-gdb.dwarf2-dw2-fixed-point.exp-on-.patch create mode 100644 gdb-testsuite-fix-gdb.dwarf2-dw2-lines.exp-on-arm-li.patch create mode 100644 gdb-testsuite-fix-gdb.python-py-format-address.exp-o.patch create mode 100644 gdb-testsuite-fix-gdb.python-py-format-string.exp-wi.patch create mode 100644 gdb-testsuite-fix-gdb.python-py-mi-cmd.exp-with-pyth.patch create mode 100644 gdb-testsuite-fix-gdb.rust-completion.exp-timeout-on.patch create mode 100644 gdb-testsuite-fix-regexp-in-gdb.ada-mi_var_access.ex.patch create mode 100644 gdb-testsuite-fix-regexp-in-gdb.arch-i386-disp-step-.patch create mode 100644 gdb-testsuite-fix-regexp-in-gdb.threads-stepi-over-c.patch create mode 100644 gdb-testsuite-fix-timeout-in-gdb.mi-mi-multi-command.patch create mode 100644 gdb-testsuite-require-can_spawn_for_attach-in-gdb.ba.patch create mode 100644 gdb-testsuite-require-supports_process_record-in-gdb.patch create mode 100644 gdb-testsuite-use-nostdlib-in-gdb.base-list-dot-node.patch create mode 100644 handle-address-class-annotation-for-s390x-in-some-te.patch create mode 100644 use-setvariable-in-gdb.dap-scopes.exp.patch diff --git a/add-dwarf_expr_piece.op.patch b/add-dwarf_expr_piece.op.patch new file mode 100644 index 0000000..1a75e3e --- /dev/null +++ b/add-dwarf_expr_piece.op.patch @@ -0,0 +1,100 @@ +From 89cf6ba4a207f5342db58d9e43178ae516cc220e Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 15 Jan 2025 17:02:00 +0100 +Subject: [PATCH 23/46] Add dwarf_expr_piece.op + +Add a new field "dwarf_location_atom op" to dwarf_expr_piece to keep track of +which dwarf_location_atom caused a dwarf_expr_piece to be added. + +This is used in the following patch. + +Tested on s390x-linux. + +Approved-By: Tom Tromey +--- + gdb/dwarf2/expr.c | 10 ++++++---- + gdb/dwarf2/expr.h | 6 +++++- + 2 files changed, 11 insertions(+), 5 deletions(-) + +diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c +index cb80dbf60b1..03107f90575 100644 +--- a/gdb/dwarf2/expr.c ++++ b/gdb/dwarf2/expr.c +@@ -1198,13 +1198,15 @@ dwarf_expr_context::stack_empty_p () const + + /* Add a new piece to the dwarf_expr_context's piece list. */ + void +-dwarf_expr_context::add_piece (ULONGEST size, ULONGEST offset) ++dwarf_expr_context::add_piece (ULONGEST size, ULONGEST offset, ++ enum dwarf_location_atom op) + { + dwarf_expr_piece &p = this->m_pieces.emplace_back (); + + p.location = this->m_location; + p.size = size; + p.offset = offset; ++ p.op = op; + + if (p.location == DWARF_VALUE_LITERAL) + { +@@ -2169,7 +2171,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr, + + /* Record the piece. */ + op_ptr = safe_read_uleb128 (op_ptr, op_end, &size); +- add_piece (8 * size, 0); ++ add_piece (8 * size, 0, op); + + /* Pop off the address/regnum, and reset the location + type. */ +@@ -2187,7 +2189,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr, + /* Record the piece. */ + op_ptr = safe_read_uleb128 (op_ptr, op_end, &size); + op_ptr = safe_read_uleb128 (op_ptr, op_end, &uleb_offset); +- add_piece (size, uleb_offset); ++ add_piece (size, uleb_offset, op); + + /* Pop off the address/regnum, and reset the location + type. */ +@@ -2389,7 +2391,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr, + pointer, then make a pieced value. This is ok because we can't + have implicit pointers in contexts where pieces are invalid. */ + if (this->m_location == DWARF_VALUE_IMPLICIT_POINTER) +- add_piece (8 * this->m_addr_size, 0); ++ add_piece (8 * this->m_addr_size, 0, DW_OP_implicit_pointer); + + this->m_recursion_depth--; + gdb_assert (this->m_recursion_depth >= 0); +diff --git a/gdb/dwarf2/expr.h b/gdb/dwarf2/expr.h +index b02cc531640..957c58f30c4 100644 +--- a/gdb/dwarf2/expr.h ++++ b/gdb/dwarf2/expr.h +@@ -24,6 +24,7 @@ + + #include "leb128.h" + #include "dwarf2/call-site.h" ++#include "dwarf2.h" + + struct dwarf2_per_objfile; + +@@ -54,6 +55,9 @@ enum dwarf_value_location + /* A piece of an object, as recorded by DW_OP_piece or DW_OP_bit_piece. */ + struct dwarf_expr_piece + { ++ /* The DWARF operation for which the piece was created. */ ++ enum dwarf_location_atom op; ++ + enum dwarf_value_location location; + + union +@@ -208,7 +212,7 @@ struct dwarf_expr_context + struct type *address_type () const; + void push (struct value *value, bool in_stack_memory); + bool stack_empty_p () const; +- void add_piece (ULONGEST size, ULONGEST offset); ++ void add_piece (ULONGEST size, ULONGEST offset, enum dwarf_location_atom op); + void execute_stack_op (const gdb_byte *op_ptr, const gdb_byte *op_end); + void pop (); + struct value *fetch (int n); +-- +2.43.0 + diff --git a/add-gdbarch_dwarf2_reg_piece_offset-hook.patch b/add-gdbarch_dwarf2_reg_piece_offset-hook.patch new file mode 100644 index 0000000..447bc38 --- /dev/null +++ b/add-gdbarch_dwarf2_reg_piece_offset-hook.patch @@ -0,0 +1,220 @@ +From 29b185c531fcd933da62142debcb088321be7c4c Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 15 Jan 2025 17:02:00 +0100 +Subject: [PATCH 24/46] Add gdbarch_dwarf2_reg_piece_offset hook + +In rw_pieced_value, when reading/writing part of a register, DW_OP_piece and +DW_OP_bit_piece are handled the same, but the standard tells us: +- DW_OP_piece: if the piece is located in a register, but does not occupy the + entire register, the placement of the piece within that register is defined + by the ABI. +- DW_OP_bit_piece: if the location is a register, the offset is from the least + significant bit end of the register. + +Add a new hook gdbarch_dwarf2_reg_piece_offset that allows us to define the +ABI-specific behaviour for DW_OP_piece. + +The default implementation of the hook is the behaviour of DW_OP_bit_piece, so +there should not be any functional changes. + +Tested on s390x-linux. + +Approved-By: Tom Tromey +--- + gdb/dwarf2/expr.c | 31 +++++++++++++++++++++++++------ + gdb/findvar.c | 18 ++++++++++++++++++ + gdb/gdbarch-gen.h | 8 ++++++++ + gdb/gdbarch.c | 22 ++++++++++++++++++++++ + gdb/gdbarch_components.py | 16 ++++++++++++++++ + gdb/value.h | 2 ++ + 6 files changed, 91 insertions(+), 6 deletions(-) + +diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c +index 03107f90575..ece713ee7cd 100644 +--- a/gdb/dwarf2/expr.c ++++ b/gdb/dwarf2/expr.c +@@ -211,14 +211,33 @@ rw_pieced_value (value *v, value *from, bool check_optimized) + ULONGEST reg_bits = 8 * register_size (arch, gdb_regnum); + int optim, unavail; + +- if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG +- && p->offset + p->size < reg_bits) ++ if (p->offset + p->size < reg_bits) + { +- /* Big-endian, and we want less than full size. */ +- bits_to_skip += reg_bits - (p->offset + p->size); ++ /* We want less than full size. */ ++ ++ if (p->op == DW_OP_piece) ++ { ++ gdb_assert (p->offset == 0); ++ ++ /* If the piece is located in a register, but does not ++ occupy the entire register, the placement of the piece ++ within that register is defined by the ABI. */ ++ bits_to_skip ++ += 8 * gdbarch_dwarf2_reg_piece_offset (arch, gdb_regnum, ++ p->size / 8); ++ } ++ else if (p->op == DW_OP_bit_piece) ++ { ++ /* If the location is a register, the offset is from the ++ least significant bit end of the register. */ ++ if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG) ++ bits_to_skip += reg_bits - (p->offset + p->size); ++ else ++ bits_to_skip += p->offset; ++ } ++ else ++ error (_("Don't know how to get part of implicit pointer")); + } +- else +- bits_to_skip += p->offset; + + this_size = bits_to_bytes (bits_to_skip, this_size_bits); + buffer.resize (this_size); +diff --git a/gdb/findvar.c b/gdb/findvar.c +index df4ab1a28b9..3b20974474a 100644 +--- a/gdb/findvar.c ++++ b/gdb/findvar.c +@@ -541,6 +541,24 @@ default_value_from_register (gdbarch *gdbarch, type *type, int regnum, + return value; + } + ++/* Default implementation of gdbarch_dwarf2_reg_piece_offset. Implements ++ DW_OP_bits_piece for DW_OP_piece. */ ++ ++ULONGEST ++default_dwarf2_reg_piece_offset (gdbarch *gdbarch, int gdb_regnum, ULONGEST size) ++{ ++ ULONGEST reg_size = register_size (gdbarch, gdb_regnum); ++ gdb_assert (size <= reg_size); ++ if (reg_size == size) ++ return 0; ++ ++ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) ++ return reg_size - size; ++ ++ return 0; ++} ++ ++ + /* VALUE must be an lval_register value. If regnum is the value's + associated register number, and len the length of the value's type, + read one or more registers in VALUE's frame, starting with register REGNUM, +diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h +index b982fd7cd09..2e20a9dbccd 100644 +--- a/gdb/gdbarch-gen.h ++++ b/gdb/gdbarch-gen.h +@@ -430,6 +430,14 @@ typedef struct value * (gdbarch_value_from_register_ftype) (struct gdbarch *gdba + extern struct value * gdbarch_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, const frame_info_ptr &this_frame); + extern void set_gdbarch_value_from_register (struct gdbarch *gdbarch, gdbarch_value_from_register_ftype *value_from_register); + ++/* For a DW_OP_piece located in a register, but not occupying the ++ entire register, return the placement of the piece within that ++ register as defined by the ABI. */ ++ ++typedef ULONGEST (gdbarch_dwarf2_reg_piece_offset_ftype) (struct gdbarch *gdbarch, int regnum, ULONGEST size); ++extern ULONGEST gdbarch_dwarf2_reg_piece_offset (struct gdbarch *gdbarch, int regnum, ULONGEST size); ++extern void set_gdbarch_dwarf2_reg_piece_offset (struct gdbarch *gdbarch, gdbarch_dwarf2_reg_piece_offset_ftype *dwarf2_reg_piece_offset); ++ + typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf); + extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf); + extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address); +diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c +index 58e9ebbdc59..ed5b5859277 100644 +--- a/gdb/gdbarch.c ++++ b/gdb/gdbarch.c +@@ -109,6 +109,7 @@ struct gdbarch + gdbarch_register_to_value_ftype *register_to_value = nullptr; + gdbarch_value_to_register_ftype *value_to_register = nullptr; + gdbarch_value_from_register_ftype *value_from_register = default_value_from_register; ++ gdbarch_dwarf2_reg_piece_offset_ftype *dwarf2_reg_piece_offset = default_dwarf2_reg_piece_offset; + gdbarch_pointer_to_address_ftype *pointer_to_address = unsigned_pointer_to_address; + gdbarch_address_to_pointer_ftype *address_to_pointer = unsigned_address_to_pointer; + gdbarch_integer_to_address_ftype *integer_to_address = nullptr; +@@ -371,6 +372,7 @@ verify_gdbarch (struct gdbarch *gdbarch) + /* Skip verify of value_from_register, invalid_p == 0 */ + /* Skip verify of pointer_to_address, invalid_p == 0 */ + /* Skip verify of address_to_pointer, invalid_p == 0 */ ++ /* Skip verify of dwarf2_reg_piece_offset, invalid_p == 0. */ + /* Skip verify of integer_to_address, has predicate. */ + /* Skip verify of return_value, invalid_p == 0 */ + if ((gdbarch->return_value_as_value == default_gdbarch_return_value) == (gdbarch->return_value == nullptr)) +@@ -783,6 +785,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) + gdb_printf (file, + "gdbarch_dump: value_from_register = <%s>\n", + host_address_to_string (gdbarch->value_from_register)); ++ gdb_printf (file, ++ "gdbarch_dump: dwarf2_reg_piece_offset = <%s>\n", ++ host_address_to_string (gdbarch->dwarf2_reg_piece_offset)); + gdb_printf (file, + "gdbarch_dump: pointer_to_address = <%s>\n", + host_address_to_string (gdbarch->pointer_to_address)); +@@ -2573,6 +2578,23 @@ set_gdbarch_value_from_register (struct gdbarch *gdbarch, + gdbarch->value_from_register = value_from_register; + } + ++ULONGEST ++gdbarch_dwarf2_reg_piece_offset (struct gdbarch *gdbarch, int regnum, ULONGEST size) ++{ ++ gdb_assert (gdbarch != NULL); ++ gdb_assert (gdbarch->dwarf2_reg_piece_offset != NULL); ++ if (gdbarch_debug >= 2) ++ gdb_printf (gdb_stdlog, "gdbarch_dwarf2_reg_piece_offset called\n"); ++ return gdbarch->dwarf2_reg_piece_offset (gdbarch, regnum, size); ++} ++ ++void ++set_gdbarch_dwarf2_reg_piece_offset (struct gdbarch *gdbarch, ++ gdbarch_dwarf2_reg_piece_offset_ftype dwarf2_reg_piece_offset) ++{ ++ gdbarch->dwarf2_reg_piece_offset = dwarf2_reg_piece_offset; ++} ++ + CORE_ADDR + gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf) + { +diff --git a/gdb/gdbarch_components.py b/gdb/gdbarch_components.py +index 4006380076d..4a228b5d27c 100644 +--- a/gdb/gdbarch_components.py ++++ b/gdb/gdbarch_components.py +@@ -829,6 +829,22 @@ allocate and return a struct value with all value attributes + invalid=False, + ) + ++Method( ++ comment=""" ++For a DW_OP_piece located in a register, but not occupying the ++entire register, return the placement of the piece within that ++register as defined by the ABI. ++""", ++ type="ULONGEST", ++ name="dwarf2_reg_piece_offset", ++ params=[ ++ ("int", "regnum"), ++ ("ULONGEST", "size") ++ ], ++ predefault="default_dwarf2_reg_piece_offset", ++ invalid=False, ++) ++ + Method( + type="CORE_ADDR", + name="pointer_to_address", +diff --git a/gdb/value.h b/gdb/value.h +index 9d7e88d9433..47df66e0961 100644 +--- a/gdb/value.h ++++ b/gdb/value.h +@@ -1128,6 +1128,8 @@ extern value *default_value_from_register (gdbarch *gdbarch, type *type, + int regnum, + const frame_info_ptr &this_frame); + ++extern ULONGEST default_dwarf2_reg_piece_offset (gdbarch *gdbarch, int regnum, ULONGEST size); ++ + extern struct value *value_from_register (struct type *type, int regnum, + const frame_info_ptr &frame); + +-- +2.43.0 + diff --git a/fix-gdb.ada-o2_float_param.exp-on-s390x-linux.patch b/fix-gdb.ada-o2_float_param.exp-on-s390x-linux.patch new file mode 100644 index 0000000..3b09d3e --- /dev/null +++ b/fix-gdb.ada-o2_float_param.exp-on-s390x-linux.patch @@ -0,0 +1,144 @@ +From 0ac8e9af3cd6713f4b230e9e335e1398c3161210 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 10 Jan 2025 21:25:53 +0100 +Subject: [PATCH 26/46] Fix gdb.ada/O2_float_param.exp on s390x-linux + +With test-case gdb.ada/O2_float_param.exp on s390x-linux, I get: +... + (gdb) frame^M + #0 callee.increment (val=99.0, val@entry=, msg=...) at callee.adb:19^M + 19 procedure Increment (Val : in out Float; Msg: String) is^M + (gdb) FAIL: $exp: scenario=all: frame +... + +The frame command calls read_frame_arg to get: +- the current value of val, and +- the value of val at function entry. + +The first scenario succeeds, and the second scenario fails. + +For context and contrast, let's also investigate the first scenario: getting +the current value of val. + +Function parameter val: +... + <2>: Abbrev Number: 4 (DW_TAG_formal_parameter) + DW_AT_name : val + DW_AT_type : <0xb86> + DW_AT_location : 0xab (location list) +... +has location list: +... + 000000ab 0000000001002928 0000000001002967 + (DW_OP_reg16 (f0)) + 000000be 0000000001002967 0000000001002968 + (DW_OP_reg24 (f8)) + 000000d1 0000000001002968 0000000001002974 + (DW_OP_GNU_regval_type: 24 (f8) <0xb29>; + DW_OP_GNU_const_type: <0xb29> 4 byte block: 3f 80 0 0 ; DW_OP_plus; + DW_OP_stack_value) + 000000ef 0000000001002974 0000000001002982 + (DW_OP_GNU_entry_value: (DW_OP_GNU_regval_type: 16 (f0) <0xb29>); + DW_OP_GNU_const_type: <0xb29> 4 byte block: 3f 80 0 0 ; DW_OP_plus; + DW_OP_stack_value) + 0000010f +... +and since we're stopped at address 0x1002928: +... +(gdb) print $pc +$1 = (access procedure) 0x1002928 +... +we get the value from dwarf register 16. + +The s390x ABI [1] specifies that dwarf register 16 maps onto 8-byte register +f0 or 16-byte register v0 (where f0 is part of v0), and in this case (because +the v0 register is available) s390_dwarf_reg_to_regnum maps it to v0. + +Val is only 4 bytes: +... +(gdb) ptype val +type = <4-byte float> +... +and s390_value_from_register takes care to get the value from the correct part +of v0. + +The value of v0 is found in the prologue cache, and the value of parameter val +is printed. + +Now the second scenario: getting the value of val at function entry. + +FWIW, since we're stopped at function entry, we could simply return the same +value, reading the same register, but that's currently not implemented [2]. + +Instead we start from the fact that val is in dwarf reg 16 at function entry, +and then use call site information: +... + <4>: Abbrev Number: 13 (DW_TAG_GNU_call_site) + DW_AT_low_pc : 0x1002a46 + DW_AT_abstract_origin: <0xdda> + <5>: Abbrev Number: 12 (DW_TAG_GNU_call_site_parameter) + DW_AT_location : 1 byte block: 60 (DW_OP_reg16 (f0)) + DW_AT_GNU_call_site_value: 3 byte block: f5 18 2d \ + (DW_OP_GNU_regval_type: 24 (f8) <0xc42>) + <5>: Abbrev Number: 12 (DW_TAG_GNU_call_site_parameter) +... +to conclude that the value we're looking for is in dwarf reg 24, which +s390_dwarf_reg_to_regnum maps to v8. + +As before, s390_value_from_register takes care to get the value from the +correct part of v8. + +However, v8 is not available in the prologue cache, and we take a different +path and end up in s390_unwind_pseudo_register, where v8 and similar +(regnum_is_vxr_full) is unhandled, and we get: +... + return value::allocate_optimized_out (type); +... +which eventually causes the "error reading variable: register has not been +saved in frame". + +Fix this by handling the regnum_is_vxr_full case in +s390_unwind_pseudo_register, similar to how that is done in +s390_pseudo_register_read. + +Tested on s390x-linux. + +This also fixes test-case gdb.base/savedregs.exp. + +[1] https://github.com/IBM/s390x-abi +[2] https://sourceware.org/pipermail/gdb-patches/2024-September/211589.html +--- + gdb/s390-tdep.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c +index a7c58b37276..31730296ef1 100644 +--- a/gdb/s390-tdep.c ++++ b/gdb/s390-tdep.c +@@ -2332,6 +2332,22 @@ s390_unwind_pseudo_register (const frame_info_ptr &this_frame, int regnum) + return value_cast (type, val); + } + ++ if (regnum_is_vxr_full (tdep, regnum)) ++ { ++ struct value *val = value::allocate_register (this_frame, regnum); ++ ++ int reg = regnum - tdep->v0_full_regnum; ++ struct value *val1 ++ = frame_unwind_register_value (this_frame, S390_F0_REGNUM + reg); ++ struct value *val2 ++ = frame_unwind_register_value (this_frame, S390_V0_LOWER_REGNUM + reg); ++ ++ val1->contents_copy (val, 0, 0, 8); ++ val2->contents_copy (val, 8, 0, 8); ++ ++ return value_cast (type, val); ++ } ++ + return value::allocate_optimized_out (type); + } + +-- +2.43.0 + diff --git a/fix-gdb.base-finish-pretty.exp-on-s390x.patch b/fix-gdb.base-finish-pretty.exp-on-s390x.patch new file mode 100644 index 0000000..c28101c --- /dev/null +++ b/fix-gdb.base-finish-pretty.exp-on-s390x.patch @@ -0,0 +1,188 @@ +From de696a57729423bf643e530fdb638dff6cf3c08b Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sat, 4 Jan 2025 11:31:02 +0100 +Subject: [PATCH 21/46] Fix gdb.base/finish-pretty.exp on s390x + +On s390x-linux, with test-case gdb.base/finish-pretty.exp I ran into: +... +(gdb) finish +Run till exit from #0 foo () at finish-pretty.c:28 +main () at finish-pretty.c:40 +40 return v.a + v.b; +Value returned has type: struct s. Cannot determine contents +(gdb) FAIL: $exp: finish foo prettyprinted function result +... + +The function being finished is foo, which returns a value of type struct s. + +The ABI [1] specifies: +- that the value is returned in a storage buffer allocated by the caller, and +- that the address of this buffer is passed as a hidden argument in r2. + +GDB fails to print the value when finishing foo, because it doesn't know the +address of the buffer. + +Implement the gdbarch_get_return_buf_addr hook for s390x to fix this. + +This is based on ppc_sysv_get_return_buf_addr, the only other implementation +of gdbarch_get_return_buf_addr. For readability I've factored out +dwarf_reg_on_entry. + +There is one difference with ppc_sysv_get_return_buf_addr: only +NO_ENTRY_VALUE_ERROR is caught. If this patch is approved, I intend to submit +a follow-up patch to fix this in ppc_sysv_get_return_buf_addr as well. + +The hook is not guaranteed to work, because it attempts to get the value r2 +had at function entry. + +The hook can be called after function entry, and the ABI doesn't guarantee +that r2 is the same throughout the function. + +Using -fvar-tracking adds debug information, which allows the hook to succeed +more often, and indeed after adding this to the test-case, it passes. + +Do likewise in one more test-case. + +Tested on s390x-linux. + +Fixes: +- gdb.ada/finish-large.exp +- gdb.base/finish-pretty.exp +- gdb.base/retval-large-struct.exp +- gdb.cp/non-trivial-retval.exp +- gdb.ada/array_return.exp + +AFAICT, I've also enabled the hook for s390 and from the ABI I get the +impression that it should work, but I haven't been able to test it. + +[1] https://github.com/IBM/s390x-abi +--- + gdb/s390-tdep.c | 58 ++++++++++++++++++++++++ + gdb/testsuite/gdb.ada/array_return.exp | 8 +++- + gdb/testsuite/gdb.base/finish-pretty.exp | 8 +++- + 3 files changed, 72 insertions(+), 2 deletions(-) + +diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c +index 4844b7e9bc8..4e7dce70c12 100644 +--- a/gdb/s390-tdep.c ++++ b/gdb/s390-tdep.c +@@ -40,6 +40,7 @@ + #include "trad-frame.h" + #include "value.h" + #include "inferior.h" ++#include "dwarf2/loc.h" + + #include "features/s390-linux32.c" + #include "features/s390x-linux64.c" +@@ -2119,6 +2120,62 @@ s390_return_value (struct gdbarch *gdbarch, struct value *function, + return rvc; + } + ++/* Try to get the value of DWARF_REG in FRAME at function entry. If successful, ++ return it as value of type VAL_TYPE. */ ++ ++static struct value * ++dwarf_reg_on_entry (int dwarf_reg, struct type *val_type, ++ const frame_info_ptr &frame) ++{ ++ enum call_site_parameter_kind kind = CALL_SITE_PARAMETER_DWARF_REG; ++ union call_site_parameter_u kind_u = { .dwarf_reg = dwarf_reg }; ++ ++ try ++ { ++ return value_of_dwarf_reg_entry (val_type, frame, kind, kind_u); ++ } ++ catch (const gdb_exception_error &e) ++ { ++ if (e.error == NO_ENTRY_VALUE_ERROR) ++ return nullptr; ++ ++ throw; ++ } ++} ++ ++/* Both the 32-bit and 64-bit ABIs specify that values of some types are ++ returned in a storage buffer provided by the caller. Return the address of ++ that storage buffer, if possible. Implements the ++ gdbarch_get_return_buf_addr hook. */ ++ ++static CORE_ADDR ++s390_get_return_buf_addr (struct type *val_type, ++ const frame_info_ptr &cur_frame) ++{ ++ /* The address of the storage buffer is provided as a hidden argument in ++ register r2. */ ++ int dwarf_reg = 2; ++ ++ /* The ABI does not guarantee that the register will not be changed while ++ executing the function. Hence, it cannot be assumed that it will still ++ contain the address of the storage buffer when execution reaches the end ++ of the function. ++ ++ Attempt to determine the value on entry using the DW_OP_entry_value DWARF ++ entries. This requires compiling the user program with -fvar-tracking. */ ++ struct value *val_on_entry ++ = dwarf_reg_on_entry (dwarf_reg, lookup_pointer_type (val_type), cur_frame); ++ ++ if (val_on_entry == nullptr) ++ { ++ warning ("Cannot determine the function return value.\n" ++ "Try compiling with -fvar-tracking."); ++ return 0; ++ } ++ ++ return value_as_address (val_on_entry); ++} ++ + /* Frame unwinding. */ + + /* Implement the stack_frame_destroyed_p gdbarch method. */ +@@ -7183,6 +7240,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) + set_gdbarch_dummy_id (gdbarch, s390_dummy_id); + set_gdbarch_frame_align (gdbarch, s390_frame_align); + set_gdbarch_return_value (gdbarch, s390_return_value); ++ set_gdbarch_get_return_buf_addr (gdbarch, s390_get_return_buf_addr); + + /* Frame handling. */ + /* Stack grows downward. */ +diff --git a/gdb/testsuite/gdb.ada/array_return.exp b/gdb/testsuite/gdb.ada/array_return.exp +index c6edee11f17..d1fc2ac2c98 100644 +--- a/gdb/testsuite/gdb.ada/array_return.exp ++++ b/gdb/testsuite/gdb.ada/array_return.exp +@@ -19,7 +19,13 @@ require allow_ada_tests + + standard_ada_testfile p + +-if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} { ++set opts {} ++lappend opts debug ++if { [have_fvar_tracking] } { ++ lappend opts "additional_flags=-fvar-tracking" ++} ++ ++if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $opts] != ""} { + return -1 + } + +diff --git a/gdb/testsuite/gdb.base/finish-pretty.exp b/gdb/testsuite/gdb.base/finish-pretty.exp +index 44f3340f41c..0b6bea6681d 100644 +--- a/gdb/testsuite/gdb.base/finish-pretty.exp ++++ b/gdb/testsuite/gdb.base/finish-pretty.exp +@@ -18,7 +18,13 @@ + + standard_testfile + +-if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { ++set opts {} ++lappend opts debug ++if { [have_fvar_tracking] } { ++ lappend opts "additional_flags=-fvar-tracking" ++} ++ ++if { [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] } { + return -1 + } + +-- +2.43.0 + diff --git a/fix-gdb.base-readnever.exp-on-s390x.patch b/fix-gdb.base-readnever.exp-on-s390x.patch new file mode 100644 index 0000000..ff7e605 --- /dev/null +++ b/fix-gdb.base-readnever.exp-on-s390x.patch @@ -0,0 +1,187 @@ +From 1d761604714b32883d2bbc4a5f274fc3e2c668fe Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 9 Jan 2025 14:32:19 +0100 +Subject: [PATCH 22/46] Fix gdb.base/readnever.exp on s390x + +On s390x-linux, I run into: +... + (gdb) backtrace + #0 0x000000000100061a in fun_three () + #1 0x000000000100067a in fun_two () + #2 0x000003fffdfa9470 in ?? () + Backtrace stopped: frame did not save the PC + (gdb) FAIL: gdb.base/readnever.exp: backtrace +... + +This is really due to a problem handling the fun_three frame. When generating +a backtrace from fun_two, everying looks ok: +... + $ gdb -readnever -q -batch outputs/gdb.base/readnever/readnever \ + -ex "b fun_two" \ + -ex run \ + -ex bt + ... + #0 0x0000000001000650 in fun_two () + #1 0x00000000010006b6 in fun_one () + #2 0x00000000010006ee in main () +... + +For reference the frame info with debug info (without -readnever) looks like this: +... +$ gdb -q -batch outputs/gdb.base/readnever/readnever \ + -ex "b fun_three" \ + -ex run \ + -ex "info frame" + ... +Stack level 0, frame at 0x3fffffff140: + pc = 0x1000632 in fun_three (readnever.c:20); saved pc = 0x100067a + called by frame at 0x3fffffff1f0 + source language c. + Arglist at 0x3fffffff140, args: a=10, b=49 '1', c=0x3fffffff29c + Locals at 0x3fffffff140, Previous frame's sp in v0 +... + +But with -readnever, like this instead: +... +Stack level 0, frame at 0x0: + pc = 0x100061a in fun_three; saved pc = 0x100067a + called by frame at 0x3fffffff140 + Arglist at 0xffffffffffffffff, args: + Locals at 0xffffffffffffffff, Previous frame's sp in r15 +... + +An obvious difference is the "Previous frame's sp in" v0 vs. r15. + +Looking at the code: +... +0000000001000608 : + 1000608: b3 c1 00 2b ldgr %f2,%r11 + 100060c: b3 c1 00 0f ldgr %f0,%r15 + 1000610: e3 f0 ff 50 ff 71 lay %r15,-176(%r15) + 1000616: b9 04 00 bf lgr %r11,%r15 +... +it becomes clear what is going on. This is an unusual prologue. + +Rather than saving r11 (frame pointer) and r15 (stack pointer) to stack, +instead they're saved into call-clobbered floating point registers. + +[ For reference, this is the prologue of fun_two: +... +0000000001000640 : + 1000640: eb bf f0 58 00 24 stmg %r11,%r15,88(%r15) + 1000646: e3 f0 ff 50 ff 71 lay %r15,-176(%r15) + 100064c: b9 04 00 bf lgr %r11,%r15 +... +where the first instruction stores registers r11 to r15 to stack. ] + +Gdb fails to properly analyze the prologue, which causes the problems getting +the frame info. + +Fix this by: +- adding handling of the ldgr insn [1] in s390_analyze_prologue, and +- recognizing the insn as saving a register in + s390_prologue_frame_unwind_cache. + +This gets us instead: +... +Stack level 0, frame at 0x0: + pc = 0x100061a in fun_three; saved pc = 0x100067a + called by frame at 0x3fffffff1f0 + Arglist at 0xffffffffffffffff, args: + Locals at 0xffffffffffffffff, Previous frame's sp in f0 +... +and: +... + (gdb) backtrace^M + #0 0x000000000100061a in fun_three ()^M + #1 0x000000000100067a in fun_two ()^M + #2 0x00000000010006b6 in fun_one ()^M + #3 0x00000000010006ee in main ()^M + (gdb) PASS: gdb.base/readnever.exp: backtrace +... + +Tested on s390x-linux. + +PR tdep/32417 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32417 + +Approved-By: Andreas Arnez + +[1] https://www.ibm.com/support/pages/sites/default/files/2021-05/SA22-7871-10.pdf +--- + gdb/s390-tdep.c | 39 +++++++++++++++++++++++++++++++++++++++ + gdb/s390-tdep.h | 1 + + 2 files changed, 40 insertions(+) + +diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c +index 4e7dce70c12..2609b42f797 100644 +--- a/gdb/s390-tdep.c ++++ b/gdb/s390-tdep.c +@@ -855,6 +855,11 @@ s390_analyze_prologue (struct gdbarch *gdbarch, + || is_rre (insn64, op_lgr, &r1, &r2)) + data->gpr[r1] = data->gpr[r2]; + ++ /* LDGR r1, r2 --- load from register to floating-point register ++ (64-bit version). */ ++ else if (is_rre (insn64, op_ldgr, &r1, &r2)) ++ data->fpr[r1] = data->gpr[r2]; ++ + /* L r1, d2(x2, b2) --- load. */ + /* LY r1, d2(x2, b2) --- load (long-displacement version). */ + /* LG r1, d2(x2, b2) --- load (64-bit version). */ +@@ -2542,6 +2547,40 @@ s390_prologue_frame_unwind_cache (const frame_info_ptr &this_frame, + && data.fpr_slot[i] != 0) + info->saved_regs[S390_F0_REGNUM + i].set_addr (cfa - data.fpr_slot[i]); + ++ /* Handle this type of prologue: ++ ldgr %f2,%r11 ++ ldgr %f0,%r15 ++ where call-clobbered floating point registers are used as register save ++ slots. */ ++ for (i = 0; i < S390_NUM_FPRS; i++) ++ { ++ int fpr = S390_F0_REGNUM + i; ++ ++ /* Check that fpr is a call-clobbered register. */ ++ if (s390_register_call_saved (gdbarch, fpr)) ++ continue; ++ ++ /* Check that fpr contains the value of a register at function ++ entry. */ ++ if (data.fpr[i].kind != pvk_register) ++ continue; ++ ++ int entry_val_reg = data.fpr[i].reg; ++ ++ /* Check that entry_val_reg is a call-saved register. */ ++ if (!s390_register_call_saved (gdbarch, entry_val_reg)) ++ continue; ++ ++ /* In the prologue, we've copied: ++ - the value of a call-saved register (entry_val_reg) at function ++ entry, to ++ - a call-clobbered floating point register (fpr). ++ ++ Heuristic: assume that makes the floating point register a register ++ save slot, leaving the value constant throughout the function. */ ++ info->saved_regs[entry_val_reg].set_realreg (fpr); ++ } ++ + /* Function return will set PC to %r14. */ + info->saved_regs[S390_PSWA_REGNUM] = info->saved_regs[S390_RETADDR_REGNUM]; + +diff --git a/gdb/s390-tdep.h b/gdb/s390-tdep.h +index 10f775f468f..b098d735a13 100644 +--- a/gdb/s390-tdep.h ++++ b/gdb/s390-tdep.h +@@ -82,6 +82,7 @@ enum + op1_lgfi = 0xc0, op2_lgfi = 0x01, + op_lr = 0x18, + op_lgr = 0xb904, ++ op_ldgr = 0xb3c1, + op_l = 0x58, + op1_ly = 0xe3, op2_ly = 0x58, + op1_lg = 0xe3, op2_lg = 0x04, +-- +2.43.0 + diff --git a/fix-gdb.base-store.exp-on-s390x.patch b/fix-gdb.base-store.exp-on-s390x.patch new file mode 100644 index 0000000..74e14df --- /dev/null +++ b/fix-gdb.base-store.exp-on-s390x.patch @@ -0,0 +1,143 @@ +From 69e165afa3d45cfac89ed6be298ac6465c84c0fd Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 15 Jan 2025 17:02:00 +0100 +Subject: [PATCH 25/46] Fix gdb.base/store.exp on s390x + +On s390x-linux, I get: +... +(gdb) print l^M +$29 = 0^M +(gdb) FAIL: gdb.base/store.exp: var doublest l; print old l, expecting -1 +... + +So, we're in wack_doublest trying to print l, which is a copy of parameter u: +... + register doublest l = u, r = v; +... +which does have the expected value: +... +(gdb) p u +$1 = -1 +... +which is a long double, 16 bytes and looks like this: +... +(gdb) p /x u +$3 = 0xbfff0000000000000000000000000000 +... + +Parameter u is passed in two registers: +... + <2><6a5>: Abbrev Number: 15 (DW_TAG_formal_parameter) + <6a6> DW_AT_name : v + <69e> DW_AT_location : 6 byte block: 50 93 8 51 93 8 \ + (DW_OP_reg0 (r0); DW_OP_piece: 8; DW_OP_reg1 (r1); DW_OP_piece: 8) +... +and indeed we find the msw in r0 and the lsw in r1: +... +(gdb) p /x $r0 +$4 = 0xbfff000000000000 +(gdb) p /x $r1 +$5 = 0x0 +(gdb) +... + +Likewise, variable l consists of two registers: +... + <2><6b5>: Abbrev Number: 13 (DW_TAG_variable) + <6b6> DW_AT_name : l + <6be> DW_AT_location : 6 byte block: 68 93 8 69 93 8 \ + (DW_OP_reg24 (f8); DW_OP_piece: 8; DW_OP_reg25 (f10); DW_OP_piece: 8) +... +and we find the same values there: +... +(gdb) p /x $f8 +$6 = 0xbfff000000000000 +(gdb) p /x $f10 +$7 = 0x0 +... + +So, we get the expected results when fetching the value from two gprs, but not +when fetching the value from two fprs. + +When fetching the values from the two fprs, we stumble upon a particularity of +the DWARF register numbers as defined by the s390x ABI [1]: dwarf register 24 +maps to both floating-point register f8 (8 bytes), and vector register v8 +(16 bytes). + +In s390_dwarf_reg_to_regnum, it's determined which of the two is chosen, and +if available vector registers are preferred over floating-point registers, so +v8 is chosen, and used to fetch the value. + +Since the size of the DW_OP_piece is 8 bytes, and the register size is 16 +bytes, this bit in rw_pieced_value is activated: +... + /* If the piece is located in a register, but does not + occupy the entire register, the placement of the piece + within that register is defined by the ABI. */ + bits_to_skip + += 8 * gdbarch_dwarf2_reg_piece_offset (arch, gdb_regnum, + p->size / 8); +... +but since the default implemention default_dwarf2_reg_piece_offset does not +match the s390x ABI, we get the wrong answer. + +This is a known problem, see FOSDEM 2018 presentation "DWARF Pieces And Other +DWARF Location Woes" [2]. + +Fix this by adding s390_dwarf2_reg_piece_offset, roughly implementing the same +logic as in s390_value_from_register. + +Tested on s390x-linux. + +Approved-By: Tom Tromey + +[1] https://github.com/IBM/s390x-abi +[2] https://archive.fosdem.org/2018/schedule/event/dwarfpieces +--- + gdb/s390-tdep.c | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c +index 2609b42f797..a7c58b37276 100644 +--- a/gdb/s390-tdep.c ++++ b/gdb/s390-tdep.c +@@ -1260,6 +1260,28 @@ s390_value_from_register (gdbarch *gdbarch, type *type, int regnum, + return value; + } + ++/* Implementation of the gdbarch_dwarf2_reg_piece_offset hook. */ ++ ++static ULONGEST ++s390_dwarf2_reg_piece_offset (gdbarch *gdbarch, int gdb_regnum, ULONGEST size) ++{ ++ s390_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); ++ ++ /* Floating point register. */ ++ if (gdb_regnum >= S390_F0_REGNUM && gdb_regnum <= S390_F15_REGNUM) ++ return 0; ++ ++ /* Vector register, v0 - v15. */ ++ if (regnum_is_vxr_full (tdep, gdb_regnum)) ++ return 0; ++ ++ /* Vector register, v16 - v31. */ ++ if (gdb_regnum >= S390_V16_REGNUM && gdb_regnum <= S390_V31_REGNUM) ++ return 0; ++ ++ return default_dwarf2_reg_piece_offset (gdbarch, gdb_regnum, size); ++} ++ + /* Implement pseudo_register_name tdesc method. */ + + static const char * +@@ -7259,6 +7281,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) + set_gdbarch_stab_reg_to_regnum (gdbarch, s390_dwarf_reg_to_regnum); + set_gdbarch_dwarf2_reg_to_regnum (gdbarch, s390_dwarf_reg_to_regnum); + set_gdbarch_value_from_register (gdbarch, s390_value_from_register); ++ set_gdbarch_dwarf2_reg_piece_offset (gdbarch, s390_dwarf2_reg_piece_offset); + + /* Pseudo registers. */ + set_gdbarch_pseudo_register_read (gdbarch, s390_pseudo_register_read); +-- +2.43.0 + diff --git a/fix-gdb.dap-step-out.exp-on-s390x.patch b/fix-gdb.dap-step-out.exp-on-s390x.patch new file mode 100644 index 0000000..d0393ed --- /dev/null +++ b/fix-gdb.dap-step-out.exp-on-s390x.patch @@ -0,0 +1,97 @@ +From 6775ce3f5e936a50d883abfb60cafa80f8b76cf6 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 10 Dec 2024 11:53:31 +0100 +Subject: [PATCH 19/46] Fix gdb.dap/step-out.exp on s390x + +With test-case gdb.dap/step-out.exp on s390x-linux, I get: +... +>>> {"seq": 7, "type": "request", "command": "scopes", "arguments": {"frameId": 0}} +Content-Length: 569^M +^M +{"request_seq": 7, "type": "response", "command": "scopes", "body": {"scopes": [{"variablesReference": 1, "name": "Locals", "presentationHint": "locals", "expensive": false, "namedVariables": 1, "line": 35, "source": {"name": "step-out.c", "path": "/home/vries/gdb/src/gdb/testsuite/gdb.dap/step-out.c"}}, {"variablesReference": 2, "name": "Registers", "presentationHint": "registers", "expensive": false, "namedVariables": 114, "line": 35, "source": {"name": "step-out.c", "path": "/home/vries/gdb/src/gdb/testsuite/gdb.dap/step-out.c"}}]}, "success": true, "seq": 21}PASS: gdb.dap/step-out.exp: get scopes success +FAIL: gdb.dap/step-out.exp: three scopes +... + +The problem is that the test-case expects three scopes: +... +lassign $scopes scope reg_scope return_scope +... +but the return_scope is missing because this doesn't work: +... +$ gdb -q -batch outputs/gdb.dap/step-out/step-out \ + -ex "b function_breakpoint_here" \ + -ex run \ + -ex finish + ... +Value returned has type: struct result. Cannot determine contents +... + +This is likely caused by a problem in gdb, but there's nothing wrong the DAP +support. + +Fix this by: +- allowing two scopes, and +- declaring the tests of return_scope unsupported. + +Tested on s390x-linux. + +Approved-By: Tom Tromey +--- + gdb/testsuite/gdb.dap/step-out.exp | 42 ++++++++++++++++-------------- + 1 file changed, 23 insertions(+), 19 deletions(-) + +diff --git a/gdb/testsuite/gdb.dap/step-out.exp b/gdb/testsuite/gdb.dap/step-out.exp +index 757f4ebdaca..491eaf71197 100644 +--- a/gdb/testsuite/gdb.dap/step-out.exp ++++ b/gdb/testsuite/gdb.dap/step-out.exp +@@ -59,24 +59,28 @@ set scopes [dap_check_request_and_response "get scopes" scopes \ + [format {o frameId [i %d]} $frame_id]] + set scopes [dict get [lindex $scopes 0] body scopes] + +-gdb_assert {[llength $scopes] == 2} "two scopes" +- +-lassign $scopes scope reg_scope +-gdb_assert {[dict get $scope name] == "Locals"} "scope is locals" +-gdb_assert {[dict get $scope presentationHint] == "locals"} \ +- "locals presentation hint" +-gdb_assert {[dict get $scope namedVariables] == 2} "two vars in scope" +- +-set num [dict get $scope variablesReference] +-set refs [lindex [dap_check_request_and_response "fetch arguments" \ +- "variables" \ +- [format {o variablesReference [i %d]} $num]] \ +- 0] +-set varlist [lindex [dict get $refs body variables] 0] +- +-gdb_assert {[dict get $varlist variablesReference] > 0} \ +- "variable has children" +-gdb_assert {[dict get $varlist name] == "(return)"} \ +- "variable is return value" ++gdb_assert {[llength $scopes] == 2 || [llength $scopes] == 3} "two or three scopes" ++lassign $scopes scope reg_scope return_scope ++ ++set test "scope is locals" ++if { $return_scope == "" } { ++ unsupported $test ++} else { ++ gdb_assert {[dict get $scope presentationHint] == "locals"} \ ++ "locals presentation hint" ++ gdb_assert {[dict get $scope namedVariables] == 2} "two vars in scope" ++ ++ set num [dict get $scope variablesReference] ++ set refs [lindex [dap_check_request_and_response "fetch arguments" \ ++ "variables" \ ++ [format {o variablesReference [i %d]} $num]] \ ++ 0] ++ set varlist [lindex [dict get $refs body variables] 0] ++ ++ gdb_assert {[dict get $varlist variablesReference] > 0} \ ++ "variable has children" ++ gdb_assert {[dict get $varlist name] == "(return)"} \ ++ "variable is return value" ++} + + dap_shutdown +-- +2.43.0 + diff --git a/fix-gdb.dwarf2-shortpiece.exp-on-s390x.patch b/fix-gdb.dwarf2-shortpiece.exp-on-s390x.patch new file mode 100644 index 0000000..87ab318 --- /dev/null +++ b/fix-gdb.dwarf2-shortpiece.exp-on-s390x.patch @@ -0,0 +1,56 @@ +From 2ccefe53891d9c1393853f5179f8e8046c95a6ce Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 19 Jun 2024 10:04:22 +0200 +Subject: [PATCH 17/46] Fix gdb.dwarf2/shortpiece.exp on s390x + +On s390x-linux, I run into: +... +(gdb) p (short []) s1^M +$3 = {0, 1, 0, }^M +(gdb) FAIL: gdb.dwarf2/shortpiece.exp: p (short []) s1 +... +while this is expected: +... +(gdb) p (short []) s1^M +$3 = {1, 0, 0, }^M +(gdb) PASS: gdb.dwarf2/shortpiece.exp: p (short []) s1 +... + +The type of s1 is: +... +(gdb) ptype s1 +type = struct S { + myint a; + myushort b; +} +... +so the difference is due the fact that viewing an int as two shorts gives +different results depending on the endianness. + +Fix this by allowing both results. + +Tested on x86_64-linux and s390x-linux. + +Approved-By: Tom Tromey +--- + gdb/testsuite/gdb.dwarf2/shortpiece.exp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.dwarf2/shortpiece.exp b/gdb/testsuite/gdb.dwarf2/shortpiece.exp +index f7ff805de7c..4fcdfcae57a 100644 +--- a/gdb/testsuite/gdb.dwarf2/shortpiece.exp ++++ b/gdb/testsuite/gdb.dwarf2/shortpiece.exp +@@ -138,7 +138,9 @@ gdb_test "p s2" \ + # This test verifies that GDB can print a pieced value casted to a + # different type. + gdb_test "p (int \[\]) s1" " = \\{1, \\}" +-gdb_test "p (short \[\]) s1" " = \\{1, 0, 0, \\}" ++set re_little [string_to_regexp "{1, 0, 0, }"] ++set re_big [string_to_regexp "{0, 1, 0, }"] ++gdb_test {p (short []) s1} " = ($re_little|$re_big)" + + # Test for correct output if the size of the original object is not a + # multiple of the array's element size. +-- +2.43.0 + diff --git a/fixup-gdb-6.5-gcore-buffer-limit-test.patch b/fixup-gdb-6.5-gcore-buffer-limit-test.patch new file mode 100644 index 0000000..de15457 --- /dev/null +++ b/fixup-gdb-6.5-gcore-buffer-limit-test.patch @@ -0,0 +1,25 @@ +From 388654c78086e5240fec47260e47d1deff4af43d Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 6 Feb 2025 13:27:57 +0100 +Subject: [PATCH 43/46] fixup-gdb-6.5-gcore-buffer-limit-test.patch + +--- + gdb/testsuite/gdb.base/gcore-excessive-memory.exp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/gdb/testsuite/gdb.base/gcore-excessive-memory.exp b/gdb/testsuite/gdb.base/gcore-excessive-memory.exp +index 31cf88ce78a..1ef595923ad 100644 +--- a/gdb/testsuite/gdb.base/gcore-excessive-memory.exp ++++ b/gdb/testsuite/gdb.base/gcore-excessive-memory.exp +@@ -14,6 +14,8 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + ++require can_spawn_for_attach ++ + if {[use_gdb_stub]} { + untested "skipping test because of use_gdb_stub" + return -1 +-- +2.43.0 + diff --git a/gdb-exp-fix-gdb.fortran-intrinsics.exp-fail-on-arm.patch b/gdb-exp-fix-gdb.fortran-intrinsics.exp-fail-on-arm.patch new file mode 100644 index 0000000..4ab4cd3 --- /dev/null +++ b/gdb-exp-fix-gdb.fortran-intrinsics.exp-fail-on-arm.patch @@ -0,0 +1,232 @@ +From 1e295ef5fa3a5a89e9ee08d6e60d971ddb9e6e46 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 31 Jul 2024 13:11:48 +0200 +Subject: [PATCH 13/46] [gdb/exp] Fix gdb.fortran/intrinsics.exp fail on arm + +When running test-case gdb.fortran/intrinsics.exp on arm-linux, I get: +... +(gdb) p cmplx (4,4,16)^M +/home/linux/gdb/src/gdb/f-lang.c:1002: internal-error: eval_op_f_cmplx: \ + Assertion `kind_arg->code () == TYPE_CODE_COMPLEX' failed.^M +A problem internal to GDB has been detected,^M +further debugging may prove unreliable.^M +----- Backtrace -----^M +FAIL: gdb.fortran/intrinsics.exp: p cmplx (4,4,16) (GDB internal error) +... + +The problem is that 16-byte floats are unsupported: +... +$ gfortran test.f90 +test.f90:2:17: + + 2 | REAL(kind=16) :: foo = 1 + | 1 +Error: Kind 16 not supported for type REAL at (1) +... +and consequently we end up with a builtin_real_s16 and builtin_complex_s16 with +code TYPE_CODE_ERROR. + +Fix this by bailing out asap when encountering such a type. + +Without this patch we're able to do the rather useless: +... +(gdb) ptype real*16 +type = real*16 +(gdb) ptype real_16 +type = real*16 +... +but with this patch we get: +... +(gdb) ptype real*16 +unsupported kind 16 for type real*4 +(gdb) ptype real_16 +unsupported type real*16 +... + +Tested on arm-linux. + +PR fortran/30537 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30537 +--- + gdb/f-exp.y | 39 +++++++++++++++++------- + gdb/testsuite/gdb.fortran/intrinsics.exp | 8 +++-- + gdb/testsuite/gdb.fortran/type-kinds.exp | 22 ++++++++++--- + gdb/testsuite/gdb.fortran/types.exp | 19 +++++++++++- + 4 files changed, 70 insertions(+), 18 deletions(-) + +diff --git a/gdb/f-exp.y b/gdb/f-exp.y +index bdf9c32a81b..259f274d341 100644 +--- a/gdb/f-exp.y ++++ b/gdb/f-exp.y +@@ -754,7 +754,11 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */ + | REAL_S8_KEYWORD + { $$ = parse_f_type (pstate)->builtin_real_s8; } + | REAL_S16_KEYWORD +- { $$ = parse_f_type (pstate)->builtin_real_s16; } ++ { $$ = parse_f_type (pstate)->builtin_real_s16; ++ if ($$->code () == TYPE_CODE_ERROR) ++ error (_("unsupported type %s"), ++ TYPE_SAFE_NAME ($$)); ++ } + | COMPLEX_KEYWORD + { $$ = parse_f_type (pstate)->builtin_complex; } + | COMPLEX_S4_KEYWORD +@@ -762,7 +766,11 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */ + | COMPLEX_S8_KEYWORD + { $$ = parse_f_type (pstate)->builtin_complex_s8; } + | COMPLEX_S16_KEYWORD +- { $$ = parse_f_type (pstate)->builtin_complex_s16; } ++ { $$ = parse_f_type (pstate)->builtin_complex_s16; ++ if ($$->code () == TYPE_CODE_ERROR) ++ error (_("unsupported type %s"), ++ TYPE_SAFE_NAME ($$)); ++ } + | SINGLE PRECISION + { $$ = parse_f_type (pstate)->builtin_real;} + | DOUBLE PRECISION +@@ -1156,12 +1164,9 @@ push_kind_type (LONGEST val, struct type *type) + type_stack->push (tp_kind); + } + +-/* Called when a type has a '(kind=N)' modifier after it, for example +- 'character(kind=1)'. The BASETYPE is the type described by 'character' +- in our example, and KIND is the integer '1'. This function returns a +- new type that represents the basetype of a specific kind. */ ++/* Helper function for convert_to_kind_type. */ + static struct type * +-convert_to_kind_type (struct type *basetype, int kind) ++convert_to_kind_type_1 (struct type *basetype, int kind) + { + if (basetype == parse_f_type (pstate)->builtin_character) + { +@@ -1211,13 +1216,25 @@ convert_to_kind_type (struct type *basetype, int kind) + return parse_f_type (pstate)->builtin_integer_s8; + } + +- error (_("unsupported kind %d for type %s"), +- kind, TYPE_SAFE_NAME (basetype)); +- +- /* Should never get here. */ + return nullptr; + } + ++/* Called when a type has a '(kind=N)' modifier after it, for example ++ 'character(kind=1)'. The BASETYPE is the type described by 'character' ++ in our example, and KIND is the integer '1'. This function returns a ++ new type that represents the basetype of a specific kind. */ ++static struct type * ++convert_to_kind_type (struct type *basetype, int kind) ++{ ++ struct type *res = convert_to_kind_type_1 (basetype, kind); ++ ++ if (res == nullptr || res->code () == TYPE_CODE_ERROR) ++ error (_("unsupported kind %d for type %s"), ++ kind, TYPE_SAFE_NAME (basetype)); ++ ++ return res; ++} ++ + struct f_token + { + /* The string to match against. */ +diff --git a/gdb/testsuite/gdb.fortran/intrinsics.exp b/gdb/testsuite/gdb.fortran/intrinsics.exp +index 60c79f956dc..060bb53db97 100644 +--- a/gdb/testsuite/gdb.fortran/intrinsics.exp ++++ b/gdb/testsuite/gdb.fortran/intrinsics.exp +@@ -112,10 +112,14 @@ gdb_test "ptype cmplx (4,4)" "= complex\\*4" + gdb_test "p cmplx (-14,-4)" "= \\(-14,-4\\)" + gdb_test "p cmplx (4,4,4)" "\\(4,4\\)" + gdb_test "p cmplx (4,4,8)" "\\(4,4\\)" +-gdb_test "p cmplx (4,4,16)" "\\(4,4\\)" ++set re_unsupported_kind_16 \ ++ [string_to_regexp "unsupported kind 16 for type complex*4"] ++gdb_test "p cmplx (4,4,16)" \ ++ ([string_to_regexp " = (4,4)"]|$re_unsupported_kind_16) + gdb_test "ptype cmplx (4,4,4)" "= complex\\*4" + gdb_test "ptype cmplx (4,4,8)" "= complex\\*8" +-gdb_test "ptype cmplx (4,4,16)" "= complex\\*16" ++gdb_test "ptype cmplx (4,4,16)" \ ++ ([string_to_regexp " = complex*16"]|$re_unsupported_kind_16) + + gdb_test "p cmplx (4,4,1)" "unsupported kind 1 for type complex\\*4" + gdb_test "p cmplx (4,4,-1)" "unsupported kind -1 for type complex\\*4" +diff --git a/gdb/testsuite/gdb.fortran/type-kinds.exp b/gdb/testsuite/gdb.fortran/type-kinds.exp +index ab5f19f97a4..a6f2aa4e870 100644 +--- a/gdb/testsuite/gdb.fortran/type-kinds.exp ++++ b/gdb/testsuite/gdb.fortran/type-kinds.exp +@@ -43,12 +43,20 @@ proc test_basic_parsing_of_type_kinds {} { + test_cast_1_to_type_kind "complex" "" "\\(1,0\\)" "8" + test_cast_1_to_type_kind "complex" "4" "\\(1,0\\)" "8" + test_cast_1_to_type_kind "complex" "8" "\\(1,0\\)" "16" +- test_cast_1_to_type_kind "complex" "16" "\\(1,0\\)" "32" ++ set re_unsupported_kind \ ++ [string_to_regexp "unsupported kind 16 for type complex*4"] ++ test_cast_1_to_type_kind "complex" "16" \ ++ [string_to_regexp (1,0)]|$re_unsupported_kind \ ++ 32|$re_unsupported_kind + + test_cast_1_to_type_kind "real" "" "1" "4" + test_cast_1_to_type_kind "real" "4" "1" "4" + test_cast_1_to_type_kind "real" "8" "1" "8" +- test_cast_1_to_type_kind "real" "16" "1" "16" ++ set re_unsupported_kind \ ++ [string_to_regexp "unsupported kind 16 for type real*4"] ++ test_cast_1_to_type_kind "real" "16" \ ++ 1|$re_unsupported_kind \ ++ 16|$re_unsupported_kind + + test_cast_1_to_type_kind "logical" "" "\\.TRUE\\." "4" + test_cast_1_to_type_kind "logical" "1" "\\.TRUE\\." "1" +@@ -83,11 +91,17 @@ proc test_old_star_type_sizes {} { + + gdb_test "p ((complex*4) 1)" " = \\(1,0\\)" + gdb_test "p ((complex*8) 1)" " = \\(1,0\\)" +- gdb_test "p ((complex*16) 1)" " = \\(1,0\\)" ++ set re_unsupported_kind \ ++ [string_to_regexp "unsupported kind 16 for type complex*4"] ++ gdb_test "p ((complex*16) 1)" \ ++ [string_to_regexp " = (1,0)"]|$re_unsupported_kind + + gdb_test "p ((real*4) 1)" " = 1" + gdb_test "p ((real*8) 1)" " = 1" +- gdb_test "p ((real*16) 1)" " = 1" ++ set re_unsupported_kind \ ++ [string_to_regexp "unsupported kind 16 for type real*4"] ++ gdb_test "p ((real*16) 1)" \ ++ "( = 1|$re_unsupported_kind)" + + gdb_test "p ((logical*1) 1)" " = \\.TRUE\\." + gdb_test "p ((logical*4) 1)" " = \\.TRUE\\." +diff --git a/gdb/testsuite/gdb.fortran/types.exp b/gdb/testsuite/gdb.fortran/types.exp +index 83b109869e6..edbf5abee97 100644 +--- a/gdb/testsuite/gdb.fortran/types.exp ++++ b/gdb/testsuite/gdb.fortran/types.exp +@@ -94,7 +94,24 @@ proc test_primitive_types_known {} { + # While TYPE_KIND is allowed as input, GDB will always return the + # Fortran notation TYPE*KIND + regsub -all "_" $type "\*" type_res +- gdb_test "ptype $type" [string_to_regexp "type = $type_res"] ++ set re [string_to_regexp "type = $type_res"] ++ switch $type { ++ real*16 - complex*16 { ++ regexp {^[^*_]*} $type base ++ set re_unsupported \ ++ [string_to_regexp \ ++ "unsupported kind 16 for type $base*4"] ++ set re ($re|$re_unsupported) ++ } ++ real_16 - complex_16 { ++ set re_unsupported \ ++ [string_to_regexp \ ++ "unsupported type $type_res"] ++ set re ($re|$re_unsupported) ++ } ++ } ++ ++ gdb_test "ptype $type" $re + } + } + +-- +2.43.0 + diff --git a/gdb-prune-inferior-after-switching-inferior.patch b/gdb-prune-inferior-after-switching-inferior.patch new file mode 100644 index 0000000..a5de740 --- /dev/null +++ b/gdb-prune-inferior-after-switching-inferior.patch @@ -0,0 +1,130 @@ +From 22d05b4879b8608e3768483735140a729952b565 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sun, 18 Aug 2024 20:51:29 +0200 +Subject: [PATCH 39/46] [gdb] Prune inferior after switching inferior + +Usually with test-case gdb.python/py-progspace-events.exp I get: +... +(gdb) inferior 1^M +[Switching to inferior 1 [process 4116] (py-progspace-events)]^M +[Switching to thread 1.1 (Thread 0xf77d0ce0 (LWP 4116))]^M +28 { /* Nothing. */ }^M +(gdb) PASS: gdb.python/py-progspace-events.exp: inferior 1 +step^M +FreeProgspaceEvent: ^M +do_parent_stuff () at py-progspace-events.c:41^M +41 ++global_var;^M +(gdb) PASS: gdb.python/py-progspace-events.exp: step +... + +But occasionally I run into the following FAIL: +... +(gdb) inferior 1^M +[Switching to inferior 1 [process 5199] (py-progspace-events)]^M +[Switching to thread 1.1 (Thread 0xf77d0ce0 (LWP 5199))]^M +28 { /* Nothing. */ }^M +(gdb) FreeProgspaceEvent: ^M +FAIL: gdb.python/py-progspace-events.exp: inferior 1 (timeout) +... + +This is caused by a race between the handling of an event, and the +"inferior 1" command. + +In the passing case, the event is handled first. During which prune_inferiors +is called, but it can't remove inferior 2, because it's still the current one. + +In the failing case, the "inferior 1" command is handled first. Then during +handling of the event, prune_inferiors is called, and it can remove inferior 2 +because it's no longer the current one. + +This looks like a test-case issue to me, but ISTM that we can do better: by +calling prune_inferiors asap, at the end of the "inferior 1" command, we +stabilize the moment when the inferior is removed: +... +(gdb) inferior 1^M +[Switching to inferior 1 [process 5199] (py-progspace-events)]^M +[Switching to thread 1.1 (Thread 0xf77d0ce0 (LWP 5199))]^M +28 { /* Nothing. */ }^M +FreeProgspaceEvent: ^M +(gdb) PASS: gdb.python/py-progspace-events.exp: inferior 1 +... + +This also allows us to simplify the test-case by removing the step command, +which is no longer required to trigger the pruning of the inferior. + +Tested on x86_64-linux. + +Approved-by: Kevin Buettner + +PR gdb/31440 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31440 +--- + gdb/inferior.c | 4 +++ + .../gdb.python/py-progspace-events.exp | 31 +++---------------- + 2 files changed, 9 insertions(+), 26 deletions(-) + +diff --git a/gdb/inferior.c b/gdb/inferior.c +index 0522cb5c14d..2a19c5b19a1 100644 +--- a/gdb/inferior.c ++++ b/gdb/inferior.c +@@ -790,6 +790,10 @@ inferior_command (const char *args, int from_tty) + notify_user_selected_context_changed + (USER_SELECTED_INFERIOR); + } ++ ++ /* Switching current inferior may have made one of the inferiors ++ prunable, so prune it. */ ++ prune_inferiors (); + } + } + +diff --git a/gdb/testsuite/gdb.python/py-progspace-events.exp b/gdb/testsuite/gdb.python/py-progspace-events.exp +index 95e4ca8da0b..9dfc7573d40 100644 +--- a/gdb/testsuite/gdb.python/py-progspace-events.exp ++++ b/gdb/testsuite/gdb.python/py-progspace-events.exp +@@ -79,37 +79,16 @@ gdb_test "continue" \ + "\\\[Inferior $decimal \[^\r\n\]+ exited normally\\\]"] \ + "continue until inferior 2 exits" + +-gdb_test "inferior 1" "\\\[Switching to inferior 1 .*" +- +-# Step the inferior. During this process GDB will prune the now ++# Switch to inferior 1. During this process GDB will prune the now + # defunct inferior, which deletes its program space, which should + # trigger the FreeProgspaceEvent. + # +-# However, there is a slight problem. When the target is remote, and +-# GDB is accessing files using remote fileio, then GDB will attempt to +-# prune the inferior at a point in time when the remote target is +-# waiting for a stop reply. Pruning an inferior causes GDB to close +-# files associated with that inferior. +-# +-# In non-async mode we can't send fileio packets while waiting for a +-# stop reply, so the attempts to close files fails, and this shows up +-# as an error. +-# +-# As this error has nothing to do with the feature being tested here, +-# we just accept the error message, the important part is the +-# 'FreeProgspaceEvent' string, so long as that appears (just once) +-# then the test is a success. +-set warning_msg \ +- [multi_line \ +- "warning: cannot close \"\[^\r\n\]+\": Cannot execute this command while the target is running\\." \ +- "Use the \"interrupt\" command to stop the target" \ +- "and then try again\\."] + +-gdb_test "step" \ ++gdb_test "inferior 1" \ + [multi_line \ +- "^FreeProgspaceEvent.*: (?:\r\n$warning_msg)*" \ +- "do_parent_stuff \\(\\) at \[^\r\n\]+" \ +- "$decimal\\s+\[^\r\n\]+"] ++ "\\\[Switching to inferior 1 .*" \ ++ ".*" \ ++ "FreeProgspaceEvent.*: "] + + # Let this inferior run to completion. + gdb_continue_to_end +-- +2.43.0 + diff --git a/gdb-symtab-fix-target-type-of-complex-long-double-on.patch b/gdb-symtab-fix-target-type-of-complex-long-double-on.patch new file mode 100644 index 0000000..d62996a --- /dev/null +++ b/gdb-symtab-fix-target-type-of-complex-long-double-on.patch @@ -0,0 +1,337 @@ +From e485fec626c14303a31bf7eab35c4288f9710c9d Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 19 Jun 2024 17:32:55 +0200 +Subject: [PATCH 07/46] [gdb/symtab] Fix target type of complex long double on + arm + +When running test-case gdb.base/complex-parts.exp on arm-linux, I get: +... +(gdb) p $_cimag (z3)^M +$6 = 6.5^M +(gdb) PASS: gdb.base/complex-parts.exp: long double imaginary: p $_cimag (z3) +ptype $^M +type = double^M +(gdb) FAIL: gdb.base/complex-parts.exp: long double imaginary: ptype $ +... + +Given that z3 is a complex long double, the test-case expects the type of the +imaginary part of z3 to be long double, but it's double instead. + +This is due to the fact that the dwarf info doesn't specify an explicit target +type: +... + <5b> DW_AT_name : z3 + <60> DW_AT_type : <0xa4> + ... + <1>: Abbrev Number: 2 (DW_TAG_base_type) + DW_AT_byte_size : 16 + DW_AT_encoding : 3 (complex float) + DW_AT_name : complex long double +... +and consequently we're guessing in dwarf2_init_complex_target_type based on +the size: +... + case 64: + tt = builtin_type (gdbarch)->builtin_double; + break; + case 96: /* The x86-32 ABI specifies 96-bit long double. */ + case 128: + tt = builtin_type (gdbarch)->builtin_long_double; + break; +... + +For arm-linux, complex long double is 16 bytes, so the target type is assumed +to be 8 bytes, which is handled by the "case 64", which gets us double +instead of long double. + +Fix this by searching for "long" in the name_hint parameter, and using long +double instead. + +Note that base types in dwarf are not allowed to contain references to other +types, and the complex types are base types, so the missing explicit target +type is standard-conformant. + +A gcc PR was filed to add this as a dwarf extension ( +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115272 ). + +Tested on arm-linux. +--- + gdb/dwarf2/read.c | 10 +- + .../gdb.dwarf2/dw2-complex-parts.exp | 244 ++++++++++++++++++ + 2 files changed, 253 insertions(+), 1 deletion(-) + create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-complex-parts.exp + +diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c +index 7cd1d2b4c4e..18054d0070d 100644 +--- a/gdb/dwarf2/read.c ++++ b/gdb/dwarf2/read.c +@@ -15123,7 +15123,15 @@ dwarf2_init_complex_target_type (struct dwarf2_cu *cu, + tt = builtin_type (gdbarch)->builtin_float; + break; + case 64: +- tt = builtin_type (gdbarch)->builtin_double; ++ if (builtin_type (gdbarch)->builtin_long_double->length () == 8 ++ && name_hint != nullptr ++ && strstr (name_hint, "long") != nullptr) ++ { ++ /* Use "long double" for "complex long double". */ ++ tt = builtin_type (gdbarch)->builtin_long_double; ++ } ++ else ++ tt = builtin_type (gdbarch)->builtin_double; + break; + case 96: /* The x86-32 ABI specifies 96-bit long double. */ + case 128: +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-complex-parts.exp b/gdb/testsuite/gdb.dwarf2/dw2-complex-parts.exp +new file mode 100644 +index 00000000000..281e87d2fc8 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-complex-parts.exp +@@ -0,0 +1,244 @@ ++# Copyright 2024 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# Test complex types, and their parts. Dwarf assembly counterpart of ++# gdb.base/complex-parts.exp. ++# ++# In dwarf, base types are not allowed to have references to other types. And ++# because complex types are modeled as base types, gdb has to figure out what ++# the part type is. ++# ++# It would be easier for gdb if compilers would add a dwarf extension and ++# supply this information, but that may or may not happen ++# ( https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115272 ). ++ ++load_lib dwarf.exp ++ ++# This test can only be run on targets which support DWARF-2 and use gas. ++require dwarf2_support ++ ++standard_testfile main.c -debug.S ++ ++if [prepare_for_testing "failed to prepare" $testfile \ ++ "${srcfile}" {}] { ++ return -1 ++} ++ ++set float_size [get_sizeof float 0] ++set double_size [get_sizeof double 0] ++set long_double_size [get_sizeof "long double" 0] ++ ++set int_size [get_sizeof int 0] ++ ++# Create the DWARF. ++set asm_file [standard_output_file $srcfile2] ++Dwarf::assemble $asm_file { ++ cu { version 2 } { ++ compile_unit {} { ++ # Main. ++ ++ declare_labels int_type ++ ++ int_type: DW_TAG_base_type { ++ {DW_AT_byte_size $::int_size DW_FORM_sdata} ++ {DW_AT_encoding @DW_ATE_signed} ++ {DW_AT_name int} ++ } ++ ++ DW_TAG_subprogram { ++ {MACRO_AT_func {main}} ++ {type :$int_type} ++ } ++ ++ # GCC complex float. ++ ++ declare_labels cf_type cd_type cld_type ++ ++ cf_type: DW_TAG_base_type { ++ {DW_AT_byte_size [expr 2 * $::float_size] DW_FORM_sdata} ++ {DW_AT_encoding @DW_ATE_complex_float} ++ {DW_AT_name "complex float"} ++ } ++ ++ cd_type: DW_TAG_base_type { ++ {DW_AT_byte_size [expr 2 * $::double_size] DW_FORM_sdata} ++ {DW_AT_encoding @DW_ATE_complex_float} ++ {DW_AT_name "complex double"} ++ } ++ ++ cld_type: DW_TAG_base_type { ++ {DW_AT_byte_size [expr 2 * $::long_double_size] DW_FORM_sdata} ++ {DW_AT_encoding @DW_ATE_complex_float} ++ {DW_AT_name "complex long double"} ++ } ++ ++ DW_TAG_variable { ++ {name var_complex_float} ++ {DW_AT_type :$cf_type} ++ } ++ ++ DW_TAG_variable { ++ {name var_complex_double} ++ {DW_AT_type :$cd_type} ++ } ++ ++ DW_TAG_variable { ++ {name var_complex_long_double} ++ {DW_AT_type :$cld_type} ++ } ++ ++ # GCC complex int. ++ # This is what gcc currently generates, see gcc PR debug/93988. ++ ++ declare_labels ci_type ++ ++ ci_type: DW_TAG_base_type { ++ {DW_AT_byte_size [expr 2 * $::int_size] DW_FORM_sdata} ++ {DW_AT_encoding @DW_ATE_lo_user} ++ {DW_AT_name "complex int"} ++ } ++ ++ DW_TAG_variable { ++ {name var_complex_int} ++ {DW_AT_type :$ci_type} ++ } ++ ++ # Clang complex float. ++ # This is what clang currently generates, see this issue ( ++ # https://github.com/llvm/llvm-project/issues/52996 ). ++ ++ declare_labels clang_cf_type clang_cd_type clang_cld_type ++ ++ clang_cf_type: DW_TAG_base_type { ++ {DW_AT_byte_size [expr 2 * $::float_size] DW_FORM_sdata} ++ {DW_AT_encoding @DW_ATE_complex_float} ++ {DW_AT_name "complex"} ++ } ++ ++ DW_TAG_variable { ++ {name var_complex_clang_float} ++ {DW_AT_type :$clang_cf_type} ++ } ++ ++ clang_cd_type: DW_TAG_base_type { ++ {DW_AT_byte_size [expr 2 * $::double_size] DW_FORM_sdata} ++ {DW_AT_encoding @DW_ATE_complex_float} ++ {DW_AT_name "complex"} ++ } ++ ++ DW_TAG_variable { ++ {name var_complex_clang_double} ++ {DW_AT_type :$clang_cd_type} ++ } ++ ++ clang_cld_type: DW_TAG_base_type { ++ {DW_AT_byte_size [expr 2 * $::long_double_size] DW_FORM_sdata} ++ {DW_AT_encoding @DW_ATE_complex_float} ++ {DW_AT_name "complex"} ++ } ++ ++ DW_TAG_variable { ++ {name var_complex_clang_long_double} ++ {DW_AT_type :$clang_cld_type} ++ } ++ } ++ } ++} ++ ++if [prepare_for_testing "failed to prepare" $testfile \ ++ "${asm_file} ${srcfile}" {}] { ++ return -1 ++} ++ ++if ![runto_main] { ++ return -1 ++} ++ ++proc do_test { type {clang 0}} { ++ with_test_prefix $type { ++ with_test_prefix clang=$clang { ++ ++ if { $clang } { ++ set type_id [regsub -all " " $type _] ++ set var "var_complex_clang_$type_id" ++ ++ # Gdb could try to synthesize better names, see enhancement ++ # PR symtab/31858. ++ set ctype "complex" ++ set ctype_id "complex" ++ } else { ++ set ctype "complex $type" ++ set type_id [regsub -all " " $type _] ++ set ctype_id [regsub -all " " $ctype _] ++ set var "var_$ctype_id" ++ } ++ ++ gdb_test "ptype '$type'" \ ++ "type = $type" ++ ++ gdb_test "ptype '$ctype'" \ ++ "type = $ctype" ++ ++ eval set type_size \$::${type_id}_size ++ ++ gdb_test "p sizeof ('$type')" \ ++ " = $type_size" ++ ++ if { ! $clang } { ++ # With clang, the ctype name does not uniquely map to a type, ++ # so the size is unpredictable. ++ gdb_test "p sizeof ('$ctype')" \ ++ " = [expr 2 * $type_size]" ++ } ++ ++ set re_kfail \ ++ [string_to_regexp \ ++ "'var_complex_int' has unknown type; cast it to its declared type"] ++ ++ foreach f { {$_cimag} {$_creal} } { ++ gdb_test_multiple "p $f ($var)" "" { ++ -re -wrap " = " { ++ pass $gdb_test_name ++ } ++ -re -wrap $re_kfail { ++ kfail gdb/31857 $gdb_test_name ++ } ++ } ++ ++ if { $clang } { ++ # Without a specific complex type name, it's ++ # unpredictable which type name the part will have. ++ gdb_test {ptype $} \ ++ "type = (float|double|long double)" \ ++ "ptype $f" ++ } else { ++ gdb_test {ptype $} \ ++ "type = $type" \ ++ "ptype $f" ++ } ++ } ++ } ++ } ++} ++ ++do_test "float" ++do_test "double" ++do_test "long double" ++ ++do_test "int" ++ ++do_test "float" 1 ++do_test "double" 1 ++do_test "long double" 1 +-- +2.43.0 + diff --git a/gdb-tdep-fix-arm-thumb2-hw-breakpoint.patch b/gdb-tdep-fix-arm-thumb2-hw-breakpoint.patch new file mode 100644 index 0000000..d0f7ca0 --- /dev/null +++ b/gdb-tdep-fix-arm-thumb2-hw-breakpoint.patch @@ -0,0 +1,264 @@ +From 64dc13a4571b4092726291f3ee30bf5c2166fa13 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Sat, 27 Jul 2024 10:05:20 +0200 +Subject: [PATCH 09/46] [gdb/tdep] Fix arm thumb2 hw breakpoint + +On an aarch64-linux system with 32-bit userland running in a chroot, and using +target board unix/mthumb I get: +... +(gdb) hbreak hbreak.c:27^M +Hardware assisted breakpoint 2 at 0x4004e2: file hbreak.c, line 27.^M +(gdb) PASS: gdb.base/hbreak.exp: hbreak +continue^M +Continuing.^M +Unexpected error setting breakpoint: Invalid argument.^M +(gdb) XFAIL: gdb.base/hbreak.exp: continue to break-at-exit after hbreak +... +due to this call in arm_linux_nat_target::low_prepare_to_resume: +... + if (ptrace (PTRACE_SETHBPREGS, pid, + (PTRACE_TYPE_ARG3) ((i << 1) + 1), &bpts[i].address) < 0) + perror_with_name (_("Unexpected error setting breakpoint")); +... + +This problem does not happen if instead we use a 4-byte aligned address. + +This may or may not be a kernel bug. + +Work around this by first using an inoffensive address bpts[i].address & ~0x7. + +Likewise in arm_target::low_prepare_to_resume, which fixes the same fail on +target board native-gdbserver/mthumb. + +While we're at it: +- use arm_hwbp_control_is_initialized in + arm_linux_nat_target::low_prepare_to_resume, +- handle the !arm_hwbp_control_is_initialized case explicitly, +- add missing '_()' in arm_target::low_prepare_to_resume, +- make error messages identical between arm_target::low_prepare_to_resume and + arm_linux_nat_target::low_prepare_to_resume, +- factor out sethbpregs_hwbp_address and sethbpregs_hwbp_control to + make the implementation more readable. + +Remove the tentative xfail added in d0af16d5a10 ("[gdb/testsuite] Add xfail in +gdb.base/hbreak.exp") by simply reverting the commit. + +Tested on arm-linux. + +Approved-By: Luis Machado +Tested-By: Luis Machado +--- + gdb/arm-linux-nat.c | 98 ++++++++++++++++++++++++++++++++++---- + gdbserver/linux-arm-low.cc | 65 ++++++++++++++++++++----- + 2 files changed, 141 insertions(+), 22 deletions(-) + +diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c +index ac53bed72d7..7b4faacd601 100644 +--- a/gdb/arm-linux-nat.c ++++ b/gdb/arm-linux-nat.c +@@ -876,6 +876,14 @@ arm_hwbp_control_is_enabled (arm_hwbp_control_t control) + return control & 0x1; + } + ++/* Is the breakpoint control value CONTROL initialized? */ ++ ++static int ++arm_hwbp_control_is_initialized (arm_hwbp_control_t control) ++{ ++ return control != 0; ++} ++ + /* Change a breakpoint control word so that it is in the disabled state. */ + static arm_hwbp_control_t + arm_hwbp_control_disable (arm_hwbp_control_t control) +@@ -1234,6 +1242,34 @@ arm_linux_nat_target::low_delete_thread (struct arch_lwp_info *arch_lwp) + xfree (arch_lwp); + } + ++/* For PID, set the address register of hardware breakpoint pair I to ++ ADDRESS. */ ++ ++static void ++sethbpregs_hwbp_address (int pid, int i, unsigned int address) ++{ ++ PTRACE_TYPE_ARG3 address_reg = (PTRACE_TYPE_ARG3) ((i << 1) + 1); ++ ++ errno = 0; ++ ++ if (ptrace (PTRACE_SETHBPREGS, pid, address_reg, &address) < 0) ++ perror_with_name (_("Unexpected error updating breakpoint address")); ++} ++ ++/* For PID, set the control register of hardware breakpoint pair I to ++ CONTROL. */ ++ ++static void ++sethbpregs_hwbp_control (int pid, int i, arm_hwbp_control_t control) ++{ ++ PTRACE_TYPE_ARG3 control_reg = (PTRACE_TYPE_ARG3) ((i << 1) + 2); ++ ++ errno = 0; ++ ++ if (ptrace (PTRACE_SETHBPREGS, pid, control_reg, &control) < 0) ++ perror_with_name (_("Unexpected error setting breakpoint control")); ++} ++ + /* Called when resuming a thread. + The hardware debug registers are updated when there is any change. */ + +@@ -1257,16 +1293,58 @@ arm_linux_nat_target::low_prepare_to_resume (struct lwp_info *lwp) + for (i = 0; i < arm_linux_get_hw_breakpoint_count (); i++) + if (arm_lwp_info->bpts_changed[i]) + { +- errno = 0; +- if (arm_hwbp_control_is_enabled (bpts[i].control)) +- if (ptrace (PTRACE_SETHBPREGS, pid, +- (PTRACE_TYPE_ARG3) ((i << 1) + 1), &bpts[i].address) < 0) +- perror_with_name (_("Unexpected error setting breakpoint")); +- +- if (bpts[i].control != 0) +- if (ptrace (PTRACE_SETHBPREGS, pid, +- (PTRACE_TYPE_ARG3) ((i << 1) + 2), &bpts[i].control) < 0) +- perror_with_name (_("Unexpected error setting breakpoint")); ++ unsigned int address = bpts[i].address; ++ arm_hwbp_control_t control = bpts[i].control; ++ ++ if (!arm_hwbp_control_is_initialized (control)) ++ { ++ /* Nothing to do. */ ++ } ++ else if (!arm_hwbp_control_is_enabled (control)) ++ { ++ /* Disable hardware breakpoint, just write the control ++ register. */ ++ sethbpregs_hwbp_control (pid, i, control); ++ } ++ else ++ { ++ /* We used to do here simply: ++ 1. address_reg = address ++ 2. control_reg = control ++ but the write to address_reg can fail for thumb2 instructions if ++ the address is not 4-byte aligned. ++ ++ It's not clear whether this is a kernel bug or not, partly ++ because PTRACE_SETHBPREGS is undocumented. ++ ++ The context is that we're using two ptrace calls to set the two ++ halves of a register pair. For each ptrace call, the kernel must ++ check the arguments, and return -1 and set errno appropriately if ++ something is wrong. One of the aspects that needs validation is ++ whether, in terms of hw_breakpoint_arch_parse, the breakpoint ++ address matches the breakpoint length. This aspect can only be ++ checked by looking in both registers, which only makes sense ++ once a pair is written in full. ++ ++ The problem is that the kernel checks this aspect after each ++ ptrace call, and consequently for the first call it may be ++ checking this aspect using a default or previous value for the ++ part of the pair not written by the call. A possible fix for ++ this would be to only check this aspect when writing the ++ control reg. ++ ++ Work around this by first using an inoffensive address, which is ++ guaranteed to hit the offset == 0 case in ++ hw_breakpoint_arch_parse. */ ++ unsigned int aligned_address = address & ~0x7U; ++ if (aligned_address != address) ++ { ++ sethbpregs_hwbp_address (pid, i, aligned_address); ++ sethbpregs_hwbp_control (pid, i, control); ++ } ++ sethbpregs_hwbp_address (pid, i, address); ++ sethbpregs_hwbp_control (pid, i, control); ++ } + + arm_lwp_info->bpts_changed[i] = 0; + } +diff --git a/gdbserver/linux-arm-low.cc b/gdbserver/linux-arm-low.cc +index eec4649b235..ee89949a2a2 100644 +--- a/gdbserver/linux-arm-low.cc ++++ b/gdbserver/linux-arm-low.cc +@@ -819,6 +819,34 @@ arm_target::low_new_fork (process_info *parent, process_info *child) + child_lwp_info->wpts_changed[i] = 1; + } + ++/* For PID, set the address register of hardware breakpoint pair I to ++ ADDRESS. */ ++ ++static void ++sethbpregs_hwbp_address (int pid, int i, unsigned int address) ++{ ++ PTRACE_TYPE_ARG3 address_reg = (PTRACE_TYPE_ARG3) ((i << 1) + 1); ++ ++ errno = 0; ++ ++ if (ptrace (PTRACE_SETHBPREGS, pid, address_reg, &address) < 0) ++ perror_with_name (_("Unexpected error updating breakpoint address")); ++} ++ ++/* For PID, set the control register of hardware breakpoint pair I to ++ CONTROL. */ ++ ++static void ++sethbpregs_hwbp_control (int pid, int i, arm_hwbp_control_t control) ++{ ++ PTRACE_TYPE_ARG3 control_reg = (PTRACE_TYPE_ARG3) ((i << 1) + 2); ++ ++ errno = 0; ++ ++ if (ptrace (PTRACE_SETHBPREGS, pid, control_reg, &control) < 0) ++ perror_with_name (_("Unexpected error setting breakpoint control")); ++} ++ + /* Called when resuming a thread. + If the debug regs have changed, update the thread's copies. */ + void +@@ -834,19 +862,32 @@ arm_target::low_prepare_to_resume (lwp_info *lwp) + for (i = 0; i < arm_linux_get_hw_breakpoint_count (); i++) + if (lwp_info->bpts_changed[i]) + { +- errno = 0; ++ unsigned int address = proc_info->bpts[i].address; ++ arm_hwbp_control_t control = proc_info->bpts[i].control; + +- if (arm_hwbp_control_is_enabled (proc_info->bpts[i].control)) +- if (ptrace (PTRACE_SETHBPREGS, pid, +- (PTRACE_TYPE_ARG3) ((i << 1) + 1), +- &proc_info->bpts[i].address) < 0) +- perror_with_name ("Unexpected error setting breakpoint address"); +- +- if (arm_hwbp_control_is_initialized (proc_info->bpts[i].control)) +- if (ptrace (PTRACE_SETHBPREGS, pid, +- (PTRACE_TYPE_ARG3) ((i << 1) + 2), +- &proc_info->bpts[i].control) < 0) +- perror_with_name ("Unexpected error setting breakpoint"); ++ if (!arm_hwbp_control_is_initialized (control)) ++ { ++ /* Nothing to do. */ ++ } ++ else if (!arm_hwbp_control_is_enabled (control)) ++ { ++ /* Disable hardware breakpoint, just write the control ++ register. */ ++ sethbpregs_hwbp_control (pid, i, control); ++ } ++ else ++ { ++ /* See arm_linux_nat_target::low_prepare_to_resume for detailed ++ comment. */ ++ unsigned int aligned_address = address & ~0x7U; ++ if (aligned_address != address) ++ { ++ sethbpregs_hwbp_address (pid, i, aligned_address); ++ sethbpregs_hwbp_control (pid, i, control); ++ } ++ sethbpregs_hwbp_address (pid, i, address); ++ sethbpregs_hwbp_control (pid, i, control); ++ } + + lwp_info->bpts_changed[i] = 0; + } +-- +2.43.0 + diff --git a/gdb-tdep-fix-gdb.cp-non-trivial-retval.exp-on-riscv6.patch b/gdb-tdep-fix-gdb.cp-non-trivial-retval.exp-on-riscv6.patch new file mode 100644 index 0000000..04fe29a --- /dev/null +++ b/gdb-tdep-fix-gdb.cp-non-trivial-retval.exp-on-riscv6.patch @@ -0,0 +1,191 @@ +From 680379be6e3bcd4f8e1fcc85055e9dd0d6bbbaff Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 10 Jan 2025 10:32:00 +0100 +Subject: [PATCH 28/46] [gdb/tdep] Fix gdb.cp/non-trivial-retval.exp on + riscv64-linux +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +With test-case gdb.cp/non-trivial-retval.exp on riscv64-linux, I ran into: +... +(gdb) finish^M +Run till exit from #0 f1 (i1=i1@entry=23, i2=i2@entry=100) \ + at non-trivial-retval.cc:34^M +main () at non-trivial-retval.cc:163^M +163 B b = f2 (i1, i2);^M +Value returned is $6 = {a = -5856}^M +(gdb) FAIL: $exp: finish from f1 +... +where "Value returned is $6 = {a = 123}" is expected. + +The problem is that gdb thinks that the return value is in $a0: +... +$ gdb -q -batch non-trivial-retval \ + -ex "b f1" \ + -ex run \ + -ex "set debug riscv infcall on" \ + -ex finish +Breakpoint 1 at 0x80a: file non-trivial-retval.cc, line 34. +[Thread debugging using libthread_db enabled] +Using host libthread_db library "/lib/riscv64-linux-gnu/libthread_db.so.1". + +Breakpoint 1, f1 (i1=i1@entry=23, i2=i2@entry=100) at non-trivial-retval.cc:34 +34 { +[riscv-infcall] riscv_return_value: \ + [R] type: 'A', length: 0x4, alignment: 0x4, register a0 +[riscv-infcall] riscv_return_value: \ + [R] type: 'A', length: 0x4, alignment: 0x4, register a0 +[riscv-infcall] riscv_return_value: \ + [R] type: 'A', length: 0x4, alignment: 0x4, register a0 +main () at non-trivial-retval.cc:163 +163 B b = f2 (i1, i2); +Value returned is $1 = {a = -3568} +... +while $a0 actually contains a pointer to the returned value 123: +... +(gdb) p /x $a0 +$3 = 0x3ffffff210 +(gdb) p *((unsigned int *)$a0) +$5 = 123 +... + +The returned type is: +... +class A +{ +public: + A () {} + A (A &obj); + + int a; +}; +... +which is a C++ aggregate with a nontrivial (because it's user-defined) copy +constructor: + +According to the ABI [1], indeed this is returned by reference: +... +Values are returned in the same manner as a first named argument of the same +type would be passed. If such an argument would have been passed by +reference, the caller allocates memory for the return value, and passes the +address as an implicit first parameter. + ... +Aggregates larger than 2×XLEN bits are passed by reference and are replaced in +the argument list with the address, as are C++ aggregates with nontrivial copy +constructors, destructors, or vtables. +... + +Fix this in riscv_call_arg_scalar_int by checking for +language_pass_by_reference ().trivially_copy_constructible. + +The vtable case is explictly mentioned in the ABI, but AFAIU already covered +by the nontrivial copy constructor case. + +The nontrivial destructor case is also not supported, but the testsuite +doesn't seem to trigger this. + +Fix this by: +- extending the test-case to cover this scenario, and +- fixing it in riscv_call_arg_scalar_int by checking for + language_pass_by_reference ().trivially_destructible. + +Tested on riscv64-linux. + +PR tdep/32152 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32152 + +Approved-By: Andrew Burgess + +[1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc +--- + gdb/riscv-tdep.c | 6 +++++- + gdb/testsuite/gdb.cp/non-trivial-retval.cc | 19 +++++++++++++++++++ + gdb/testsuite/gdb.cp/non-trivial-retval.exp | 6 ++++++ + 3 files changed, 30 insertions(+), 1 deletion(-) + +diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c +index d592d2dc0c4..edb40d6babf 100644 +--- a/gdb/riscv-tdep.c ++++ b/gdb/riscv-tdep.c +@@ -2857,8 +2857,12 @@ static void + riscv_call_arg_scalar_int (struct riscv_arg_info *ainfo, + struct riscv_call_info *cinfo) + { ++ auto lang_req = language_pass_by_reference (ainfo->type); ++ + if (TYPE_HAS_DYNAMIC_LENGTH (ainfo->type) +- || ainfo->length > (2 * cinfo->xlen)) ++ || ainfo->length > (2 * cinfo->xlen) ++ || !lang_req.trivially_copy_constructible ++ || !lang_req.trivially_destructible) + { + /* Argument is going to be passed by reference. */ + ainfo->argloc[0].loc_type +diff --git a/gdb/testsuite/gdb.cp/non-trivial-retval.cc b/gdb/testsuite/gdb.cp/non-trivial-retval.cc +index 4bba0f1c3af..4e812516d63 100644 +--- a/gdb/testsuite/gdb.cp/non-trivial-retval.cc ++++ b/gdb/testsuite/gdb.cp/non-trivial-retval.cc +@@ -142,6 +142,24 @@ f4 (int i1, int i2) + return e; + } + ++class F ++{ ++public: ++ ~F () {} ++ ++ int f; ++}; ++ ++F ++f5 (int i1, int i2) ++{ ++ F f; ++ ++ f.f = i1 + i2; ++ ++ return f; ++} ++ + /* We place a breakpoint on the call to this function. */ + + void +@@ -164,6 +182,7 @@ main (void) + B1 b1 = f22 (i1, i2); + C c = f3 (i1, i2); + E e = f4 (i1, i2); ++ F f = f5 (i1, i2); + + return 0; + } +diff --git a/gdb/testsuite/gdb.cp/non-trivial-retval.exp b/gdb/testsuite/gdb.cp/non-trivial-retval.exp +index 89035e178ed..6c9f7e13d2a 100644 +--- a/gdb/testsuite/gdb.cp/non-trivial-retval.exp ++++ b/gdb/testsuite/gdb.cp/non-trivial-retval.exp +@@ -42,12 +42,14 @@ gdb_test "p f2 (i1, i2)" ".* = {b = 123}" + gdb_test "p f22 (i1, i2)" ".* = {b1 = 123}" + gdb_test "p f3 (i1, i2)" ".* = {.* c = 123}" + gdb_test "p f4 (i1, i2)" ".* = {.* e = 123}" ++gdb_test "p f5 (i1, i2)" ".* = {f = 123}" + + gdb_breakpoint "f1" + gdb_breakpoint "f2" + gdb_breakpoint "f22" + gdb_breakpoint "f3" + gdb_breakpoint "f4" ++gdb_breakpoint "f5" + + gdb_continue_to_breakpoint "Break in f1" + gdb_test "finish" " = {a = 123}" \ +@@ -68,3 +70,7 @@ gdb_test "finish" " = {.* c = 123}" \ + gdb_continue_to_breakpoint "Break in f4" + gdb_test "finish" " = {.* e = 123}" \ + "finish from f4" ++ ++gdb_continue_to_breakpoint "Break in f5" ++gdb_test "finish" " = {f = 123}" \ ++ "finish from f5" +-- +2.43.0 + diff --git a/gdb-tdep-fix-recording-of-t1-push.patch b/gdb-tdep-fix-recording-of-t1-push.patch new file mode 100644 index 0000000..33673a4 --- /dev/null +++ b/gdb-tdep-fix-recording-of-t1-push.patch @@ -0,0 +1,69 @@ +From 0494211cb5f418654ca3a4ac1b9f10518426732f Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 13 Nov 2024 19:44:21 +0100 +Subject: [PATCH 15/46] [gdb/tdep] Fix recording of T1 push + +When running test-case gdb.reverse/recursion.exp on arm-linux with target +board unix/-mthumb, I run into: +... +(gdb) PASS: gdb.reverse/recursion.exp: Skipping recursion from inside +reverse-next^M +bar (x=4195569) at /home/linux/gdb/src/gdb/testsuite/gdb.reverse/recursion.c:34^M +34 int r = foo (x);^M +(gdb) FAIL: gdb.reverse/recursion.exp: print frame when stepping out +... + +The problem is the recording of the T1 push instruction [1,2], specifically: +... +000004d8 : + 4d8: b580 push {r7, lr} +... + +The current code fails to add a memory record for the memory written with the +value of the lr register. + +Fix this by adding the missing memory record. + +Tested on arm-linux. + +Reviewed-By: Guinevere Larsen +Approved-By: Luis Machado + +[1] https://developer.arm.com/documentation/ddi0406/c/Application-Level-Architecture/Instruction-Details/Encoding-of-lists-of-ARM-core-registers +[2] https://developer.arm.com/documentation/ddi0597/2024-09/T32-Instructions-by-Encoding/16-bit?lang=en#pushpop16 +--- + gdb/arm-tdep.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c +index f36ce631a08..d898a426609 100644 +--- a/gdb/arm-tdep.c ++++ b/gdb/arm-tdep.c +@@ -13561,9 +13561,12 @@ thumb_record_misc (arm_insn_decode_record *thumb_insn_r) + record_buf[0] = bits (thumb_insn_r->arm_insn, 0, 2); + thumb_insn_r->reg_rec_count = 1; + break; +- case 4: /* fall through */ + case 5: +- /* PUSH. */ ++ /* PUSH with lr. */ ++ register_count++; ++ [[fallthrough]]; ++ case 4: ++ /* PUSH without lr. */ + register_bits = bits (thumb_insn_r->arm_insn, 0, 7); + regcache_raw_read_unsigned (reg_cache, ARM_SP_REGNUM, &u_regval); + while (register_bits) +@@ -13572,8 +13575,7 @@ thumb_record_misc (arm_insn_decode_record *thumb_insn_r) + register_count++; + register_bits = register_bits >> 1; + } +- start_address = u_regval - \ +- (4 * (bit (thumb_insn_r->arm_insn, 8) + register_count)); ++ start_address = u_regval - (4 * register_count); + thumb_insn_r->mem_rec_count = register_count; + while (register_count) + { +-- +2.43.0 + diff --git a/gdb-tdep-handle-sycall-statx-for-arm-linux.patch b/gdb-tdep-handle-sycall-statx-for-arm-linux.patch new file mode 100644 index 0000000..b8981d5 --- /dev/null +++ b/gdb-tdep-handle-sycall-statx-for-arm-linux.patch @@ -0,0 +1,46 @@ +From 559ec501f594101dd786ce7dad1c89069934c965 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 13 Nov 2024 19:37:04 +0100 +Subject: [PATCH 14/46] [gdb/tdep] Handle sycall statx for arm-linux + +When running test-case gdb.reverse/fstatat-reverse.exp on arm-linux, I run +into: +... +(gdb) continue^M +Continuing.^M +Process record and replay target doesn't support syscall number 397^M +Process record does not support instruction 0xdf00 at address 0xf7ebf774.^M +Process record: failed to record execution log.^M +^M +Program stopped.^M +0xf7ebf774 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6^M +(gdb) FAIL: gdb.reverse/fstatat-reverse.exp: continue to breakpoint: marker2 +... + +Syscall number 397 stands for statx on arm-linux. + +Fix this by handling 397 in arm_canonicalize_syscall. + +Tested on arm-linux. + +Reviewed-By: Guinevere Larsen +Approved-By: Luis Machado +--- + gdb/arm-linux-tdep.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c +index 43869e4fcfe..bb3d808bd5a 100644 +--- a/gdb/arm-linux-tdep.c ++++ b/gdb/arm-linux-tdep.c +@@ -1644,6 +1644,7 @@ arm_canonicalize_syscall (int syscall) + case 379: return gdb_sys_finit_module; + */ + case 384: return gdb_sys_getrandom; ++ case 397: return gdb_sys_statx; + case 983041: /* ARM_breakpoint */ return gdb_sys_no_syscall; + case 983042: /* ARM_cacheflush */ return gdb_sys_no_syscall; + case 983043: /* ARM_usr26 */ return gdb_sys_no_syscall; +-- +2.43.0 + diff --git a/gdb-tdep-handle-syscall-clock_gettime64-for-arm-linu.patch b/gdb-tdep-handle-syscall-clock_gettime64-for-arm-linu.patch new file mode 100644 index 0000000..ce2e115 --- /dev/null +++ b/gdb-tdep-handle-syscall-clock_gettime64-for-arm-linu.patch @@ -0,0 +1,80 @@ +From 522e3a4837eaef79fc255b29c5ed75fc6f817ce1 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 13 Nov 2024 22:41:35 +0100 +Subject: [PATCH 16/46] [gdb/tdep] Handle syscall clock_gettime64 for arm-linux + +When running test-case gdb.reverse/time-reverse.exp on arm-linux, I run into: +... +(gdb) continue^M +Continuing.^M +Process record and replay target doesn't support syscall number 403^M +Process record does not support instruction 0xdf00 at address 0xf7ebf774.^M +Process record: failed to record execution log.^M +^M +Program stopped.^M +0xf7ebf774 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6^M +(gdb) FAIL: $exp: mode=c: continue to breakpoint: marker2 +... + +Syscall number 403 stands for clock_gettime64 on arm-linux. + +Fix this by handling 403 in arm_canonicalize_syscall, and handling +gdb_sys_clock_gettime64 elsewhere. + +Since i386_canonicalize_syscall is the identity function, enum value +gdb_sys_clock_gettime64 gets a value to match i386, which also happens to be +403. + +Tested on arm-linux. + +Approved-By: Guinevere Larsen (record-full) +--- + gdb/arm-linux-tdep.c | 1 + + gdb/linux-record.c | 6 ++++++ + gdb/linux-record.h | 1 + + 3 files changed, 8 insertions(+) + +diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c +index bb3d808bd5a..4dc8f00d8c2 100644 +--- a/gdb/arm-linux-tdep.c ++++ b/gdb/arm-linux-tdep.c +@@ -1645,6 +1645,7 @@ arm_canonicalize_syscall (int syscall) + */ + case 384: return gdb_sys_getrandom; + case 397: return gdb_sys_statx; ++ case 403: return gdb_sys_clock_gettime64; + case 983041: /* ARM_breakpoint */ return gdb_sys_no_syscall; + case 983042: /* ARM_cacheflush */ return gdb_sys_no_syscall; + case 983043: /* ARM_usr26 */ return gdb_sys_no_syscall; +diff --git a/gdb/linux-record.c b/gdb/linux-record.c +index 549ea1bd713..33efa026a53 100644 +--- a/gdb/linux-record.c ++++ b/gdb/linux-record.c +@@ -1820,6 +1820,12 @@ Do you want to stop the program?"), + return -1; + break; + ++ case gdb_sys_clock_gettime64: ++ /* Size of struct __timespec64 is 16. */ ++ if (record_mem_at_reg (regcache, tdep->arg2, 16)) ++ return -1; ++ break; ++ + case gdb_sys_clock_getres: + if (record_mem_at_reg (regcache, tdep->arg2, tdep->size_timespec)) + return -1; +diff --git a/gdb/linux-record.h b/gdb/linux-record.h +index 962cedc3d34..54696124bf2 100644 +--- a/gdb/linux-record.h ++++ b/gdb/linux-record.h +@@ -512,6 +512,7 @@ enum gdb_syscall { + gdb_sys_inotify_init1 = 332, + gdb_sys_getrandom = 355, + gdb_sys_statx = 383, ++ gdb_sys_clock_gettime64 = 403, + gdb_sys_socket = 500, + gdb_sys_connect = 501, + gdb_sys_accept = 502, +-- +2.43.0 + diff --git a/gdb-testsuite-check-gnatmake-version-in-gdb.ada-scal.patch b/gdb-testsuite-check-gnatmake-version-in-gdb.ada-scal.patch new file mode 100644 index 0000000..d8e8bfc --- /dev/null +++ b/gdb-testsuite-check-gnatmake-version-in-gdb.ada-scal.patch @@ -0,0 +1,48 @@ +From 889debbb7270408fa96401d5482dc2b9caec494d Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 8 Jan 2025 16:24:11 +0100 +Subject: [PATCH 05/46] [gdb/testsuite] Check gnatmake version in + gdb.ada/scalar_storage.exp + +On a system with gcc 14.2.0 and gnatmake 13.3.0 I run into: +... +(gdb) PASS: gdb.ada/scalar_storage.exp: print V_LE +get_compiler_info: gcc-14-2-0 +print V_BE^M +$2 = (value => 126, another_value => 12, color => red)^M +(gdb) FAIL: gdb.ada/scalar_storage.exp: print V_BE +... + +The test-case contains a corresponding kfail: +... + # This requires a compiler fix that is in GCC 14. + if {[gcc_major_version] < 14} { + setup_kfail "DW_AT_endianity on enum types" *-*-* + } +... +which doesn't trigger because it checks the gcc version rather than the +gnatmake version. + +Fix this by checking the gnatmake version instead. + +Tested on aarch64-linux and x86_64-linux. +--- + gdb/testsuite/gdb.ada/scalar_storage.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.ada/scalar_storage.exp b/gdb/testsuite/gdb.ada/scalar_storage.exp +index e01e75fe5d2..5dccaef8f14 100644 +--- a/gdb/testsuite/gdb.ada/scalar_storage.exp ++++ b/gdb/testsuite/gdb.ada/scalar_storage.exp +@@ -36,7 +36,7 @@ if {![runto "storage.adb:$bp_location"]} { + gdb_test "print V_LE" "= \\(value => 126, another_value => 12, color => green\\)" + + # This requires a compiler fix that is in GCC 14. +-if {[gcc_major_version] < 14} { ++if { ![gnatmake_version_at_least 14] } { + setup_kfail "DW_AT_endianity on enum types" *-*-* + } + gdb_test "print V_BE" "= \\(value => 126, another_value => 12, color => green\\)" +-- +2.43.0 + diff --git a/gdb-testsuite-don-t-use-set-auto-solib-add-off.patch b/gdb-testsuite-don-t-use-set-auto-solib-add-off.patch new file mode 100644 index 0000000..0c410f4 --- /dev/null +++ b/gdb-testsuite-don-t-use-set-auto-solib-add-off.patch @@ -0,0 +1,274 @@ +From 42f3a32877ab455607662c7a12c7a793f3744e4e Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 10 Jun 2024 10:43:10 +0200 +Subject: [PATCH 08/46] [gdb/testsuite] Don't use set auto-solib-add off + +In test-case gdb.mi/mi-var-child-f.exp, we have: +... +mi_gdb_test "-gdb-set auto-solib-add off" "\\^done" +mi_runto prog_array +mi_gdb_test "nosharedlibrary" ".*\\^done" +... + +This was added to avoid a name clash between the array variable as defined in +gdb.mi/array.f90 and debug info in shared libraries, and used in other places +in the testsuite. + +The same workaround is also used to ignore symbols from shared libraries when +excercising for instance a command that prints all symbols. + +However, this approach can cause problems for targets like arm that require +symbol info for some libraries like ld.so and libc to fully function. + +While absense of debug info for shared libraries should be handled gracefully +(which does need fixing, see PR31817), failure to do so should not result +in failures in unrelated test-cases. + +Fix this by removing "set auto-solib-add off". + +This ensures that we don't run into PR31817, while the presence of +nosharedlibrary still ensures that in the rest of the test-case we're not +bothered by shared library symbols. + +Likewise in other test-cases. + +Approved-by: Kevin Buettner + +Tested on arm-linux. +--- + gdb/testsuite/gdb.base/gold-gdb-index.exp | 4 ++-- + gdb/testsuite/gdb.base/info-types.exp.tcl | 3 ++- + gdb/testsuite/gdb.base/print-symbol-loading.exp | 4 +++- + gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp | 6 ++---- + gdb/testsuite/gdb.fortran/allocated.exp | 3 --- + gdb/testsuite/gdb.fortran/array-slices-bad.exp | 3 --- + gdb/testsuite/gdb.fortran/array-slices-sub-slices.exp | 3 --- + gdb/testsuite/gdb.fortran/array-slices.exp | 3 --- + gdb/testsuite/gdb.fortran/info-modules.exp | 3 --- + gdb/testsuite/gdb.fortran/lbound-ubound.exp | 3 --- + gdb/testsuite/gdb.fortran/module.exp | 3 --- + gdb/testsuite/gdb.fortran/subarray.exp | 3 --- + gdb/testsuite/gdb.mi/mi-fortran-modules.exp | 3 --- + gdb/testsuite/gdb.mi/mi-var-child-f.exp | 3 --- + 14 files changed, 9 insertions(+), 38 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/gold-gdb-index.exp b/gdb/testsuite/gdb.base/gold-gdb-index.exp +index c9c6598c3fa..0309dd353ad 100644 +--- a/gdb/testsuite/gdb.base/gold-gdb-index.exp ++++ b/gdb/testsuite/gdb.base/gold-gdb-index.exp +@@ -32,12 +32,12 @@ if { [have_index $binfile] != "gdb_index" } { + return -1 + } + +-gdb_test_no_output "set auto-solib-add off" +- + if {![runto_main]} { + return 0 + } + ++gdb_test_no_output "nosharedlibrary" ++ + gdb_test_no_output "set breakpoint pending off" + gdb_test "break N1::misspelled" "Function \"N1::misspelled\" not defined\." + +diff --git a/gdb/testsuite/gdb.base/info-types.exp.tcl b/gdb/testsuite/gdb.base/info-types.exp.tcl +index 69d53b9f8de..0a33afedf86 100644 +--- a/gdb/testsuite/gdb.base/info-types.exp.tcl ++++ b/gdb/testsuite/gdb.base/info-types.exp.tcl +@@ -32,12 +32,13 @@ proc run_test { lang } { + "${testfile}" $srcfile "debug $lang"]} { + return -1 + } +- gdb_test_no_output "set auto-solib-add off" + + if ![runto_main] then { + return 0 + } + ++ gdb_test_no_output "nosharedlibrary" ++ + set file_re "File .*[string_to_regexp $srcfile]:" + + if { $lang == "c++" } { +diff --git a/gdb/testsuite/gdb.base/print-symbol-loading.exp b/gdb/testsuite/gdb.base/print-symbol-loading.exp +index b61dba33377..b3520f1e032 100644 +--- a/gdb/testsuite/gdb.base/print-symbol-loading.exp ++++ b/gdb/testsuite/gdb.base/print-symbol-loading.exp +@@ -95,10 +95,12 @@ proc test_load_shlib { print_symbol_loading } { + global gdb_prompt + with_test_prefix "shlib ${print_symbol_loading}" { + clean_restart ${binfile} +- gdb_test_no_output "set auto-solib-add off" + if ![runto_main] { + return -1 + } ++ ++ gdb_test_no_output "nosharedlibrary" ++ + gdb_test_no_output "set print symbol-loading $print_symbol_loading" + set test_name "load shared-lib" + set libc_re \ +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp b/gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp +index 59840b8d0e2..e2e4f240c88 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp ++++ b/gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp +@@ -29,14 +29,12 @@ proc_with_prefix test_relocated { exec_path lib_path complaint_re readnow_p } { + clean_restart $exec_path + gdb_load_shlib $lib_path + +- # Don't load the symbols for $lib_path during runto_main. +- # Instead, we do this afterwards using "sharedlibrary $lib_path". +- gdb_test_no_output "set auto-solib-add off" +- + if { ![runto_main] } { + return + } + ++ gdb_test_no_output "nosharedlibrary" ++ + # Test for presence of complaint. + with_complaints 1 { + set have_complaint 0 +diff --git a/gdb/testsuite/gdb.fortran/allocated.exp b/gdb/testsuite/gdb.fortran/allocated.exp +index d8aee441d7f..1d87bf76244 100644 +--- a/gdb/testsuite/gdb.fortran/allocated.exp ++++ b/gdb/testsuite/gdb.fortran/allocated.exp +@@ -25,9 +25,6 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ + return -1 + } + +-# Avoid shared lib symbols. +-gdb_test_no_output "set auto-solib-add off" +- + if ![fortran_runto_main] { + return -1 + } +diff --git a/gdb/testsuite/gdb.fortran/array-slices-bad.exp b/gdb/testsuite/gdb.fortran/array-slices-bad.exp +index 8f23b38599f..ac4a77d2e39 100644 +--- a/gdb/testsuite/gdb.fortran/array-slices-bad.exp ++++ b/gdb/testsuite/gdb.fortran/array-slices-bad.exp +@@ -30,9 +30,6 @@ if {![runto [gdb_get_line_number "First Breakpoint"]]} { + return -1 + } + +-# Avoid shared lib symbols. +-gdb_test_no_output "set auto-solib-add off" +- + # Avoid libc symbols, in particular the 'array' type. + gdb_test_no_output "nosharedlibrary" + +diff --git a/gdb/testsuite/gdb.fortran/array-slices-sub-slices.exp b/gdb/testsuite/gdb.fortran/array-slices-sub-slices.exp +index 5bdc7d59f16..5a0f0406afe 100644 +--- a/gdb/testsuite/gdb.fortran/array-slices-sub-slices.exp ++++ b/gdb/testsuite/gdb.fortran/array-slices-sub-slices.exp +@@ -25,9 +25,6 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ + return -1 + } + +-# Avoid shared lib symbols. +-gdb_test_no_output "set auto-solib-add off" +- + if ![fortran_runto_main] { + return -1 + } +diff --git a/gdb/testsuite/gdb.fortran/array-slices.exp b/gdb/testsuite/gdb.fortran/array-slices.exp +index f2928676bf3..919a2c6e7eb 100644 +--- a/gdb/testsuite/gdb.fortran/array-slices.exp ++++ b/gdb/testsuite/gdb.fortran/array-slices.exp +@@ -58,9 +58,6 @@ proc run_test { repack } { + + clean_restart ${binfile} + +- # Avoid shared lib symbols. +- gdb_test_no_output "set auto-solib-add off" +- + if ![fortran_runto_main] { + return -1 + } +diff --git a/gdb/testsuite/gdb.fortran/info-modules.exp b/gdb/testsuite/gdb.fortran/info-modules.exp +index e6c515ff70f..c8ae7362223 100644 +--- a/gdb/testsuite/gdb.fortran/info-modules.exp ++++ b/gdb/testsuite/gdb.fortran/info-modules.exp +@@ -28,9 +28,6 @@ if { [prepare_for_testing "failed to prepare" $testfile \ + return -1 + } + +-# Avoid shared lib symbols. +-gdb_test_no_output "set auto-solib-add off" +- + if { ![fortran_runto_main] } { + perror "Could not run to main." + return +diff --git a/gdb/testsuite/gdb.fortran/lbound-ubound.exp b/gdb/testsuite/gdb.fortran/lbound-ubound.exp +index 01597ca23ff..781d3614f4c 100644 +--- a/gdb/testsuite/gdb.fortran/lbound-ubound.exp ++++ b/gdb/testsuite/gdb.fortran/lbound-ubound.exp +@@ -25,9 +25,6 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ + return -1 + } + +-# Avoid shared lib symbols. +-gdb_test_no_output "set auto-solib-add off" +- + if ![fortran_runto_main] { + return -1 + } +diff --git a/gdb/testsuite/gdb.fortran/module.exp b/gdb/testsuite/gdb.fortran/module.exp +index eea83ad71f1..df7ee3b9605 100644 +--- a/gdb/testsuite/gdb.fortran/module.exp ++++ b/gdb/testsuite/gdb.fortran/module.exp +@@ -31,9 +31,6 @@ gdb_test "p modmany::var_i" " = 14" "stopped language detection" + + gdb_test "print mod1::var_const" " = 20" "fully qualified name of DW_TAG_constant" + +-# Avoid shared lib symbols. +-gdb_test_no_output "set auto-solib-add off" +- + if {![fortran_runto_main]} { + return + } +diff --git a/gdb/testsuite/gdb.fortran/subarray.exp b/gdb/testsuite/gdb.fortran/subarray.exp +index 1ec80e78fe4..70a7a2345ba 100644 +--- a/gdb/testsuite/gdb.fortran/subarray.exp ++++ b/gdb/testsuite/gdb.fortran/subarray.exp +@@ -27,9 +27,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} { + return -1 + } + +-# Avoid shared lib symbols. +-gdb_test_no_output "set auto-solib-add off" +- + if {![fortran_runto_main]} { + return + } +diff --git a/gdb/testsuite/gdb.mi/mi-fortran-modules.exp b/gdb/testsuite/gdb.mi/mi-fortran-modules.exp +index 13996b9547f..5441d8f15e5 100644 +--- a/gdb/testsuite/gdb.mi/mi-fortran-modules.exp ++++ b/gdb/testsuite/gdb.mi/mi-fortran-modules.exp +@@ -30,9 +30,6 @@ if {[build_executable "failed to prepare" ${testfile} \ + + mi_clean_restart $binfile + +-# Avoid shared lib symbols. +-mi_gdb_test "-gdb-set auto-solib-add off" "\\^done" +- + mi_runto_main + + # Avoid libc symbols. +diff --git a/gdb/testsuite/gdb.mi/mi-var-child-f.exp b/gdb/testsuite/gdb.mi/mi-var-child-f.exp +index 258cbe7cb40..441c3a09366 100644 +--- a/gdb/testsuite/gdb.mi/mi-var-child-f.exp ++++ b/gdb/testsuite/gdb.mi/mi-var-child-f.exp +@@ -32,9 +32,6 @@ if {[mi_clean_restart $binfile]} { + return + } + +-# Avoid shared lib symbols. +-mi_gdb_test "-gdb-set auto-solib-add off" "\\^done" +- + mi_runto prog_array + + # Avoid libc symbols, in particular the 'array' type. +-- +2.43.0 + diff --git a/gdb-testsuite-fix-another-regexp-in-gdb.threads-step.patch b/gdb-testsuite-fix-another-regexp-in-gdb.threads-step.patch index 014bd08..3c955c9 100644 --- a/gdb-testsuite-fix-another-regexp-in-gdb.threads-step.patch +++ b/gdb-testsuite-fix-another-regexp-in-gdb.threads-step.patch @@ -1,7 +1,7 @@ -From 210d0ce41454a56ee39ff97d5353c98b38c8ac5f Mon Sep 17 00:00:00 2001 +From 002b882370fb3d69b7c89fc99e85fc1b767567b9 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 29 Aug 2024 11:39:02 +0200 -Subject: [PATCH 17/37] [gdb/testsuite] Fix another regexp in +Subject: [PATCH 2/2] [gdb/testsuite] Fix another regexp in gdb.threads/stepi-over-clone.exp On openSUSE Tumbleweed, I run into: @@ -23,12 +23,12 @@ Tested on x86_64-linux. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.threads/stepi-over-clone.exp b/gdb/testsuite/gdb.threads/stepi-over-clone.exp -index f671fd7b8bd..a9f3cb52fca 100644 +index da8bbf6a215..b93cfe69c7f 100644 --- a/gdb/testsuite/gdb.threads/stepi-over-clone.exp +++ b/gdb/testsuite/gdb.threads/stepi-over-clone.exp @@ -50,7 +50,7 @@ gdb_test_multiple "catch syscall group:process" "catch process syscalls" { - set re_loc1 "$hex in clone\[23\]? \\(\\)" + set re_loc1 "$hex in (__)?clone\[23\]? \\(\\)" set re_loc2 "$decimal\[ \t\]+in \[^\r\n\]+" -set re_loc3 "clone\[23\]? \\(\\) at \[^:\]+:$decimal" +set re_loc3 "(__)?clone\[23\]? \\(\\) at \[^:\]+:$decimal" diff --git a/gdb-testsuite-fix-gdb.ada-big_packed_array.exp-on-s3.patch b/gdb-testsuite-fix-gdb.ada-big_packed_array.exp-on-s3.patch new file mode 100644 index 0000000..6d38957 --- /dev/null +++ b/gdb-testsuite-fix-gdb.ada-big_packed_array.exp-on-s3.patch @@ -0,0 +1,62 @@ +From f74652042d7330cd5db2fe1c2f6f4e9cd23f2d55 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 4 Feb 2025 14:06:20 +0100 +Subject: [PATCH 44/46] [gdb/testsuite] Fix gdb.ada/big_packed_array.exp on + s390x-linux + +When running test-case gdb.ada/big_packed_array.exp on s390x-linux, I run +into: +... +(gdb) print bad^M +$2 = (0 => 0 , 1)^M +(gdb) FAIL: gdb.ada/big_packed_array.exp: scenario=minimal: print bad +... + +This is with gcc 7.5.0, and this xfail should trigger: +... + if { $have_xfail && [string is integer $last] \ + && [expr ($last & 0xf) == 0] } { + # gcc/101643 + setup_xfail *-*-* + } +... +but it doesn't because $last is '1'. + +Fix this by using 0xf0 as mask for big endian. + +Tested on s390x-linux. +--- + gdb/testsuite/gdb.ada/big_packed_array.exp | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.ada/big_packed_array.exp b/gdb/testsuite/gdb.ada/big_packed_array.exp +index 1ba2c4853c8..1a10ea1d2a5 100644 +--- a/gdb/testsuite/gdb.ada/big_packed_array.exp ++++ b/gdb/testsuite/gdb.ada/big_packed_array.exp +@@ -21,6 +21,8 @@ standard_ada_testfile foo_ra24_010 + + set old_gcc [expr [test_compiler_info {gcc-[0-8]-*}]] + ++set endian [target_endianness] ++ + foreach_with_prefix scenario {all minimal} { + set flags [list debug additional_flags=-fgnat-encodings=$scenario] + +@@ -54,8 +56,13 @@ foreach_with_prefix scenario {all minimal} { + } + -re -wrap $re_xfail2 { + set last $expect_out(1,string) ++ if { $endian == "little" } { ++ set mask 0x0f ++ } else { ++ set mask 0xf0 ++ } + if { $have_xfail && [string is integer $last] \ +- && [expr ($last & 0xf) == 0] } { ++ && [expr ($last & $mask) == 0] } { + # gcc/101643 + setup_xfail *-*-* + } +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdb.ada-convvar_comp.exp-on-s390x-.patch b/gdb-testsuite-fix-gdb.ada-convvar_comp.exp-on-s390x-.patch new file mode 100644 index 0000000..974e847 --- /dev/null +++ b/gdb-testsuite-fix-gdb.ada-convvar_comp.exp-on-s390x-.patch @@ -0,0 +1,113 @@ +From ac9c99f7f6b86d536c60fcb4b5ecdd4a2e767603 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 4 Feb 2025 14:06:20 +0100 +Subject: [PATCH 45/46] [gdb/testsuite] Fix gdb.ada/convvar_comp.exp on + s390x-linux + +When running test-case gdb.ada/convvar_comp.exp on s390x-linux, I get: +... +(gdb) run ^M +Starting program: pb16_063 ^M +^M +Breakpoint 1, pck.break_me (item=...) at pck.adb:17^M +17 function Break_Me (Item : T) return Boolean is^M +(gdb) print item.started^M +Cannot access memory at address 0x0^M +(gdb) FAIL: gdb.ada/convvar_comp.exp: print item.started +... + +This happens as follows. + +The parameter item is available in (DW_OP_fbreg: -168): +... + <2><912>: Abbrev Number: 18 (DW_TAG_formal_parameter) + <913> DW_AT_name : (indirect string, offset: 0x14ca): item + <919> DW_AT_type : <0x929> + <91d> DW_AT_location : 3 byte block: 91 d8 7e (DW_OP_fbreg: -168) +... +and according to the rules of -O0, it's considered to be available after the +prologue, which looks like this: +... +0000000001002998 : + 1002998: b3 c1 00 2b ldgr %f2,%r11 + 100299c: b3 c1 00 0f ldgr %f0,%r15 + 10029a0: e3 f0 ff 58 ff 71 lay %r15,-168(%r15) + 10029a6: b9 04 00 bf lgr %r11,%r15 + 10029aa: e3 20 b0 a0 00 24 stg %r2,160(%r11) +... + +To detect the prologue, gdb checks the line info, which looks like this: +... +pck.adb: +File name Line number Starting address View Stmt +pck.adb 17 0x1002998 x +pck.adb 17 0x1002998 1 x +pck.adb 19 0x10029b0 x +pck.adb 20 0x10029b8 x +pck.adb - 0x10029c6 +... +and gdb concludes that it's an empty prologue, so we stop at 0x1002998 and +try to print parameter item, which is not available yet. + +For more details, see this comment in skip_prologue_using_sal: +... + /* For languages other than assembly, treat two consecutive line + entries at the same address as a zero-instruction prologue. +... + +The same thing happens on x86_64-linux, but it causes no problem there, +because amd64_skip_prologue decides not to trust the result: +... + struct compunit_symtab *cust = find_pc_compunit_symtab (func_addr); + + /* LLVM backend (Clang/Flang) always emits a line note before the + prologue and another one after. We trust clang and newer Intel + compilers to emit usable line notes. */ + if (post_prologue_pc + && (cust != NULL + && cust->producer () != nullptr + && (producer_is_llvm (cust->producer ()) + || producer_is_icc_ge_19 (cust->producer ())))) + return std::max (start_pc, post_prologue_pc); +... +because the producer is GCC. + +Work around this by setting a breakpoint on the first statement of +pck.break_me instead. + +Tested on s390x-linux. +--- + gdb/testsuite/gdb.ada/convvar_comp.exp | 4 +++- + gdb/testsuite/gdb.ada/convvar_comp/pck.adb | 2 +- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/gdb/testsuite/gdb.ada/convvar_comp.exp b/gdb/testsuite/gdb.ada/convvar_comp.exp +index d59a19a40c3..e7ff3baa624 100644 +--- a/gdb/testsuite/gdb.ada/convvar_comp.exp ++++ b/gdb/testsuite/gdb.ada/convvar_comp.exp +@@ -25,7 +25,9 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } + + clean_restart ${testfile} + +-if {![runto "break_me"]} { ++set bp_location [gdb_get_line_number "BREAK" "$testdir/pck.adb"] ++ ++if {![runto pck.adb:$bp_location]} { + return + } + +diff --git a/gdb/testsuite/gdb.ada/convvar_comp/pck.adb b/gdb/testsuite/gdb.ada/convvar_comp/pck.adb +index be5d8d719d8..b7bf3efe8f9 100644 +--- a/gdb/testsuite/gdb.ada/convvar_comp/pck.adb ++++ b/gdb/testsuite/gdb.ada/convvar_comp/pck.adb +@@ -16,6 +16,6 @@ + package body Pck is + function Break_Me (Item : T) return Boolean is + begin +- return False; ++ return False; -- BREAK + end Break_Me; + end Pck; +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdb.ada-mi_task_arg.exp-on-arm-lin.patch b/gdb-testsuite-fix-gdb.ada-mi_task_arg.exp-on-arm-lin.patch new file mode 100644 index 0000000..ec794db --- /dev/null +++ b/gdb-testsuite-fix-gdb.ada-mi_task_arg.exp-on-arm-lin.patch @@ -0,0 +1,70 @@ +From 58e1c193329c4e919272f01e5626b912d36ff65d Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 23 Jul 2024 14:27:36 +0200 +Subject: [PATCH 03/46] [gdb/testsuite] Fix gdb.ada/mi_task_arg.exp on + arm-linux + +On arm-linux, I run into: +... +PASS: gdb.ada/mi_task_arg.exp: mi runto task_switch.break_me +Expecting: ^(-stack-list-arguments 1[^M +]+)?(\^done,stack-args=\[frame={level="0",args=\[\]},frame={level="1",args=\[{name="<_task>",value="0x[0-9A-Fa-f]+"}(,{name="<_taskL>",value="[0-9]+"})?\]},frame={level="2",args=\[({name="self_id",value="(0x[0-9A-Fa-f]+|)"})?\]},.*[^M +]+[(]gdb[)] ^M +[ ]*) +-stack-list-arguments 1^M +^done,stack-args=[frame={level="0",args=[]},frame={level="1",args=[{name="<_task>",value="0x40bc48"}]},frame={level="2",args=[]}]^M +(gdb) ^M +FAIL: gdb.ada/mi_task_arg.exp: -stack-list-arguments 1 (unexpected output) +... + +The problem is that the test-case expects a level 3 frame, but there is none. + +This can be reproduced using cli bt: +... + $ gdb -q -batch outputs/gdb.ada/mi_task_arg/task_switch \ + -ex "b task_switch.break_me" \ + -ex run \ + -ex bt + Breakpoint 1 at 0x34b4: file task_switch.adb, line 57. + + Thread 3 "my_caller" hit Breakpoint 1, task_switch.break_me () \ + at task_switch.adb:57 + 57 null; + #0 task_switch.break_me () at task_switch.adb:57 + #1 0x00403424 in task_switch.caller (<_task>=0x40bc48) at task_switch.adb:51 + #2 0xf7f95a08 in ?? () from /lib/arm-linux-gnueabihf/libgnarl-12.so + Backtrace stopped: previous frame identical to this frame (corrupt stack?) +... + +The purpose of the test-case is printing the frame at level 1, so I don't +think we should bother about the presence of the frame at level 3. + +Fix this by allowing the backtrace to stop at level 2. + +Tested on arm-linux. + +Approved-By: Luis Machado +Approved-By: Andrew Burgess +--- + gdb/testsuite/gdb.ada/mi_task_arg.exp | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/gdb/testsuite/gdb.ada/mi_task_arg.exp b/gdb/testsuite/gdb.ada/mi_task_arg.exp +index 098396d5c09..b4b7b4997f3 100644 +--- a/gdb/testsuite/gdb.ada/mi_task_arg.exp ++++ b/gdb/testsuite/gdb.ada/mi_task_arg.exp +@@ -49,7 +49,8 @@ set frame1 "frame=\{level=\"1\",args=\\\[${frame1_args}(,$frame1_opt_args)?\\\]\ + # Frame for system.tasking.stages.task_wrapper + set frame2_args "(\{name=\"self_id\",value=\"($hex|)\"\})?" + set frame2 "frame=\{level=\"2\",args=\\\[$frame2_args\\\]\}" +-mi_gdb_test "-stack-list-arguments 1" \ +- "\\^done,stack-args=\\\[$frame0,$frame1,$frame2,.*" \ +- "-stack-list-arguments 1" + ++set frames "$frame0,$frame1,${frame2}(,.*)?" ++mi_gdb_test "-stack-list-arguments 1" \ ++ "\\^done,stack-args=\\\[$frames\\\]" \ ++ "-stack-list-arguments 1" +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdb.arch-arm-pseudo-unwind.exp-wit.patch b/gdb-testsuite-fix-gdb.arch-arm-pseudo-unwind.exp-wit.patch new file mode 100644 index 0000000..d681bbc --- /dev/null +++ b/gdb-testsuite-fix-gdb.arch-arm-pseudo-unwind.exp-wit.patch @@ -0,0 +1,88 @@ +From 23c9940a62f31071c03e54142e57aea3b8ab1eff Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 17 Jul 2024 17:04:02 +0200 +Subject: [PATCH 06/46] [gdb/testsuite] Fix gdb.arch/arm-pseudo-unwind.exp with + unix/mthumb + +When running test-case gdb.arch/arm-pseudo-unwind.exp with target board +unix/mthumb, we run into: +... +(gdb) continue^M +Continuing.^M +^M +Program received signal SIGILL, Illegal instruction.^M +0x00400f38 in ?? ()^M +(gdb) FAIL: $exp: continue to breakpoint: continue to callee +... + +The test-case attempts to force arm-pseudo-unwind.c to be compiled in arm mode +using additional_flags=-marm, but that's overridden by using target board +unix/mthumb. + +This causes function main to be in thumb mode, and consequently function +caller (which is called from main) is is executed as if it's in thumb mode, +while it's actually in arm mode. + +Fix this by adding an intermediate function caller_trampoline in +arm-pseudo-unwind.c, and hardcoding it to arm mode using +__attribute__((target("arm"))). + +Likewise for test-case gdb.arch/arm-pseudo-unwind-legacy.exp. + +Tested on arm-linux. + +Approved-By: Luis Machado +--- + gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.c | 9 ++++++++- + gdb/testsuite/gdb.arch/arm-pseudo-unwind.c | 9 ++++++++- + 2 files changed, 16 insertions(+), 2 deletions(-) + +diff --git a/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.c b/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.c +index 49b0553ade4..adda4b8b298 100644 +--- a/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.c ++++ b/gdb/testsuite/gdb.arch/arm-pseudo-unwind-legacy.c +@@ -24,10 +24,17 @@ break_here_c (uint64_t value) + { + } + ++__attribute__((target("arm"))) ++uint64_t ++caller_trampoline (void) ++{ ++ return caller (); ++} ++ + int + main (void) + { +- uint64_t value = caller (); ++ uint64_t value = caller_trampoline (); + break_here_c (value); + return 0; + } +diff --git a/gdb/testsuite/gdb.arch/arm-pseudo-unwind.c b/gdb/testsuite/gdb.arch/arm-pseudo-unwind.c +index 49b0553ade4..adda4b8b298 100644 +--- a/gdb/testsuite/gdb.arch/arm-pseudo-unwind.c ++++ b/gdb/testsuite/gdb.arch/arm-pseudo-unwind.c +@@ -24,10 +24,17 @@ break_here_c (uint64_t value) + { + } + ++__attribute__((target("arm"))) ++uint64_t ++caller_trampoline (void) ++{ ++ return caller (); ++} ++ + int + main (void) + { +- uint64_t value = caller (); ++ uint64_t value = caller_trampoline (); + break_here_c (value); + return 0; + } +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdb.arch-arm-single-step-kernel-he.patch b/gdb-testsuite-fix-gdb.arch-arm-single-step-kernel-he.patch new file mode 100644 index 0000000..2a0f777 --- /dev/null +++ b/gdb-testsuite-fix-gdb.arch-arm-single-step-kernel-he.patch @@ -0,0 +1,79 @@ +From eb20b0f725b114eb117093971cf0146113517e6b Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 16 Aug 2024 14:22:46 +0200 +Subject: [PATCH 33/46] [gdb/testsuite] Fix + gdb.arch/arm-single-step-kernel-helper.exp + +On arm-linux I run into: +... +(gdb) p *kernel_user_helper_version^M +Cannot access memory at address 0xffff0ffc^M +(gdb) FAIL: gdb.arch/arm-single-step-kernel-helper.exp: check kernel helper version +... + +What the test-case is trying to do, is to access a special address in the arm +linux kernel [1] using ptrace, which doesn't seem to work. + +This is with kernel version 6.1.55. Perhaps this used to work, but the kernel +was modified to be more strict with respect to access to this special address. + +Fix this by making the inferior access that special address instead. + +Tested on arm-linux. + +Approved-By: Luis Machado + +PR testsuite/32070 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32070 + +[1] https://www.kernel.org/doc/Documentation/arm/kernel_user_helpers.txt +--- + gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.c | 5 ++++- + gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.exp | 5 ++++- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.c b/gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.c +index 393004e623a..9b5e137992d 100644 +--- a/gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.c ++++ b/gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.c +@@ -15,7 +15,8 @@ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +-static int *kernel_user_helper_version = (int *) 0xffff0ffc; ++static int *kernel_user_helper_version_ptr = (int *) 0xffff0ffc; ++static int kernel_user_helper_version; + + typedef void * (kernel_user_func_t)(void); + #define kernel_user_get_tls (*(kernel_user_func_t *) 0xffff0fe0) +@@ -25,6 +26,8 @@ main (void) + { + int i; + ++ kernel_user_helper_version = *kernel_user_helper_version_ptr; ++ + for (i = 0; i < 8; i++) + kernel_user_get_tls (); + } +diff --git a/gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.exp b/gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.exp +index 27be5d56883..788bc863799 100644 +--- a/gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.exp ++++ b/gdb/testsuite/gdb.arch/arm-single-step-kernel-helper.exp +@@ -26,10 +26,13 @@ if { ![runto_main] } { + return -1 + } + ++# Initialize kernel_user_helper_version. ++gdb_test "next" "for .*" ++ + # Check kernel helpers are supported or not. + + set kernel_helper_supported 0 +-gdb_test_multiple "p *kernel_user_helper_version" \ ++gdb_test_multiple "p kernel_user_helper_version" \ + "check kernel helper version" { + -re " = ($decimal)\r\n$gdb_prompt $" { + if { $expect_out(1,string) >= 1 } { +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdb.arch-riscv-tdesc-regs.exp.patch b/gdb-testsuite-fix-gdb.arch-riscv-tdesc-regs.exp.patch new file mode 100644 index 0000000..d1a5104 --- /dev/null +++ b/gdb-testsuite-fix-gdb.arch-riscv-tdesc-regs.exp.patch @@ -0,0 +1,84 @@ +From cb85331b671b668aaea1e10b2a37d49e9260bac3 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 4 Sep 2024 15:37:28 +0200 +Subject: [PATCH 35/46] [gdb/testsuite] Fix gdb.arch/riscv-tdesc-regs.exp + +On riscv64-linux, with test-case gdb.arch/riscv-tdesc-regs.exp I get: +... +(gdb) info registers fflags^M +fflags 0x0 NV:0 DZ:0 OF:0 UF:0 NX:0^M +(gdb) FAIL: gdb.arch/riscv-tdesc-regs.exp: info registers fflags +info registers frm^M +frm 0x0 FRM:0 [RNE (round to nearest; ties to even)]^M +(gdb) FAIL: gdb.arch/riscv-tdesc-regs.exp: info registers frm +... + +The FAILs are produced by: +... +foreach reg {fflags frm} { + gdb_test_multiple "info registers $reg" "" { + -re "^info registers $reg\r\n" { + exp_continue + } + + -wrap -re "^Invalid register `$reg`" { + fail $gdb_test_name + } + + -wrap -re "^$reg\\s+\[^\r\n\]+" { + pass $gdb_test_name + } + } +} +... + +The first clause is meant to consume the command. + +The '^' char was updated to mean "consume command", so that clause no longer +works since it now attempts to consume the command twice. + +Also, it's unnecessary because the following clauses start with ^. + +Then, the second clause is unnecessary because there's a default clause +producing the FAIL. + +Fix this by simplifying to: +... +foreach reg {fflags frm} { + gdb_test "info registers $reg" "^$reg\\s+\[^\r\n\]+" +} +... + +Tested on riscv64-linux. + +Approved-By: Andrew Burgess +--- + gdb/testsuite/gdb.arch/riscv-tdesc-regs.exp | 14 +------------- + 1 file changed, 1 insertion(+), 13 deletions(-) + +diff --git a/gdb/testsuite/gdb.arch/riscv-tdesc-regs.exp b/gdb/testsuite/gdb.arch/riscv-tdesc-regs.exp +index bd4ba38390a..58859d161b6 100644 +--- a/gdb/testsuite/gdb.arch/riscv-tdesc-regs.exp ++++ b/gdb/testsuite/gdb.arch/riscv-tdesc-regs.exp +@@ -156,17 +156,5 @@ gdb_test_no_output "set tdesc filename $remote_file" \ + "load the target description that lacks fflags and frm" + + foreach reg {fflags frm} { +- gdb_test_multiple "info registers $reg" "" { +- -re "^info registers $reg\r\n" { +- exp_continue +- } +- +- -wrap -re "^Invalid register `$reg`" { +- fail $gdb_test_name +- } +- +- -wrap -re "^$reg\\s+\[^\r\n\]+" { +- pass $gdb_test_name +- } +- } ++ gdb_test "info registers $reg" "^$reg\\s+\[^\r\n\]+" + } +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdb.base-branch-to-self.exp-on-arm.patch b/gdb-testsuite-fix-gdb.base-branch-to-self.exp-on-arm.patch new file mode 100644 index 0000000..5932a51 --- /dev/null +++ b/gdb-testsuite-fix-gdb.base-branch-to-self.exp-on-arm.patch @@ -0,0 +1,96 @@ +From 9625fc9c035b75f7e55350ad72c37ce1b7e8fe55 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 22 Jan 2025 10:46:08 +0100 +Subject: [PATCH 27/46] [gdb/testsuite] Fix gdb.base/branch-to-self.exp on + arm-linux + +On arm-linux (ubuntu 24.04 with gcc 13.3.0) with target board unix/-marm and +test-case gdb.base/branch-to-self.exp I run into: +... +(gdb) continue^M +Continuing.^M +^M +Breakpoint 2, main () at branch-to-self.c:38^M +38 for (;;); /* loop-line */^M +(gdb) PASS: $exp: single-step: continue to breakpoint: hit breakpoint +si^M +0x0040058c 38 for (;;); /* loop-line */^M +(gdb) FAIL: $exp: single-step: si +... + +In contrast, on the same machine but with debian testing and gcc 14.2.0 we have: +... +(gdb) continue^M +Continuing.^M +^M +Breakpoint 2, main () at branch-to-self.c:38^M +38 for (;;); /* loop-line */^M +(gdb) PASS: $exp: single-step: continue to breakpoint: hit breakpoint +si^M +^M +Breakpoint 2, main () at branch-to-self.c:38^M +38 for (;;); /* loop-line */^M +(gdb) PASS: $exp: single-step: stepi +... + +The difference is in the instruction(s) generated for the loop. + +In the passing case, we have: +... + 588: eafffffe b 588 +... +and in the failing case: +... + 588: e320f000 nop {0} + 58c: eafffffd b 588 +... + +The purpose of this part of the test-case is to: +- generate a branch instruction that jumps to itself, and +- set a breakpoint on it, and check that stepi-ing from that breakpoint + triggers the breakpoint again. + +As we can see, in the failing case we failed to generate a branch instruction +that jumps to itself, and consequently we cannot expect to hit the breakpoint +again after issuing a single si. + +Fix this by issuing stepi until we hit the breakpoint. + +Tested on arm-linux. + +Reviewed-by: Thiago Jung Bauermann +--- + gdb/testsuite/gdb.base/branch-to-self.exp | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.base/branch-to-self.exp b/gdb/testsuite/gdb.base/branch-to-self.exp +index 9b4f7467498..71859d71e0d 100644 +--- a/gdb/testsuite/gdb.base/branch-to-self.exp ++++ b/gdb/testsuite/gdb.base/branch-to-self.exp +@@ -35,7 +35,22 @@ with_test_prefix "single-step" { + gdb_test "break ${testfile}.c:${line_num}" "Breakpoint .*" \ + "set breakpoint" + gdb_continue_to_breakpoint "hit breakpoint" +- gdb_test "si" ".*${testfile}.c:${line_num}.*" ++ ++ set stepi_count 1 ++ gdb_test_multiple "stepi" "" { ++ -re -wrap ".*${testfile}.c:${line_num}.*" { ++ pass $gdb_test_name ++ } ++ -re -wrap "" { ++ if { $stepi_count == 10 } { ++ fail $gdb_test_name ++ } else { ++ incr stepi_count ++ send_gdb "stepi\n" ++ exp_continue ++ } ++ } ++ } + } + + with_test_prefix "break-cond" { +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdb.base-empty-host-env-vars.exp.patch b/gdb-testsuite-fix-gdb.base-empty-host-env-vars.exp.patch new file mode 100644 index 0000000..b601900 --- /dev/null +++ b/gdb-testsuite-fix-gdb.base-empty-host-env-vars.exp.patch @@ -0,0 +1,132 @@ +From bb7497a27dc37f9775c2c00ecb464b7b44a9e8bb Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 23 Sep 2024 07:57:49 +0200 +Subject: [PATCH 38/46] [gdb/testsuite] Fix gdb.base/empty-host-env-vars.exp + +On aarch64-linux (debian testing) with test-case +gdb.base/empty-host-env-vars.exp I ran into: +... +(gdb) show index-cache directory^M +The directory of the index cache is "/home/linux/.cache/gdb".^M +(gdb) FAIL: $exp: env_var_name=HOME: show index-cache directory +... + +Without changing any environment variables, the value of the index-cache dir +is: +... +$ gdb -q -batch -ex "show index-cache directory" +The directory of the index cache is "/home/linux/.cache/gdb". +... +and the expectation of the test-case is that setting HOME to empty will +produce an empty dir, but what it actually produces is: +... +$ HOME= gdb -q -batch -ex "show index-cache directory" +The directory of the index cache is "/home/linux/.cache/gdb". +... + +There's nothing wrong with that behaviour, the dir is simply constructed using +XDG_CACHE_HOME which happens to be explictly set to its default value +$HOME/.cache [1]: +... +$ echo $XDG_CACHE_HOME +/home/linux/.cache +... +and indeed also setting that variable to empty gets us the expected empty dir: +... +$ XDG_CACHE_HOME= HOME= gdb -q -batch -ex "show index-cache directory" +gdb: warning: Couldn't determine a path for the index cache directory. +The directory of the index cache is "". +... + +Furthermore, the test-case assumption that setting variables to empty either +produces the original dir or an empty dir is incorrect. + +Say that XDG_CACHE_HOME has a non-default value: +... +$ echo $XDG_CACHE_HOME +/home/linux/my-xdg-cache-home +$ gdb -q -batch -ex "show index-cache directory" +The directory of the index cache is "/home/linux/my-xdg-cache-home/gdb". +... +then setting that variable to empty: +... +$ XDG_CACHE_HOME= gdb -q -batch -ex "show index-cache directory" +The directory of the index cache is "/home/linux/.cache/gdb". +... +does change the value of the dir. + +Fix this by making the test-case less specific. + +While we're at it, factor out regexps re_pre and re_post to make regexps more +readable, and use string_to_regexp to reduce quoting. + +Tested on aarch64-linux. + +PR testsuite/32132 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32132 + +[1] https://specifications.freedesktop.org/basedir-spec/latest/index.html#variables +--- + .../gdb.base/empty-host-env-vars.exp | 32 ++++++------------- + 1 file changed, 9 insertions(+), 23 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/empty-host-env-vars.exp b/gdb/testsuite/gdb.base/empty-host-env-vars.exp +index e6e9d6e3156..5fab65a3607 100644 +--- a/gdb/testsuite/gdb.base/empty-host-env-vars.exp ++++ b/gdb/testsuite/gdb.base/empty-host-env-vars.exp +@@ -21,16 +21,14 @@ require {!is_remote host} + + set all_env_vars { HOME XDG_CACHE_HOME LOCALAPPDATA XDG_CONFIG_HOME } + +-# Record the initial value of the index-cache directory. ++set re_pre \ ++ [string_to_regexp {The directory of the index cache is "}] ++set re_post \ ++ [string_to_regexp {".}] ++ ++# Show the initial value of the index-cache directory. + clean_restart +-set index_cache_directory "" +-gdb_test_multiple "show index-cache directory" "" { +- -re -wrap "The directory of the index cache is \"(.*)\"\\." { +- set index_cache_directory $expect_out(1,string) +- set index_cache_directory [string_to_regexp $index_cache_directory] +- pass $gdb_test_name +- } +-} ++gdb_test "show index-cache directory" $re_pre\[^\r\n\]*$re_post + + foreach_with_prefix env_var_name $all_env_vars { + # Restore the original state of the environment variable. +@@ -38,18 +36,7 @@ foreach_with_prefix env_var_name $all_env_vars { + set env($env_var_name) {} + clean_restart + +- # Verify that the empty environment variable didn't affect the +- # index-cache directory setting, that we still see the initial value. +- # "HOME" is different, because if that one is unset, GDB isn't even +- # able to compute the default location. In that case, we expect it to +- # be empty. +- if { $env_var_name == "HOME" } { +- gdb_test "show index-cache directory" \ +- "The directory of the index cache is \"\"\\." +- } else { +- gdb_test "show index-cache directory" \ +- "The directory of the index cache is \"$index_cache_directory\"\\." +- } ++ gdb_test "show index-cache directory" $re_pre\[^\r\n\]*$re_post + } + } + +@@ -69,7 +56,6 @@ with_test_prefix "all env vars" { + + clean_restart + +- gdb_test "show index-cache directory" \ +- "The directory of the index cache is \"\"\\." ++ gdb_test "show index-cache directory" $re_pre$re_post + } + } +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdb.base-list-dot-nodebug-and-make.patch b/gdb-testsuite-fix-gdb.base-list-dot-nodebug-and-make.patch new file mode 100644 index 0000000..8e78363 --- /dev/null +++ b/gdb-testsuite-fix-gdb.base-list-dot-nodebug-and-make.patch @@ -0,0 +1,83 @@ +From 755699757fc57172c5c9a173fae9bfaf75bc1b6a Mon Sep 17 00:00:00 2001 +From: Guinevere Larsen +Date: Fri, 31 May 2024 10:48:54 -0300 +Subject: [PATCH 36/46] gdb,testsuite: fix gdb.base/list-dot-nodebug and make + it more robust + +Thiago Jung Bauermann noticed that gdb.base/list-dot-nodebug was not +actually compiling the test with some debuginfo in the relevant part, +and while fixing I noticed that the base assumption of the "some" case +was wrong, GDB would select some symtab as a default location and the +test would always fail. This fix makes printing the default location +only be tested when there is no debuginfo. + +When testing with no debuginfo, if a system had static libc debuginfo, +the test would also fail. To add an extra layer of robustness to the +test, this rewrite also strips any stray debuginfo from the executable. +The test would only fail now if it runs in a system that can't handle +stripped debuginfo and has static debuginfo pre-installed. + +Reported-By: Tom de Vries +Reported-By: Thiago Jung Bauermann +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31721 +Reviewed-by: Thiago Jung Bauermann +Approved-By: Andrew Burgess +--- + gdb/testsuite/gdb.base/list-dot-nodebug.exp | 37 +++++++++++++++------ + 1 file changed, 26 insertions(+), 11 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/list-dot-nodebug.exp b/gdb/testsuite/gdb.base/list-dot-nodebug.exp +index c9d732e801b..b7359be1a45 100644 +--- a/gdb/testsuite/gdb.base/list-dot-nodebug.exp ++++ b/gdb/testsuite/gdb.base/list-dot-nodebug.exp +@@ -34,21 +34,36 @@ standard_testfile .c -extra.c + + foreach_with_prefix debug {"none" "some"} { + +- set flags "nodebug" + if {$debug == "some"} { +- set flags "debug" +- } ++ if {[prepare_for_testing_full "failed to prepare" \ ++ [list ${testfile}-${debug} $linkflags \ ++ $srcfile [list nodebug] \ ++ $srcfile2 [list debug]]]} { ++ return -1 ++ } + +- if {[prepare_for_testing_full "failed to prepare" \ +- [list ${testfile}-${debug} $linkflags \ +- $srcfile [list nodebug] \ +- $srcfile2 [list $debug]]]} { +- return -1 ++ # We don't test "list ." before starting with some debug info ++ # because GDB will choose the symtab that has debuginfo, and ++ # print the copyright blurb. This test isn't interested (yet?) ++ # in checking if this default location choice is consistent. ++ } else { ++ set executable ${testfile}-none ++ if {[build_executable "failed to prepare" ${executable} \ ++ [list $srcfile $srcfile2] $linkflags]} { ++ return -1 ++ } ++ ++ # Stripping is a backup in case the system has static libc debuginfo. ++ # We can continue the test even if it fails. ++ gdb_gnu_strip_debug $executable no-debuglink ++ ++ clean_restart ${executable} ++ ++ gdb_test "list ." \ ++ "^Insufficient debug info for showing source lines at default location" \ ++ "print before start" + } + +- gdb_test "list ." \ +- "^Insufficient debug info for showing source lines at default location" \ +- "print before start" + + if { ![runto bar] } { + return -1 +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdb.base-list-dot-nodebug.exp-on-o.patch b/gdb-testsuite-fix-gdb.base-list-dot-nodebug.exp-on-o.patch new file mode 100644 index 0000000..2db9117 --- /dev/null +++ b/gdb-testsuite-fix-gdb.base-list-dot-nodebug.exp-on-o.patch @@ -0,0 +1,60 @@ +From 3048a9807737063118adfd0addbcf7218a5d8681 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 4 Feb 2025 10:34:39 +0100 +Subject: [PATCH 37/46] [gdb/testsuite] Fix gdb.base/list-dot-nodebug.exp on + openSUSE + +On openSUSE Leap 15.6 with test-case gdb.base/list-dot-nodebug.exp I run into: +... +(gdb) list .^M +warning: 1 ../sysdeps/x86_64/crtn.S: No such file or directory^M +(gdb) FAIL: $exp: debug=none: print before start +... + +The intent of the debug=none case is to generate an executable with no debug +info. However, we have quite a few CUs with debug info: +... +$ readelf -wi outputs/gdb.base/list-dot-nodebug/list-dot-nodebug-none \ + | egrep -c " @ " +431 +... + +This is because this code: +... + gdb_gnu_strip_debug $executable no-debuglink +... +uses $executable, and the variable is set here: +... + set executable ${testfile}-none +... +which sets it to "list-dot-nodebug-none" and consequently +gdb_gnu_strip_debug cannot find it. + +Fix this by using "[standard_output_file $executable]" instead. + +Tested on x86_64-linux. + +Approved-By: Tom Tromey + +PR testsuite/31721 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31721 +--- + gdb/testsuite/gdb.base/list-dot-nodebug.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.base/list-dot-nodebug.exp b/gdb/testsuite/gdb.base/list-dot-nodebug.exp +index b7359be1a45..107669de04d 100644 +--- a/gdb/testsuite/gdb.base/list-dot-nodebug.exp ++++ b/gdb/testsuite/gdb.base/list-dot-nodebug.exp +@@ -55,7 +55,7 @@ foreach_with_prefix debug {"none" "some"} { + + # Stripping is a backup in case the system has static libc debuginfo. + # We can continue the test even if it fails. +- gdb_gnu_strip_debug $executable no-debuglink ++ gdb_gnu_strip_debug [standard_output_file $executable] no-debuglink + + clean_restart ${executable} + +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdb.cp-m-static.exp-on-arm.patch b/gdb-testsuite-fix-gdb.cp-m-static.exp-on-arm.patch new file mode 100644 index 0000000..8917824 --- /dev/null +++ b/gdb-testsuite-fix-gdb.cp-m-static.exp-on-arm.patch @@ -0,0 +1,88 @@ +From c77016a72a59a2f32be370d2c8d6729baa97191c Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 24 Jul 2024 14:44:33 +0200 +Subject: [PATCH 10/46] [gdb/testsuite] Fix gdb.cp/m-static.exp on arm + +With test-case gdb.cp/m-static.exp on arm-linux, I get: +... +(gdb) ptype test5.single_constructor^M +type = class single_constructor {^M +^M + public:^M + single_constructor(void);^M + ~single_constructor(void);^M +} *(single_constructor * const)^M +(gdb) FAIL: gdb.cp/m-static.exp: simple object instance, ptype constructor +... + +The test-case expects: +- no empty line before "public:", and +- no "~single_constructor(void)", but "~single_constructor()" + +The latter is due to commit 137c886e9a6 ("[gdb/c++] Print destructor the same +for gcc and clang"). + +The failing test is in a part only enabled for is_aarch32_target == 1, so it +looks like it was left behind. + +I'm assuming the same happened for the other difference. + +Fix this by updating the regexps to match the observed output. + +Tested on arm-linux. + +Approved-By: Andrew Burgess +--- + gdb/testsuite/gdb.cp/m-static.exp | 15 +++++++++++---- + gdb/testsuite/lib/gdb-utils.exp | 8 ++++++++ + 2 files changed, 19 insertions(+), 4 deletions(-) + +diff --git a/gdb/testsuite/gdb.cp/m-static.exp b/gdb/testsuite/gdb.cp/m-static.exp +index 45bc090d01f..5b41898ec9d 100644 +--- a/gdb/testsuite/gdb.cp/m-static.exp ++++ b/gdb/testsuite/gdb.cp/m-static.exp +@@ -71,11 +71,18 @@ if { [is_aarch32_target] } { + gdb_test "print test5.single_constructor" \ + { = {single_constructor \*\(single_constructor \* const\)} 0x[0-9a-f]+ } \ + "simple object instance, print constructor" +- gdb_test "ptype test5.single_constructor" \ +- {type = class single_constructor {\r\n public:\r\n single_constructor\(void\);\r\n ~single_constructor\(\);\r\n} \*\(single_constructor \* const\)} \ ++ ++ set re \ ++ [multi_line_string_to_regexp \ ++ "type = class single_constructor {" \ ++ "" \ ++ " public:" \ ++ " single_constructor(void);" \ ++ " ~single_constructor(void);" \ ++ "} *(single_constructor * const)"] ++ gdb_test "ptype test5.single_constructor" $re \ + "simple object instance, ptype constructor" +- gdb_test "ptype single_constructor::single_constructor" \ +- {type = class single_constructor {\r\n public:\r\n single_constructor\(void\);\r\n ~single_constructor\(\);\r\n} \*\(single_constructor \* const\)} \ ++ gdb_test "ptype single_constructor::single_constructor" $re \ + "simple object class, ptype constructor" + + gdb_test "print test1.~gnu_obj_1" \ +diff --git a/gdb/testsuite/lib/gdb-utils.exp b/gdb/testsuite/lib/gdb-utils.exp +index 95c53d030d8..41989da3ed2 100644 +--- a/gdb/testsuite/lib/gdb-utils.exp ++++ b/gdb/testsuite/lib/gdb-utils.exp +@@ -38,6 +38,14 @@ proc string_to_regexp {str} { + return $result + } + ++# Convenience function that calls string_to_regexp for each arg, and ++# joins the results using "\r\n". ++ ++proc multi_line_string_to_regexp { args } { ++ set res [lmap arg $args {string_to_regexp $arg}] ++ return [multi_line {*}$res] ++} ++ + # Given a list of strings, adds backslashes as needed to each string to + # create a regexp that will match the string, and join the result. + +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdb.cp-non-trivial-retval.exp-on-a.patch b/gdb-testsuite-fix-gdb.cp-non-trivial-retval.exp-on-a.patch new file mode 100644 index 0000000..af8d7de --- /dev/null +++ b/gdb-testsuite-fix-gdb.cp-non-trivial-retval.exp-on-a.patch @@ -0,0 +1,99 @@ +From 23574ea1b3502dd13efa9b3ebf32fee3118e6ff0 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 20 Jan 2025 05:41:01 +0100 +Subject: [PATCH 29/46] [gdb/testsuite] Fix gdb.cp/non-trivial-retval.exp on + arm-linux with gcc 13 + +On arm-linux, with target board unix/-mthumb, we get: +... +(gdb) PASS: gdb.cp/non-trivial-retval.exp: continue to breakpoint: Break here +p f1 (i1, i2)^M +$1 = {a = -136274256}^M +(gdb) FAIL: gdb.cp/non-trivial-retval.exp: gdb-command

+... + +This is not a problem with the inferior call, which works fine: +... +(gdb) p f1 (23, 100) +$3 = {a = 123} +... +but instead it's a problem with the location information: +... +(gdb) p i1 +$1 = -136274356 +(gdb) p i2 +$2 = 100 +... +which tells us to find the value of i1 in (DW_OP_fbreg: -12). + +The test-case passes if we drop -fvar-tracking, in which case the debug info +tells us to find the value of i1 in (DW_OP_fbreg: -20). + +This is with gcc 13.3.0 on Ubuntu 24.04. With gcc 14.2.0 on Debian testing, +the code is the same, but -fvar-tracking does use the correct +'(DW_OP_fbreg: -20)'. + +There seems to be some bugfix in -fvar-tracking for gcc 14. + +Workaround the bug by using constants 23 and 100 instead of i1 and i2 when +using -fvar-tracking and gcc < 14. + +Tested on arm-linux. + +PR testsuite/32549 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32549 +--- + gdb/testsuite/gdb.cp/non-trivial-retval.exp | 28 ++++++++++++++++----- + 1 file changed, 22 insertions(+), 6 deletions(-) + +diff --git a/gdb/testsuite/gdb.cp/non-trivial-retval.exp b/gdb/testsuite/gdb.cp/non-trivial-retval.exp +index 6c9f7e13d2a..64c0867368d 100644 +--- a/gdb/testsuite/gdb.cp/non-trivial-retval.exp ++++ b/gdb/testsuite/gdb.cp/non-trivial-retval.exp +@@ -21,8 +21,18 @@ require allow_cplus_tests + + standard_testfile .cc + ++set i1 i1 ++set i2 i2 ++ + if {[have_fvar_tracking]} { + set additional_flags "additional_flags= -fvar-tracking" ++ ++ if { [gcc_major_version] < 14 } { ++ # For armv7, target board unix/-mthumb, -fvar-tracking and gcc 13 we ++ # get incorrect location info. Work around this by using constants instead. ++ set i1 23 ++ set i2 100 ++ } + } + + if {[prepare_for_testing "failed to prepare" $testfile $srcfile [list debug c++ $additional_flags]]} { +@@ -37,12 +47,18 @@ if {![runto_main]} { + gdb_breakpoint [gdb_get_line_number "Break here"] + gdb_continue_to_breakpoint "Break here" + +-gdb_test "p f1 (i1, i2)" ".* = {a = 123}" +-gdb_test "p f2 (i1, i2)" ".* = {b = 123}" +-gdb_test "p f22 (i1, i2)" ".* = {b1 = 123}" +-gdb_test "p f3 (i1, i2)" ".* = {.* c = 123}" +-gdb_test "p f4 (i1, i2)" ".* = {.* e = 123}" +-gdb_test "p f5 (i1, i2)" ".* = {f = 123}" ++gdb_test "p f1 ($i1, $i2)" ".* = {a = 123}" \ ++ "p f1 (i1, i2)" ++gdb_test "p f2 ($i1, $i2)" ".* = {b = 123}" \ ++ "p f2 (i1, i2)" ++gdb_test "p f22 ($i1, $i2)" ".* = {b1 = 123}" \ ++ "p f22 (i1, i2)" ++gdb_test "p f3 ($i1, $i2)" ".* = {.* c = 123}" \ ++ "p f3 (i1, i2)" ++gdb_test "p f4 ($i1, $i2)" ".* = {.* e = 123}" \ ++ "p f4 (i1, i2)" ++gdb_test "p f5 ($i1, $i2)" ".* = {f = 123}" \ ++ "p f5 (i1, i2)" + + gdb_breakpoint "f1" + gdb_breakpoint "f2" +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdb.dwarf2-dw2-fixed-point.exp-on-.patch b/gdb-testsuite-fix-gdb.dwarf2-dw2-fixed-point.exp-on-.patch new file mode 100644 index 0000000..2d44067 --- /dev/null +++ b/gdb-testsuite-fix-gdb.dwarf2-dw2-fixed-point.exp-on-.patch @@ -0,0 +1,54 @@ +From 80150dc7ac41e767d857905702bf4b57eb1c0029 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 16 Aug 2024 14:22:46 +0200 +Subject: [PATCH 11/46] [gdb/testsuite] Fix gdb.dwarf2/dw2-fixed-point.exp on + arm-linux + +With test-case gdb.dwarf2/dw2-fixed-point.exp on arm-linux I run into: +... +(gdb) PASS: gdb.dwarf2/dw2-fixed-point.exp: set lang ada +print pck.fp1_var^M +$1 = 0.3125^M +(gdb) FAIL: gdb.dwarf2/dw2-fixed-point.exp: print pck.fp1_var +... + +The problem is that the thumb prologue analyzer overshoot, setting the +breakpoint for main after line 49: +... + 46 int + 47 main (void) + 48 { + 49 pck__fp1_var++; +... +and consequently we see the value of pck.fp1_var after line 49 instead of +before line 49. This is PR tdep/31981. + +Work around this by removing line 49 and all similar subsequent lines, which +turn out to be dead code. + +Approved-By: Luis Machado + +Tested on arm-linux. +--- + gdb/testsuite/gdb.dwarf2/dw2-fixed-point.c | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-fixed-point.c b/gdb/testsuite/gdb.dwarf2/dw2-fixed-point.c +index 58b97caf055..2789e6ac0fb 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-fixed-point.c ++++ b/gdb/testsuite/gdb.dwarf2/dw2-fixed-point.c +@@ -46,11 +46,5 @@ int8_t pck__fp1_range_var = 16; + int + main (void) + { +- pck__fp1_var++; +- pck__fp1_var2++; +- pck__fp2_var++; +- pck__fp3_var++; +- pck__fp1_range_var++; +- + return 0; + } +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdb.dwarf2-dw2-lines.exp-on-arm-li.patch b/gdb-testsuite-fix-gdb.dwarf2-dw2-lines.exp-on-arm-li.patch new file mode 100644 index 0000000..9d6fc1a --- /dev/null +++ b/gdb-testsuite-fix-gdb.dwarf2-dw2-lines.exp-on-arm-li.patch @@ -0,0 +1,279 @@ +From e13b5af2c0bc0cdf1b2d66f184fff4ba019b28ec Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 4 Sep 2024 10:07:19 +0200 +Subject: [PATCH 12/46] [gdb/testsuite] Fix gdb.dwarf2/dw2-lines.exp on + arm-linux + +With test-case gdb.dwarf2/dw2-lines.exp on arm-linux, I run into: +... +(gdb) break bar_label^M +Breakpoint 2 at 0x4004f6: file dw2-lines.c, line 29.^M +(gdb) continue^M +Continuing.^M +^M +Breakpoint 2, bar () at dw2-lines.c:29^M +29 foo (2);^M +(gdb) PASS: $exp: cv=2: cdw=32: lv=2: ldw=32: continue to breakpoint: foo \(1\) +... + +The pass is incorrect because the continue lands at line 29 with "foo (2)" +instead of line line 27 with "foo (1)". + +A minimal version is: +... +$ gdb -q -batch dw2-lines.cv-2-cdw-32-lv-2-ldw-32 -ex "b bar_label" +Breakpoint 1 at 0x4f6: file dw2-lines.c, line 29. +... +where: +... +000004ec : + 4ec: b580 push {r7, lr} + 4ee: af00 add r7, sp, #0 + +000004f0 : + 4f0: 2001 movs r0, #1 + 4f2: f7ff fff1 bl 4d8 + +000004f6 : + 4f6: 2002 movs r0, #2 + 4f8: f7ff ffee bl 4d8 +... + +So, how does this happen? In short: +- skip_prologue_sal calls arm_skip_prologue with pc == 0x4ec, +- thumb_analyze_prologue returns 0x4f2 + (overshooting by 1 insn, PR tdep/31981), and +- skip_prologue_sal decides that we're mid-line, and updates to 0x4f6. + +However, this is a test-case about .debug_line info, so why didn't arm_skip_prologue +use the line info to skip the prologue? + +The answer is that the line info starts at bar_label, not at bar. + +Fixing that allows us to work around PR tdep/31981. + +Likewise in gdb.dwarf2/dw2-line-number-zero.exp. + +Instead, add a new test-case gdb.arch/skip-prologue.exp that is dedicated to +checking quality of architecture-specific prologue analysis, without being +written in an architecture-specific way. + +If fails on arm-linux for both marm and mthumb: +... +FAIL: gdb.arch/skip-prologue.exp: f2: $bp_addr == $prologue_end_addr (skipped too much) +FAIL: gdb.arch/skip-prologue.exp: f4: $bp_addr == $prologue_end_addr (skipped too much) +... +and passes for: +- x86_64-linux for {m64,m32}x{-fno-PIE/-no-pie,-fPIE/-pie} +- aarch64-linux. + +Tested on arm-linux. +--- + gdb/testsuite/gdb.arch/skip-prologue.c | 54 +++++++++++++ + gdb/testsuite/gdb.arch/skip-prologue.exp | 76 +++++++++++++++++++ + .../gdb.dwarf2/dw2-line-number-zero.exp | 8 ++ + gdb/testsuite/gdb.dwarf2/dw2-lines.c | 2 +- + gdb/testsuite/gdb.dwarf2/dw2-lines.exp | 4 + + 5 files changed, 143 insertions(+), 1 deletion(-) + create mode 100644 gdb/testsuite/gdb.arch/skip-prologue.c + create mode 100644 gdb/testsuite/gdb.arch/skip-prologue.exp + +diff --git a/gdb/testsuite/gdb.arch/skip-prologue.c b/gdb/testsuite/gdb.arch/skip-prologue.c +new file mode 100644 +index 00000000000..08ceacb6aa8 +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/skip-prologue.c +@@ -0,0 +1,54 @@ ++/* Copyright 2024 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++void ++f1 (void) ++{ ++ asm ("f1_prologue_end: .globl f1_prologue_end"); ++} ++ ++int ++f2 (int a) ++{ ++ asm ("f2_prologue_end: .globl f2_prologue_end"); ++ return a; ++} ++ ++void ++f3 (void) ++{ ++ asm ("f3_prologue_end: .globl f3_prologue_end"); ++ f1 (); ++} ++ ++int ++f4 (int a) ++{ ++ asm ("f4_prologue_end: .globl f4_prologue_end"); ++ return f2 (a); ++} ++ ++int ++main (void) ++{ ++ f1 (); ++ f2 (0); ++ f3 (); ++ f4 (0); ++ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.arch/skip-prologue.exp b/gdb/testsuite/gdb.arch/skip-prologue.exp +new file mode 100644 +index 00000000000..89d2225151a +--- /dev/null ++++ b/gdb/testsuite/gdb.arch/skip-prologue.exp +@@ -0,0 +1,76 @@ ++# Copyright 2024 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# Test-case that checks architecture-specific prologue analyzers. ++ ++standard_testfile ++ ++if { [prepare_for_testing "failed to prepare" $testfile $srcfile \ ++ {nodebug}] } { ++ return -1 ++} ++ ++proc do_test { f } { ++ set bp_addr "" ++ gdb_test_multiple "break $f" "" { ++ -re -wrap "Breakpoint $::decimal at ($::hex)" { ++ set bp_addr $expect_out(1,string) ++ pass $gdb_test_name ++ } ++ } ++ ++ if { $bp_addr == "" } { ++ return ++ } ++ ++ set prologue_end_addr "" ++ gdb_test_multiple "p /x &${f}_prologue_end" "" { ++ -re -wrap " = ($::hex)" { ++ set prologue_end_addr $expect_out(1,string) ++ pass $gdb_test_name ++ } ++ } ++ ++ if { $prologue_end_addr == "" } { ++ return ++ } ++ ++ set test {$bp_addr == $prologue_end_addr} ++ if { [expr $test] } { ++ pass $test ++ } elseif { $bp_addr < $prologue_end_addr } { ++ # We'll allow this. For instance, amd64 has a prologue ++ # analyzer that doesn't skip the 3rd instruction here, which saves an ++ # argument register to stack: ++ # ++ # 00000000004004ae : ++ # 4004ae: 55 push %rbp ++ # 4004af: 48 89 e5 mov %rsp,%rbp ++ # 4004b2: 89 7d fc mov %edi,-0x4(%rbp) ++ # 00000000004004b5 : ++ # ++ pass "$test (skipped less than possible)" ++ } elseif { $bp_addr > $prologue_end_addr } { ++ fail "$test (skipped too much)" ++ } else { ++ fail "$test" ++ } ++} ++ ++foreach f { f1 f2 f3 f4 } { ++ with_test_prefix $f { ++ do_test $f ++ } ++} +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp b/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp +index c510de42037..9124aff1dad 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp ++++ b/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp +@@ -56,6 +56,10 @@ Dwarf::assemble $asm_file { + file_name "$srcfile" 1 + + program { ++ DW_LNE_set_address $bar1_start ++ line 25 ++ DW_LNS_copy ++ + DW_LNE_set_address bar1_label + line 27 + DW_LNS_copy +@@ -76,6 +80,10 @@ Dwarf::assemble $asm_file { + DW_LNE_end_sequence + + ++ DW_LNE_set_address $bar2_start ++ line 39 ++ DW_LNS_copy ++ + DW_LNE_set_address bar2_label + line 41 + DW_LNS_copy +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-lines.c b/gdb/testsuite/gdb.dwarf2/dw2-lines.c +index 67c98fecf02..221d7b95bc3 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-lines.c ++++ b/gdb/testsuite/gdb.dwarf2/dw2-lines.c +@@ -22,7 +22,7 @@ foo (int x) + + void + bar (void) +-{ ++{ /* bar: */ + asm ("bar_label: .globl bar_label"); + foo (1); + asm ("bar_label_2: .globl bar_label_2"); +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-lines.exp b/gdb/testsuite/gdb.dwarf2/dw2-lines.exp +index af5b6b71768..fd5b83edc5b 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-lines.exp ++++ b/gdb/testsuite/gdb.dwarf2/dw2-lines.exp +@@ -88,6 +88,10 @@ proc test_1 { _cv _cdw64 _lv _ldw64 {_string_form ""}} { + # to set the current file explicitly. + DW_LNS_set_file $diridx + ++ DW_LNE_set_address $bar_start ++ line [line_for bar] ++ DW_LNS_copy ++ + DW_LNE_set_address bar_label + line [line_for bar_label] + DW_LNS_copy +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdb.python-py-format-address.exp-o.patch b/gdb-testsuite-fix-gdb.python-py-format-address.exp-o.patch new file mode 100644 index 0000000..76756db --- /dev/null +++ b/gdb-testsuite-fix-gdb.python-py-format-address.exp-o.patch @@ -0,0 +1,88 @@ +From 37ce118a44994fb178065eaed671c7036f3d93a5 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 20 Jun 2024 16:54:47 +0200 +Subject: [PATCH 34/46] [gdb/testsuite] Fix gdb.python/py-format-address.exp on + arm + +When running test-case gdb.python/py-format-address.exp on arm-linux, I get: +... +(gdb) python print("Got: " + gdb.format_address(0x103dd))^M +Got: 0x103dd

^M +(gdb) FAIL: $exp: symbol_filename=on: gdb.format_address, \ +result should have an offset +... + +What is expected here is: +... +Got: 0x103dd ^M +... + +Main starts at main_addr: +... +(gdb) print /x &main^M +$1 = 0x103dc^M +... +and we obtained next_addr 0x103dd by adding 1 to it: +... +set next_addr [format 0x%x [expr $main_addr + 1]] +... + +Adding 1 to $main_addr results in an address for a thumb function starting at +address 0x103dc, which is incorrect because main is an arm function (because +I'm running with target board unix/-marm). + +At some point during the call to format_addr, arm_addr_bits_remove removes +the thumb bit, which causes the +1 offset to be dropped, causing the FAIL. + +Fix this by using the address of the breakpoint on main, provided it's not at +the very start of main. + +Tested on arm-linux. + +PR testsuite/31452 +Bug: https://www.sourceware.org/bugzilla/show_bug.cgi?id=31452 +--- + .../gdb.python/py-format-address.exp | 20 +++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) + +diff --git a/gdb/testsuite/gdb.python/py-format-address.exp b/gdb/testsuite/gdb.python/py-format-address.exp +index 8e7cf47e03a..ab8022c753b 100644 +--- a/gdb/testsuite/gdb.python/py-format-address.exp ++++ b/gdb/testsuite/gdb.python/py-format-address.exp +@@ -40,7 +40,23 @@ if ![runto_main] { + # for the program space and architecture (these will be selected based + # on the current inferior). + set main_addr [get_hexadecimal_valueof "&main" "UNKNOWN"] +-set next_addr [format 0x%x [expr $main_addr + 1]] ++require {!string equal $main_addr {UNKNOWN}} ++ ++set next_addr "UNKNOWN" ++gdb_test_multiple "info break 1" "" { ++ -re -wrap " y +($hex) +in .*" { ++ set next_addr $expect_out(1,string) ++ set next_addr [regsub {^0x0+} $next_addr "0x"] ++ pass $gdb_test_name ++ } ++} ++if { $next_addr == "UNKNOWN" || $next_addr == $main_addr } { ++ set next_addr [format 0x%x [expr $main_addr + 1]] ++} ++ ++verbose -log "main_addr: $main_addr" ++verbose -log "next_addr: $next_addr" ++ + + foreach_with_prefix symbol_filename { on off } { + gdb_test_no_output "set print symbol-filename ${symbol_filename}" +@@ -56,7 +72,7 @@ foreach_with_prefix symbol_filename { on off } { + "gdb.format_address, result should have no offset" + + gdb_test "python print(\"Got: \" + gdb.format_address($next_addr))" \ +- "Got: $next_addr " \ ++ "Got: $next_addr " \ + "gdb.format_address, result should have an offset" + } + +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdb.python-py-format-string.exp-wi.patch b/gdb-testsuite-fix-gdb.python-py-format-string.exp-wi.patch new file mode 100644 index 0000000..51bea55 --- /dev/null +++ b/gdb-testsuite-fix-gdb.python-py-format-string.exp-wi.patch @@ -0,0 +1,65 @@ +From ae564bb3259a6ae34efa3dd48561709d116dc3bc Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 1 Aug 2024 09:23:24 +0200 +Subject: [PATCH 01/46] [gdb/testsuite] Fix gdb.python/py-format-string.exp + with python 3.13 + +On fedora rawhide, with python 3.13, I run into: +... +(gdb) python print (gdb.parse_and_eval ('a_point_t').format_string (invalid=True))^M +Python Exception : \ + this function got an unexpected keyword argument 'invalid'^M +Error occurred in Python: \ + this function got an unexpected keyword argument 'invalid'^M +(gdb) FAIL: $exp: format_string: lang_c: test_all_common: test_invalid_args: \ + a_point_t with option invalid=True +... + +A passing version with an older python version looks like: +... +(gdb) python print (gdb.parse_and_eval ('a_point_t').format_string (invalid=True))^M +Python Exception : \ + 'invalid' is an invalid keyword argument for this function^M +Error occurred in Python: \ + 'invalid' is an invalid keyword argument for this function^M +(gdb) PASS: $exp: format_string: lang_c: test_all_common: test_invalid_args: \ + a_point_t with option invalid=True +... + +Fix this by accepting the updated error message. + +Tested on aarch64-linux. + +PR testsuite/31912 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31912 +--- + gdb/testsuite/gdb.python/py-format-string.exp | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.python/py-format-string.exp b/gdb/testsuite/gdb.python/py-format-string.exp +index 0c70ad562c7..92092139639 100644 +--- a/gdb/testsuite/gdb.python/py-format-string.exp ++++ b/gdb/testsuite/gdb.python/py-format-string.exp +@@ -1104,10 +1104,16 @@ proc_with_prefix test_invalid_args {} { + "12" \ + "TypeError.*: format_string\\(\\) takes 0 positional arguments but 1 were given.*" + ++ # For python <= 3.12. ++ set re1 \ ++ "TypeError.*: 'invalid' is an invalid keyword argument for this function" ++ # For python >= 3.13. ++ set re2 \ ++ "TypeError.*: this function got an unexpected keyword argument 'invalid'" + check_format_string \ + "a_point_t" \ + "invalid=True" \ +- "TypeError.*: 'invalid' is an invalid keyword argument for this function.*" ++ "($re1|$re2).*" + + check_format_string \ + "a_point_t" \ + +base-commit: 735d4dc480bcdcb0eddde33b687bd5f11d4f86ee +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdb.python-py-mi-cmd.exp-with-pyth.patch b/gdb-testsuite-fix-gdb.python-py-mi-cmd.exp-with-pyth.patch new file mode 100644 index 0000000..45aa42d --- /dev/null +++ b/gdb-testsuite-fix-gdb.python-py-mi-cmd.exp-with-pyth.patch @@ -0,0 +1,154 @@ +From 6874385b527cf5d5a43a01484ea58f3912a06b67 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 20 Aug 2024 15:57:36 +0200 +Subject: [PATCH 02/46] [gdb/testsuite] Fix gdb.python/py-mi-cmd.exp with + python 3.13 + +When running test-case gdb.python/py-mi-cmd.exp with python 3.13, I run into: +... +Expecting: ^(-pycmd exp[^M +]+)?(.*&"Traceback \(most recent call last\):.."^M +&"[^^M +]+py-mi-cmd.py[^^M +]+"^M +&"[^^M +]+raise gdb.GdbError\(\).."^M +&"gdb.GdbError.."^M +\^error,msg="Error occurred in Python\."[^M +]+[(]gdb[)] ^M +[ ]*) +-pycmd exp^M +&"Traceback (most recent call last):\n"^M +&" File \"py-mi-cmd.py\", line 76, in invoke\n raise gdb.GdbError()\n"^M +&"gdb.GdbError\n"^M +^error,msg="Error occurred in Python."^M +(gdb) ^M +FAIL: gdb.python/py-mi-cmd.exp: -pycmd exp (unexpected output) +... + +In contrast, with python 3.12 I have: +... +Expecting: ^(-pycmd exp[^M +]+)?(.*&"Traceback \(most recent call last\):.."^M +&"[^^M +]+py-mi-cmd.py[^^M +]+"^M +&"[^^M +]+raise gdb.GdbError\(\).."^M +&"gdb.GdbError.."^M +\^error,msg="Error occurred in Python\."[^M +]+[(]gdb[)] ^M +[ ]*) +-pycmd exp^M +&"Traceback (most recent call last):\n"^M +&" File \"py-mi-cmd.py\", line 76, in invoke\n"^M +&" raise gdb.GdbError()\n"^M +&"gdb.GdbError\n"^M +^error,msg="Error occurred in Python."^M +(gdb) ^M +PASS: gdb.python/py-mi-cmd.exp: -pycmd exp +... + +To make it easier to understand what we're looking at, let's take this out of +the mi interpreter context and use the cli interpreter: +... +$ gdb -q -batch -ex "set trace-commands on" -x gdb.in ++set python print-stack full ++source py-mi-cmd.py ++python pycmd1('-pycmd') ++python pycmd1.invoke (pycmd1, ["exp"]) +Traceback (most recent call last): + File "", line 1, in + File "py-mi-cmd.py", line 76, in invoke + raise gdb.GdbError() +gdb.GdbError +gdb.in:4: Error in sourced command file: +Error occurred in Python. +... + +Interestingly, this is what we're seeing with both python 3.12 and 3.13. + +The difference between the python versions is that: +- with python 3.12 each line is printed by itself, and +- with python 3.13 two particular lines are printed toghether. + +With the cli interpreter, that makes no difference, because the '\n' is +interpreted. + +But with the mi interpreter, that causes a difference in output because the +'\n' is not interpreted, but rather printed literally. + +Fix this by accepting the new output in addition to the old one. + +Tested on aarch64-linux. + +Reviewed-by: Thiago Jung Bauermann + +PR testsuite/31913 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31913 +--- + gdb/testsuite/gdb.python/py-mi-cmd.exp | 48 ++++++++++++++++++++++---- + 1 file changed, 41 insertions(+), 7 deletions(-) + +diff --git a/gdb/testsuite/gdb.python/py-mi-cmd.exp b/gdb/testsuite/gdb.python/py-mi-cmd.exp +index 28c71cd75f3..52914099e6d 100644 +--- a/gdb/testsuite/gdb.python/py-mi-cmd.exp ++++ b/gdb/testsuite/gdb.python/py-mi-cmd.exp +@@ -119,13 +119,47 @@ mi_gdb_test "-pycmd dash-key" \ + # With this argument the command raises a gdb.GdbError with no message + # string. GDB considers this a bug in the user program, so prints a + # backtrace, and a generic error message. +-mi_gdb_test "-pycmd exp" \ +- [multi_line ".*&\"Traceback \\(most recent call last\\):..\"" \ +- "&\"\[^\r\n\]+${testfile}.py\[^\r\n\]+\"" \ +- "&\"\[^\r\n\]+raise gdb.GdbError\\(\\)..\"" \ +- "&\"gdb.GdbError..\"" \ +- "\\^error,msg=\"Error occurred in Python\\.\""] \ +- "-pycmd exp" ++ ++set line1 \ ++ [string_to_regexp {Traceback (most recent call last):\n}] ++set line2 \ ++ [string cat \ ++ [string_to_regexp { File \"}] \ ++ "\[^\r\n\]+" \ ++ [string_to_regexp ${testfile}.py] \ ++ [string_to_regexp {\", line }] \ ++ $decimal \ ++ [string_to_regexp {, in invoke\n}]] ++set line3 \ ++ [string_to_regexp { raise gdb.GdbError()\n}] ++set line4 \ ++ [string_to_regexp {gdb.GdbError\n}] ++set errline \ ++ [string_to_regexp {^error,msg="Error occurred in Python."}] ++ ++set start_line \ ++ [string_to_regexp {&"}] ++set end_line \ ++ [string_to_regexp {"}] ++ ++# With python <= 3.12. ++set re1 \ ++ [multi_line \ ++ $start_line$line1$end_line \ ++ $start_line$line2$end_line \ ++ $start_line$line3$end_line \ ++ $start_line$line4$end_line \ ++ $errline] ++ ++# With python >= 3.13. ++set re2 \ ++ [multi_line \ ++ $start_line$line1$end_line \ ++ $start_line$line2$line3$end_line \ ++ $start_line$line4$end_line \ ++ $errline] ++ ++mi_gdb_test "-pycmd exp" ($re1|$re2) + + mi_gdb_test "python pycmd2('-pycmd')" \ + ".*\\^done" \ +-- +2.43.0 + diff --git a/gdb-testsuite-fix-gdb.rust-completion.exp-timeout-on.patch b/gdb-testsuite-fix-gdb.rust-completion.exp-timeout-on.patch new file mode 100644 index 0000000..d650637 --- /dev/null +++ b/gdb-testsuite-fix-gdb.rust-completion.exp-timeout-on.patch @@ -0,0 +1,70 @@ +From 90e16cc4b30a742387b6d8324a862a5e4a91b24e Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 10 Jan 2025 08:53:29 +0100 +Subject: [PATCH 30/46] [gdb/testsuite] Fix gdb.rust/completion.exp timeout on + riscv64-linux + +On riscv64-linux, with test-case gdb.rust/completion.exp I run into the +following timeout: +... +(gdb) complete break pars^M +FAIL: gdb.rust/completion.exp: complete break pars (timeout) +... + +Replaying the scenario outside the testsuite show us that the command takes +~13 seconds: +... +$ gdb -q -batch -x gdb.in + ... +2025-01-08 12:23:46.853 - command started ++complete break pars +break parse.rs +break parse_printf_format +break parse_running_mmaps_unix.rs +break parser.rs +2025-01-08 12:23:59.600 - command finished +Command execution time: 12.677752 (cpu), 12.748565 (wall) +... +while the timeout is 10 seconds. + +The riscv64 processor on the server (cfarm91) is not fast (a fair amount of +the skip_huge_test test-cases times out), but something else is going on as +well. + +For x86_64-linux, roughly measuring the size of debug info in the exec get us: +... +$ readelf -wi outputs/gdb.rust/completion/completion | wc -l +2007 +... +while on the riscv64 server I get: +... +$ readelf -wi outputs/gdb.rust/completion/completion | wc -l +1606950 +... + +So it seems reasonable that the test is somewhat slower on riscv64. + +Fix this by using timeout factor 2. + +Tested on riscv64-linux and x86_64-linux. + +Approved-By: Tom Tromey +--- + gdb/testsuite/gdb.rust/completion.exp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.rust/completion.exp b/gdb/testsuite/gdb.rust/completion.exp +index 02fbdcdf92c..1b0638ad21a 100644 +--- a/gdb/testsuite/gdb.rust/completion.exp ++++ b/gdb/testsuite/gdb.rust/completion.exp +@@ -31,4 +31,6 @@ if {![runto ${srcfile}:$line]} { + return -1 + } + +-gdb_test "complete break pars" ".*" ++with_timeout_factor 2 { ++ gdb_test "complete break pars" ".*" ++} +-- +2.43.0 + diff --git a/gdb-testsuite-fix-regexp-in-gdb.ada-mi_var_access.ex.patch b/gdb-testsuite-fix-regexp-in-gdb.ada-mi_var_access.ex.patch new file mode 100644 index 0000000..f17ead7 --- /dev/null +++ b/gdb-testsuite-fix-regexp-in-gdb.ada-mi_var_access.ex.patch @@ -0,0 +1,50 @@ +From d9da3935f1be9c0d008764d6fff4b5dc277a5cd7 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 30 Jul 2024 21:50:17 +0200 +Subject: [PATCH 04/46] [gdb/testsuite] Fix regexp in gdb.ada/mi_var_access.exp + some more + +When running test-case gdb.ada/mi_var_access.exp on arm-linux (debian trixie), +I run into: +... +Expecting: ^(-var-create A_String_Access \* A_String_Access[ +]+)?((\^done,name="A_String_Access",numchild="[0-9]+",.*|\^error,msg="Value out of range.".*)[ +]+[(]gdb[)] +[ ]*) +-var-create A_String_Access * A_String_Access +^error,msg="Cannot access memory at address 0x4" +(gdb) +FAIL: gdb.ada/mi_var_access.exp: Create varobj (unexpected output) +... + +This is similar to the problem fixed by commit c5a72a8d1c3 ("[gdb/testsuite] +Fix regexp in gdb.ada/mi_var_access.exp"). + +The problem in both cases is that we're printing an uninitialized variable, +and consequently we can run into various error messages during printing. + +Fix this as in the other commit, by accepting the error message. + +Tested on arm-linux. +--- + gdb/testsuite/gdb.ada/mi_var_access.exp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.ada/mi_var_access.exp b/gdb/testsuite/gdb.ada/mi_var_access.exp +index b71c8f32151..e797a1576cb 100644 +--- a/gdb/testsuite/gdb.ada/mi_var_access.exp ++++ b/gdb/testsuite/gdb.ada/mi_var_access.exp +@@ -42,8 +42,9 @@ mi_continue_to_line \ + # to match possible values. + set re_ok "\\^done,name=\"A_String_Access\",numchild=\"$decimal\",.*" + set re_error "\\^error,msg=\"Value out of range\.\".*" ++set re_error2 "\\^error,msg=\"Cannot access memory at address $hex\"" + mi_gdb_test "-var-create A_String_Access * A_String_Access" \ +- "($re_ok|$re_error)" \ ++ "($re_ok|$re_error|$re_error2)" \ + "Create varobj" + + set bp_location [gdb_get_line_number "STOP2" ${testdir}/mi_access.adb] +-- +2.43.0 + diff --git a/gdb-testsuite-fix-regexp-in-gdb.arch-i386-disp-step-.patch b/gdb-testsuite-fix-regexp-in-gdb.arch-i386-disp-step-.patch new file mode 100644 index 0000000..5311ad0 --- /dev/null +++ b/gdb-testsuite-fix-regexp-in-gdb.arch-i386-disp-step-.patch @@ -0,0 +1,71 @@ +From da8d1a26f1015678245f23abc0b96ee6fba9f16d Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Thu, 29 Aug 2024 07:31:12 +0200 +Subject: [PATCH 32/46] [gdb/testsuite] Fix regexp in + gdb.arch/i386-disp-step-self-call.exp + +Usually, with test-case gdb.arch/i386-disp-step-self-call.exp I get: +... +(gdb) x/1wx 0xffffc4f8^M +0xffffc4f8: 0x08048472^M +(gdb) PASS: $exp: check return address was updated correctly +... +but sometimes I run into: +... +(gdb) x/1wx 0xffffc5c8^M +0xffffc5c8: 0x0804917e^M +(gdb) FAIL: $exp: check return address was updated correctly +... + +The problem is that here: +... +set next_insn_addr 0x[format %08X $next_insn_addr] +gdb_test "x/1wx 0x[format %x $sp]" "$hex:\\s+$next_insn_addr" \ + "check return address was updated correctly" +... +we're trying to match string 0x0804917e against regexp 0x0804917E due to using +"%08X" as format string. + +We only run into this problem if the address contains letters, which apparently +usually isn't the case. + +Fix this by using "%08x" instead as format string. + +Likewise in test-case gdb.arch/amd64-disp-step-self-call.exp. + +Tested on x86_64-linux. + +PR testsuite/32121 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32121 +--- + gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp | 2 +- + gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp b/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp +index 762d19a2960..2db3ff228c9 100644 +--- a/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp ++++ b/gdb/testsuite/gdb.arch/amd64-disp-step-self-call.exp +@@ -77,6 +77,6 @@ gdb_assert {[expr $sp == $new_sp]} \ + "check stack pointer was updated as expected" + + # Check the contents of the stack were updated to the expected value. +-set next_insn_addr 0x[format %016X $next_insn_addr] ++set next_insn_addr 0x[format %016x $next_insn_addr] + gdb_test "x/1gx 0x[format %x $sp]" "$hex:\\s+$next_insn_addr" \ + "check return address was updated correctly" +diff --git a/gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp b/gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp +index b2cb902f8ed..5de7ebcd69f 100644 +--- a/gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp ++++ b/gdb/testsuite/gdb.arch/i386-disp-step-self-call.exp +@@ -77,6 +77,6 @@ gdb_assert {[expr $sp == $new_sp]} \ + "check stack pointer was updated as expected" + + # Check the contents of the stack were updated to the expected value. +-set next_insn_addr 0x[format %08X $next_insn_addr] ++set next_insn_addr 0x[format %08x $next_insn_addr] + gdb_test "x/1wx 0x[format %x $sp]" "$hex:\\s+$next_insn_addr" \ + "check return address was updated correctly" +-- +2.43.0 + diff --git a/gdb-testsuite-fix-regexp-in-gdb.threads-stepi-over-c.patch b/gdb-testsuite-fix-regexp-in-gdb.threads-stepi-over-c.patch new file mode 100644 index 0000000..ebd390e --- /dev/null +++ b/gdb-testsuite-fix-regexp-in-gdb.threads-stepi-over-c.patch @@ -0,0 +1,42 @@ +From 2140bfdb0f523bcfd4475bc9ef779d693f0852fc Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Fri, 21 Jun 2024 16:53:19 +0200 +Subject: [PATCH 1/2] [gdb/testsuite] Fix regexp in + gdb.threads/stepi-over-clone.exp + +On fedora rawhide, I ran into: +... +(gdb) continue^M +Continuing.^M +^M +Catchpoint 2 (call to syscall clone3), 0x000000000042097d in __clone3 ()^M +(gdb) FAIL: gdb.threads/stepi-over-clone.exp: continue +... + +Fix this by updating a regexp to also recognize __clone3. + +Tested on x86_64-linux. + +Tested-By: Guinevere Larsen +--- + gdb/testsuite/gdb.threads/stepi-over-clone.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.threads/stepi-over-clone.exp b/gdb/testsuite/gdb.threads/stepi-over-clone.exp +index f671fd7b8bd..da8bbf6a215 100644 +--- a/gdb/testsuite/gdb.threads/stepi-over-clone.exp ++++ b/gdb/testsuite/gdb.threads/stepi-over-clone.exp +@@ -48,7 +48,7 @@ gdb_test_multiple "catch syscall group:process" "catch process syscalls" { + } + } + +-set re_loc1 "$hex in clone\[23\]? \\(\\)" ++set re_loc1 "$hex in (__)?clone\[23\]? \\(\\)" + set re_loc2 "$decimal\[ \t\]+in \[^\r\n\]+" + set re_loc3 "clone\[23\]? \\(\\) at \[^:\]+:$decimal" + + +base-commit: 1b57388d5731941f69010502bb59c24bd1db9f68 +-- +2.43.0 + diff --git a/gdb-testsuite-fix-timeout-in-gdb.mi-mi-multi-command.patch b/gdb-testsuite-fix-timeout-in-gdb.mi-mi-multi-command.patch new file mode 100644 index 0000000..f69b515 --- /dev/null +++ b/gdb-testsuite-fix-timeout-in-gdb.mi-mi-multi-command.patch @@ -0,0 +1,69 @@ +From 25157766c1f81deecb53f2b784177a0d14c3d945 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Mon, 23 Sep 2024 07:45:54 +0200 +Subject: [PATCH 41/46] [gdb/testsuite] Fix timeout in + gdb.mi/mi-multi-commands.exp + +On aarch64-linux, with test-case gdb.mi/mi-multi-commands.exp once in a while +I run into (edited for readability): +... +(gdb) ^M +-data-evaluate-expression $a^M +-data-evaluate-^done,value="\"FIRST COMMAND\""^M +expression $b(gdb) ^M +^M +^done,value="\"TEST COMPLETE\""^M +(gdb) ^M +PASS: $exp: args=: look for first command output, command length 236 +FAIL: $exp: args=: look for second command output, command length 236 (timeout) +... + +This is more likely to trigger when running the test-case using +taskset -c (where in a big.little setup we pick a little cpu). + +The setup here is that the test-case issues these two commands at once: +... +-data-evaluate-expression $a +-data-evaluate-expression $b +... +where the length of the first command is artificially increased by prefixing +it with spaces, show as above. + +What happens is that gdb, after parsing the first command, executes it. +Then the output of the first command intermixes with the echoing of the second +command, which produces this line containing the first prompt: +... +expression $b(gdb) ^M +... +which doesn't match the \r\n prefix of the regexp supposed to consume the +first prompt: +... + -re "\r\n$mi_gdb_prompt" { +... + +Fix this by dropping the \r\n prefix. + +Tested on aarch64-linux. + +PR testsuite/29781 +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29781 +--- + gdb/testsuite/gdb.mi/mi-multi-commands.exp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/testsuite/gdb.mi/mi-multi-commands.exp b/gdb/testsuite/gdb.mi/mi-multi-commands.exp +index 3a2e774bddc..028e187366a 100644 +--- a/gdb/testsuite/gdb.mi/mi-multi-commands.exp ++++ b/gdb/testsuite/gdb.mi/mi-multi-commands.exp +@@ -103,7 +103,7 @@ proc run_test { args } { + set seen_first_message true + exp_continue + } +- -re "\r\n$mi_gdb_prompt" { ++ -re "$mi_gdb_prompt" { + gdb_assert $seen_first_message $gdb_test_name + } + } +-- +2.43.0 + diff --git a/gdb-testsuite-require-can_spawn_for_attach-in-gdb.ba.patch b/gdb-testsuite-require-can_spawn_for_attach-in-gdb.ba.patch new file mode 100644 index 0000000..98c3d82 --- /dev/null +++ b/gdb-testsuite-require-can_spawn_for_attach-in-gdb.ba.patch @@ -0,0 +1,40 @@ +From 86ab8a78a6947891eaf93fc6910febf3eb7fa8f0 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 8 Jan 2025 16:07:08 +0100 +Subject: [PATCH 42/46] [gdb/testsuite] Require can_spawn_for_attach in + gdb.base/gstack.exp + +I ran test-case gdb.base/gstack.exp on a machine with kernel.yama.ptrace_scope +set to 1 and ran into: +... +PASS: gdb.base/gstack.exp: spawn gstack +ptrace: Operation not permitted.^M +GSTACK-END^M +PASS: gdb.base/gstack.exp: gstack exits with no error +PASS: gdb.base/gstack.exp: gstack's exit status is 0 +FAIL: gdb.base/gstack.exp: got backtrace +... + +Fix this by requiring can_spawn_for_attach. + +Tested on x86_64-linux. +--- + gdb/testsuite/gdb.base/gstack.exp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/gdb/testsuite/gdb.base/gstack.exp b/gdb/testsuite/gdb.base/gstack.exp +index a5dacd582ff..d8a6d78e550 100644 +--- a/gdb/testsuite/gdb.base/gstack.exp ++++ b/gdb/testsuite/gdb.base/gstack.exp +@@ -13,6 +13,8 @@ + # You should have received a copy of the GNU General Public License + # along with this program. If not, see . + ++require can_spawn_for_attach ++ + set testfile gstack + set executable ${testfile} + set binfile [standard_output_file $executable] +-- +2.43.0 + diff --git a/gdb-testsuite-require-supports_process_record-in-gdb.patch b/gdb-testsuite-require-supports_process_record-in-gdb.patch new file mode 100644 index 0000000..666f569 --- /dev/null +++ b/gdb-testsuite-require-supports_process_record-in-gdb.patch @@ -0,0 +1,36 @@ +From e910a619716a2554f583679ff062a363699b2b93 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 8 Jan 2025 12:48:08 +0100 +Subject: [PATCH 31/46] [gdb/testsuite] Require supports_process_record in + gdb.reverse/test_ioctl_TCSETSW.exp + +I ran test-case gdb.reverse/test_ioctl_TCSETSW.exp on riscv64-linux, and got: +... +(gdb) record full^M +Process record: the current architecture doesn't support record function.^M +(gdb) FAIL: gdb.reverse/test_ioctl_TCSETSW.exp: record full +... + +Fix this by requiring supports_process_record. + +Tested on riscv64-linux and x86_64-linux. +--- + gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp b/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp +index f6346bc86bf..6d54683982d 100644 +--- a/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp ++++ b/gdb/testsuite/gdb.reverse/test_ioctl_TCSETSW.exp +@@ -16,6 +16,8 @@ + # Test ioctl TCSETSW record for PowerPC. + # + ++require supports_process_record ++ + standard_testfile .c + + if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { +-- +2.43.0 + diff --git a/gdb-testsuite-use-nostdlib-in-gdb.base-list-dot-node.patch b/gdb-testsuite-use-nostdlib-in-gdb.base-list-dot-node.patch new file mode 100644 index 0000000..b460d8a --- /dev/null +++ b/gdb-testsuite-use-nostdlib-in-gdb.base-list-dot-node.patch @@ -0,0 +1,172 @@ +From 43be94acc8f9bbc0ff8da8c2b9fbaa56ee9b344e Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 4 Feb 2025 11:01:38 +0100 +Subject: [PATCH 40/46] [gdb/testsuite] Use -nostdlib in + gdb.base/list-dot-nodebug.exp + +When running test-case gdb.base/list-dot-nodebug.exp with target board +cc-with-gnu-debuglink, I run into: +... +(gdb) list .^M +warning: 1 ../sysdeps/x86_64/crtn.S: No such file or directory^M +(gdb) FAIL: gdb.base/list-dot-nodebug.exp: debug=none: print before start +... + +The problem is that the call to gdb_gnu_strip_debug in +gdb.base/list-dot-nodebug.exp has no effect, because the target board makes +sure that compilation delivers an executable that is already stripped, with a +.gnu_debuglink section linking to the debug info. + +Fix this by using -nostdlib instead of static, which means the call to +gdb_gnu_strip_debug can be removed. + +This also allows us to extend the test-case to excercise "list ." before +starting the inferior, for the debug=some scenario, which is currently +skipped: +... + # We don't test "list ." before starting with some debug info + # because GDB will choose the symtab that has debuginfo, and + # print the copyright blurb. This test isn't interested (yet?) + # in checking if this default location choice is consistent. +... + +While we're at it, make the effect of "list ." on the current source location +explicit using "info source" before and after "list .". + +While we're at it, make sure when running with target board +cc-with-gdb-index or cc-with-debug-names, that the failure to compile the +debug=none variant due to: +... +Error while writing index ...: No debugging symbols +... +doesn't stop the test-case from running the debug=some variant. + +Tested on x86_64-linux. +--- + gdb/testsuite/gdb.base/list-dot-nodebug.c | 9 +++ + gdb/testsuite/gdb.base/list-dot-nodebug.exp | 69 +++++++++++++-------- + 2 files changed, 52 insertions(+), 26 deletions(-) + +diff --git a/gdb/testsuite/gdb.base/list-dot-nodebug.c b/gdb/testsuite/gdb.base/list-dot-nodebug.c +index b37c3561c41..5d2a1a32d82 100644 +--- a/gdb/testsuite/gdb.base/list-dot-nodebug.c ++++ b/gdb/testsuite/gdb.base/list-dot-nodebug.c +@@ -31,3 +31,12 @@ main () + foo (&x); + return 0; + } ++ ++void ++_start () ++{ ++ (void) main (); ++ ++ while (1) ++ ; ++} +diff --git a/gdb/testsuite/gdb.base/list-dot-nodebug.exp b/gdb/testsuite/gdb.base/list-dot-nodebug.exp +index 107669de04d..e15e2bd58e1 100644 +--- a/gdb/testsuite/gdb.base/list-dot-nodebug.exp ++++ b/gdb/testsuite/gdb.base/list-dot-nodebug.exp +@@ -19,51 +19,64 @@ + + require !use_gdb_stub + +-set linkflags [list additional_flags="-static"] +- +-if { ![gdb_can_simple_compile static-libc \ +- { +- int main (void) { return 0; } +- } \ +- executable $linkflags] } { +- untested "Can't statically link" +- return -1 +-} +- + standard_testfile .c -extra.c + +-foreach_with_prefix debug {"none" "some"} { ++proc do_test { debug } { ++ ++ set opts {} ++ lappend opts additional_flags=-nostdlib + + if {$debug == "some"} { ++ lappend opts debug ++ + if {[prepare_for_testing_full "failed to prepare" \ +- [list ${testfile}-${debug} $linkflags \ +- $srcfile [list nodebug] \ +- $srcfile2 [list debug]]]} { ++ [list ${::testfile}-${debug} $opts \ ++ $::srcfile [list nodebug] \ ++ $::srcfile2 [list debug]]]} { + return -1 + } + +- # We don't test "list ." before starting with some debug info +- # because GDB will choose the symtab that has debuginfo, and +- # print the copyright blurb. This test isn't interested (yet?) +- # in checking if this default location choice is consistent. ++ ++ with_test_prefix "before list" { ++ gdb_test "info source" \ ++ [string_to_regexp "No current source file."] ++ } ++ ++ gdb_test "list ." \ ++ .*[string_to_regexp \ ++ "This testcase is part of GDB, the GNU debugger."].* \ ++ "print before start" ++ ++ with_test_prefix "after list" { ++ gdb_test "info source" \ ++ .*[string_to_regexp $::srcfile2].* ++ } ++ + } else { +- set executable ${testfile}-none ++ lappend opts nodebug ++ ++ set executable ${::testfile}-none + if {[build_executable "failed to prepare" ${executable} \ +- [list $srcfile $srcfile2] $linkflags]} { ++ [list $::srcfile $::srcfile2] $opts]} { + return -1 + } + +- # Stripping is a backup in case the system has static libc debuginfo. +- # We can continue the test even if it fails. +- gdb_gnu_strip_debug [standard_output_file $executable] no-debuglink +- + clean_restart ${executable} + ++ with_test_prefix "before list" { ++ gdb_test "info source" \ ++ [string_to_regexp "No current source file."] ++ } ++ + gdb_test "list ." \ + "^Insufficient debug info for showing source lines at default location" \ + "print before start" +- } + ++ with_test_prefix "after list" { ++ gdb_test "info source" \ ++ [string_to_regexp "No current source file."] ++ } ++ } + + if { ![runto bar] } { + return -1 +@@ -73,3 +86,7 @@ foreach_with_prefix debug {"none" "some"} { + "^Insufficient debug info for showing source lines at current PC \\($::hex\\)\\." \ + "print after start" + } ++ ++foreach_with_prefix debug {"none" "some"} { ++ do_test $debug ++} +-- +2.43.0 + diff --git a/gdb.changes b/gdb.changes index f4fc348..a535bd7 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,56 @@ +------------------------------------------------------------------- +Wed Feb 12 06:28:50 UTC 2025 - Tom de Vries + +- Maintenance script qa.sh: + * Fix 16.0 handling. +- Patches added: + * gdb-testsuite-fix-gdb.python-py-format-string.exp-wi.patch + * gdb-testsuite-fix-gdb.python-py-mi-cmd.exp-with-pyth.patch + * gdb-testsuite-fix-gdb.ada-mi_task_arg.exp-on-arm-lin.patch + * gdb-testsuite-fix-regexp-in-gdb.ada-mi_var_access.ex.patch + * gdb-testsuite-check-gnatmake-version-in-gdb.ada-scal.patch + * gdb-testsuite-fix-gdb.arch-arm-pseudo-unwind.exp-wit.patch + * gdb-symtab-fix-target-type-of-complex-long-double-on.patch + * gdb-testsuite-don-t-use-set-auto-solib-add-off.patch + * gdb-tdep-fix-arm-thumb2-hw-breakpoint.patch + * gdb-testsuite-fix-gdb.cp-m-static.exp-on-arm.patch + * gdb-testsuite-fix-gdb.dwarf2-dw2-fixed-point.exp-on-.patch + * gdb-testsuite-fix-gdb.dwarf2-dw2-lines.exp-on-arm-li.patch + * gdb-exp-fix-gdb.fortran-intrinsics.exp-fail-on-arm.patch + * gdb-tdep-handle-sycall-statx-for-arm-linux.patch + * gdb-tdep-fix-recording-of-t1-push.patch + * gdb-tdep-handle-syscall-clock_gettime64-for-arm-linu.patch + * fix-gdb.dwarf2-shortpiece.exp-on-s390x.patch + * handle-address-class-annotation-for-s390x-in-some-te.patch + * fix-gdb.dap-step-out.exp-on-s390x.patch + * use-setvariable-in-gdb.dap-scopes.exp.patch + * fix-gdb.base-finish-pretty.exp-on-s390x.patch + * fix-gdb.base-readnever.exp-on-s390x.patch + * add-dwarf_expr_piece.op.patch + * add-gdbarch_dwarf2_reg_piece_offset-hook.patch + * fix-gdb.base-store.exp-on-s390x.patch + * fix-gdb.ada-o2_float_param.exp-on-s390x-linux.patch + * gdb-testsuite-fix-gdb.base-branch-to-self.exp-on-arm.patch + * gdb-tdep-fix-gdb.cp-non-trivial-retval.exp-on-riscv6.patch + * gdb-testsuite-fix-gdb.cp-non-trivial-retval.exp-on-a.patch + * gdb-testsuite-fix-gdb.rust-completion.exp-timeout-on.patch + * gdb-testsuite-require-supports_process_record-in-gdb.patch + * gdb-testsuite-fix-regexp-in-gdb.arch-i386-disp-step-.patch + * gdb-testsuite-fix-gdb.arch-arm-single-step-kernel-he.patch + * gdb-testsuite-fix-gdb.python-py-format-address.exp-o.patch + * gdb-testsuite-fix-gdb.arch-riscv-tdesc-regs.exp.patch + * gdb-testsuite-fix-gdb.base-list-dot-nodebug-and-make.patch + * gdb-testsuite-fix-gdb.base-list-dot-nodebug.exp-on-o.patch + * gdb-testsuite-fix-gdb.base-empty-host-env-vars.exp.patch + * gdb-prune-inferior-after-switching-inferior.patch + * gdb-testsuite-use-nostdlib-in-gdb.base-list-dot-node.patch + * gdb-testsuite-fix-timeout-in-gdb.mi-mi-multi-command.patch + * gdb-testsuite-require-can_spawn_for_attach-in-gdb.ba.patch + * fixup-gdb-6.5-gcore-buffer-limit-test.patch + * gdb-testsuite-fix-gdb.ada-big_packed_array.exp-on-s3.patch + * gdb-testsuite-fix-gdb.ada-convvar_comp.exp-on-s390x-.patch + * gdb-testsuite-fix-regexp-in-gdb.threads-stepi-over-c.patch + ------------------------------------------------------------------- Tue Feb 11 12:25:44 UTC 2025 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index eaa9dbd..871a244 100644 --- a/gdb.spec +++ b/gdb.spec @@ -189,7 +189,7 @@ Patch21: gdb-catchpoint-re-set.patch # These need a number with at least four digits, otherwise patchlist.pl removes # them when upgrading. -# +Patch1000: fixup-gdb-6.5-gcore-buffer-limit-test.patch # openSUSE specific @@ -237,6 +237,34 @@ Patch2002: gdb-tdep-s390-add-arch15-record-replay-support.patch Patch2003: gdb-testsuite-avoid-intermittent-failures-on-a-debug.patch Patch2004: gdb-python-avoid-depending-on-the-curses-library.patch Patch2005: gdb-testsuite-fix-gdb.threads-leader-exit-attach.exp.patch +Patch2006: gdb-testsuite-fix-gdb.python-py-format-string.exp-wi.patch +Patch2007: gdb-testsuite-fix-gdb.python-py-mi-cmd.exp-with-pyth.patch +Patch2008: gdb-testsuite-fix-gdb.ada-mi_task_arg.exp-on-arm-lin.patch +Patch2009: gdb-testsuite-fix-regexp-in-gdb.ada-mi_var_access.ex.patch +Patch2010: gdb-testsuite-fix-gdb.arch-arm-pseudo-unwind.exp-wit.patch +Patch2011: gdb-symtab-fix-target-type-of-complex-long-double-on.patch +Patch2012: gdb-testsuite-don-t-use-set-auto-solib-add-off.patch +Patch2013: gdb-tdep-fix-arm-thumb2-hw-breakpoint.patch +Patch2014: gdb-testsuite-fix-gdb.cp-m-static.exp-on-arm.patch +Patch2015: gdb-testsuite-fix-gdb.dwarf2-dw2-fixed-point.exp-on-.patch +Patch2016: gdb-testsuite-fix-gdb.dwarf2-dw2-lines.exp-on-arm-li.patch +Patch2017: gdb-exp-fix-gdb.fortran-intrinsics.exp-fail-on-arm.patch +Patch2018: gdb-tdep-handle-sycall-statx-for-arm-linux.patch +Patch2019: gdb-tdep-fix-recording-of-t1-push.patch +Patch2020: gdb-tdep-handle-syscall-clock_gettime64-for-arm-linu.patch +Patch2021: fix-gdb.dwarf2-shortpiece.exp-on-s390x.patch +Patch2022: handle-address-class-annotation-for-s390x-in-some-te.patch +Patch2023: fix-gdb.dap-step-out.exp-on-s390x.patch +Patch2024: use-setvariable-in-gdb.dap-scopes.exp.patch +Patch2025: gdb-testsuite-fix-regexp-in-gdb.arch-i386-disp-step-.patch +Patch2026: gdb-testsuite-fix-gdb.arch-arm-single-step-kernel-he.patch +Patch2027: gdb-testsuite-fix-gdb.python-py-format-address.exp-o.patch +Patch2028: gdb-testsuite-fix-gdb.arch-riscv-tdesc-regs.exp.patch +Patch2029: gdb-testsuite-fix-gdb.base-list-dot-nodebug-and-make.patch +Patch2030: gdb-testsuite-fix-gdb.base-empty-host-env-vars.exp.patch +Patch2031: gdb-prune-inferior-after-switching-inferior.patch +Patch2032: gdb-testsuite-fix-timeout-in-gdb.mi-mi-multi-command.patch +Patch2033: gdb-testsuite-fix-regexp-in-gdb.threads-stepi-over-c.patch # Backports from master, available in GDB 17. @@ -246,8 +274,23 @@ Patch2102: gdb-doc-fix-qisaddresstagged-anchor.patch Patch2103: gdb-testsuite-fix-another-regexp-in-gdb.threads-step.patch Patch2104: gdb-testsuite-fix-timeouts-in-gdb.threads-step-over-.patch Patch2105: gdb-testsuite-handle-unordered-dict-in-gdb.python-py.patch - -# +Patch2106: gdb-testsuite-check-gnatmake-version-in-gdb.ada-scal.patch +Patch2107: fix-gdb.base-finish-pretty.exp-on-s390x.patch +Patch2108: fix-gdb.base-readnever.exp-on-s390x.patch +Patch2109: add-dwarf_expr_piece.op.patch +Patch2110: add-gdbarch_dwarf2_reg_piece_offset-hook.patch +Patch2111: fix-gdb.base-store.exp-on-s390x.patch +Patch2112: fix-gdb.ada-o2_float_param.exp-on-s390x-linux.patch +Patch2113: gdb-testsuite-fix-gdb.base-branch-to-self.exp-on-arm.patch +Patch2114: gdb-tdep-fix-gdb.cp-non-trivial-retval.exp-on-riscv6.patch +Patch2115: gdb-testsuite-fix-gdb.cp-non-trivial-retval.exp-on-a.patch +Patch2116: gdb-testsuite-fix-gdb.rust-completion.exp-timeout-on.patch +Patch2117: gdb-testsuite-require-supports_process_record-in-gdb.patch +Patch2118: gdb-testsuite-fix-gdb.base-list-dot-nodebug.exp-on-o.patch +Patch2119: gdb-testsuite-use-nostdlib-in-gdb.base-list-dot-node.patch +Patch2120: gdb-testsuite-require-can_spawn_for_attach-in-gdb.ba.patch +Patch2121: gdb-testsuite-fix-gdb.ada-big_packed_array.exp-on-s3.patch +Patch2122: gdb-testsuite-fix-gdb.ada-convvar_comp.exp-on-s390x-.patch # Backport from gdb-patches @@ -601,6 +644,8 @@ find -name "*.info*"|xargs rm -f %patch -P 21 -p1 #Fedora patching end +%patch -P 1000 -p1 + %patch -P 1100 -p1 %patch -P 1101 -p1 @@ -623,6 +668,34 @@ find -name "*.info*"|xargs rm -f %patch -P 2003 -p1 %patch -P 2004 -p1 %patch -P 2005 -p1 +%patch -P 2006 -p1 +%patch -P 2007 -p1 +%patch -P 2008 -p1 +%patch -P 2009 -p1 +%patch -P 2010 -p1 +%patch -P 2011 -p1 +%patch -P 2012 -p1 +%patch -P 2013 -p1 +%patch -P 2014 -p1 +%patch -P 2015 -p1 +%patch -P 2016 -p1 +%patch -P 2017 -p1 +%patch -P 2018 -p1 +%patch -P 2019 -p1 +%patch -P 2020 -p1 +%patch -P 2021 -p1 +%patch -P 2022 -p1 +%patch -P 2023 -p1 +%patch -P 2024 -p1 +%patch -P 2025 -p1 +%patch -P 2026 -p1 +%patch -P 2027 -p1 +%patch -P 2028 -p1 +%patch -P 2029 -p1 +%patch -P 2030 -p1 +%patch -P 2031 -p1 +%patch -P 2032 -p1 +%patch -P 2033 -p1 %patch -P 2100 -p1 %patch -P 2101 -p1 @@ -630,6 +703,23 @@ find -name "*.info*"|xargs rm -f %patch -P 2103 -p1 %patch -P 2104 -p1 %patch -P 2105 -p1 +%patch -P 2106 -p1 +%patch -P 2107 -p1 +%patch -P 2108 -p1 +%patch -P 2109 -p1 +%patch -P 2110 -p1 +%patch -P 2111 -p1 +%patch -P 2112 -p1 +%patch -P 2113 -p1 +%patch -P 2114 -p1 +%patch -P 2115 -p1 +%patch -P 2116 -p1 +%patch -P 2117 -p1 +%patch -P 2118 -p1 +%patch -P 2119 -p1 +%patch -P 2120 -p1 +%patch -P 2121 -p1 +%patch -P 2122 -p1 %patch -P 3000 -p1 %patch -P 3001 -p1 diff --git a/handle-address-class-annotation-for-s390x-in-some-te.patch b/handle-address-class-annotation-for-s390x-in-some-te.patch new file mode 100644 index 0000000..4d96ba3 --- /dev/null +++ b/handle-address-class-annotation-for-s390x-in-some-te.patch @@ -0,0 +1,125 @@ +From f6d4de8ce34365107106c4af60a9a1fb86a9977d Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Wed, 24 Jul 2024 14:56:56 +0200 +Subject: [PATCH 18/46] Handle address class annotation for s390x in some + test-cases + +On s390x-linux, I ran into: +... +(gdb) ptype crash^M +type = class crash {^M +^M + public:^M + crash(int (class {...}::*)(class {...} * const @mode32));^M +}^M +(gdb) FAIL: gdb.dwarf2/dw2-anon-mptr.exp: ptype crash +... + +The problem is that the test-case doesn't expect the address class annotation +@mode32. + +The test-case uses a .S file, with the address size hard-coded to 4 bytes, and +that's something that is annotated with @mode32 on s390x (which uses 8 byte +addresses). + +Fix this by allowing the annotation in the regexp. + +Likewise in two other test-cases. + +Tested on s390-linux and x86_64-linux. +--- + gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.exp | 16 +++++++++++++++- + gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp | 17 ++++++++++++----- + .../gdb.dwarf2/member-ptr-forwardref.exp | 16 +++++++++++++++- + 3 files changed, 42 insertions(+), 7 deletions(-) + +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.exp b/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.exp +index 5935ba628b6..fa98e413ad8 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.exp ++++ b/gdb/testsuite/gdb.dwarf2/dw2-anon-mptr.exp +@@ -36,5 +36,19 @@ gdb_test "show cp-abi" {The currently selected C\+\+ ABI is "gnu-v3".*} + + gdb_load $binfile + ++set re_address_class "@\[^\r\n\]+" ++ ++set re_class_ptr_const \ ++ [string cat \ ++ [string_to_regexp "class {...} * const"] "( $re_address_class)?"] ++ + gdb_test "ptype crash" \ +- "type = class crash {\[\r\n \t\]*public:\[\r\n \t\]*crash\\(int \\(class {\\.\\.\\.}::\\*\\)\\(class {\\.\\.\\.} \\* const\\)\\);\[\r\n \t\]*}" ++ [multi_line \ ++ "type = class crash {" \ ++ "" \ ++ " public:" \ ++ [string cat \ ++ [string_to_regexp " crash(int (class {...}::*)("] \ ++ $re_class_ptr_const \ ++ [string_to_regexp "));"]] \ ++ "}"] +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp b/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp +index cebed1d292b..d73f4a892ba 100644 +--- a/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp ++++ b/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp +@@ -126,6 +126,8 @@ proc build_test_program {} { + } + } + ++set re_address_class "@\[^\r\n\]+" ++ + # Test access to an optimized-out pointer-to-struct using the + # console interpreter. + +@@ -210,13 +212,18 @@ proc do_mi_test {} { + + # Test that -var-create for 'ptr' is successful. + mi_create_varobj "var1" "ptr" "create varobj for ptr" ++ ++ set struct_foo_ptr \ ++ [string cat \ ++ [string_to_regexp "struct foo *"] "( $::re_address_class)?"] + + # Test that -var-list-children of 'ptr' is successful. +- mi_list_varobj_children "var1" { \ +- {var1.a a 0 integer} \ +- {var1.x x 128 foo__array_type} \ +- {var1.y y 3 "struct foo \\*"} \ +- } "get children of var1 (ptr)" ++ mi_list_varobj_children "var1" \ ++ [list \ ++ {var1.a a 0 integer} \ ++ {var1.x x 128 foo__array_type} \ ++ [list "var1.y" "y" "3" $struct_foo_ptr]] \ ++ "get children of var1 (ptr)" + + # Test that dereferencing 'ptr' will throw an error. + mi_gdb_test "-var-create var2 * &((ptr)->a)" \ +diff --git a/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp b/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp +index c97c887d5a1..21ad111c9ac 100644 +--- a/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp ++++ b/gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp +@@ -34,5 +34,19 @@ gdb_test "show cp-abi" {The currently selected C\+\+ ABI is "gnu-v3".*} + + gdb_load ${binfile} + ++set re_address_class "@\[^\r\n\]+" ++ ++set re_C_ptr \ ++ [string cat \ ++ [string_to_regexp "C *"] "( const)?( $re_address_class)?"] ++ + gdb_test_no_output "set language c++" +-gdb_test "ptype c" "type = struct C {\[\r\n \t\]*private:\[\r\n \t\]*int \\(C::\\*fp\\)\\(C \\*( const)?\\);\[\r\n \t\]*}" ++gdb_test "ptype c" \ ++ [multi_line \ ++ "type = struct C {" \ ++ " private:" \ ++ [string cat \ ++ [string_to_regexp " int (C::*fp)("] \ ++ $re_C_ptr \ ++ [string_to_regexp ");"]] \ ++ "}"] +-- +2.43.0 + diff --git a/qa.sh b/qa.sh index 97ab74b..6a8b960 100644 --- a/qa.sh +++ b/qa.sh @@ -1015,7 +1015,7 @@ case $n in SLE-12) kfail+=("${kfail_sle12[@]}") ;; - SLFO|openSUSE_Factory) + SLFO|openSUSE_Factory|16.0) kfail+=("${kfail_factory[@]}") ;; *) diff --git a/use-setvariable-in-gdb.dap-scopes.exp.patch b/use-setvariable-in-gdb.dap-scopes.exp.patch new file mode 100644 index 0000000..844fb39 --- /dev/null +++ b/use-setvariable-in-gdb.dap-scopes.exp.patch @@ -0,0 +1,64 @@ +From 44651f4eae0a9ecf4a734e996bf75c9cd67e5f63 Mon Sep 17 00:00:00 2001 +From: Tom de Vries +Date: Tue, 10 Dec 2024 20:30:05 +0100 +Subject: [PATCH 20/46] Use setVariable in gdb.dap/scopes.exp + +The test-case gdb.dap/scopes.exp contains the following outdated comment: +... + # setVariable isn't implemented yet, so use the register name. +... + +Now that setVariable is implemented, use it to set variable scalar, and remove +the bit that sets the first register. That part is known to fail on s390x, +because the first register isn't writeable [1]. + +Tested on x86_64-linux. + +Suggested-By: Tom Tromey +Approved-By: Tom Tromey + +[1] https://sourceware.org/pipermail/gdb-patches/2024-December/213823.html +--- + gdb/testsuite/gdb.dap/scopes.exp | 27 +++++++++------------------ + 1 file changed, 9 insertions(+), 18 deletions(-) + +diff --git a/gdb/testsuite/gdb.dap/scopes.exp b/gdb/testsuite/gdb.dap/scopes.exp +index aa3bb688c0e..c78ae6e1202 100644 +--- a/gdb/testsuite/gdb.dap/scopes.exp ++++ b/gdb/testsuite/gdb.dap/scopes.exp +@@ -133,23 +133,14 @@ set val [dap_check_request_and_response "fetch first register" \ + "variables" \ + [format {o variablesReference [i %d] count [i 1]} $num]] + +-# Try setting the value to something else. +-set val [dict get [lindex $val 0] body variables] +-set name [dict get [lindex $val 0] name] +-set val [dict get [lindex $val 0] value] +-# Just make sure it is different from the original value. +-set val [expr {$val ^ 7}] +- +-# setVariable isn't implemented yet, so use the register name. Note +-# that we sneak the "$" into the name, written in a slightly funny way +-# to work around apparent TON limitations. +-set response [dap_check_request_and_response "set first register" \ +- setExpression \ +- [format {o expression [s \$%s] value [s %d] frameId [i %d]} \ +- $name $val $frame_id]] +-set response [lindex $response 0] +- +-gdb_assert {[dict get $response body value] == $val} \ +- "setting register yields updated value" ++set num [dict get $scope variablesReference] ++set refs [lindex [dap_check_request_and_response "set variable scalar" \ ++ "setVariable" \ ++ [format {o variablesReference [i %d] name [s scalar] \ ++ value [s 32]} \ ++ $num]] \ ++ 0] ++gdb_assert { [dict get $refs body value] == 32 } \ ++ "setting variable yields updated value" + + dap_shutdown +-- +2.43.0 + From 783b8d9968cb05ea5ff17e6b1224ba63a6799bc7a98ff4d31b1fe1c1e168746a Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Mon, 17 Feb 2025 16:43:29 +0000 Subject: [PATCH 33/34] - Mention changes in GDB 15: * The MPX commands "show/set mpx bound" have been deprecated, as Intel listed MPX as removed in 2019. * GDB index now contains information about the main function. * This speeds up startup when it is being used for some large binaries. * On hosts where threading is available, DWARF reading is now done in the background, resulting in faster startup. This can be controlled using "maint set dwarf synchronous". * Changed commands: * disassemble: Attempting to use both the 'r' and 'b' flags with the disassemble command will now give an error. Previously the 'b' flag would always override the 'r' flag. * gcore, generate-core-file: GDB now generates sparse core files, on systems that support it. * maintenance info line-table: Add an EPILOGUE-BEGIN column to the output of the command. It indicates if the line is considered the start of the epilogue, and thus a point at which the frame can be considered destroyed. * set unwindonsignal on|off, show unwindonsignal: These commands are now aliases for the new set/show unwind-on-signal. * target record-full: This command now gives an error if any unexpected arguments are found after the command. * list .: When using the command "list ." in a location that has no debug information or no file loaded, GDB now says that there is no debug information to print lines. This makes it more obvious that there is no information, as opposed to implying there is no inferior loaded. * New commands: * info missing-debug-handler: List all the registered missing debug handlers. * enable missing-debug-handler LOCUS HANDLER, disable missing-debug-handler LOCUS HANDLER: Enable or disable a missing debug handler with a name matching the regular expression HANDLER, in LOCUS. LOCUS can be 'global' to operate on global missing debug handler, 'progspace' to operate on handlers within the current program space, or can be a regular expression which is matched against the filename of the primary executable in each program space. * maintenance info linux-lwps: List all LWPs under control of the linux-nat target. * set remote thread-options-packet, show remote thread-options-packet: Set/show the use of the thread options packet. * set direct-call-timeout SECONDS, show direct-call-timeout, set indirect-call-timeout SECONDS, show indirect-call-timeout: These new settings can be used to limit how long GDB will wait for an inferior function call to complete. The direct timeout is used for inferior function calls from e.g. 'call' and 'print' commands, while the indirect timeout is used for inferior function calls from within a conditional breakpoint expression. The default for the direct timeout is unlimited, while the default for the indirect timeout is 30 seconds. These timeouts will only have an effect for targets that are operating in async mode. For non-async targets the timeouts are ignored, GDB will wait indefinitely for an inferior function to complete, unless interrupted by the user using Ctrl-C. * set unwind-on-timeout on|off, show unwind-on-timeout: These commands control whether GDB should unwind the stack when a timeout occurs during an inferior function call. The default is off, in which case the inferior will remain in the frame where the timeout occurred. When on, GDB will unwind the stack removing the dummy frame that was added for the inferior call, and restoring the inferior state to how it was before the inferior call started. * set unwind-on-signal on|off, show unwind-on-signal: These new commands replaces the existing set/show unwindonsignal. The old command is maintained as an alias. * New features in the GDB remote stub, GDBserver: * The --remote-debug and --event-loop-debug command line options have been removed. * The --debug command line option now takes an optional comma separated list of components to emit debug for. The currently supported components are: all, threads, event-loop, and remote. If no components are given then threads is assumed. * The 'monitor set remote-debug' and 'monitor set event-loop-debug' command have been removed. * The 'monitor set debug 0|1' command has been extended to take a component name, e.g.: 'monitor set debug COMPONENT off|on'. Possible component names are: all, threads, event-loop, and remote. * Python API: * New function gdb.notify_mi(NAME, DATA), that emits custom GDB/MI async notification. * New read/write attribute gdb.Value.bytes that contains a bytes object holding the contents of this value. * New module gdb.missing_debug that facilitates dealing with objfiles that are missing any debug information. * New function gdb.missing_debug.register_handler that can register an instance of a sub-class of gdb.missing_debug.MissingDebugInfo as a handler for objfiles that are missing debug information. * New class gdb.missing_debug.MissingDebugInfo which can be sub-classed to create handlers for objfiles with missing debug information. * Stop events now have a "details" attribute that holds a dictionary that carries the same information as an MI "*stopped" event. * New function gdb.interrupt(), that interrupts GDB as if the user typed control-c. * New gdb.InferiorThread.ptid_string attribute. This read-only attribute contains the string that appears in the 'Target Id' column of the 'info threads' command output. * It is no longer possible to create new gdb.Progspace object using 'gdb.Progspace()', this will result in a TypeError. Progspace objects can still be obtained through calling other API functions, for example 'gdb.current_progspace()'. * User defined attributes can be added to a gdb.Inferior object, these will be stored in the object's new Inferior.__dict__ attribute. * User defined attributes can be added to a gdb.InferiorThread object, these will be stored in the object's new InferiorThread.__dict__ attribute. * New constants gdb.SYMBOL_TYPE_DOMAIN, gdb.SYMBOL_FUNCTION_DOMAIN, and gdb.SEARCH_*_DOMAIN corresponding to all the existing symbol domains. Symbol lookup can now search in multiple domains at once, and can also narrowly search for just a type or function. * Debugger Adapter Protocol changes: * GDB now emits the "process" event. * GDB now supports the "cancel" request. * The "attach" request now supports specifying the program. * New command "set debug dap-log-level" controls DAP logging. * The "set debug dap-log-file" command is now documented. This command was available in GDB 14 but not documented. * Guile API: * New constants SYMBOL_TYPE_DOMAIN, SYMBOL_FUNCTION_DOMAIN, and SEARCH_*_DOMAIN corresponding to all the existing symbol domains. Symbol lookup can now search in multiple domains at once, and can also narrowly search for just a type or function. * Remote packets: * New stop reason clone: Indicates that a clone system call was executed. * New remote packets: * QThreadOptions: Enable/disable optional event reporting, on a per-thread basis. Currently supported options are GDB_THREAD_OPTION_CLONE, to enable clone event reporting, and GDB_THREAD_OPTION_EXIT to enable thread exit event reporting. * QThreadOptions in qSupported: * The qSupported packet allows GDB to inform the stub it supports the QThreadOptions packet, and the qSupported response can contain the set of thread options the remote stub supports. * qIsAddressTagged: This new packet allows GDB to query the stub about a given address to check if it is tagged or not. Many memory tagging-related GDB commands need to perform this check before they read/write the allocation tag related to an address. Currently, however, this is done through a 'vFile' request to read the file /proc//smaps and check if the address is in a region reported as memory tagged. Since not all targets have a notion of what the smaps file is about, this new packet provides a more generic way to perform such a check. OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=438 --- gdb.changes | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) diff --git a/gdb.changes b/gdb.changes index a535bd7..405b8e3 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,175 @@ +------------------------------------------------------------------- +Thu Feb 13 15:09:04 UTC 2025 - Tom de Vries + +- Mention changes in GDB 15: + * The MPX commands "show/set mpx bound" have been deprecated, as + Intel listed MPX as removed in 2019. + * GDB index now contains information about the main function. + * This speeds up startup when it is being used for some large + binaries. + * On hosts where threading is available, DWARF reading is now + done in the background, resulting in faster startup. This can + be controlled using "maint set dwarf synchronous". + * Changed commands: + * disassemble: + Attempting to use both the 'r' and 'b' flags with the + disassemble command will now give an error. Previously the + 'b' flag would always override the 'r' flag. + * gcore, generate-core-file: + GDB now generates sparse core files, on systems that support + it. + * maintenance info line-table: + Add an EPILOGUE-BEGIN column to the output of the command. + It indicates if the line is considered the start of the + epilogue, and thus a point at which the frame can be + considered destroyed. + * set unwindonsignal on|off, show unwindonsignal: + These commands are now aliases for the new + set/show unwind-on-signal. + * target record-full: + This command now gives an error if any unexpected arguments + are found after the command. + * list .: + When using the command "list ." in a location that has no + debug information or no file loaded, GDB now says that there + is no debug information to print lines. This makes it more + obvious that there is no information, as opposed to implying + there is no inferior loaded. + * New commands: + * info missing-debug-handler: + List all the registered missing debug handlers. + * enable missing-debug-handler LOCUS HANDLER, + disable missing-debug-handler LOCUS HANDLER: + Enable or disable a missing debug handler with a name + matching the regular expression HANDLER, in LOCUS. + LOCUS can be 'global' to operate on global missing debug + handler, 'progspace' to operate on handlers within the + current program space, or can be a regular expression which + is matched against the filename of the primary executable in + each program space. + * maintenance info linux-lwps: + List all LWPs under control of the linux-nat target. + * set remote thread-options-packet, + show remote thread-options-packet: + Set/show the use of the thread options packet. + * set direct-call-timeout SECONDS, show direct-call-timeout, + set indirect-call-timeout SECONDS, + show indirect-call-timeout: + These new settings can be used to limit how long GDB will + wait for an inferior function call to complete. The direct + timeout is used for inferior function calls from e.g. 'call' + and 'print' commands, while the indirect timeout is used for + inferior function calls from within a conditional breakpoint + expression. + The default for the direct timeout is unlimited, while the + default for the indirect timeout is 30 seconds. + These timeouts will only have an effect for targets that are + operating in async mode. For non-async targets the timeouts + are ignored, GDB will wait indefinitely for an inferior + function to complete, unless interrupted by the user using + Ctrl-C. + * set unwind-on-timeout on|off, show unwind-on-timeout: + These commands control whether GDB should unwind the stack + when a timeout occurs during an inferior function call. The + default is off, in which case the inferior will remain in + the frame where the timeout occurred. When on, GDB will + unwind the stack removing the dummy frame that was added for + the inferior call, and restoring the inferior state to how + it was before the inferior call started. + * set unwind-on-signal on|off, show unwind-on-signal: + These new commands replaces the existing set/show + unwindonsignal. The old command is maintained as an alias. + * New features in the GDB remote stub, GDBserver: + * The --remote-debug and --event-loop-debug command line + options have been removed. + * The --debug command line option now takes an optional comma + separated list of components to emit debug for. The + currently supported components are: all, threads, + event-loop, and remote. If no components are given then + threads is assumed. + * The 'monitor set remote-debug' and 'monitor set + event-loop-debug' command have been removed. + * The 'monitor set debug 0|1' command has been extended to + take a component name, e.g.: 'monitor set debug COMPONENT + off|on'. Possible component names are: all, threads, + event-loop, and remote. + * Python API: + * New function gdb.notify_mi(NAME, DATA), that emits custom + GDB/MI async notification. + * New read/write attribute gdb.Value.bytes that contains a + bytes object holding the contents of this value. + * New module gdb.missing_debug that facilitates dealing with + objfiles that are missing any debug information. + * New function gdb.missing_debug.register_handler that can + register an instance of a sub-class of + gdb.missing_debug.MissingDebugInfo as a handler for objfiles + that are missing debug information. + * New class gdb.missing_debug.MissingDebugInfo which can be + sub-classed to create handlers for objfiles with missing + debug information. + * Stop events now have a "details" attribute that holds a + dictionary that carries the same information as an MI + "*stopped" event. + * New function gdb.interrupt(), that interrupts GDB as if the + user typed control-c. + * New gdb.InferiorThread.ptid_string attribute. This + read-only attribute contains the string that appears in the + 'Target Id' column of the 'info threads' command output. + * It is no longer possible to create new gdb.Progspace object + using 'gdb.Progspace()', this will result in a TypeError. + Progspace objects can still be obtained through calling + other API functions, for example 'gdb.current_progspace()'. + * User defined attributes can be added to a gdb.Inferior + object, these will be stored in the object's new + Inferior.__dict__ attribute. + * User defined attributes can be added to a gdb.InferiorThread + object, these will be stored in the object's new + InferiorThread.__dict__ attribute. + * New constants gdb.SYMBOL_TYPE_DOMAIN, + gdb.SYMBOL_FUNCTION_DOMAIN, and gdb.SEARCH_*_DOMAIN + corresponding to all the existing symbol domains. Symbol + lookup can now search in multiple domains at once, and can + also narrowly search for just a type or function. + * Debugger Adapter Protocol changes: + * GDB now emits the "process" event. + * GDB now supports the "cancel" request. + * The "attach" request now supports specifying the program. + * New command "set debug dap-log-level" controls DAP logging. + * The "set debug dap-log-file" command is now documented. + This command was available in GDB 14 but not documented. + * Guile API: + * New constants SYMBOL_TYPE_DOMAIN, SYMBOL_FUNCTION_DOMAIN, + and SEARCH_*_DOMAIN corresponding to all the existing symbol + domains. Symbol lookup can now search in multiple domains + at once, and can also narrowly search for just a type or + function. + * Remote packets: + * New stop reason clone: + Indicates that a clone system call was executed. + * New remote packets: + * QThreadOptions: + Enable/disable optional event reporting, on a per-thread + basis. Currently supported options are + GDB_THREAD_OPTION_CLONE, to enable clone event reporting, + and GDB_THREAD_OPTION_EXIT to enable thread exit event + reporting. + * QThreadOptions in qSupported: + * The qSupported packet allows GDB to inform the stub it + supports the QThreadOptions packet, and the qSupported + response can contain the set of thread options the remote + stub supports. + * qIsAddressTagged: + This new packet allows GDB to query the stub about a given + address to check if it is tagged or not. Many memory + tagging-related GDB commands need to perform this check + before they read/write the allocation tag related to an + address. Currently, however, this is done through a 'vFile' + request to read the file /proc//smaps and check if the + address is in a region reported as memory tagged. Since not + all targets have a notion of what the smaps file is about, + this new packet provides a more generic way to perform such + a check. + ------------------------------------------------------------------- Wed Feb 12 06:28:50 UTC 2025 - Tom de Vries From 423981b36026a9fa974a27d67087f0c87f484f62e5690a3469b3b4623d040ca9 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 18 Feb 2025 07:01:14 +0000 Subject: [PATCH 34/34] - Maintenance script qa.sh: * Add PR32712 kfail. OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=439 --- gdb.changes | 6 ++++++ qa.sh | 2 ++ 2 files changed, 8 insertions(+) diff --git a/gdb.changes b/gdb.changes index 405b8e3..82b7ef6 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Feb 18 06:58:58 UTC 2025 - Tom de Vries + +- Maintenance script qa.sh: + * Add PR32712 kfail. + ------------------------------------------------------------------- Thu Feb 13 15:09:04 UTC 2025 - Tom de Vries diff --git a/qa.sh b/qa.sh index 6a8b960..fb95cfd 100644 --- a/qa.sh +++ b/qa.sh @@ -887,6 +887,8 @@ case $n in # https://sourceware.org/bugzilla/show_bug.cgi?id=32446 "linux-nat.c:[0-9]*: internal-error: mark_lwp_dead: Assertion .lp->status == 0. failed\." + # https://sourceware.org/bugzilla/show_bug.cgi?id=32712 + "thread\.c:[0-9]*: internal-error: set_thread_options: Assertion .!this->executing \(\). failed\." ) kfail_re=$(join "|" "${kfail[@]}")