Hello community, here is the log from the commit of package gdb for openSUSE:Factory checked in at 2020-08-14 09:31:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gdb (Old) and /work/SRC/openSUSE:Factory/.gdb.new.3399 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gdb" Fri Aug 14 09:31:00 2020 rev:141 rq:825816 version:9.2 Changes: -------- --- /work/SRC/openSUSE:Factory/gdb/gdb.changes 2020-05-09 19:49:02.544411292 +0200 +++ /work/SRC/openSUSE:Factory/.gdb.new.3399/gdb.changes 2020-08-14 09:31:54.620354790 +0200 @@ -1,0 +2,144 @@ +Tue Aug 11 09:56:29 UTC 2020 - Tom de Vries <tdevr...@suse.com> + +- Restore License/Group. + +------------------------------------------------------------------- +Tue Aug 4 10:57:48 UTC 2020 - Tom de Vries <tdevr...@suse.com> + +- 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 <tdevr...@suse.com> + +- 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 <tdevr...@suse.com> + +- Change into multibuild package and add flavour gdb-testsuite. + +------------------------------------------------------------------- +Fri Jul 24 12:39:06 UTC 2020 - Tom de Vries <tdevr...@suse.com> + +- Fix s390 -> s390x typo. + +------------------------------------------------------------------- +Fri Jul 24 12:34:41 UTC 2020 - Tom de Vries <tdevr...@suse.com> + +- Don't BuildRequire binutils-gold for SLE-12/s390. + +------------------------------------------------------------------- +Fri Jul 24 10:23:12 UTC 2020 - Tom de Vries <tdevr...@suse.com> + +- BuildRequire binutils-gold for testsuite + +------------------------------------------------------------------- +Thu Jul 23 15:34:40 UTC 2020 - Tom de Vries <tdevr...@suse.com> + +- Rebase to 9.2 release. + +------------------------------------------------------------------- +Tue Jul 14 14:33:12 UTC 2020 - Tom de Vries <tdevr...@suse.com> + +- 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 <tdevr...@suse.com> + +- Fix patch context: + * gdb-fix-the-thread-pool.c-compilation.patch + +------------------------------------------------------------------- +Mon Jul 13 22:13:07 UTC 2020 - Tom de Vries <tdevr...@suse.com> + +- 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 <tdevr...@suse.com> + +- Drop ChangeLog part of patch: + * gdb-fix-unused-function-error.patch + +------------------------------------------------------------------- +Mon Jul 13 15:24:53 UTC 2020 - Tom de Vries <tdevr...@suse.com> + +- 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 <tdevr...@suse.com> + +- Require %{suse_version} >= 1500 for --with-system-readline. + +------------------------------------------------------------------- +Mon Jul 13 12:21:04 UTC 2020 - Tom de Vries <tdevr...@suse.com> + +- 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 + +------------------------------------------------------------------- Old: ---- bfd-change-num_group-to-unsigned-int.patch gdb-0001-remove-alloca-0-calls.patch gdb-6.3-rh-testversion-20041202.patch gdb-6.5-bz216711-clone-is-outermost.patch gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch gdb-6.6-scheduler_locking-step-is-default.patch gdb-6.8-bz436037-reg-no-longer-active.patch gdb-8.3.1.tar.bz2 gdb-arch13-1.diff gdb-arch13-2.diff gdb-arch13-3.diff gdb-bz541866-rwatch-before-run.patch gdb-bz568248-oom-is-error.patch gdb-dwarf-reader-reject-sections-with-invalid-sizes.patch gdb-fix-heap-use-after-free-in-typename-concat.patch gdb-fix-incorrect-use-of-is-operator-for-comparison-in-python-lib-gdb-command-prompt.py.patch gdb-fix-riscv-tdep.patch gdb-fix-s390-build.diff gdb-follow-child-stale-parent.patch gdb-libexec-add-index.patch gdb-only-force-interp_console-ui_out-for-breakpoint-commands-in-mi-mode.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-s390-handle-arch13.diff gdb-symtab-prefer-var-def-over-decl.patch gdb-testsuite-8.3-kfail-xfail-unsupported.patch gdb-testsuite-add-missing-initial-prompt-read-in-multidictionary.exp.patch gdb-testsuite-i386-pkru-exp.patch gdb-testsuite-pie-no-pie.patch gdb-testsuite-read1-fixes.patch gdb-testsuite-readline63-sigint.patch New: ---- _multibuild gdb-9.2.tar.bz2 gdb-aarch64-fix-erroneous-use-of-spu-architecture-bfd.patch gdb-fix-debug-agent-odr-bool-int.patch gdb-fix-python3.9-related-runtime-problems.patch gdb-fix-the-thread-pool.c-compilation.patch gdb-fix-unused-function-error.patch gdb-rhbz1818011-bfd-gcc10-error.patch gdbserver-fix-build-with-make-3.81.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gdb.spec ++++++ ++++ 619 lines (skipped) ++++ between /work/SRC/openSUSE:Factory/gdb/gdb.spec ++++ and /work/SRC/openSUSE:Factory/.gdb.new.3399/gdb.spec ++++++ _multibuild ++++++ <multibuild> <package>testsuite</package> </multibuild> ++++++ gdb-6.3-gstack-20050411.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.608356834 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.612356836 +0200 @@ -16,7 +16,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -1749,7 +1749,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force +@@ -1768,7 +1768,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force install: all @$(MAKE) $(FLAGS_TO_PASS) install-only @@ -25,7 +25,7 @@ transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e "$$t"` ; \ if test "x$$transformed_name" = x; then \ -@@ -1798,7 +1798,25 @@ install-guile: +@@ -1817,7 +1817,25 @@ install-guile: install-python: $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb @@ -52,7 +52,7 @@ transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e $$t` ; \ if test "x$$transformed_name" = x; then \ -@@ -1821,6 +1839,18 @@ uninstall: force $(CONFIG_UNINSTALL) +@@ -1840,6 +1858,18 @@ uninstall: force $(CONFIG_UNINSTALL) fi @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do ++++++ gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.652356856 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.656356859 +0200 @@ -44,9 +44,9 @@ diff --git a/gdb/printcmd.c b/gdb/printcmd.c --- a/gdb/printcmd.c +++ b/gdb/printcmd.c -@@ -1183,6 +1183,10 @@ print_command_1 (const char *exp, int voidprint) +@@ -1214,6 +1214,10 @@ print_command_1 (const char *args, int voidprint) - if (exp && *exp) + if (exp != nullptr && *exp) { + /* '*((int *(*) (void)) __errno_location) ()' is incompatible with + function descriptors. */ ++++++ gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.672356867 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.672356867 +0200 @@ -11,8 +11,8 @@ diff --git a/gdb/symtab.c b/gdb/symtab.c --- a/gdb/symtab.c +++ b/gdb/symtab.c -@@ -3177,6 +3177,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent) - SYMBOL_LINKAGE_NAME (msymbol)); */ +@@ -3166,6 +3166,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent) + msymbol->linkage_name ()); */ ; /* fall through */ + /* `msymbol' trampoline may be located before its .text symbol @@ -20,7 +20,7 @@ + Avoid `find_pc_sect_line'<->`find_pc_line' infinite loop. + Red Hat Bug 218379. */ + else if (BMSYMBOL_VALUE_ADDRESS (mfunsym) == pc) -+ warning ("In stub for %s (0x%s); interlocked, please submit the binary to http://bugzilla.redhat.com", MSYMBOL_LINKAGE_NAME (msymbol.minsym), paddress (target_gdbarch (), pc)); ++ warning ("In stub for %s (0x%s); interlocked, please submit the binary to http://bugzilla.redhat.com", msymbol.minsym->linkage_name (), paddress (target_gdbarch (), pc)); + /* fall through */ else return find_pc_line (BMSYMBOL_VALUE_ADDRESS (mfunsym), 0); ++++++ gdb-6.6-buildid-locate-core-as-arg.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.708356885 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.708356885 +0200 @@ -61,31 +61,19 @@ * exec.c (exec_file_attach): Print a more useful error message if the user did "gdb core". -diff --git a/gdb/common/common-exceptions.h b/gdb/common/common-exceptions.h ---- a/gdb/common/common-exceptions.h -+++ b/gdb/common/common-exceptions.h -@@ -104,6 +104,9 @@ enum errors { - "_ERROR" is appended to the name. */ - MAX_COMPLETIONS_REACHED_ERROR, - -+ /* Attempt to load a core file as executable. */ -+ IS_CORE_ERROR, -+ - /* Add more errors here. */ - NR_ERRORS - }; diff --git a/gdb/exec.c b/gdb/exec.c --- a/gdb/exec.c +++ b/gdb/exec.c -@@ -36,6 +36,7 @@ - #include "gdb_bfd.h" - #include "gcore.h" - #include "source.h" -+#include "exceptions.h" +@@ -18,6 +18,8 @@ + along with this program. If not, see <http://www.gnu.org/licenses/>. */ - #include <fcntl.h> - #include "readline/readline.h" -@@ -355,12 +356,27 @@ exec_file_attach (const char *filename, int from_tty) + #include "defs.h" ++#include "arch-utils.h" ++#include "exceptions.h" + #include "frame.h" + #include "inferior.h" + #include "target.h" +@@ -345,12 +347,27 @@ exec_file_attach (const char *filename, int from_tty) if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching)) { @@ -106,20 +94,33 @@ + + if (is_core != 0) + throw_error (IS_CORE_ERROR, -+ _("\"%s\" is a core file.\n" -+ "Please specify an executable to debug."), -+ scratch_pathname); ++ _("\"%s\" is a core file.\n" ++ "Please specify an executable to debug."), ++ scratch_pathname); + else -+ error (_("\"%s\": not in executable format: %s"), ++ error (_("\"%ss\": not in executable format: %s"), + scratch_pathname, + gdb_bfd_errmsg (bfd_get_error (), matching).c_str ()); } if (build_section_table (exec_bfd, §ions, §ions_end)) +diff --git a/gdb/gdbsupport/common-exceptions.h b/gdb/gdbsupport/common-exceptions.h +--- a/gdb/gdbsupport/common-exceptions.h ++++ b/gdb/gdbsupport/common-exceptions.h +@@ -106,6 +106,9 @@ enum errors { + "_ERROR" is appended to the name. */ + MAX_COMPLETIONS_REACHED_ERROR, + ++ /* Attempt to load a core file as executable. */ ++ IS_CORE_ERROR, ++ + /* Add more errors here. */ + NR_ERRORS + }; diff --git a/gdb/main.c b/gdb/main.c --- a/gdb/main.c +++ b/gdb/main.c -@@ -448,6 +448,35 @@ struct cmdarg +@@ -467,6 +467,34 @@ struct cmdarg char *string; }; @@ -132,11 +133,11 @@ +{ + gdb_assert (exec_bfd == NULL); + -+ TRY ++ try + { + exec_file_attach (filename, from_tty); + } -+ CATCH (e, RETURN_MASK_ALL) ++ catch (gdb_exception_error &e) + { + if (e.error == IS_CORE_ERROR) + { @@ -147,15 +148,14 @@ + if (exec_bfd != NULL) + return; + } -+ throw_exception (e); ++ throw_exception (std::move (e)); + } -+ END_CATCH +} + static void captured_main_1 (struct captured_main_args *context) { -@@ -893,6 +922,8 @@ captured_main_1 (struct captured_main_args *context) +@@ -907,6 +935,8 @@ captured_main_1 (struct captured_main_args *context) { symarg = argv[optind]; execarg = argv[optind]; @@ -164,7 +164,7 @@ optind++; } -@@ -1043,12 +1074,25 @@ captured_main_1 (struct captured_main_args *context) +@@ -1063,12 +1093,25 @@ captured_main_1 (struct captured_main_args *context) && symarg != NULL && strcmp (execarg, symarg) == 0) { ++++++ gdb-6.6-buildid-locate-rpm-librpm-workaround.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.720356891 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.720356891 +0200 @@ -9,7 +9,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c --- a/gdb/build-id.c +++ b/gdb/build-id.c -@@ -712,6 +712,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return) +@@ -709,6 +709,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return) #include <dlfcn.h> #endif ++++++ gdb-6.6-buildid-locate-rpm-scl.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.732356897 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.732356897 +0200 @@ -12,7 +12,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c --- a/gdb/build-id.c +++ b/gdb/build-id.c -@@ -746,7 +746,11 @@ static int missing_rpm_list_entries; +@@ -743,7 +743,11 @@ static int missing_rpm_list_entries; /* Returns the count of newly added rpms. */ static int @@ -24,7 +24,7 @@ { static int rpm_init_done = 0; rpmts ts; -@@ -853,7 +857,11 @@ missing_rpm_enlist (const char *filename) +@@ -850,7 +854,11 @@ missing_rpm_enlist (const char *filename) mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0); if (mi != NULL) { @@ -36,7 +36,7 @@ { Header h; char *debuginfo, **slot, *s, *s2; -@@ -971,6 +979,37 @@ missing_rpm_enlist (const char *filename) +@@ -968,6 +976,37 @@ missing_rpm_enlist (const char *filename) xfree (debuginfo); count++; } @@ -74,10 +74,10 @@ rpmdbFreeIterator_p (mi); } -@@ -981,6 +1020,21 @@ missing_rpm_enlist (const char *filename) +@@ -977,6 +1016,20 @@ missing_rpm_enlist (const char *filename) + return count; } - static int +#ifdef GDB_INDEX_VERIFY_VENDOR +missing_rpm_enlist (const char *filename) +{ @@ -90,16 +90,15 @@ +{ + return missing_rpm_enlist_1 (filename, 1); +} -+ -+static int +#endif - missing_rpm_list_compar (const char *const *ap, const char *const *bp) ++ + static bool + missing_rpm_list_compar (const char *ap, const char *bp) { - return strcoll (*ap, *bp); diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -3501,6 +3501,16 @@ read_gdb_index_from_buffer (struct objfile *objfile, +@@ -3497,6 +3497,16 @@ read_gdb_index_from_buffer (struct objfile *objfile, "set use-deprecated-index-sections on". */ if (version < 6 && !deprecated_ok) { @@ -116,7 +115,7 @@ static int warning_printed = 0; if (!warning_printed) { -@@ -3512,6 +3522,10 @@ to use the section anyway."), +@@ -3508,6 +3518,10 @@ to use the section anyway."), warning_printed = 1; } return 0; ++++++ gdb-6.6-buildid-locate-rpm-suse.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.740356902 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.740356902 +0200 @@ -1,8 +1,19 @@ -Index: gdb-7.12.1/gdb/build-id.c +Index: gdb-9.1/gdb/build-id.c =================================================================== ---- gdb-7.12.1.orig/gdb/build-id.c 2017-02-14 15:56:04.000000000 +0100 -+++ gdb-7.12.1/gdb/build-id.c 2017-02-14 15:58:29.000000000 +0100 -@@ -841,9 +841,9 @@ missing_rpm_enlist_1 (const char *filena +--- gdb-9.1.orig/gdb/build-id.c ++++ gdb-9.1/gdb/build-id.c +@@ -861,19 +861,17 @@ missing_rpm_enlist_1 (const char *filena + #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); if (h == NULL) break; @@ -15,7 +26,7 @@ &err); if (!debuginfo) { -@@ -851,60 +851,19 @@ missing_rpm_enlist_1 (const char *filena +@@ -881,60 +879,19 @@ missing_rpm_enlist_1 (const char *filena err); continue; } @@ -78,8 +89,8 @@ /* Base package name for `debuginfo-install'. We do not use the `yum' command directly as the line yum --enablerepo='*debug*' install NAME-debuginfo.ARCH -@@ -1035,10 +994,7 @@ missing_rpm_list_print (void) - (int (*) (const void *, const void *)) missing_rpm_list_compar); +@@ -1076,10 +1033,7 @@ missing_rpm_list_print (void) + missing_rpm_list_entries = 0; printf_unfiltered (_("Missing separate debuginfos, use: %s"), -#ifdef DNF_DEBUGINFO_INSTALL @@ -87,10 +98,10 @@ -#endif - "debuginfo-install"); + "zypper install"); - for (array_iter = array; array_iter < array + missing_rpm_list_entries; - array_iter++) + for (const char *el : array) { -@@ -1251,13 +1207,12 @@ debug_print_missing (const char *binary, + puts_unfiltered (" "); +@@ -1287,13 +1241,12 @@ debug_print_missing (const char *binary, fprintf_unfiltered (gdb_stdlog, _("Missing separate debuginfo for %s\n"), binary); if (debug != NULL) @@ -110,19 +121,3 @@ } } -diff --git a/gdb/build-id.c b/gdb/build-id.c -index b9ff15a..75d501a 100644 ---- a/gdb/build-id.c -+++ b/gdb/build-id.c -@@ -864,10 +864,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); ++++++ gdb-6.6-buildid-locate-rpm.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.752356908 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.752356908 +0200 @@ -235,16 +235,15 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c --- a/gdb/build-id.c +++ b/gdb/build-id.c -@@ -35,6 +35,8 @@ - #include "elf/common.h" - #include "elf-bfd.h" - #include <sys/stat.h> -+#include "elf/external.h" +@@ -33,6 +33,7 @@ + #include "gdb_bfd.h" + #include "gdbcmd.h" + #include "gdbcore.h" +#include "inferior.h" - - #define BUILD_ID_VERBOSE_NONE 0 - #define BUILD_ID_VERBOSE_FILENAMES 1 -@@ -700,8 +702,366 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return) + #include "libbfd.h" + #include "objfiles.h" + #include "observable.h" +@@ -698,8 +699,374 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return) return result; } @@ -513,10 +512,10 @@ + return count; +} + -+static int -+missing_rpm_list_compar (const char *const *ap, const char *const *bp) ++static bool ++missing_rpm_list_compar (const char *ap, const char *bp) +{ -+ return strcoll (*ap, *bp); ++ return strcoll (ap, bp) < 0; +} + +/* It returns a NULL-terminated array of strings needing to be FREEd. It may @@ -525,39 +524,50 @@ +static void +missing_rpm_list_print (void) +{ -+ char **array, **array_iter; + struct missing_rpm *list_iter; -+ struct cleanup *cleanups; + + if (missing_rpm_list_entries == 0) + return; + -+ array = (char **) xmalloc (sizeof (*array) * missing_rpm_list_entries); -+ cleanups = make_cleanup (xfree, array); ++ std::vector<const char *> array (missing_rpm_list_entries); ++ size_t idx = 0; + -+ array_iter = array; + for (list_iter = missing_rpm_list; list_iter != NULL; + list_iter = list_iter->next) + { -+ *array_iter++ = list_iter->rpm; ++ array[idx++] = list_iter->rpm; + } -+ gdb_assert (array_iter == array + missing_rpm_list_entries); ++ 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 ... + -+ qsort (array, missing_rpm_list_entries, sizeof (*array), -+ (int (*) (const void *, const void *)) missing_rpm_list_compar); ++ For this reason, we make sure MISSING_RPM_LIST_ENTRIES is zero ++ *before* calling any print function. */ ++ missing_rpm_list_entries = 0; + + printf_unfiltered (_("Missing separate debuginfos, use: %s"), +#ifdef DNF_DEBUGINFO_INSTALL + "dnf " +#endif + "debuginfo-install"); -+ for (array_iter = array; array_iter < array + missing_rpm_list_entries; -+ array_iter++) ++ for (const char *el : array) + { -+ putchar_unfiltered (' '); -+ puts_unfiltered (*array_iter); ++ puts_unfiltered (" "); ++ puts_unfiltered (el); + } -+ putchar_unfiltered ('\n'); ++ puts_unfiltered ("\n"); + + while (missing_rpm_list != NULL) + { @@ -565,9 +575,6 @@ + missing_rpm_list = list_iter->next; + xfree (list_iter); + } -+ missing_rpm_list_entries = 0; -+ -+ do_cleanups (cleanups); +} + +static void @@ -612,7 +619,7 @@ avoidance. */ struct missing_filepair -@@ -755,11 +1115,17 @@ missing_filepair_change (void) +@@ -753,11 +1120,17 @@ missing_filepair_change (void) /* All their memory came just from missing_filepair_OBSTACK. */ missing_filepair_hash = NULL; } @@ -630,7 +637,7 @@ missing_filepair_change (); } -@@ -826,14 +1192,39 @@ debug_print_missing (const char *binary, const char *debug) +@@ -824,14 +1197,38 @@ debug_print_missing (const char *binary, const char *debug) *slot = missing_filepair; @@ -639,14 +646,13 @@ +#ifdef HAVE_LIBRPM + if (missing_exec == MISSING_EXEC_NOT_TRIED) + { -+ char *execfilename; ++ const char *execfilename = get_exec_file (0); - fprintf_unfiltered (gdb_stdlog, - _("Missing separate debuginfo for %s\n"), binary); - if (debug != NULL) - fprintf_unfiltered (gdb_stdlog, _("Try to install the hash file %s\n"), - debug); -+ execfilename = get_exec_file (0); + if (execfilename != NULL) + { + if (missing_rpm_enlist (execfilename) == 0) @@ -680,7 +686,7 @@ diff --git a/gdb/config.in b/gdb/config.in --- a/gdb/config.in +++ b/gdb/config.in -@@ -33,6 +33,9 @@ +@@ -36,6 +36,9 @@ /* Define to BFD's default target vector. */ #undef DEFAULT_BFD_VEC @@ -690,9 +696,9 @@ /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS -@@ -261,6 +264,9 @@ - /* Define if Python 2.7 is being used. */ - #undef HAVE_LIBPYTHON2_7 +@@ -245,6 +248,9 @@ + /* Define if you have the mpfr library. */ + #undef HAVE_LIBMPFR +/* Define if librpm library is being used. */ +#undef HAVE_LIBRPM @@ -703,7 +709,7 @@ diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -751,6 +751,11 @@ CODESIGN_CERT +@@ -761,6 +761,11 @@ CODESIGN_CERT HAVE_NATIVE_GCORE_TARGET TARGET_OBS subdirs @@ -715,7 +721,7 @@ GDB_DATADIR DEBUGDIR MAKEINFO_EXTRA_FLAGS -@@ -855,6 +860,7 @@ with_gdb_datadir +@@ -864,6 +869,7 @@ with_gdb_datadir with_relocated_sources with_auto_load_dir with_auto_load_safe_path @@ -723,7 +729,7 @@ enable_targets enable_64_bit_bfd enable_gdbmi -@@ -915,6 +921,11 @@ CCC +@@ -926,6 +932,11 @@ CCC CPP MAKEINFO MAKEINFOFLAGS @@ -735,7 +741,7 @@ YACC YFLAGS XMKMF' -@@ -1588,6 +1599,8 @@ Optional Packages: +@@ -1598,6 +1609,8 @@ Optional Packages: [--with-auto-load-dir] --without-auto-load-safe-path do not restrict auto-loaded files locations @@ -744,7 +750,7 @@ --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets --with-curses use the curses library instead of the termcap library -@@ -1645,6 +1658,13 @@ Some influential environment variables: +@@ -1661,6 +1674,13 @@ Some influential environment variables: MAKEINFO Parent configure detects if it is of sufficient version. MAKEINFOFLAGS Parameters for MAKEINFO. @@ -758,7 +764,7 @@ YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. -@@ -6626,6 +6646,494 @@ _ACEOF +@@ -6587,6 +6607,494 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5 $as_echo "$with_auto_load_safe_path" >&6; } @@ -1256,7 +1262,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -166,6 +166,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir, +@@ -144,6 +144,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir, [Directories safe to hold auto-loaded files.]) AC_MSG_RESULT([$with_auto_load_safe_path]) @@ -1456,30 +1462,18 @@ AC_CONFIG_SUBDIRS(testsuite) # Check whether to support alternative target configurations -diff --git a/gdb/corelow.c b/gdb/corelow.c ---- a/gdb/corelow.c -+++ b/gdb/corelow.c -@@ -365,7 +365,7 @@ build_id_locate_exec (int from_tty) - symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED; - } - else -- debug_print_missing (_("the main executable file"), build_id_filename); -+ debug_print_missing (BUILD_ID_MAIN_EXECUTABLE_FILENAME, build_id_filename); - - do_cleanups (back_to); - diff --git a/gdb/event-top.c b/gdb/event-top.c --- a/gdb/event-top.c +++ b/gdb/event-top.c -@@ -40,6 +40,7 @@ - #include "common/buffer.h" +@@ -41,6 +41,7 @@ #include "ser-event.h" #include "gdb_select.h" + #include "gdbsupport/gdb-sigmask.h" +#include "symfile.h" /* readline include files. */ #include "readline/readline.h" -@@ -359,6 +360,8 @@ display_gdb_prompt (const char *new_prompt) +@@ -363,6 +364,8 @@ display_gdb_prompt (const char *new_prompt) /* Reset the nesting depth used when trace-commands is set. */ reset_command_nest_depth (); @@ -1488,7 +1482,7 @@ /* 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. */ -@@ -770,7 +773,10 @@ command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl) +@@ -772,7 +775,10 @@ command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl) command_handler (cmd); if (ui->prompt_state != PROMPTED) @@ -1503,7 +1497,7 @@ diff --git a/gdb/symfile.h b/gdb/symfile.h --- a/gdb/symfile.h +++ b/gdb/symfile.h -@@ -534,6 +534,8 @@ void map_symbol_filenames (symbol_filename_ftype *fun, void *data, +@@ -542,6 +542,8 @@ 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); ++++++ gdb-6.6-buildid-locate-solib-missing-ids.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.760356912 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.764356914 +0200 @@ -14,7 +14,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c -@@ -1347,14 +1347,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, +@@ -1346,14 +1346,27 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, } { @@ -44,7 +44,7 @@ if (build_id != NULL) { char *name, *build_id_filename; -@@ -1369,23 +1382,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, +@@ -1368,23 +1381,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, xfree (name); } else ++++++ gdb-6.6-buildid-locate.patch ++++++ ++++ 644 lines (skipped) ++++ between /work/SRC/openSUSE:Factory/gdb/gdb-6.6-buildid-locate.patch ++++ and /work/SRC/openSUSE:Factory/.gdb.new.3399/gdb-6.6-buildid-locate.patch ++++++ gdb-6.8-quit-never-aborts.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.804356935 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.804356935 +0200 @@ -30,7 +30,7 @@ diff --git a/gdb/extension.c b/gdb/extension.c --- a/gdb/extension.c +++ b/gdb/extension.c -@@ -820,6 +820,11 @@ check_quit_flag (void) +@@ -823,6 +823,11 @@ check_quit_flag (void) int i, result = 0; const struct extension_language_defn *extlang; @@ -45,7 +45,7 @@ diff --git a/gdb/top.c b/gdb/top.c --- a/gdb/top.c +++ b/gdb/top.c -@@ -1626,7 +1626,13 @@ quit_force (int *exit_arg, int from_tty) +@@ -1703,7 +1703,13 @@ quit_force (int *exit_arg, int from_tty) qt.from_tty = from_tty; @@ -58,13 +58,13 @@ +#endif /* Get out of tfind mode, and kill or detach all inferiors. */ - TRY + try diff --git a/gdb/utils.c b/gdb/utils.c --- a/gdb/utils.c +++ b/gdb/utils.c -@@ -100,6 +100,13 @@ static std::chrono::steady_clock::duration prompt_for_continue_wait_time; +@@ -102,6 +102,13 @@ static std::chrono::steady_clock::duration prompt_for_continue_wait_time; - static int debug_timestamp = 0; + static bool debug_timestamp = false; +#ifdef NEED_DETACH_SIGSTOP +/* Nonzero means we are already processing the quitting cleanups and we should @@ -73,6 +73,6 @@ +int quit_flag_cleanup; +#endif + - /* Nonzero means that strings with character values >0x7F should be printed - as octal escapes. Zero means just print the value (e.g. it's an + /* True means that strings with character values >0x7F should be printed + as octal escapes. False means just print the value (e.g. it's an international character, and the terminal or window can cope.) */ ++++++ gdb-8.3.1.tar.bz2 -> gdb-9.2.tar.bz2 ++++++ /work/SRC/openSUSE:Factory/gdb/gdb-8.3.1.tar.bz2 /work/SRC/openSUSE:Factory/.gdb.new.3399/gdb-9.2.tar.bz2 differ: char 11, line 1 ++++++ gdb-aarch64-fix-erroneous-use-of-spu-architecture-bfd.patch ++++++ [AArch64] Fix erroneous use of spu architecture bfd While investigating some SVE code, i noticed the use of two spu bfd variables. This looks like an oversight, as the "id" field is available for non-spu architectures as well, even though its primary use was the Cell BE architecture. gdb/ChangeLog: 2020-01-05 Luis Machado <luis.mach...@linaro.org> * aarch64-linux-nat.c (aarch64_linux_nat_target::thread_architecture): Use bfd_arch_aarch64 and bfd_mach_aarch64. --- gdb/ChangeLog | 6 ++++++ gdb/aarch64-linux-nat.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c index 62f5cdb1fc..4e712ebfb7 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c @@ -970,7 +970,7 @@ aarch64_linux_nat_target::thread_architecture (ptid_t ptid) unavailable, to distinguish from an unset value of 0. */ struct gdbarch_info info; gdbarch_info_init (&info); - info.bfd_arch_info = bfd_lookup_arch (bfd_arch_spu, bfd_mach_spu); + info.bfd_arch_info = bfd_lookup_arch (bfd_arch_aarch64, bfd_mach_aarch64); info.id = (int *) (vq == 0 ? -1 : vq); return gdbarch_find_by_info (info); } ++++++ gdb-archer-pie-addons-keep-disabled.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.856356961 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.856356961 +0200 @@ -8,7 +8,7 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -15441,6 +15441,50 @@ static struct cmd_list_element *enablebreaklist = NULL; +@@ -15396,6 +15396,51 @@ static struct cmd_list_element *enablebreaklist = NULL; cmd_list_element *commands_cmd_element = nullptr; @@ -52,17 +52,18 @@ + } + + if (changed) -+ qsort (bp_locations, bp_locations_count, sizeof (*bp_locations), -+ bp_locations_compare); ++ std::sort (bp_locations, bp_locations + bp_locations_count, ++ bp_location_is_less_than); +} + ++void _initialize_breakpoint (void); void _initialize_breakpoint (void) { diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h -@@ -1664,6 +1664,9 @@ extern const char *ep_parse_optional_if_clause (const char **arg); +@@ -1696,6 +1696,9 @@ extern const char *ep_parse_optional_if_clause (const char **arg); UIOUT iff debugging multiple threads. */ extern void maybe_print_thread_hit_breakpoint (struct ui_out *uiout); @@ -75,7 +76,7 @@ diff --git a/gdb/objfiles.c b/gdb/objfiles.c --- a/gdb/objfiles.c +++ b/gdb/objfiles.c -@@ -875,6 +875,11 @@ objfile_relocate1 (struct objfile *objfile, +@@ -816,6 +816,11 @@ objfile_relocate1 (struct objfile *objfile, obj_section_addr (s)); } @@ -87,3 +88,15 @@ /* Data changed. */ return 1; } +diff --git a/gdb/value.c b/gdb/value.c +--- a/gdb/value.c ++++ b/gdb/value.c +@@ -2840,7 +2840,7 @@ value_static_field (struct type *type, int fieldno) + case FIELD_LOC_KIND_PHYSADDR: + retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno), + TYPE_FIELD_STATIC_PHYSADDR (type, fieldno) +- + (TYPE_OBJFILE (type) == NULL ? 0 : TYPE_OBJFILE (type)->section_offsets[SECT_OFF_TEXT (TYPE_OBJFILE (type))])); ++ + (TYPE_OBJFILE (type) == NULL ? 0 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type))))); + break; + case FIELD_LOC_KIND_PHYSNAME: + { ++++++ gdb-archer-pie-addons.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.868356968 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.872356969 +0200 @@ -8,7 +8,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h -@@ -507,6 +507,7 @@ enum field_loc_kind +@@ -516,6 +516,7 @@ enum field_loc_kind { FIELD_LOC_KIND_BITPOS, /**< bitpos */ FIELD_LOC_KIND_ENUMVAL, /**< enumval */ @@ -16,7 +16,7 @@ FIELD_LOC_KIND_PHYSADDR, /**< physaddr */ FIELD_LOC_KIND_PHYSNAME, /**< physname */ FIELD_LOC_KIND_DWARF_BLOCK /**< dwarf_block */ -@@ -558,6 +559,7 @@ union field_location +@@ -566,6 +567,7 @@ union field_location field. Otherwise, physname is the mangled label of the static field. */ @@ -24,7 +24,7 @@ CORE_ADDR physaddr; const char *physname; -@@ -1436,6 +1438,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *); +@@ -1474,6 +1476,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *); #define FIELD_ENUMVAL_LVAL(thisfld) ((thisfld).loc.enumval) #define FIELD_ENUMVAL(thisfld) (FIELD_ENUMVAL_LVAL (thisfld) + 0) #define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname) @@ -32,7 +32,7 @@ #define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr) #define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block) #define SET_FIELD_BITPOS(thisfld, bitpos) \ -@@ -1447,6 +1450,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *); +@@ -1485,6 +1488,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *); #define SET_FIELD_PHYSNAME(thisfld, name) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \ FIELD_STATIC_PHYSNAME (thisfld) = (name)) @@ -40,7 +40,7 @@ #define SET_FIELD_PHYSADDR(thisfld, addr) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \ FIELD_STATIC_PHYSADDR (thisfld) = (addr)) -@@ -1463,6 +1467,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *); +@@ -1501,6 +1505,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *); #define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n)) @@ -51,13 +51,13 @@ diff --git a/gdb/value.c b/gdb/value.c --- a/gdb/value.c +++ b/gdb/value.c -@@ -2827,7 +2827,8 @@ value_static_field (struct type *type, int fieldno) +@@ -2839,7 +2839,8 @@ value_static_field (struct type *type, int fieldno) { case FIELD_LOC_KIND_PHYSADDR: retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno), - TYPE_FIELD_STATIC_PHYSADDR (type, fieldno)); + TYPE_FIELD_STATIC_PHYSADDR (type, fieldno) -+ + (TYPE_OBJFILE (type) == NULL ? 0 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type))))); ++ + (TYPE_OBJFILE (type) == NULL ? 0 : TYPE_OBJFILE (type)->section_offsets[SECT_OFF_TEXT (TYPE_OBJFILE (type))])); break; case FIELD_LOC_KIND_PHYSNAME: { ++++++ gdb-archer-vla-tests.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.888356978 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.888356978 +0200 @@ -8,7 +8,7 @@ diff --git a/gdb/testsuite/gdb.ada/packed_array.exp b/gdb/testsuite/gdb.ada/packed_array.exp --- a/gdb/testsuite/gdb.ada/packed_array.exp +++ b/gdb/testsuite/gdb.ada/packed_array.exp -@@ -56,5 +56,11 @@ gdb_test_multiple "$test" "$test" { +@@ -53,5 +53,11 @@ gdb_test_multiple "$test" "$test" { # are. Observed with (FSF GNU Ada 4.5.3 20110124). xfail $test } @@ -2804,7 +2804,7 @@ +gdb_breakpoint [gdb_get_line_number "varx-allocated"] +gdb_continue_to_breakpoint "varx-allocated" +# $1 = (( ( 0, 0, 0, 0, 0, 0) ( 0, 0, 0, 0, 0, 0) --- , 0) ) ( ( 0, 0, ...) ...) ...) -+gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" "ptype varx allocated" ++gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4), allocatable \\(6,5:15,17:28\\)" "ptype varx allocated" +# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1. +gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" "p l if varx allocated" + @@ -2831,7 +2831,7 @@ +gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 6" "p varv(3, 7, 19) associated" +# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1. +gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" "p l if varv associated" -+gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" "ptype varx with varv associated" ++gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4), allocatable \\(6,5:15,17:28\\)" "ptype varx with varv associated" +# Intel Fortran Compiler 10.1.008 uses the pointer type. +gdb_test "ptype varv" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)\\)?" "ptype varv associated" + @@ -2852,7 +2852,7 @@ +gdb_breakpoint [gdb_get_line_number "varx-deallocated"] +gdb_continue_to_breakpoint "varx-deallocated" +gdb_test "p varx" "\\$\[0-9\]* = <not allocated>" "p varx deallocated" -+gdb_test "ptype varx" {type = real\(kind=4\) \(:,:,:\)} "ptype varx deallocated" ++gdb_test "ptype varx" {type = real\(kind=4\), allocatable \(:,:,:\)} "ptype varx deallocated" +gdb_test "p l" "\\$\[0-9\]* = \\.FALSE\\." "p l if varx deallocated" +gdb_test "p varx(1,5,17)" {no such vector element \(vector not allocated\)} "p varx(1,5,17) deallocated" +gdb_test "ptype varx(1,5,17)" {no such vector element \(vector not allocated\)} "ptype varx(1,5,17) deallocated" @@ -3690,7 +3690,7 @@ --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -170,6 +170,11 @@ proc gdb_unload {} { - send_gdb "y\n" + send_gdb "y\n" answer exp_continue } + -re "A program is being debugged already..*Are you sure you want to change the file.*y or n. $"\ @@ -3699,7 +3699,7 @@ + exp_continue + } -re "Discard symbol table from .*y or n.*$" { - send_gdb "y\n" + send_gdb "y\n" answer exp_continue diff --git a/gdb/testsuite/lib/pascal.exp b/gdb/testsuite/lib/pascal.exp --- a/gdb/testsuite/lib/pascal.exp ++++++ gdb-archer.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.908356988 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.908356988 +0200 @@ -14,22 +14,6 @@ tromey/python -diff --git a/gdb/Makefile.in b/gdb/Makefile.in ---- a/gdb/Makefile.in -+++ b/gdb/Makefile.in -@@ -2082,6 +2082,12 @@ stamp-h: $(srcdir)/config.in config.status - CONFIG_LINKS= \ - $(SHELL) config.status - -+.gdbinit: $(srcdir)/gdbinit.in config.status -+ CONFIG_FILES=".gdbinit:gdbinit.in" \ -+ CONFIG_COMMANDS= \ -+ CONFIG_HEADERS= \ -+ $(SHELL) config.status -+ - config.status: $(srcdir)/configure configure.nat configure.tgt configure.host ../bfd/development.sh - $(SHELL) config.status --recheck - diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in --- a/gdb/data-directory/Makefile.in +++ b/gdb/data-directory/Makefile.in @@ -41,47 +25,14 @@ gdb/command/explore.py \ gdb/command/backtrace.py \ gdb/command/frame_filters.py \ -@@ -92,6 +93,8 @@ PYTHON_FILE_LIST = \ +@@ -92,6 +93,7 @@ PYTHON_FILE_LIST = \ gdb/function/as_string.py \ gdb/function/caller_is.py \ gdb/function/strfns.py \ -+ gdb/function/caller_is.py \ + gdb/function/in_scope.py \ gdb/printer/__init__.py \ gdb/printer/bound_registers.py -diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo ---- a/gdb/doc/gdb.texinfo -+++ b/gdb/doc/gdb.texinfo -@@ -1251,6 +1251,16 @@ for remote debugging. - Run using @var{device} for your program's standard input and output. - @c FIXME: kingdon thinks there is more to -tty. Investigate. - -+@item -P -+@cindex @code{-P} -+@itemx --python -+@cindex @code{--python} -+Change interpretation of command line so that the argument immediately -+following this switch is taken to be the name of a Python script file. -+This option stops option processing; subsequent options are passed to -+Python as @code{sys.argv}. This option is only available if Python -+scripting support was enabled when @value{GDBN} was configured. -+ - @c resolve the situation of these eventually - @item -tui - @cindex @code{--tui} -diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi ---- a/gdb/doc/python.texi -+++ b/gdb/doc/python.texi -@@ -90,8 +90,6 @@ containing @code{end}. For example: - - @smallexample - (@value{GDBP}) python --Type python script --End with a line saying just "end". - >print 23 - >end - 23 diff --git a/gdb/gdb-gdb.gdb.in b/gdb/gdb-gdb.gdb.in --- a/gdb/gdb-gdb.gdb.in +++ b/gdb/gdb-gdb.gdb.in @@ -101,173 +52,6 @@ if !$gdb_init_done set variable $gdb_init_done = 1 -diff --git a/gdb/main.c b/gdb/main.c ---- a/gdb/main.c -+++ b/gdb/main.c -@@ -33,6 +33,7 @@ - - #include "interps.h" - #include "main.h" -+#include "python/python.h" - #include "source.h" - #include "cli/cli-cmds.h" - #include "objfiles.h" -@@ -478,7 +479,7 @@ exec_or_core_file_attach (const char *filename, int from_tty) - } - - static void --captured_main_1 (struct captured_main_args *context) -+captured_main_1 (struct captured_main_args *context, int &python_script) - { - int argc = context->argc; - char **argv = context->argv; -@@ -698,10 +699,14 @@ captured_main_1 (struct captured_main_args *context) - {"args", no_argument, &set_args, 1}, - {"l", required_argument, 0, 'l'}, - {"return-child-result", no_argument, &return_child_result, 1}, -+#if HAVE_PYTHON -+ {"python", no_argument, 0, 'P'}, -+ {"P", no_argument, 0, 'P'}, -+#endif - {0, no_argument, 0, 0} - }; - -- while (1) -+ while (!python_script) - { - int option_index; - -@@ -719,6 +724,9 @@ captured_main_1 (struct captured_main_args *context) - case 0: - /* Long option that just sets a flag. */ - break; -+ case 'P': -+ python_script = 1; -+ break; - case OPT_SE: - symarg = optarg; - execarg = optarg; -@@ -898,7 +906,31 @@ captured_main_1 (struct captured_main_args *context) - - /* Now that gdb_init has created the initial inferior, we're in - position to set args for that inferior. */ -- if (set_args) -+ if (python_script) -+ { -+ /* The first argument is a python script to evaluate, and -+ subsequent arguments are passed to the script for -+ processing there. */ -+ if (optind >= argc) -+ { -+ fprintf_unfiltered (gdb_stderr, -+ _("%s: Python script file name required\n"), -+ argv[0]); -+ exit (1); -+ } -+ -+ /* FIXME: should handle inferior I/O intelligently here. -+ E.g., should be possible to run gdb in pipeline and have -+ Python (and gdb) output go to stderr or file; and if a -+ prompt is needed, open the tty. */ -+ quiet = 1; -+ /* FIXME: should read .gdbinit if, and only if, a prompt is -+ requested by the script. Though... maybe this is not -+ ideal? */ -+ /* FIXME: likewise, reading in history. */ -+ inhibit_gdbinit = 1; -+ } -+ else if (set_args) - { - /* The remaining options are the command-line options for the - inferior. The first one is the sym/exec file, and the rest -@@ -1199,7 +1231,8 @@ captured_main_1 (struct captured_main_args *context) - - /* Read in the old history after all the command files have been - read. */ -- init_history (); -+ if (!python_script) -+ init_history (); - - if (batch_flag) - { -@@ -1215,24 +1248,37 @@ static void - captured_main (void *data) - { - struct captured_main_args *context = (struct captured_main_args *) data; -+ int python_script = 0; - -- captured_main_1 (context); -+ captured_main_1 (context, python_script); - -- /* NOTE: cagney/1999-11-07: There is probably no reason for not -- moving this loop and the code found in captured_command_loop() -- into the command_loop() proper. The main thing holding back that -- change - SET_TOP_LEVEL() - has been eliminated. */ -- while (1) -+#if HAVE_PYTHON -+ if (python_script) - { -- TRY -- { -- captured_command_loop (); -- } -- CATCH (ex, RETURN_MASK_ALL) -+ extern int pagination_enabled; -+ pagination_enabled = 0; -+ run_python_script (context->argc - optind, &context->argv[optind]); -+ return; -+ } -+ else -+#endif -+ { -+ /* NOTE: cagney/1999-11-07: There is probably no reason for not -+ moving this loop and the code found in captured_command_loop() -+ into the command_loop() proper. The main thing holding back that -+ change - SET_TOP_LEVEL() - has been eliminated. */ -+ while (1) - { -- exception_print (gdb_stderr, ex); -+ TRY -+ { -+ captured_command_loop (); -+ } -+ CATCH (ex, RETURN_MASK_ALL) -+ { -+ exception_print (gdb_stderr, ex); -+ } -+ END_CATCH - } -- END_CATCH - } - /* No exit -- exit is through quit_command. */ - } -@@ -1275,6 +1321,12 @@ print_gdb_help (struct ui_file *stream) - fputs_unfiltered (_("\ - This is the GNU debugger. Usage:\n\n\ - gdb [options] [executable-file [core-file or process-id]]\n\ -+ gdb [options] --args executable-file [inferior-arguments ...]\n"), stream); -+#if HAVE_PYTHON -+ fputs_unfiltered (_("\ -+ gdb [options] [--python|-P] script-file [script-arguments ...]\n"), stream); -+#endif -+ fputs_unfiltered (_("\n\ - gdb [options] --args executable-file [inferior-arguments ...]\n\n\ - "), stream); - fputs_unfiltered (_("\ -@@ -1320,6 +1372,13 @@ Output and user interface control:\n\n\ - #endif - fputs_unfiltered (_("\ - --dbx DBX compatibility mode.\n\ -+"), stream); -+#if HAVE_PYTHON -+ fputs_unfiltered (_("\ -+ --python, -P Following argument is Python script file; remaining\n\ -+ arguments are passed to script.\n"), stream); -+#endif -+ fputs_unfiltered (_("\ - -q, --quiet, --silent\n\ - Do not print version number on startup.\n\n\ - "), stream); diff --git a/gdb/python/lib/gdb/command/ignore_errors.py b/gdb/python/lib/gdb/command/ignore_errors.py new file mode 100644 --- /dev/null @@ -362,177 +146,6 @@ + return wanted == found + +InScope () -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 -@@ -709,6 +709,9 @@ private: - PyThreadState *m_save; - }; - -+struct cleanup *ensure_python_env (struct gdbarch *gdbarch, -+ const struct language_defn *language); -+ - extern struct gdbarch *python_gdbarch; - extern const struct language_defn *python_language; - -diff --git a/gdb/python/python.c b/gdb/python/python.c ---- a/gdb/python/python.c -+++ b/gdb/python/python.c -@@ -94,6 +94,8 @@ const struct extension_language_defn extension_language_python = - #include "linespec.h" - #include "source.h" - #include "common/version.h" -+#include "inferior.h" -+#include "gdbthread.h" - #include "target.h" - #include "gdbthread.h" - #include "interps.h" -@@ -235,6 +237,29 @@ gdbpy_enter::~gdbpy_enter () - restore_active_ext_lang (m_previous_active); - } - -+static void -+restore_python_env (void *p) -+{ -+ gdbpy_enter *env = (gdbpy_enter *) p; -+ -+ delete env; -+} -+ -+/* Called before entering the Python interpreter to install the -+ current language and architecture to be used for Python values. -+ Also set the active extension language for GDB so that SIGINT's -+ are directed our way, and if necessary install the right SIGINT -+ handler. */ -+ -+struct cleanup * -+ensure_python_env (struct gdbarch *gdbarch, -+ const struct language_defn *language) -+{ -+ gdbpy_enter *env = new gdbpy_enter (gdbarch, language); -+ -+ return make_cleanup (restore_python_env, env); -+} -+ - /* Set the quit flag. */ - - static void -@@ -1283,6 +1308,92 @@ gdbpy_print_stack_or_quit () - - - -+/* True if 'gdb -P' was used, false otherwise. */ -+static int running_python_script; -+ -+/* True if we are currently in a call to 'gdb.cli', false otherwise. */ -+static int in_cli; -+ -+/* Enter the command loop. */ -+ -+static PyObject * -+gdbpy_cli (PyObject *unused1, PyObject *unused2) -+{ -+ if (! running_python_script || in_cli) -+ return PyErr_Format (PyExc_RuntimeError, "cannot invoke CLI recursively"); -+ -+ if (current_uiout->is_mi_like_p ()) -+ return PyErr_Format (PyExc_RuntimeError, _("Cannot invoke CLI from MI.")); -+ -+ in_cli = 1; -+ /* See captured_command_loop. */ -+ -+ /* Give the interpreter a chance to print a prompt. */ -+ interp_pre_command_loop (top_level_interpreter ()); -+ -+ /* Now it's time to start the event loop. */ -+ start_event_loop (); -+ -+ in_cli = 0; -+ -+ Py_RETURN_NONE; -+} -+ -+/* Set up the Python argument vector and evaluate a script. This is -+ used to implement 'gdb -P'. */ -+ -+void -+run_python_script (int argc, char **argv) -+{ -+ FILE *input; -+ -+ /* We never free this, since we plan to exit at the end. */ -+ ensure_python_env (get_current_arch (), current_language); -+ -+ running_python_script = 1; -+ -+#if PYTHON_ABI_VERSION < 3 -+ PySys_SetArgv (argc - 1, argv + 1); -+#else -+ { -+ wchar_t **wargv = (wchar_t **) alloca (sizeof (*wargv) * (argc + 1)); -+ int i; -+ -+ for (i = 1; i < argc; i++) -+ { -+ size_t len = mbstowcs (NULL, argv[i], 0); -+ /* Python-related GDB sources are built with -DNDEBUG -+ https://sourceware.org/bugzilla/show_bug.cgi?id=20445 */ -+ size_t len2 ATTRIBUTE_UNUSED; -+ -+ if (len == (size_t) -1) -+ { -+ fprintf (stderr, "Invalid multibyte argument #%d \"%s\"\n", -+ i, argv[i]); -+ exit (1); -+ } -+ wargv[i] = (wchar_t *) alloca (sizeof (**wargv) * (len + 1)); -+ len2 = mbstowcs (wargv[i], argv[i], len + 1); -+ assert (len2 == len); -+ } -+ wargv[argc] = NULL; -+ PySys_SetArgv (argc - 1, wargv + 1); -+ } -+#endif -+ -+ input = fopen (argv[0], "r"); -+ if (! input) -+ { -+ fprintf (stderr, "could not open %s: %s\n", argv[0], strerror (errno)); -+ exit (1); -+ } -+ PyRun_SimpleFile (input, argv[0]); -+ fclose (input); -+ exit (0); -+} -+ -+ -+ - /* Return a sequence holding all the Progspaces. */ - - static PyObject * -@@ -1937,6 +2048,8 @@ PyMethodDef python_GdbMethods[] = - Evaluate command, a string, as a gdb CLI command. Optionally returns\n\ - a Python String containing the output of the command if to_string is\n\ - set to True." }, -+ { "cli", gdbpy_cli, METH_NOARGS, -+ "Enter the gdb CLI" }, - { "parameter", gdbpy_parameter, METH_VARARGS, - "Return a gdb parameter's value" }, - -diff --git a/gdb/python/python.h b/gdb/python/python.h ---- a/gdb/python/python.h -+++ b/gdb/python/python.h -@@ -25,7 +25,10 @@ - /* This is all that python exports to gdb. */ - extern const struct extension_language_defn extension_language_python; - -+ - /* Command element for the 'python' command. */ - extern cmd_list_element *python_cmd_element; - -+extern void run_python_script (int argc, char **argv); -+ - #endif /* PYTHON_PYTHON_H */ diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp --- a/gdb/testsuite/gdb.python/py-frame.exp +++ b/gdb/testsuite/gdb.python/py-frame.exp @@ -548,7 +161,7 @@ diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp --- a/gdb/testsuite/gdb.python/py-value.exp +++ b/gdb/testsuite/gdb.python/py-value.exp -@@ -399,6 +399,15 @@ proc test_value_after_death {} { +@@ -419,6 +419,15 @@ proc test_value_after_death {} { "print value's type" } @@ -564,7 +177,7 @@ # Regression test for invalid subscript operations. The bug was that # the type of the value was not being checked before allowing a # subscript operation to proceed. -@@ -585,6 +594,7 @@ test_value_in_inferior +@@ -606,6 +615,7 @@ test_value_in_inferior test_value_from_buffer test_inferior_function_call test_value_after_death @@ -572,33 +185,3 @@ # Test either C or C++ values. -diff --git a/gdb/varobj.c b/gdb/varobj.c ---- a/gdb/varobj.c -+++ b/gdb/varobj.c -@@ -217,6 +217,14 @@ is_root_p (const struct varobj *var) - } - - #ifdef HAVE_PYTHON -+/* Helper function to install a Python environment suitable for -+ use during operations on VAR. */ -+struct cleanup * -+varobj_ensure_python_env (const struct varobj *var) -+{ -+ return ensure_python_env (var->root->exp->gdbarch, -+ var->root->exp->language_defn); -+} - - /* See python-internal.h. */ - gdbpy_enter_varobj::gdbpy_enter_varobj (const struct varobj *var) -diff --git a/gdb/varobj.h b/gdb/varobj.h ---- a/gdb/varobj.h -+++ b/gdb/varobj.h -@@ -328,6 +328,8 @@ extern bool varobj_has_more (const struct varobj *var, int to); - - extern bool varobj_is_dynamic_p (const struct varobj *var); - -+extern struct cleanup *varobj_ensure_python_env (const struct varobj *var); -+ - extern bool varobj_default_value_is_changeable_p (const struct varobj *var); - extern bool varobj_value_is_changeable_p (const struct varobj *var); - ++++++ gdb-attach-fail-reasons-5of5.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.924356996 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.924356996 +0200 @@ -45,7 +45,7 @@ diff --git a/gdb/config.in b/gdb/config.in --- a/gdb/config.in +++ b/gdb/config.in -@@ -267,6 +267,9 @@ +@@ -251,6 +251,9 @@ /* Define if librpm library is being used. */ #undef HAVE_LIBRPM @@ -55,7 +55,7 @@ /* Define to 1 if you have the <libunwind-ia64.h> header file. */ #undef HAVE_LIBUNWIND_IA64_H -@@ -390,6 +393,9 @@ +@@ -386,6 +389,9 @@ /* Define to 1 if you have the `scm_new_smob' function. */ #undef HAVE_SCM_NEW_SMOB @@ -68,7 +68,7 @@ diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -15898,6 +15898,64 @@ cat >>confdefs.h <<_ACEOF +@@ -16434,6 +16434,64 @@ cat >>confdefs.h <<_ACEOF _ACEOF @@ -136,7 +136,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -2051,6 +2051,10 @@ case $host_os in +@@ -1964,6 +1964,10 @@ case $host_os in esac AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.]) @@ -150,9 +150,9 @@ diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in --- a/gdb/gdbserver/config.in +++ b/gdb/gdbserver/config.in -@@ -126,6 +126,9 @@ - /* Define to 1 if you have the `mcheck' library (-lmcheck). */ - #undef HAVE_LIBMCHECK +@@ -125,6 +125,9 @@ + /* Define to 1 if you have the `dl' library (-ldl). */ + #undef HAVE_LIBDL +/* Define to 1 if you have the `selinux' library (-lselinux). */ +#undef HAVE_LIBSELINUX @@ -160,7 +160,7 @@ /* Define if the target supports branch tracing. */ #undef HAVE_LINUX_BTRACE -@@ -202,6 +205,9 @@ +@@ -210,6 +213,9 @@ /* Define to 1 if you have the `pwrite' function. */ #undef HAVE_PWRITE @@ -173,7 +173,7 @@ diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure -@@ -8589,6 +8589,64 @@ if $want_ipa ; then +@@ -9398,6 +9398,64 @@ if $want_ipa ; then fi fi @@ -241,7 +241,7 @@ diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac --- a/gdb/gdbserver/configure.ac +++ b/gdb/gdbserver/configure.ac -@@ -478,6 +478,10 @@ if $want_ipa ; then +@@ -465,6 +465,10 @@ if $want_ipa ; then fi fi @@ -255,7 +255,7 @@ diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c -@@ -967,7 +967,16 @@ linux_ptrace_fun () +@@ -968,7 +968,16 @@ linux_ptrace_fun () { if (ptrace (PTRACE_TRACEME, 0, (PTRACE_TYPE_ARG3) 0, (PTRACE_TYPE_ARG4) 0) < 0) @@ -276,22 +276,21 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c -@@ -1099,7 +1099,17 @@ linux_nat_target::create_inferior (const char *exec_file, +@@ -1092,7 +1092,16 @@ linux_nat_target::create_inferior (const char *exec_file, /* Make sure we report all signals during startup. */ pass_signals ({}); - inf_ptrace_target::create_inferior (exec_file, allargs, env, from_tty); -+ TRY ++ try + { + inf_ptrace_target::create_inferior (exec_file, allargs, env, from_tty); + } -+ CATCH (ex, RETURN_MASK_ERROR) ++ catch (const gdb_exception_error &ex) + { + std::string result = linux_ptrace_create_warnings (); + -+ throw_error (ex.error, "%s%s", result.c_str (), ex.message); ++ throw_error (ex.error, "%s%s", result.c_str (), ex.message->c_str ()); + } -+ END_CATCH } /* Callback for linux_proc_attach_tgid_threads. Attach to PTID if not ++++++ gdb-btrobust.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.936357002 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.936357002 +0200 @@ -14,7 +14,7 @@ diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c --- a/gdb/python/py-framefilter.c +++ b/gdb/python/py-framefilter.c -@@ -1139,6 +1139,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, +@@ -1204,6 +1204,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, htab_eq_pointer, NULL)); @@ -22,7 +22,7 @@ while (true) { gdbpy_ref<> item (PyIter_Next (iterable.get ())); -@@ -1147,8 +1148,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, +@@ -1212,8 +1213,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, { if (PyErr_Occurred ()) { @@ -33,7 +33,7 @@ } break; } -@@ -1181,7 +1182,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, +@@ -1245,7 +1246,8 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang, /* Do not exit on error printing a single frame. Print the error and continue with other frames. */ if (success == EXT_LANG_BT_ERROR) ++++++ gdb-bz1219747-attach-kills.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.948357009 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.948357009 +0200 @@ -80,7 +80,7 @@ diff --git a/gdb/main.c b/gdb/main.c --- a/gdb/main.c +++ b/gdb/main.c -@@ -1129,7 +1129,10 @@ captured_main_1 (struct captured_main_args *context) +@@ -1148,7 +1148,10 @@ captured_main_1 (struct captured_main_args *context) { ret = catch_command_errors (attach_command, pid_or_core_arg, !batch_flag); ++++++ gdb-bz533176-fortran-omp-step.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.960357014 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.960357014 +0200 @@ -30,7 +30,7 @@ diff --git a/gdb/infrun.c b/gdb/infrun.c --- a/gdb/infrun.c +++ b/gdb/infrun.c -@@ -6499,6 +6499,16 @@ process_event_stop_test (struct execution_control_state *ecs) +@@ -6453,6 +6453,16 @@ process_event_stop_test (struct execution_control_state *ecs) if (ecs->event_thread->control.step_over_calls == STEP_OVER_ALL) { @@ -38,16 +38,16 @@ + struct minimal_symbol *stopf = lookup_minimal_symbol_by_pc (stop_pc).minsym; + + if ((stop_fn == NULL -+ || strstr (SYMBOL_LINKAGE_NAME (stop_fn), ".omp_fn.") == NULL) ++ || strstr (stop_fn->linkage_name (), ".omp_fn.") == NULL) + /* gcc-4.7.2-9.fc19.x86_64 uses a new format. */ + && (stopf == NULL -+ || strstr (MSYMBOL_LINKAGE_NAME (stopf), "._omp_fn.") == NULL)) ++ || strstr (stopf->linkage_name (), "._omp_fn.") == NULL)) +{ /* ".omp_fn." */ + /* We're doing a "next". Normal (forward) execution: set a breakpoint at the -@@ -6532,6 +6542,7 @@ process_event_stop_test (struct execution_control_state *ecs) +@@ -6486,6 +6496,7 @@ process_event_stop_test (struct execution_control_state *ecs) keep_going (ecs); return; ++++++ gdb-container-rh-pkg.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.980357025 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.980357025 +0200 @@ -9,7 +9,7 @@ diff --git a/gdb/remote.c b/gdb/remote.c --- a/gdb/remote.c +++ b/gdb/remote.c -@@ -13966,7 +13966,17 @@ remote_target::pid_to_exec_file (int pid) +@@ -13916,7 +13916,17 @@ remote_target::pid_to_exec_file (int pid) char *annex = NULL; if (packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE) ++++++ gdb-core-open-vdso-warning.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:58.996357033 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:58.996357033 +0200 @@ -27,7 +27,7 @@ if [get_compiler_info] { return -1 -@@ -72,8 +73,26 @@ gdb_test "br foo2" \ +@@ -71,8 +72,26 @@ gdb_test "br foo2" \ "Breakpoint.*: foo2. .2 locations..*" \ "foo2 in mdlib" ++++++ gdb-fedora-libncursesw.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:59.012357041 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:59.016357043 +0200 @@ -12,7 +12,7 @@ diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -9418,6 +9418,7 @@ if test x"$prefer_curses" = xyes; then +@@ -9375,6 +9375,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. @@ -20,7 +20,7 @@ { $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 : -@@ -9442,7 +9443,7 @@ return waddstr (); +@@ -9399,7 +9400,7 @@ return waddstr (); return 0; } _ACEOF @@ -29,7 +29,7 @@ if test -z "$ac_lib"; then ac_res="none required" else -@@ -9516,6 +9517,7 @@ case $host_os in +@@ -9473,6 +9474,7 @@ case $host_os in esac # These are the libraries checked by Readline. @@ -37,7 +37,7 @@ { $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 : -@@ -9540,7 +9542,7 @@ return tgetent (); +@@ -9497,7 +9499,7 @@ return tgetent (); return 0; } _ACEOF @@ -49,7 +49,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -743,7 +743,8 @@ if test x"$prefer_curses" = xyes; then +@@ -717,7 +717,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. @@ -59,7 +59,7 @@ if test "$ac_cv_search_waddstr" != no; then curses_found=yes -@@ -785,7 +786,8 @@ case $host_os in +@@ -759,7 +760,8 @@ case $host_os in esac # These are the libraries checked by Readline. ++++++ gdb-fix-debug-agent-odr-bool-int.patch ++++++ Fix odr error --- gdb/gdbserver/ax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/gdbserver/ax.c b/gdb/gdbserver/ax.c index 213db410a0..42d28128fa 100644 --- a/gdb/gdbserver/ax.c +++ b/gdb/gdbserver/ax.c @@ -25,7 +25,7 @@ static void ax_vdebug (const char *, ...) ATTRIBUTE_PRINTF (1, 2); #ifdef IN_PROCESS_AGENT -int debug_agent = 0; +bool debug_agent = 0; #endif static void ++++++ gdb-fix-python3.9-related-runtime-problems.patch ++++++ Fix Python3.9 related runtime problems Python3.9b1 is now available on Rawhide. GDB w/ Python 3.9 support can be built using the configure switch -with-python=/usr/bin/python3.9. Attempting to run gdb/Python3.9 segfaults on startup: #0 0x00007ffff7b0582c in PyEval_ReleaseLock () from /lib64/libpython3.9.so.1.0 #1 0x000000000069ccbf in do_start_initialization () at worktree-test1/gdb/python/python.c:1789 #2 _initialize_python () at worktree-test1/gdb/python/python.c:1877 #3 0x00000000007afb0a in initialize_all_files () at init.c:237 ... Consulting the the documentation... https://docs.python.org/3/c-api/init.html ...we find that PyEval_ReleaseLock() has been deprecated since version 3.2. It recommends using PyEval_SaveThread or PyEval_ReleaseThread() instead. In do_start_initialization, in gdb/python/python.c, we can replace the calls to PyThreadState_Swap() and PyEval_ReleaseLock() with a single call to PyEval_SaveThread. (Thanks to Keith Seitz for working this out.) With that in place, GDB gets a little bit further. It still dies on startup, but the backtrace is different: #0 0x00007ffff7b04306 in PyOS_InterruptOccurred () from /lib64/libpython3.9.so.1.0 #1 0x0000000000576e86 in check_quit_flag () at worktree-test1/gdb/extension.c:776 #2 0x0000000000576f8a in set_active_ext_lang (now_active=now_active@entry=0x983c00 <extension_language_python>) at worktree-test1/gdb/extension.c:705 #3 0x000000000069d399 in gdbpy_enter::gdbpy_enter (this=0x7fffffffd2d0, gdbarch=0x0, language=0x0) at worktree-test1/gdb/python/python.c:211 #4 0x0000000000686e00 in python_new_inferior (inf=0xddeb10) at worktree-test1/gdb/python/py-inferior.c:251 #5 0x00000000005d9fb9 in std::function<void (inferior*)>::operator()(inferior*) const (__args#0=<optimized out>, this=0xccad20) at /usr/include/c++/10/bits/std_function.h:617 #6 gdb::observers::observable<inferior*>::notify (args#0=0xddeb10, this=<optimized out>) at worktree-test1/gdb/../gdbsupport/observable.h:106 #7 add_inferior_silent (pid=0) at worktree-test1/gdb/inferior.c:113 #8 0x00000000005dbcb8 in initialize_inferiors () at worktree-test1/gdb/inferior.c:947 ... We checked with some Python Developers and were told that we should acquire the GIL prior to calling any Python C API function. We definitely don't have the GIL for calls of PyOS_InterruptOccurred(). I moved class_gdbpy_gil earlier in the file and use it in gdbpy_check_quit_flag() to acquire (and automatically release) the GIL. With those changes in place, I was able to run to a GDB prompt. But, when trying to quit, it segfaulted again due to due to some other problems with gdbpy_check_quit_flag(): Thread 1 "gdb" received signal SIGSEGV, Segmentation fault. 0x00007ffff7bbab0c in new_threadstate () from /lib64/libpython3.9.so.1.0 (top-gdb) bt 8 #0 0x00007ffff7bbab0c in new_threadstate () from /lib64/libpython3.9.so.1.0 #1 0x00007ffff7afa5ea in PyGILState_Ensure.cold () from /lib64/libpython3.9.so.1.0 #2 0x000000000069b58c in gdbpy_gil::gdbpy_gil (this=<synthetic pointer>) at worktree-test1/gdb/python/python.c:278 #3 gdbpy_check_quit_flag (extlang=<optimized out>) at worktree-test1/gdb/python/python.c:278 #4 0x0000000000576e96 in check_quit_flag () at worktree-test1/gdb/extension.c:776 #5 0x000000000057700c in restore_active_ext_lang (previous=0xe9c050) at worktree-test1/gdb/extension.c:729 #6 0x000000000088913a in do_my_cleanups ( pmy_chain=0xc31870 <final_cleanup_chain>, old_chain=0xae5720 <sentinel_cleanup>) at worktree-test1/gdbsupport/cleanups.cc:131 #7 do_final_cleanups () at worktree-test1/gdbsupport/cleanups.cc:143 In this case, we're trying to call a Python C API function after Py_Finalize() has been called from finalize_python(). I made finalize_python set gdb_python_initialized to false and then cause check_quit_flag() to return early when it's false. With these changes in place, GDB seems to be working again with Python3.9b1. I think it likely that there are other problems lurking. I wouldn't be surprised to find that there are other calls into Python where we don't first make sure that we have the GIL. Further changes may well be needed. I see no regressions testing on Rawhide using a GDB built with the default Python version (3.8.3) versus one built using Python 3.9b1. I've also tested on Fedora 28, 29, 30, 31, and 32 (all x86_64) using the default (though updated) system installed versions of Python on those OSes. This means that I've tested against Python versions 2.7.15, 2.7.17, 2.7.18, 3.7.7, 3.8.2, and 3.8.3. In each case GDB still builds without problem and shows no regressions after applying this patch. gdb/ChangeLog: 2020-MM-DD Kevin Buettner <kev...@redhat.com> Keith Seitz <kei...@redhat.com> * python/python.c (do_start_initialization): For Python 3.9 and later, call PyEval_SaveThread instead of PyEval_ReleaseLock. (class gdbpy_gil): Move to earlier in file. (finalize_python): Set gdb_python_initialized. (gdbpy_check_quit_flag): Acquire GIL via gdbpy_gil. Return early when not initialized. --- gdb/python/python.c | 56 ++++++++++++++++++++++++++++------------------------- 2 files changed, 40 insertions(+), 26 deletions(-) diff --git a/gdb/python/python.c b/gdb/python/python.c index 67f362b852..4bdd2201ab 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -238,6 +238,30 @@ gdbpy_enter::~gdbpy_enter () PyGILState_Release (m_state); } +/* 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 @@ -251,6 +275,10 @@ gdbpy_set_quit_flag (const struct extension_language_defn *extlang) static int gdbpy_check_quit_flag (const struct extension_language_defn *extlang) { + if (!gdb_python_initialized) + return 0; + + gdbpy_gil gil; return PyOS_InterruptOccurred (); } @@ -943,30 +971,6 @@ gdbpy_source_script (const struct extension_language_defn *extlang, /* Posting and handling events. */ -/* 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; -}; - /* A single event. */ struct gdbpy_event { @@ -1616,6 +1620,7 @@ finalize_python (void *ignore) Py_Finalize (); + gdb_python_initialized = false; restore_active_ext_lang (previous_active); } @@ -1785,8 +1790,7 @@ do_start_initialization () return false; /* Release the GIL while gdb runs. */ - PyThreadState_Swap (NULL); - PyEval_ReleaseLock (); + PyEval_SaveThread (); make_final_cleanup (finalize_python, NULL); ++++++ gdb-fix-range-loop-index-in-find_method.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:59.052357061 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:59.056357064 +0200 @@ -49,11 +49,11 @@ gdb/testsuite/gdb.cp/cpexprs.exp | 14 ++++++++++++-- 5 files changed, 45 insertions(+), 4 deletions(-) -diff --git a/gdb/linespec.c b/gdb/linespec.c -index e902b11c8e8..2231a5674c8 100644 ---- a/gdb/linespec.c -+++ b/gdb/linespec.c -@@ -3680,12 +3680,12 @@ find_method (struct linespec_state *self, std::vector<symtab *> *file_symtabs, +Index: gdb-9.1/gdb/linespec.c +=================================================================== +--- gdb-9.1.orig/gdb/linespec.c ++++ gdb-9.1/gdb/linespec.c +@@ -3670,12 +3670,12 @@ find_method (struct linespec_state *self because we collect data across the program space before deciding what to do. */ last_result_len = 0; @@ -67,7 +67,7 @@ /* Program spaces that are executing startup should have been filtered out earlier. */ -@@ -3716,7 +3716,6 @@ find_method (struct linespec_state *self, std::vector<symtab *> *file_symtabs, +@@ -3706,7 +3706,6 @@ find_method (struct linespec_state *self superclass_vec.clear (); last_result_len = result_names.size (); @@ -75,11 +75,10 @@ } } -diff --git a/gdb/testsuite/gdb.cp/cpexprs-debug-types.exp b/gdb/testsuite/gdb.cp/cpexprs-debug-types.exp -new file mode 100644 -index 00000000000..9499aecf4c6 +Index: gdb-9.1/gdb/testsuite/gdb.cp/cpexprs-debug-types.exp +=================================================================== --- /dev/null -+++ b/gdb/testsuite/gdb.cp/cpexprs-debug-types.exp ++++ gdb-9.1/gdb/testsuite/gdb.cp/cpexprs-debug-types.exp @@ -0,0 +1,20 @@ +# Copyright 2020 Free Software Foundation, Inc. +# @@ -101,11 +100,11 @@ +# Run cpexprs.exp with -fdebug-types-section. +set flags {additional_flags=-fdebug-types-section} +source $srcdir/$subdir/cpexprs.exp -diff --git a/gdb/testsuite/gdb.cp/cpexprs.exp b/gdb/testsuite/gdb.cp/cpexprs.exp -index ecf3a2fbc8d..618388cef3d 100644 ---- a/gdb/testsuite/gdb.cp/cpexprs.exp -+++ b/gdb/testsuite/gdb.cp/cpexprs.exp -@@ -690,13 +690,23 @@ if { [istarget "spu*-*-*"] } { +Index: gdb-9.1/gdb/testsuite/gdb.cp/cpexprs.exp +=================================================================== +--- gdb-9.1.orig/gdb/testsuite/gdb.cp/cpexprs.exp ++++ gdb-9.1/gdb/testsuite/gdb.cp/cpexprs.exp +@@ -685,13 +685,23 @@ if {[skip_cplus_tests]} { continue } # test running programs # ++++++ gdb-fix-the-thread-pool.c-compilation.patch ++++++ Fix the thread-pool.c compilation A recent commit removed DIAGNOSTIC_IGNORE_UNUSED_FUNCTION, which was used in thread-pool.c. This patch changes this code to use ATTRIBUTE_UNUSED instead. Tested by rebuilding. gdb/ChangeLog 2019-12-12 Tom Tromey <tro...@adacore.com> * gdbsupport/thread-pool.c (set_thread_name): Use ATTRIBUTE_UNUSED. Change-Id: I56d46eaac73690565d0e52db1791411567a918dd --- gdb/ChangeLog | 5 +++++ gdb/gdbsupport/thread-pool.c | 10 ++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/gdb/gdbsupport/thread-pool.c b/gdb/gdbsupport/thread-pool.c index 1b3e44c670..fc83ff765f 100644 --- a/gdb/gdbsupport/thread-pool.c +++ b/gdb/gdbsupport/thread-pool.c @@ -25,7 +25,6 @@ #include "gdbsupport/alt-stack.h" #include "gdbsupport/block-signals.h" #include <algorithm> -#include "diagnostics.h" /* On the off chance that we have the pthread library on a Windows host, but std::thread is not using it, avoid calling @@ -40,14 +39,11 @@ #include <pthread.h> -DIAGNOSTIC_PUSH -DIAGNOSTIC_IGNORE_UNUSED_FUNCTION - /* Handle platform discrepancies in pthread_setname_np: macOS uses a single-argument form, while Linux uses a two-argument form. This wrapper handles the difference. */ -static void +ATTRIBUTE_UNUSED static void set_thread_name (int (*set_name) (pthread_t, const char *), const char *name) { set_name (pthread_self (), name); @@ -55,14 +51,12 @@ set_thread_name (int (*set_name) (pthread_t, const char *), const char *name) /* The macOS man page says that pthread_setname_np returns "void", but the headers actually declare it returning "int". */ -static void +ATTRIBUTE_UNUSED static void set_thread_name (int (*set_name) (const char *), const char *name) { set_name (name); } -DIAGNOSTIC_POP - #endif /* USE_PTHREAD_SETNAME_NP */ namespace gdb ++++++ gdb-fix-toplevel-types-with-fdebug-types-section.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:59.084357078 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:59.084357078 +0200 @@ -1,43 +1,8 @@ -gdb: Fix toplevel types with -fdebug-types-section - -When debugging a program compiled with -fdebug-types-section, -only the first top-level type in each file is visible to gdb. - -The problem was caused by moving the assignment to list_in_scope -from process_full_comp_unit and process_full_type_unit to -start_symtab. This was fine for process_full_comp_unit, because -symtabs and comp units are one-to-one. But there can be many type -units per symtab (one for each type), and we only call start_symtab -for the first one. This adds the necessary assignments on the paths -where start_symtab is not called. - -gdb/Changelog: - -2020-04-28 Mark Williams <m...@myosotissp.com> - - PR gdb/24480 - * dwarf2read.c: Add missing assingments to list_in_scope when - start_symtab was already called. - -gdb/testsuite/Changelog: - -2020-04-28 Mark Williams <m...@myosotissp.com> - - PR gdb/24480 - * dw4-toplevel-types.exp: Test for top level types. - * dw4-toplevel-types.cc: Test for top level types. - ---- - gdb/dwarf2read.c | 2 ++ - gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.cc | 21 +++++++++++++++ - gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.exp | 36 +++++++++++++++++++++++++ - 3 files changed, 59 insertions(+) - -diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index 4251ed03b46..7e6f1a0ff62 100644 ---- a/gdb/dwarf2read.c -+++ b/gdb/dwarf2read.c -@@ -11666,6 +11666,7 @@ dwarf2_cu::setup_type_unit_groups (struct die_info *die) +Index: gdb-9.1/gdb/dwarf2read.c +=================================================================== +--- gdb-9.1.orig/gdb/dwarf2read.c ++++ gdb-9.1/gdb/dwarf2read.c +@@ -11759,6 +11759,7 @@ dwarf2_cu::setup_type_unit_groups (struc COMPUNIT_DIRNAME (cust), compunit_language (cust), 0, cust)); @@ -45,19 +10,18 @@ } return; } -@@ -11717,6 +11718,7 @@ dwarf2_cu::setup_type_unit_groups (struct die_info *die) +@@ -11810,6 +11811,7 @@ dwarf2_cu::setup_type_unit_groups (struc COMPUNIT_DIRNAME (cust), compunit_language (cust), 0, cust)); + list_in_scope = get_builder ()->get_file_symbols (); - for (i = 0; i < line_header->file_names.size (); ++i) - { -diff --git a/gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.cc b/gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.cc -new file mode 100644 -index 00000000000..c47598c46ef + auto &file_names = line_header->file_names (); + for (i = 0; i < file_names.size (); ++i) +Index: gdb-9.1/gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.cc +=================================================================== --- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.cc ++++ gdb-9.1/gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.cc @@ -0,0 +1,21 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -80,11 +44,10 @@ +struct Y {} y; +struct Z {} z; +int main() {} -diff --git a/gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.exp b/gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.exp -new file mode 100644 -index 00000000000..8e3875ad71e +Index: gdb-9.1/gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.exp +=================================================================== --- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.exp ++++ gdb-9.1/gdb/testsuite/gdb.dwarf2/dw4-toplevel-types.exp @@ -0,0 +1,36 @@ +# Copyright 2020 Free Software Foundation, Inc. + ++++++ gdb-fix-unused-function-error.patch ++++++ Fix unused function error Attempting to build GDB in Ubuntu 16.04.6 LTS on x86_64, I ran into warnings that caused the build to fail: binutils-gdb/gdb/gdbsupport/safe-strerror.c:44:1: error: ‘char* select_strerror_r(char*, char*)’ defined but not used [-Werror=unused-function] select_strerror_r (char *res, char *) The diagnostic macro DIAGNOSTIC_IGNORE_UNUSED_FUNCTION seems to expand correctly to its respective pragma, but this doesn't seem to have an effect on the warning. I tried to use the pragma explicitly and got the same result. ATTRIBUTE_UNUSED works fine in this case if you put it in both functions, which should fix warnings for both gdb and gdbserver builds. The compiler version is gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609. This is likely the result of PR64079 in GCC, which was fixed by commit 9e96f1e1b9731c4e1ef4fbbbf0997319973f0537. To prevent other developers from attempting to use this macro, only to get confused by it not working as expected, it seems better to not define this particular macro. gdb/ChangeLog: 2019-12-12 Luis Machado <luis.mach...@linaro.org> * gdbsupport/safe-strerror.c: Don't include diagnostics.h. (select_strerror_r): Use ATTRIBUTE_UNUSED instead of the diagnostics macros. include/ChangeLog: 2019-12-12 Luis Machado <luis.mach...@linaro.org> * diagnostics.h (DIAGNOSTIC_IGNORE_UNUSED_FUNCTION). Remove definitions. Change-Id: Iad6123d61d76d111e3ef8d24aa8c60112304c749 --- gdb/ChangeLog | 6 ++++++ gdb/gdbsupport/safe-strerror.c | 12 ++---------- include/ChangeLog | 5 +++++ include/diagnostics.h | 9 --------- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/gdb/gdbsupport/safe-strerror.c b/gdb/gdbsupport/safe-strerror.c index 9973fa6785..a5ddf74835 100644 --- a/gdb/gdbsupport/safe-strerror.c +++ b/gdb/gdbsupport/safe-strerror.c @@ -18,7 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "common-defs.h" -#include "diagnostics.h" #include <string.h> /* There are two different versions of strerror_r; one is GNU-specific, the @@ -27,27 +26,20 @@ to solve this for us because IPA does not use Gnulib but uses this function. */ -/* We only ever use one of the two overloads, so suppress the warning for - an unused function. */ -DIAGNOSTIC_PUSH -DIAGNOSTIC_IGNORE_UNUSED_FUNCTION - /* Called if we have a XSI-compliant strerror_r. */ -static char * +ATTRIBUTE_UNUSED static char * select_strerror_r (int res, char *buf) { return res == 0 ? buf : nullptr; } /* Called if we have a GNU strerror_r. */ -static char * +ATTRIBUTE_UNUSED static char * select_strerror_r (char *res, char *) { return res; } -DIAGNOSTIC_POP - /* Implementation of safe_strerror as defined in common-utils.h. */ const char * diff --git a/include/diagnostics.h b/include/diagnostics.h index 2adaa4d3a0..019ade2567 100644 --- a/include/diagnostics.h +++ b/include/diagnostics.h @@ -53,8 +53,6 @@ DIAGNOSTIC_IGNORE ("-Wdeprecated-declarations") # define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER \ DIAGNOSTIC_IGNORE ("-Wdeprecated-register") -# define DIAGNOSTIC_IGNORE_UNUSED_FUNCTION \ - DIAGNOSTIC_IGNORE ("-Wunused-function") # if __has_warning ("-Wenum-compare-switch") # define DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES \ DIAGNOSTIC_IGNORE ("-Wenum-compare-switch") @@ -65,9 +63,6 @@ #elif defined (__GNUC__) /* GCC */ -# define DIAGNOSTIC_IGNORE_UNUSED_FUNCTION \ - DIAGNOSTIC_IGNORE ("-Wunused-function") - # define DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION \ DIAGNOSTIC_IGNORE ("-Wstringop-truncation") @@ -88,10 +83,6 @@ # define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER #endif -#ifndef DIAGNOSTIC_IGNORE_UNUSED_FUNCTION -# define DIAGNOSTIC_IGNORE_UNUSED_FUNCTION -#endif - #ifndef DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES # define DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES #endif ++++++ gdb-gcore-bash.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:59.112357092 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:59.112357092 +0200 @@ -6,5 +6,5 @@ -#!/usr/bin/env bash +#!/bin/bash - # Copyright (C) 2003-2019 Free Software Foundation, Inc. + # Copyright (C) 2003-2020 Free Software Foundation, Inc. ++++++ gdb-gnat-dwarf-crash-3of3.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:59.132357102 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:59.132357102 +0200 @@ -42,7 +42,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -10588,6 +10588,13 @@ private: +@@ -10657,6 +10657,13 @@ private: static void process_die (struct die_info *die, struct dwarf2_cu *cu) { @@ -59,8 +59,8 @@ diff --git a/gdb/infrun.c b/gdb/infrun.c --- a/gdb/infrun.c +++ b/gdb/infrun.c -@@ -609,6 +609,13 @@ holding the child stopped. Try \"set detach-on-fork\" or \ - target_pid_to_str (process_ptid)); +@@ -601,6 +601,13 @@ holding the child stopped. Try \"set detach-on-fork\" or \ + target_pid_to_str (process_ptid).c_str ()); } +#ifdef NEED_DETACH_SIGSTOP @@ -76,7 +76,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c -@@ -192,6 +192,12 @@ struct linux_nat_target *linux_target; +@@ -189,6 +189,12 @@ struct linux_nat_target *linux_target; /* Does the current host support PTRACE_GETREGSET? */ enum tribool have_ptrace_getregset = TRIBOOL_UNKNOWN; @@ -89,7 +89,7 @@ static unsigned int debug_linux_nat; static void show_debug_linux_nat (struct ui_file *file, int from_tty, -@@ -1037,6 +1043,9 @@ linux_nat_post_attach_wait (ptid_t ptid, int *signalled) +@@ -1030,6 +1036,9 @@ linux_nat_post_attach_wait (ptid_t ptid, int *signalled) if (debug_linux_nat) fprintf_unfiltered (gdb_stdlog, "LNPAW: Attaching to a stopped process\n"); @@ -99,7 +99,7 @@ /* The process is definitely stopped. It is in a job control stop, unless the kernel predates the TASK_STOPPED / -@@ -1369,6 +1378,25 @@ get_detach_signal (struct lwp_info *lp) +@@ -1361,6 +1370,25 @@ get_detach_signal (struct lwp_info *lp) return gdb_signal_to_host (signo); } @@ -125,7 +125,7 @@ return 0; } -@@ -1517,6 +1545,10 @@ linux_nat_target::detach (inferior *inf, int from_tty) +@@ -1509,6 +1537,10 @@ linux_nat_target::detach (inferior *inf, int from_tty) detach_one_lwp (main_lwp, &signo); detach_success (inf); @@ -136,7 +136,7 @@ } } -@@ -1775,6 +1807,16 @@ linux_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo) +@@ -1766,6 +1798,16 @@ linux_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo) return; } @@ -151,9 +151,9 @@ + +#endif if (resume_many) - iterate_over_lwps (ptid, linux_nat_resume_callback, lp); - -@@ -3763,6 +3805,10 @@ linux_nat_target::mourn_inferior () + iterate_over_lwps (ptid, [=] (struct lwp_info *info) + { +@@ -3770,6 +3812,10 @@ linux_nat_target::mourn_inferior () /* Let the arch-specific native code know this process is gone. */ linux_target->low_forget_process (pid); ++++++ gdb-jit-reader-multilib.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:59.164357119 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:59.164357119 +0200 @@ -9,7 +9,7 @@ diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -9705,10 +9705,12 @@ _ACEOF +@@ -9694,10 +9694,12 @@ _ACEOF @@ -28,7 +28,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -820,10 +820,12 @@ AC_CHECK_SIZEOF(unsigned long long) +@@ -808,10 +808,12 @@ AC_CHECK_SIZEOF(unsigned long long) AC_CHECK_SIZEOF(unsigned long) AC_CHECK_SIZEOF(unsigned __int128) ++++++ gdb-linux_perf-bundle.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:59.180357127 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:59.184357129 +0200 @@ -9,7 +9,7 @@ diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -12137,7 +12137,7 @@ else +@@ -11905,7 +11905,7 @@ else #include <linux/perf_event.h> #ifndef PERF_ATTR_SIZE_VER5 @@ -21,7 +21,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -1500,7 +1500,7 @@ else +@@ -1414,7 +1414,7 @@ else AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ #include <linux/perf_event.h> #ifndef PERF_ATTR_SIZE_VER5 @@ -56,7 +56,7 @@ 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 @@ +@@ -27,6 +27,177 @@ # include <linux/perf_event.h> #endif ++++++ gdb-moribund-utrace-workaround.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:59.196357135 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:59.196357135 +0200 @@ -14,7 +14,7 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -11929,6 +11929,8 @@ update_global_location_list (enum ugll_insert_mode insert_mode) +@@ -11904,6 +11904,8 @@ update_global_location_list (enum ugll_insert_mode insert_mode) traps we can no longer explain. */ old_loc->events_till_retirement = 3 * (thread_count () + 1); ++++++ gdb-rhbz1818011-bfd-gcc10-error.patch ++++++ >From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 From: Kevin Buettner <kev...@redhat.com> Date: Wed, 6 May 2020 10:02:22 -0700 Subject: gdb-rhbz1818011-bfd-gcc10-error.patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ;; Fix int conversion error from bfd/elf.c when compiling with gcc 10 Original commit message from H.J. Lu <hjl.to...@gmail.com> is below: bfd: Change num_group to unsigned int elf.c failed with to with GCC 10 as of commit 906b3eb9df6c577d3f6e9c3ea5c9d7e4d1e90536 Author: Martin Liska <mli...@suse.cz> Date: Tue Mar 24 11:40:10 2020 +0100 Improve endianess detection. PR lto/94249 * plugin-api.h: Add more robust endianess detection. binutils-gdb/bfd/elf.c: In function ‘setup_group’: binutils-gdb/bfd/elf.c:740:35: error: overflow in conversion from ‘unsigned int’ to ‘int’ changes value from ‘num_group = 4294967295’ to ‘-1’ [-Werror=overflow] 740 | elf_tdata (abfd)->num_group = num_group = -1; | ^~~~~~~~~ cc1: all warnings being treated as errors make[2]: *** [Makefile:1608: elf.lo] Error 1 Change num_group in elf_obj_tdata to unsigned int to compile with GCC 10. PR binutils/25717 * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int. diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1937,7 +1937,7 @@ struct elf_obj_tdata struct sdt_note *sdt_note_head; Elf_Internal_Shdr **group_sect_ptr; - int num_group; + unsigned int num_group; /* Index into group_sect_ptr, updated by setup_group when finding a section's group. Used to optimize subsequent group searches. */ ++++++ gdb-runtest-pie-override.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:59.304357191 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:59.304357191 +0200 @@ -25,7 +25,7 @@ diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp --- a/gdb/testsuite/lib/future.exp +++ b/gdb/testsuite/lib/future.exp -@@ -185,6 +185,10 @@ proc gdb_default_target_compile {source destfile type options} { +@@ -195,6 +195,10 @@ proc gdb_default_target_compile {source destfile type options} { set ldflags "" set dest [target_info name] @@ -36,7 +36,7 @@ if {[info exists CFLAGS_FOR_TARGET]} { append add_flags " $CFLAGS_FOR_TARGET" } -@@ -519,10 +523,6 @@ proc gdb_default_target_compile {source destfile type options} { +@@ -529,10 +533,6 @@ proc gdb_default_target_compile {source destfile type options} { } } ++++++ gdb-threads-fix-hang-in-stop_all_threads-after-killing-inferior.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:59.348357213 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:59.348357213 +0200 @@ -1,113 +1,8 @@ -[gdb/threads] Fix hang in stop_all_threads after killing inferior - -Consider a two-threaded testcase a.out, sleeping in both its threads: -... -$ gdb -ex r --args a.out -Reading symbols from a.out... -Starting program: /data/gdb_versions/devel/a.out -[Thread debugging using libthread_db enabled] -Using host libthread_db library "/lib64/libthread_db.so.1". -[New Thread 0x7ffff77fe700 (LWP 31268)] -... - -Typing ^C causes stop_all_threads to be executed, and if an external SIGKILL -(such as caused by killall -9 a.out) arrives at the start of stop_all_threads, -gdb hangs in stop_all_threads after giving this warning: -... -warning: unable to open /proc file '/proc/24938/status' -... - -Using "set debug infrun 1" we can see in more detail where we hang: -... -infrun: stop_all_threads -infrun: stop_all_threads, pass=0, iterations=0 -infrun: Thread 0x7ffff7fa6740 (LWP 10264) not executing -infrun: Thread 0x7ffff77fe700 (LWP 10268) executing, need stop -infrun: target_wait (-1.0.0, status) = -infrun: 10264.10268.0 [Thread 0x7ffff77fe700 (LWP 10268)], -infrun: status->kind = signalled, signal = GDB_SIGNAL_KILL -infrun: stop_all_threads status->kind = signalled, signal = GDB_SIGNAL_KILL \ - Thread 0x7ffff77fe700 (LWP 10268) -infrun: Thread 0x7ffff7fa6740 (LWP 10264) not executing -infrun: Thread 0x7ffff77fe700 (LWP 10268) executing, already stopping -warning: unable to open /proc file '/proc/10264/status' -infrun: target_wait (-1.0.0, status) = -infrun: -1.0.0 [process -1], -infrun: status->kind = no-resumed -infrun: infrun_async(0) -infrun: stop_all_threads status->kind = no-resumed process -1 -infrun: Thread 0x7ffff7fa6740 (LWP 10264) not executing -infrun: Thread 0x7ffff77fe700 (LWP 10268) executing, already stopping -infrun: stop_all_threads status->kind = no-resumed process -1 -infrun: Thread 0x7ffff7fa6740 (LWP 10264) not executing -infrun: Thread 0x7ffff77fe700 (LWP 10268) executing, already stopping -infrun: stop_all_threads status->kind = no-resumed process -1 -infrun: Thread 0x7ffff7fa6740 (LWP 10264) not executing -infrun: Thread 0x7ffff77fe700 (LWP 10268) executing, already stopping -<repeat> -...... - -So, we're hanging in the 'while (1)' loop in stop_all_threads as follows: -- thread t is tested, and both t->executing and t->stop_requested are found - to be 1 (noted with 'executing, already stopping') -- consequently need_wait is set 1 -- consequently wait_one is executed -- wait_one returns a TARGET_WAITKIND_NO_RESUMED event, which is handled by - continuing at the start of the loop - -The loop actually starts with update_thread_list (), but that doesn't seem -to change the state of the threads. - -Fix the hang by: -- detecting the first sign of trouble: the TARGET_WAITKIND_SIGNALLED event - with signal GDB_SIGNAL_KILL, -- making that event pending again, -- making sure the corresponding thread will not set need_wait again - (by setting t->executing == 0) -- making sure that the corresponding thread keeps t->resumed == 1 in the - the all_non_exited_threads loop - -This results in the ^C being handled without showing the user that the -test-case was killed: -... -^C -Thread 1 received signal SIGINT, Interrupt. -0x00007ffff78c50f0 in nanosleep () from /lib64/libc.so.6 -(gdb) -... - -But a subsequent continue does show that: -... -(gdb) c -Continuing. - -Program terminated with signal SIGKILL, Killed. -The program no longer exists. -(gdb) -.... - -Build and reg-tested on x86_64-linux. - -gdb/ChangeLog: - -2020-01-29 Tom de Vries <tdevr...@suse.de> - - PR threads/25478 - * infrun.c (stop_all_threads): Detecting event - TARGET_WAITKIND_SIGNALLED with signal GDB_SIGNAL_KILL, make event - pending again, set t->executing to 0 and keep t->resumed set to 1. - -Change-Id: Ibe1f29251fe2ff1c1991f041babbe18373c113b1 - ---- - gdb/infrun.c | 17 +++++++++++++++-- - 1 file changed, 15 insertions(+), 2 deletions(-) - -diff --git a/gdb/infrun.c b/gdb/infrun.c -index 9d20036fcf..16e9e136c0 100644 ---- a/gdb/infrun.c -+++ b/gdb/infrun.c -@@ -4344,7 +4344,12 @@ stop_all_threads (void) +Index: gdb-9.1/gdb/infrun.c +=================================================================== +--- gdb-9.1.orig/gdb/infrun.c ++++ gdb-9.1/gdb/infrun.c +@@ -4354,7 +4354,12 @@ stop_all_threads (void) /* The thread may be not executing, but still be resumed with a pending status to process. */ @@ -121,11 +16,14 @@ } } -@@ -4359,7 +4364,15 @@ stop_all_threads (void) - - event_ptid = wait_one (&ws); +@@ -4376,10 +4381,18 @@ stop_all_threads (void) + target_pid_to_str (event_ptid).c_str ()); + } -- if (ws.kind == TARGET_WAITKIND_NO_RESUMED) +- if (ws.kind == TARGET_WAITKIND_NO_RESUMED +- || ws.kind == TARGET_WAITKIND_THREAD_EXITED +- || ws.kind == TARGET_WAITKIND_EXITED +- || ws.kind == TARGET_WAITKIND_SIGNALLED) + if (ws.kind == TARGET_WAITKIND_SIGNALLED + && ws.value.sig == GDB_SIGNAL_KILL) + { @@ -134,7 +32,10 @@ + t->resumed = 1; + t->executing = 0; + } -+ else if (ws.kind == TARGET_WAITKIND_NO_RESUMED) ++ else if (ws.kind == TARGET_WAITKIND_NO_RESUMED ++ || ws.kind == TARGET_WAITKIND_THREAD_EXITED ++ || ws.kind == TARGET_WAITKIND_EXITED ++ || ws.kind == TARGET_WAITKIND_SIGNALLED) { - /* All resumed threads exited. */ - } + /* All resumed threads exited + or one thread/process exited/signalled. */ ++++++ gdb-vla-intel-fix-print-char-array.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:59.360357219 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:59.364357222 +0200 @@ -22,7 +22,7 @@ diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c -@@ -313,8 +313,22 @@ f_val_print (struct type *type, LONGEST embedded_offset, +@@ -319,8 +319,22 @@ f_val_print (struct type *type, int embedded_offset, original_value, &opts, 0, stream); } else ++++++ gdb-vla-intel-fortran-strides.patch ++++++ ++++ 698 lines (skipped) ++++ between /work/SRC/openSUSE:Factory/gdb/gdb-vla-intel-fortran-strides.patch ++++ and /work/SRC/openSUSE:Factory/.gdb.new.3399/gdb-vla-intel-fortran-strides.patch ++++++ gdb-vla-intel-fortran-vla-strings.patch ++++++ ++++ 1234 lines (skipped) ++++ between /work/SRC/openSUSE:Factory/gdb/gdb-vla-intel-fortran-vla-strings.patch ++++ and /work/SRC/openSUSE:Factory/.gdb.new.3399/gdb-vla-intel-fortran-vla-strings.patch ++++++ gdb-vla-intel-stringbt-fix.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:59.396357238 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:59.396357238 +0200 @@ -30,15 +30,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c -@@ -42,6 +42,7 @@ - #include <algorithm> - #include <vector> - #include <unordered_set> -+#include <functional> - #include "common/underlying.h" - #include "common/byte-vector.h" - -@@ -2158,6 +2159,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, +@@ -2154,6 +2154,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, ctx.per_cu = per_cu; ctx.obj_address = 0; ++++++ gdb-vla-intel-tests.patch ++++++ --- /var/tmp/diff_new_pack.9Tv8Wq/_old 2020-08-14 09:31:59.404357242 +0200 +++ /var/tmp/diff_new_pack.9Tv8Wq/_new 2020-08-14 09:31:59.408357244 +0200 @@ -5,6 +5,25 @@ ;;=fedoratest +diff --git a/gdb/testsuite/gdb.fortran/ptr-indentation.exp b/gdb/testsuite/gdb.fortran/ptr-indentation.exp +--- a/gdb/testsuite/gdb.fortran/ptr-indentation.exp ++++ b/gdb/testsuite/gdb.fortran/ptr-indentation.exp +@@ -37,5 +37,5 @@ gdb_continue_to_breakpoint "BP1" + gdb_test "ptype tinsta" \ + [multi_line "type = Type tuserdef" \ + " $int :: i" \ +- " PTR TO -> \\( $real :: ptr \\)" \ ++ " PTR TO -> \\( $real :: ptr\\)" \ + "End Type tuserdef"] +diff --git a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp +--- a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp ++++ b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp +@@ -42,4 +42,4 @@ gdb_test "ptype say_numbers" \ + "type = void \\(integer\\(kind=4\\), integer\\(kind=4\\), integer\\(kind=4\\)\\)" + + gdb_test "ptype fun_ptr" \ +- "type = PTR TO -> \\( integer\\(kind=4\\) \\(\\) \\(REF TO -> \\( integer\\(kind=4\\) \\)\\) \\)" ++ "type = PTR TO -> \\( integer\\(kind=4\\) \\(\\) \\(REF TO -> \\( integer\\(kind=4\\)\\)\\)\\)" diff --git a/gdb/testsuite/gdb.fortran/vla-func.exp b/gdb/testsuite/gdb.fortran/vla-func.exp new file mode 100644 --- /dev/null @@ -42,7 +61,7 @@ +gdb_continue_to_breakpoint "func1-vla-passed" +gdb_test "print vla" " = \\( *\\( *22, *22, *22,\[()22, .\]*\\)" \ + "print vla (func1)" -+gdb_test "ptype vla" "type = integer\\\(kind=4\\\) \\\(10,10\\\)" \ ++gdb_test "ptype vla" "type = integer\\\(kind=4\\\), allocatable \\\(10,10\\\)" \ + "ptype vla (func1)" + +gdb_breakpoint [gdb_get_line_number "func1-vla-modified"] @@ -69,7 +88,7 @@ +gdb_continue_to_breakpoint "func2-returned" +gdb_test "print vla3" " = \\\(1, 2, 44, 4, 44, 44, 44, 8, 44, 44\\\)" \ + "print vla3 (after func2)" -+gdb_test "ptype vla3" "type = integer\\\(kind=4\\\) \\\(10\\\)" \ ++gdb_test "ptype vla3" "type = integer\\\(kind=4\\\), allocatable \\\(10\\\)" \ + "ptype vla3 (after func2)" diff --git a/gdb/testsuite/gdb.fortran/vla-func.f90 b/gdb/testsuite/gdb.fortran/vla-func.f90 new file mode 100644 @@ -147,6 +166,16 @@ + + ret = .TRUE. ! func2-returned +end program vla_func +diff --git a/gdb/testsuite/gdb.fortran/vla-ptr-info.exp b/gdb/testsuite/gdb.fortran/vla-ptr-info.exp +--- a/gdb/testsuite/gdb.fortran/vla-ptr-info.exp ++++ b/gdb/testsuite/gdb.fortran/vla-ptr-info.exp +@@ -28,5 +28,5 @@ if ![runto_main] { + # Check the status of a pointer to a dynamic array. + gdb_breakpoint [gdb_get_line_number "pvla-associated"] + gdb_continue_to_breakpoint "pvla-associated" +-gdb_test "print &pvla" " = \\(PTR TO -> \\( real\\(kind=4\\) \\(10,10,10\\) \\)\\) ${hex}" \ ++gdb_test "print &pvla" " = \\(PTR TO -> \\( real\\(kind=4\\) \\(10,10,10\\)\\)\\) ${hex}" \ + "print pvla pointer information" diff --git a/gdb/testsuite/gdb.fortran/vla-stringsold.exp b/gdb/testsuite/gdb.fortran/vla-stringsold.exp new file mode 100644 --- /dev/null @@ -185,11 +214,11 @@ +gdb_breakpoint [gdb_get_line_number "var_char-allocated-1"] +gdb_continue_to_breakpoint "var_char-allocated-1" +gdb_test "print var_char" \ -+ " = \\(PTR TO -> \\( character\\*10 \\)\\) ${hex}" \ ++ " = \\(PTR TO -> \\( character\\*10\\)\\) ${hex}" \ + "print var_char after allocated first time" -+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*10 \\)" \ ++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*10\\)" \ + "whatis var_char first time" -+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*10 \\)" \ ++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*10\\)" \ + "ptype var_char first time" +gdb_test "next" "\\d+.*var_char = 'foo'.*" \ + "next to allocation status of var_char" @@ -198,13 +227,13 @@ +gdb_breakpoint [gdb_get_line_number "var_char-filled-1"] +gdb_continue_to_breakpoint "var_char-filled-1" +gdb_test "print var_char" \ -+ " = \\(PTR TO -> \\( character\\*3 \\)\\) ${hex}" \ ++ " = \\(PTR TO -> \\( character\\*3\\)\\) ${hex}" \ + "print var_char after filled first time" +gdb_test "print *var_char" " = 'foo'" \ + "print *var_char after filled first time" -+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*3 \\)" \ ++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*3\\)" \ + "whatis var_char after filled first time" -+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*3 \\)" \ ++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*3\\)" \ + "ptype var_char after filled first time" +gdb_test "print var_char(1)" " = 102 'f'" "print var_char(1)" +gdb_test "print var_char(3)" " = 111 'o'" "print var_char(3)" @@ -212,46 +241,46 @@ +gdb_breakpoint [gdb_get_line_number "var_char-filled-2"] +gdb_continue_to_breakpoint "var_char-filled-2" +gdb_test "print var_char" \ -+ " = \\(PTR TO -> \\( character\\*6 \\)\\) ${hex}" \ ++ " = \\(PTR TO -> \\( character\\*6\\)\\) ${hex}" \ + "print var_char after allocated second time" +gdb_test "print *var_char" " = 'foobar'" \ + "print *var_char after allocated second time" -+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*6 \\)" \ ++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*6\\)" \ + "whatis var_char second time" -+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*6 \\)" \ ++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*6\\)" \ + "ptype var_char second time" + +gdb_breakpoint [gdb_get_line_number "var_char-empty"] +gdb_continue_to_breakpoint "var_char-empty" +gdb_test "print var_char" \ -+ " = \\(PTR TO -> \\( character\\*0 \\)\\) ${hex}" \ ++ " = \\(PTR TO -> \\( character\\*0\\)\\) ${hex}" \ + "print var_char after set empty" +gdb_test "print *var_char" " = \"\"" "print *var_char after set empty" -+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*0 \\)" \ ++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*0\\)" \ + "whatis var_char after set empty" -+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*0 \\)" \ ++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*0\\)" \ + "ptype var_char after set empty" + +gdb_breakpoint [gdb_get_line_number "var_char-allocated-3"] +gdb_continue_to_breakpoint "var_char-allocated-3" +gdb_test "print var_char" \ -+ " = \\(PTR TO -> \\( character\\*21 \\)\\) ${hex}" \ ++ " = \\(PTR TO -> \\( character\\*21\\)\\) ${hex}" \ + "print var_char after allocated third time" -+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*21 \\)" \ ++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*21\\)" \ + "whatis var_char after allocated third time" -+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*21 \\)" \ ++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*21\\)" \ + "ptype var_char after allocated third time" + +gdb_breakpoint [gdb_get_line_number "var_char_p-associated"] +gdb_continue_to_breakpoint "var_char_p-associated" +gdb_test "print var_char_p" \ -+ " = \\(PTR TO -> \\( character\\*7 \\)\\) ${hex}" \ ++ " = \\(PTR TO -> \\( character\\*7\\)\\) ${hex}" \ + "print var_char_p after associated" +gdb_test "print *var_char_p" " = 'johndoe'" \ + "print *var_char_ after associated" -+gdb_test "whatis var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \ ++gdb_test "whatis var_char_p" "type = PTR TO -> \\( character\\*7\\)" \ + "whatis var_char_p after associated" -+gdb_test "ptype var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \ ++gdb_test "ptype var_char_p" "type = PTR TO -> \\( character\\*7\\)" \ + "ptype var_char_p after associated" diff --git a/gdb/testsuite/gdb.fortran/vla-stringsold.f90 b/gdb/testsuite/gdb.fortran/vla-stringsold.f90 new file mode 100644 @@ -298,3 +327,21 @@ + var_char_p => null() + l = associated(var_char_p) ! var_char_p-not-associated +end program vla_strings +diff --git a/gdb/testsuite/gdb.fortran/whatis_type.exp b/gdb/testsuite/gdb.fortran/whatis_type.exp +--- a/gdb/testsuite/gdb.fortran/whatis_type.exp ++++ b/gdb/testsuite/gdb.fortran/whatis_type.exp +@@ -44,7 +44,7 @@ gdb_test "whatis t2" "type = Type t2" + gdb_test "whatis t2v" "type = Type t2" + gdb_test "whatis t3" "type = Type t3" + gdb_test "whatis t3v" "type = Type t3" +-gdb_test "whatis t3p" "type = PTR TO -> \\( Type t3 \\)" ++gdb_test "whatis t3p" "type = PTR TO -> \\( Type t3\\)" + + gdb_test "ptype t1" \ + [multi_line "type = Type t1" \ +@@ -73,4 +73,4 @@ gdb_test "ptype t3p" \ + [multi_line "type = PTR TO -> \\( Type t3" \ + " $int :: t3_i" \ + " Type t2 :: t2_n" \ +- "End Type t3 \\)"] ++ "End Type t3\\)"] ++++++ gdbserver-fix-build-with-make-3.81.patch ++++++ [gdbserver] Fix build with make 3.81 --- gdb/gdbserver/Makefile.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index 16a9f2fd38..687bee2658 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -580,9 +580,22 @@ ax.o: ax.c $(COMPILE) $(WARN_CFLAGS_NO_FORMAT) $< $(POSTCOMPILE) +ifeq ($(WORKAROUND_ALLOC_IPA),) +ifeq ($(MAKE_VERSION),3.81) +WORKAROUND_ALLOC_IPA = 1 +else +WORKAROUND_ALLOC_IPA = 0 +endif +endif + +ifeq ($(WORKAROUND_ALLOC_IPA),0) alloc-ipa.o: ../alloc.c $(IPAGENT_COMPILE) $(WARN_CFLAGS_NO_FORMAT) $< $(POSTCOMPILE) +else +alloc-ipa.o: ../alloc.c + @$(MAKE) $(FLAGS_TO_PASS) WORKAROUND_ALLOC_IPA=0 alloc-ipa.o +endif # Rules for objects that go in the in-process agent.