#46 Backport upstream patch "gdb: call check_typedef at beginning of dwarf_expr_context::fetch_result". (Simon Marchi)
Closed a year ago by keiths. Opened 2 years ago by snmende.
rpms/ snmende/gdb rawhide  into  rawhide

file modified
+4
@@ -317,3 +317,7 @@ 

  # (Keith Seitz, build/22395)

  Patch076: gdb-sw22395-constify-target_desc.patch

  

+ # [gdb] Backport call check_typedef at beginning of

+ # dwarf_expr_context::fetch_result (Simon Marchi)

+ Patch077: gdb-backport-call-check_typedef-at-beginning-of-dwarf_expr_context::fetch_result.patch

+ 

file modified
+1
@@ -74,3 +74,4 @@ 

  %patch074 -p1

  %patch075 -p1

  %patch076 -p1

+ %patch077 -p1

file modified
+1
@@ -74,3 +74,4 @@ 

  gdb-backport-readline_support.patch

  gdb-backport-fix-break-main-file-remove-fail.patch

  gdb-sw22395-constify-target_desc.patch

+ gdb-backport-call-check_typedef-at-beginning-of-dwarf_expr_context::fetch_result.patch

file modified
+5 -1
@@ -48,7 +48,7 @@ 

  

  # The release always contains a leading reserved number, start it at 1.

  # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.

- Release: 9%{?dist}

+ Release: 10%{?dist}

  

  License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL

  # Do not provide URL for snapshots as the file lasts there only for 2 days.
@@ -1186,6 +1186,10 @@ 

  %endif

  

  %changelog

+ * Sun Nov 13 2022 Sergey Mende - 12.1-10

+ - Backport upstream patch "gdb: call check_typedef at beginning of

+   dwarf_expr_context::fetch_result". (Simon Marchi)

+ 

  * Thu Nov  3 2022 Keith Seitz <keiths@redhat.com> - 12.1-9

  - Add patch to fix ODR violations on powerpc and

    enable LTO builds. (Keith Seitz, sw build/23395)

I hit the gdb bug 29374 [0] during development, it would be nice to have it patched.
Thank you,
Sergey

https://sourceware.org/bugzilla/show_bug.cgi?id=29374

This patch does not appear to have followed the directions in the README for generating patches. Applying your patch locally,

$ ./generate-git-repo-from-patches.sh binutils-gdb
[...]
$ ./generate-patches-from-git-repo.sh binutils-gdb/
rm 'gdb-6.3-rh-testversion-20041202.patch'
rm 'gdb-6.3-gstack-20050411.patch'
rm 'gdb-6.3-test-movedir-20050125.patch'
rm 'gdb-6.3-threaded-watchpoints2-20050225.patch'
rm 'gdb-6.3-inheritancetest-20050726.patch'
rm 'gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch'
rm 'gdb-6.5-sharedlibrary-path.patch'
rm 'gdb-6.5-BEA-testsuite.patch'
rm 'gdb-6.5-last-address-space-byte-test.patch'
rm 'gdb-6.5-readline-long-line-crash-test.patch'
rm 'gdb-6.5-bz218379-ppc-solib-trampoline-test.patch'
rm 'gdb-6.5-bz109921-DW_AT_decl_file-test.patch'
rm 'gdb-6.3-bz140532-ppc-unwinding-test.patch'
rm 'gdb-6.3-bz202689-exec-from-pthread-test.patch'
rm 'gdb-6.6-bz230000-power6-disassembly-test.patch'
rm 'gdb-6.6-bz229517-gcore-without-terminal.patch'
rm 'gdb-6.6-testsuite-timeouts.patch'
rm 'gdb-6.6-bz237572-ppc-atomic-sequence-test.patch'
rm 'gdb-6.3-attach-see-vdso-test.patch'
rm 'gdb-6.5-bz243845-stale-testing-zombie-test.patch'
rm 'gdb-6.6-buildid-locate.patch'
rm 'gdb-6.6-buildid-locate-solib-missing-ids.patch'
rm 'gdb-6.6-buildid-locate-rpm.patch'
rm 'gdb-6.7-charsign-test.patch'
rm 'gdb-6.7-ppc-clobbered-registers-O2-test.patch'
rm 'gdb-6.7-testsuite-stable-results.patch'
rm 'gdb-6.5-ia64-libunwind-leak-test.patch'
rm 'gdb-6.5-missed-trap-on-step-test.patch'
rm 'gdb-6.5-gcore-buffer-limit-test.patch'
rm 'gdb-6.3-mapping-zero-inode-test.patch'
rm 'gdb-6.3-focus-cmd-prev-test.patch'
rm 'gdb-6.8-bz442765-threaded-exec-test.patch'
rm 'gdb-6.5-section-num-fixup-test.patch'
rm 'gdb-6.8-bz466901-backtrace-full-prelinked.patch'
rm 'gdb-simultaneous-step-resume-breakpoint-test.patch'
rm 'gdb-core-open-vdso-warning.patch'
rm 'gdb-ccache-workaround.patch'
rm 'gdb-lineno-makeup-test.patch'
rm 'gdb-ppc-power7-test.patch'
rm 'gdb-archer-next-over-throw-cxx-exec.patch'
rm 'gdb-bz601887-dwarf4-rh-test.patch'
rm 'gdb-6.6-buildid-locate-rpm-librpm-workaround.patch'
rm 'gdb-test-bt-cfi-without-die.patch'
rm 'gdb-bz634108-solib_address.patch'
rm 'gdb-test-pid0-core.patch'
rm 'gdb-test-dw2-aranges.patch'
rm 'gdb-test-expr-cumulative-archer.patch'
rm 'gdb-physname-pr11734-test.patch'
rm 'gdb-physname-pr12273-test.patch'
rm 'gdb-test-ivy-bridge.patch'
rm 'gdb-runtest-pie-override.patch'
rm 'gdb-glibc-strstr-workaround.patch'
rm 'gdb-rhel5.9-testcase-xlf-var-inside-mod.patch'
rm 'gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch'
rm 'gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch'
rm 'gdb-rhbz1007614-memleak-infpy_read_memory-test.patch'
rm 'gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch'
rm 'gdb-fortran-frame-string.patch'
rm 'gdb-rhbz1156192-recursive-dlopen-test.patch'
rm 'gdb-rhbz1149205-catch-syscall-after-fork-test.patch'
rm 'gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch'
rm 'gdb-rhbz1350436-type-printers-error.patch'
rm 'gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch'
rm 'gdb-fedora-libncursesw.patch'
rm 'gdb-opcodes-clflushopt-test.patch'
rm 'gdb-6.6-buildid-locate-rpm-scl.patch'
rm 'gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch'
rm 'gdb-container-rh-pkg.patch'
rm 'gdb-rhbz1325795-framefilters-test.patch'
rm 'gdb-linux_perf-bundle.patch'
rm 'gdb-libexec-add-index.patch'
rm 'gdb-rhbz1398387-tab-crash-test.patch'
rm 'gdb-rhbz1553104-s390x-arch12-test.patch'
rm 'gdb-backport-readline_support.patch'
rm 'gdb-backport-fix-break-main-file-remove-fail.patch'
rm 'gdb-sw22395-constify-target_desc.patch'
fatal: pathspec 'gdb-backport-call-check_typedef-at-beginning-of-dwarf_expr_context::fetch_result.patch' did not match any files
e53a8e8685685c97588f8319d993ea6cd5635e47 tags/gdb-12.1-release^0
./generate-patches-from-git-repo.sh: line 79: test: too many arguments
fatal: pathspec 'gdb:' did not match any files
./generate-patches-from-git-repo.sh: line 92: printf: call: invalid number
./generate-patches-from-git-repo.sh: line 92: printf: at: invalid number
./generate-patches-from-git-repo.sh: line 92: printf: of: invalid number

This happens because the new patch file is not properly formed. It must start with
a patch file name on a single line (aka the subject), followed by two comments. In this case:

--->%--->%---
gdb-backport-call-check_typedef-at-beginning-of-dwarf_expr_context.patch

;; Backport "call check_typedef at beginning of dwarf_expr_context::fetch_result"
;; {Simon Marchi, backtrace/29374)
---%<---%<---

Please see the README.

I've corrected this locally, and the new patch file should look like:

Author: Simon Marchi simon.marchi@polymtl.ca
Date: Thu Jul 28 01:34:22 2022 -0400

gdb-backport-call-check_typedef-at-beginning-of-dwarf_expr_context.patch

;; Backport "call check_typedef at beginning of dwarf_expr_context::fetch_result"
;; {Simon Marchi, backtrace/29374)

gdb: call check_typedef at beginning of dwarf_expr_context::fetch_result

Bug 29374 shows this crash:
[snip]

This patch does not appear to have followed the directions in the README for generating patches. Applying your patch locally,

Please see the README.

Thank you Keith,

I will redo the work locally again as an additional exercise.

Cheers,
Sergey.

I've corrected this locally, and the new patch file should look like:

Author: Simon Marchi simon.marchi@polymtl.ca
Date: Thu Jul 28 01:34:22 2022 -0400

gdb-backport-call-check_typedef-at-beginning-of-dwarf_expr_context

;; Backport "call check_typedef at beginning of dwarf_expr_context::fetch_result"
;; {Simon Marchi, backtrace/29374)

gdb: call check_typedef at beginning of dwarf_expr_context::fetch_result

Bug 29374 shows this crash:
[snip]

Keith,

do you expect me to update the PR?

Thank you,
Sergey

You can if you'd like -- it's pretty trivial to do. [just follow the README]
If you'd prefer I do it, just say the word, and I can get it done pretty quickly.

I prefer to do my homework and will fix this myself.

Kind regards,
Sergey

Dear Keith,

I am sorry, I have been very busy last weeks. I will try to complete this today or tomorrow.
However, if you have something on the table to commit, please feel free to include this one as well.

Thank you,
Sergey.

@snmende any update? If you're unable to get to this by next week, I will update my branch of this backport and merge it.

I've merged this off my own feature branch.

Pull-Request has been closed by keiths

a year ago