From 389676c4ef5ee1a7c7bf5806e182a8a74cb6cd4b4cb6637dfd63f7d2c4726559 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Thu, 23 Jul 2020 12:21:48 +0000 Subject: [PATCH] Accepting request 822281 from home:tomdevries:branches:gdb-upgrade - 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 - Fix patch context: * gdb-fix-the-thread-pool.c-compilation.patch - Fix build error due to missing DIAGNOSTIC_IGNORE_UNUSED_FUNCTION. * gdb-fix-the-thread-pool.c-compilation.patch - Drop ChangeLog part of patch: * gdb-fix-unused-function-error.patch - Fix Werror=unused-function with gcc 4.8 (for Leap 42.3). * gdb-fix-unused-function-error.patch - Require %{suse_version} >= 1500 for --with-system-readline. - 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 OBS-URL: https://build.opensuse.org/request/show/822281 OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=251 --- gdb-0001-remove-alloca-0-calls.patch | 57 - gdb-6.3-gstack-20050411.patch | 6 +- gdb-6.3-rh-testversion-20041202.patch | 26 - ...337-resolve-tls-without-debuginfo-v2.patch | 4 +- gdb-6.5-bz216711-clone-is-outermost.patch | 304 -- ...379-solib-trampoline-lookup-lock-fix.patch | 6 +- gdb-6.6-buildid-locate-core-as-arg.patch | 64 +- ...warning-missing-debuginfo-rhbz981154.patch | 129 - ...buildid-locate-rpm-librpm-workaround.patch | 2 +- gdb-6.6-buildid-locate-rpm-scl.patch | 21 +- gdb-6.6-buildid-locate-rpm-suse.patch | 47 +- gdb-6.6-buildid-locate-rpm.patch | 116 +- ...6.6-buildid-locate-solib-missing-ids.patch | 4 +- gdb-6.6-buildid-locate.patch | 329 +- ....6-scheduler_locking-step-is-default.patch | 78 - gdb-6.8-bz436037-reg-no-longer-active.patch | 37 - gdb-6.8-quit-never-aborts.patch | 14 +- gdb-8.3.1.tar.bz2 | 3 - gdb-9.1.tar.bz2 | 3 + gdb-arch13-1.diff | 238 -- gdb-arch13-2.diff | 50 - gdb-arch13-3.diff | 40 - gdb-archer-pie-addons-keep-disabled.patch | 23 +- gdb-archer-pie-addons.patch | 14 +- gdb-archer-vla-tests.patch | 12 +- gdb-archer.patch | 423 +- gdb-attach-fail-reasons-5of5.patch | 31 +- gdb-btrobust.patch | 6 +- gdb-bz1219747-attach-kills.patch | 2 +- gdb-bz533176-fortran-omp-step.patch | 8 +- gdb-bz541866-rwatch-before-run.patch | 175 - gdb-bz568248-oom-is-error.patch | 71 - gdb-container-rh-pkg.patch | 2 +- gdb-core-open-vdso-warning.patch | 2 +- ...r-reject-sections-with-invalid-sizes.patch | 123 - gdb-fedora-libncursesw.patch | 12 +- gdb-fix-debug-agent-odr-bool-int.patch | 19 + ...ap-use-after-free-in-typename-concat.patch | 314 -- ...-in-python-lib-gdb-command-prompt.py.patch | 32 - ...x-python3.9-related-runtime-problems.patch | 216 ++ gdb-fix-range-loop-index-in-find_method.patch | 29 +- gdb-fix-riscv-tdep.patch | 30 - gdb-fix-s390-build.diff | 76 - gdb-fix-the-thread-pool.c-compilation.patch | 65 + ...evel-types-with-fdebug-types-section.patch | 65 +- gdb-fix-unused-function-error.patch | 123 + gdb-follow-child-stale-parent.patch | 36 - gdb-gcore-bash.patch | 2 +- gdb-gnat-dwarf-crash-3of3.patch | 22 +- gdb-jit-reader-multilib.patch | 4 +- gdb-libexec-add-index.patch | 23 - gdb-linux_perf-bundle.patch | 6 +- gdb-moribund-utrace-workaround.patch | 2 +- ...t-for-breakpoint-commands-in-mi-mode.patch | 178 - gdb-readline62-ask-more-rh.patch | 25 - gdb-rhbz1371380-gcore-elf-headers.patch | 461 --- ...warning-loadable-section-outside-elf.patch | 84 - ...704406-disable-style-log-output-1of3.patch | 88 - ...704406-disable-style-log-output-2of3.patch | 194 - ...704406-disable-style-log-output-3of3.patch | 30 - ...1708192-parse_macro_definition-crash.patch | 69 - ...1723564-gdb-crash-PYTHONMALLOC-debug.patch | 110 - ...h => gdb-rhbz1818011-bfd-gcc10-error.patch | 19 +- gdb-rhbz795424-bitpos-20of25.patch | 3435 ----------------- gdb-rhbz795424-bitpos-21of25.patch | 181 - gdb-rhbz795424-bitpos-22of25.patch | 558 --- gdb-rhbz795424-bitpos-23of25.patch | 1248 ------ gdb-rhbz795424-bitpos-25of25-test.patch | 638 --- gdb-rhbz795424-bitpos-25of25.patch | 140 - gdb-rhbz795424-bitpos-arrayview.patch | 60 - gdb-rhbz795424-bitpos-lazyvalue.patch | 432 --- gdb-runtest-pie-override.patch | 4 +- gdb-s390-handle-arch13.diff | 168 - gdb-symtab-prefer-var-def-over-decl.patch | 232 -- ...estsuite-8.3-kfail-xfail-unsupported.patch | 948 ----- ...l-prompt-read-in-multidictionary.exp.patch | 59 - gdb-testsuite-i386-pkru-exp.patch | 47 - gdb-testsuite-pie-no-pie.patch | 397 -- gdb-testsuite-read1-fixes.patch | 312 -- gdb-testsuite-readline63-sigint.patch | 46 - ...p_all_threads-after-killing-inferior.patch | 135 +- gdb-vla-intel-fix-print-char-array.patch | 2 +- gdb-vla-intel-fortran-strides.patch | 449 +-- gdb-vla-intel-fortran-vla-strings.patch | 861 ++--- gdb-vla-intel-stringbt-fix.patch | 10 +- gdb-vla-intel-tests.patch | 87 +- gdb.changes | 101 + gdb.spec | 277 +- gdbserver-fix-build-with-make-3.81.patch | 33 + 89 files changed, 1595 insertions(+), 14069 deletions(-) delete mode 100644 gdb-0001-remove-alloca-0-calls.patch delete mode 100644 gdb-6.3-rh-testversion-20041202.patch delete mode 100644 gdb-6.5-bz216711-clone-is-outermost.patch delete mode 100644 gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch delete mode 100644 gdb-6.6-scheduler_locking-step-is-default.patch delete mode 100644 gdb-6.8-bz436037-reg-no-longer-active.patch delete mode 100644 gdb-8.3.1.tar.bz2 create mode 100644 gdb-9.1.tar.bz2 delete mode 100644 gdb-arch13-1.diff delete mode 100644 gdb-arch13-2.diff delete mode 100644 gdb-arch13-3.diff delete mode 100644 gdb-bz541866-rwatch-before-run.patch delete mode 100644 gdb-bz568248-oom-is-error.patch delete mode 100644 gdb-dwarf-reader-reject-sections-with-invalid-sizes.patch create mode 100644 gdb-fix-debug-agent-odr-bool-int.patch delete mode 100644 gdb-fix-heap-use-after-free-in-typename-concat.patch delete mode 100644 gdb-fix-incorrect-use-of-is-operator-for-comparison-in-python-lib-gdb-command-prompt.py.patch create mode 100644 gdb-fix-python3.9-related-runtime-problems.patch delete mode 100644 gdb-fix-riscv-tdep.patch delete mode 100644 gdb-fix-s390-build.diff create mode 100644 gdb-fix-the-thread-pool.c-compilation.patch create mode 100644 gdb-fix-unused-function-error.patch delete mode 100644 gdb-follow-child-stale-parent.patch delete mode 100644 gdb-libexec-add-index.patch delete mode 100644 gdb-only-force-interp_console-ui_out-for-breakpoint-commands-in-mi-mode.patch delete mode 100644 gdb-readline62-ask-more-rh.patch delete mode 100644 gdb-rhbz1371380-gcore-elf-headers.patch delete mode 100644 gdb-rhbz1553086-binutils-warning-loadable-section-outside-elf.patch delete mode 100644 gdb-rhbz1704406-disable-style-log-output-1of3.patch delete mode 100644 gdb-rhbz1704406-disable-style-log-output-2of3.patch delete mode 100644 gdb-rhbz1704406-disable-style-log-output-3of3.patch delete mode 100644 gdb-rhbz1708192-parse_macro_definition-crash.patch delete mode 100644 gdb-rhbz1723564-gdb-crash-PYTHONMALLOC-debug.patch rename bfd-change-num_group-to-unsigned-int.patch => gdb-rhbz1818011-bfd-gcc10-error.patch (74%) delete mode 100644 gdb-rhbz795424-bitpos-20of25.patch delete mode 100644 gdb-rhbz795424-bitpos-21of25.patch delete mode 100644 gdb-rhbz795424-bitpos-22of25.patch delete mode 100644 gdb-rhbz795424-bitpos-23of25.patch delete mode 100644 gdb-rhbz795424-bitpos-25of25-test.patch delete mode 100644 gdb-rhbz795424-bitpos-25of25.patch delete mode 100644 gdb-rhbz795424-bitpos-arrayview.patch delete mode 100644 gdb-rhbz795424-bitpos-lazyvalue.patch delete mode 100644 gdb-s390-handle-arch13.diff delete mode 100644 gdb-symtab-prefer-var-def-over-decl.patch delete mode 100644 gdb-testsuite-8.3-kfail-xfail-unsupported.patch delete mode 100644 gdb-testsuite-add-missing-initial-prompt-read-in-multidictionary.exp.patch delete mode 100644 gdb-testsuite-i386-pkru-exp.patch delete mode 100644 gdb-testsuite-pie-no-pie.patch delete mode 100644 gdb-testsuite-read1-fixes.patch delete mode 100644 gdb-testsuite-readline63-sigint.patch create mode 100644 gdbserver-fix-build-with-make-3.81.patch diff --git a/gdb-0001-remove-alloca-0-calls.patch b/gdb-0001-remove-alloca-0-calls.patch deleted file mode 100644 index 3d729be..0000000 --- a/gdb-0001-remove-alloca-0-calls.patch +++ /dev/null @@ -1,57 +0,0 @@ -Remove alloca(0) calls - -PR gdb/24653 points out that a gcc snapshot will complain about the -calls to alloca(0) in gdb. - -These calls are only needed when using the C alloca. I'm inclined to -think that no current platform needs this, so this patch removes the -calls. - -Let me know what you think. - -gdb/ChangeLog -2019-06-14 Tom Tromey - - PR gdb/24653: - * regcache.c (registers_changed): Don't call alloca. - * top.c (execute_command): Don't call alloca. - ---- - gdb/ChangeLog | 6 ++++++ - gdb/regcache.c | 7 ------- - gdb/top.c | 4 ---- - 3 files changed, 6 insertions(+), 11 deletions(-) - -diff --git a/gdb/regcache.c b/gdb/regcache.c -index 6e3eee96631..323f0f5ab4e 100644 ---- a/gdb/regcache.c -+++ b/gdb/regcache.c -@@ -454,13 +454,6 @@ void - registers_changed (void) - { - registers_changed_ptid (minus_one_ptid); -- -- /* Force cleanup of any alloca areas if using C alloca instead of -- a builtin alloca. This particular call is used to clean up -- areas allocated by low level target code which may build up -- during lengthy interactions between gdb and the target before -- gdb gives control to the user (ie watchpoints). */ -- alloca (0); - } - - void -diff --git a/gdb/top.c b/gdb/top.c -index b46de90f755..857207c3767 100644 ---- a/gdb/top.c -+++ b/gdb/top.c -@@ -560,10 +560,6 @@ execute_command (const char *p, int from_tty) - auto cleanup_if_error = make_scope_exit (bpstat_clear_actions); - scoped_value_mark cleanup = prepare_execute_command (); - -- /* Force cleanup of any alloca areas if using C alloca instead of -- a builtin alloca. */ -- alloca (0); -- - /* This can happen when command_line_input hits end of file. */ - if (p == NULL) - { diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch index 8ea4203..778b4ed 100644 --- a/gdb-6.3-gstack-20050411.patch +++ b/gdb-6.3-gstack-20050411.patch @@ -16,7 +16,7 @@ Subject: gdb-6.3-gstack-20050411.patch diff --git a/gdb/Makefile.in b/gdb/Makefile.in --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -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 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e "$$t"` ; \ if test "x$$transformed_name" = x; then \ -@@ -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 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e $$t` ; \ if test "x$$transformed_name" = x; then \ -@@ -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 diff --git a/gdb-6.3-rh-testversion-20041202.patch b/gdb-6.3-rh-testversion-20041202.patch deleted file mode 100644 index 3cbc571..0000000 --- a/gdb-6.3-rh-testversion-20041202.patch +++ /dev/null @@ -1,26 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Elena Zannoni -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.3-rh-testversion-20041202.patch - -;; Match the Fedora's version info. -;;=fedora - -2003-02-24 Elena Zannoni - - * gdb.gdb/selftest.exp: Add matching on specific Red Hat only version - string. - -diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp ---- a/gdb/testsuite/gdb.gdb/selftest.exp -+++ b/gdb/testsuite/gdb.gdb/selftest.exp -@@ -53,6 +53,9 @@ proc test_with_self { } { - -re ".\[0-9\]+ = +.+ +0x.*\[0-9.\]+.*$gdb_prompt $" { - pass "printed version with cast" - } -+ -re ".\[0-9\]+ = .(Fedora|Red Hat Enterprise Linux) \[\\(\\)0-9.a-z\\-\]+.*$gdb_prompt $" { -+ pass "printed version Fedora or Red Hat Enterprise Linux only" -+ } - } - - # start the "xgdb" process diff --git a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch index 43bdbbe..ba0fd06 100644 --- a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +++ b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch @@ -44,9 +44,9 @@ glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug: 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. */ diff --git a/gdb-6.5-bz216711-clone-is-outermost.patch b/gdb-6.5-bz216711-clone-is-outermost.patch deleted file mode 100644 index 1f0ac9b..0000000 --- a/gdb-6.5-bz216711-clone-is-outermost.patch +++ /dev/null @@ -1,304 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.5-bz216711-clone-is-outermost.patch - -;; Fix bogus 0x0 unwind of the thread's topmost function clone(3) (BZ 216711). -;;=fedora - -https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216711 - -FIXME: This workaround should be dropped and -glibc/sysdeps/unix/sysv/linux/x86_64/clone.S should get CFI for the child -instead. - -2006-12-17 Jan Kratochvil - - * gdb/amd64-linux-tdep.c (linux_clone_code): New variable. - (LINUX_CLONE_LEN): New definition. - (amd64_linux_clone_running, amd64_linux_outermost_frame): New function. - (amd64_linux_init_abi): Initialize `outermost_frame_p'. - * gdb/i386-tdep.c (i386_gdbarch_init): Likewise. - * gdb/i386-tdep.h (gdbarch_tdep): Add `outermost_frame_p' member. - * gdb/amd64-tdep.c (amd64_frame_this_id): Call `outermost_frame_p'. - -2006-12-17 Jan Kratochvil - - * gdb.threads/bt-clone-stop.exp, gdb.threads/bt-clone-stop.c: - New file. - -2007-10-16 Jan Kratochvil - - Port to GDB-6.7. - -diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c ---- a/gdb/amd64-linux-tdep.c -+++ b/gdb/amd64-linux-tdep.c -@@ -291,6 +291,80 @@ amd64_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - - /* Set the program counter for process PTID to PC. */ - -+/* Detect the outermost frame; during unwind of -+ #5 0x000000305cec68c3 in clone () from /lib64/tls/libc.so.6 -+ avoid the additional bogus frame -+ #6 0x0000000000000000 in ?? -+ We compare if the `linux_clone_code' block is _before_ unwound PC. */ -+ -+static const unsigned char linux_clone_code[] = -+{ -+/* libc/sysdeps/unix/sysv/linux/x86_64/clone.S */ -+/* #ifdef RESET_PID */ -+/* ... */ -+/* mov $SYS_ify(getpid), %eax */ -+/* 0xb8, 0x27, 0x00, 0x00, 0x00 */ -+/* OR */ -+/* mov $SYS_ify(getpid), %rax */ -+/* 0x48, 0xc7, 0xc0, 0x27, 0x00, 0x00, 0x00 */ -+/* so just: */ -+ 0x27, 0x00, 0x00, 0x00, -+/* syscall */ -+ 0x0f, 0x05, -+/* movl %eax, %fs:PID */ -+ 0x64, 0x89, 0x04, 0x25, 0x94, 0x00, 0x00, 0x00, -+/* movl %eax, %fs:TID */ -+ 0x64, 0x89, 0x04, 0x25, 0x90, 0x00, 0x00, 0x00, -+/* #endif */ -+/* |* Set up arguments for the function call. *| */ -+/* popq %rax |* Function to call. *| */ -+ 0x58, -+/* popq %rdi |* Argument. *| */ -+ 0x5f, -+/* call *%rax$ */ -+ 0xff, 0xd0 -+}; -+ -+#define LINUX_CLONE_LEN (sizeof linux_clone_code) -+ -+static int -+amd64_linux_clone_running (struct frame_info *this_frame) -+{ -+ CORE_ADDR pc = get_frame_pc (this_frame); -+ unsigned char buf[LINUX_CLONE_LEN]; -+ -+ if (!safe_frame_unwind_memory (this_frame, pc - LINUX_CLONE_LEN, buf, -+ LINUX_CLONE_LEN)) -+ return 0; -+ -+ if (memcmp (buf, linux_clone_code, LINUX_CLONE_LEN) != 0) -+ return 0; -+ -+ return 1; -+} -+ -+static int -+amd64_linux_outermost_frame (struct frame_info *this_frame) -+{ -+ CORE_ADDR pc = get_frame_pc (this_frame); -+ const char *name; -+ -+ find_pc_partial_function (pc, &name, NULL, NULL); -+ -+ /* If we have NAME, we can optimize the search. -+ `clone' NAME still needs to have the code checked as its name may be -+ present in the user code. -+ `__clone' NAME should not be present in the user code but in the initial -+ parts of the `__clone' implementation the unwind still makes sense. -+ More detailed unwinding decision would be too much sensitive to possible -+ subtle changes in specific glibc revisions. */ -+ if (name == NULL || strcmp (name, "clone") == 0 -+ || strcmp ("__clone", name) == 0) -+ return (amd64_linux_clone_running (this_frame) != 0); -+ -+ return 0; -+} -+ - static void - amd64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc) - { -@@ -1808,6 +1882,8 @@ amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch) - - tdep->xsave_xcr0_offset = I386_LINUX_XSAVE_XCR0_OFFSET; - -+ tdep->outermost_frame_p = amd64_linux_outermost_frame; -+ - /* Add the %orig_rax register used for syscall restarting. */ - set_gdbarch_write_pc (gdbarch, amd64_linux_write_pc); - -diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c ---- a/gdb/amd64-tdep.c -+++ b/gdb/amd64-tdep.c -@@ -2601,6 +2601,7 @@ amd64_frame_unwind_stop_reason (struct frame_info *this_frame, - { - struct amd64_frame_cache *cache = - amd64_frame_cache (this_frame, this_cache); -+ struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (this_frame)); - - if (!cache->base_p) - return UNWIND_UNAVAILABLE; -@@ -2609,6 +2610,10 @@ amd64_frame_unwind_stop_reason (struct frame_info *this_frame, - if (cache->base == 0) - return UNWIND_OUTERMOST; - -+ /* Detect OS dependent outermost frames; such as `clone'. */ -+ if (tdep->outermost_frame_p && tdep->outermost_frame_p (this_frame)) -+ return UNWIND_OUTERMOST; -+ - return UNWIND_NO_REASON; - } - -@@ -2743,6 +2748,7 @@ amd64_sigtramp_frame_this_id (struct frame_info *this_frame, - { - struct amd64_frame_cache *cache = - amd64_sigtramp_frame_cache (this_frame, this_cache); -+ struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (this_frame)); - - if (!cache->base_p) - (*this_id) = frame_id_build_unavailable_stack (get_frame_pc (this_frame)); -@@ -2751,6 +2757,11 @@ amd64_sigtramp_frame_this_id (struct frame_info *this_frame, - /* This marks the outermost frame. */ - return; - } -+ else if (tdep->outermost_frame_p && tdep->outermost_frame_p (this_frame)) -+ { -+ /* Detect OS dependent outermost frames; such as `clone'. */ -+ return; -+ } - else - (*this_id) = frame_id_build (cache->base + 16, get_frame_pc (this_frame)); - } -diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c ---- a/gdb/i386-tdep.c -+++ b/gdb/i386-tdep.c -@@ -8407,6 +8407,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) - - tdep->xsave_xcr0_offset = -1; - -+ /* Unwinding stops on i386 automatically. */ -+ tdep->outermost_frame_p = NULL; -+ - tdep->record_regmap = i386_record_regmap; - - set_gdbarch_type_align (gdbarch, i386_type_align); -diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h ---- a/gdb/i386-tdep.h -+++ b/gdb/i386-tdep.h -@@ -251,6 +251,9 @@ struct gdbarch_tdep - - /* Regsets. */ - const struct regset *fpregset; -+ -+ /* Detect OS dependent outermost frames; such as `clone'. */ -+ int (*outermost_frame_p) (struct frame_info *this_frame); - }; - - /* Floating-point registers. */ -diff --git a/gdb/testsuite/gdb.threads/bt-clone-stop.c b/gdb/testsuite/gdb.threads/bt-clone-stop.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.threads/bt-clone-stop.c -@@ -0,0 +1,39 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2006 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -+ MA 02110-1301, USA. */ -+ -+ -+#include -+#include -+#include -+ -+ -+void *threader (void *arg) -+{ -+ assert (0); -+ return NULL; -+} -+ -+int main (void) -+{ -+ pthread_t t1; -+ -+ pthread_create (&t1, NULL, threader, (void *) NULL); -+ for (;;) -+ pause(); -+} -diff --git a/gdb/testsuite/gdb.threads/bt-clone-stop.exp b/gdb/testsuite/gdb.threads/bt-clone-stop.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.threads/bt-clone-stop.exp -@@ -0,0 +1,61 @@ -+# Copyright 2006 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ -+# Backtraced `clone' must not have `PC == 0' as its previous frame. -+ -+if $tracelevel then { -+ strace $tracelevel -+} -+ -+set testfile bt-clone-stop -+set srcfile ${testfile}.c -+set binfile [standard_output_file ${testfile}] -+if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+# Get things started. -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+# threader: threader.c:8: threader: Assertion `0' failed. -+# Program received signal SIGABRT, Aborted. -+ -+gdb_test "run" \ -+ {Thread 2 "bt-clone-stop" received signal SIGABRT.*} \ -+ "run" -+ -+# Former gdb unwind (the first function is `clone'): -+# #5 0x0000003421ecd62d in ?? () from /lib64/libc.so.6 -+# #6 0x0000000000000000 in ?? () -+# (gdb) -+# Tested `amd64_linux_outermost_frame' functionality should omit the line `#6'. -+# -+# Two `-re' cases below must be in this order (1st is a subset of the 2nd one). -+# Unhandled case below should not happen and it is fortunately handled by -+# `amd64_linux_outermost_frame' as FAIL (and result `0x0 entry output invalid'). -+gdb_test_multiple "bt" "0x0 entry output invalid" { -+ -re "in threader \\(.*\n#\[0-9\]* *0x0* in .*$gdb_prompt $" { -+ fail "0x0 entry found" -+ } -+ -re "in threader \\(.*$gdb_prompt $" { -+ pass "0x0 entry not found" -+ } -+} diff --git a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch index ca418c4..9d066e5 100644 --- a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch +++ b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch @@ -11,8 +11,8 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379 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 @@ diff --git a/gdb/symtab.c b/gdb/symtab.c + 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); diff --git a/gdb-6.6-buildid-locate-core-as-arg.patch b/gdb-6.6-buildid-locate-core-as-arg.patch index e8f31a3..07327ce 100644 --- a/gdb-6.6-buildid-locate-core-as-arg.patch +++ b/gdb-6.6-buildid-locate-core-as-arg.patch @@ -61,31 +61,19 @@ Http://sourceware.org/ml/gdb-patches/2010-01/msg00517.html * exec.c (exec_file_attach): Print a more useful error message if the user did "gdb core". -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 . */ - #include - #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 @@ diff --git a/gdb/exec.c b/gdb/exec.c + + 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 @@ diff --git a/gdb/main.c b/gdb/main.c +{ + 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 @@ diff --git a/gdb/main.c b/gdb/main.c + 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 @@ diff --git a/gdb/main.c b/gdb/main.c 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) { diff --git a/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch b/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch deleted file mode 100644 index ce4409b..0000000 --- a/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch +++ /dev/null @@ -1,129 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: - gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch - -;; Fix 'gdb gives highly misleading error when debuginfo pkg is present, -;; but not corresponding binary pkg' (RH BZ 981154). -;;=push+jan - -Comments by Sergio Durigan Junior : - - This is the fix for RH BZ #981154 - - It is mainly a testcase addition, but a minor fix in the gdb/build-id.c - file was also needed. - - gdb/build-id.c was added by: - - commit dc294be54c96414035eed7d53dafdea0a6f31a72 - Author: Tom Tromey - Date: Tue Oct 8 19:56:15 2013 +0000 - - and had a little thinko there. The variable 'filename' needs to be set to - NULL after it is free'd, otherwise the code below thinks that it is still - valid and doesn't print the necessary warning ("Try: yum install ..."). - -diff --git a/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp -@@ -0,0 +1,97 @@ -+# Copyright (C) 2014 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+standard_testfile "normal.c" -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { -+ return -1 -+} -+ -+# Get the build-id of the file -+set build_id_debug_file [build_id_debug_filename_get $binfile] -+regsub -all ".debug$" $build_id_debug_file "" build_id_without_debug -+ -+# Run to main -+if { ![runto_main] } { -+ return -1 -+} -+ -+# We first need to generate a corefile -+set escapedfilename [string_to_regexp [standard_output_file gcore.test]] -+set core_supported 0 -+gdb_test_multiple "gcore [standard_output_file gcore.test]" \ -+ "save a corefile" \ -+{ -+ -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" { -+ pass "save a corefile" -+ global core_supported -+ set core_supported 1 -+ } -+ -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" { -+ unsupported "save a corefile" -+ global core_supported -+ set core_supported 0 -+ } -+} -+ -+if {!$core_supported} { -+ return -1 -+} -+ -+# Move the binfile to a temporary name -+remote_exec build "mv $binfile ${binfile}.old" -+ -+# Reinitialize GDB and see if we get a yum/dnf warning -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+ -+with_test_prefix "first run:" { -+ gdb_test "set build-id-verbose 1" "" \ -+ "set build-id-verbose" -+ -+ gdb_test "set debug-file-directory [file dirname [standard_output_file gcore.test]]" "" \ -+ "set debug-file-directory" -+ -+ gdb_test "core-file [standard_output_file gcore.test]" \ -+ "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install [standard_output_file $build_id_without_debug]\r\n.*" \ -+ "test first yum/dnf warning" -+} -+ -+# Now we define and create our .build-id -+file mkdir [file dirname [standard_output_file ${build_id_without_debug}]] -+# Cannot use "file link" (from TCL) because it requires the target file to -+# exist. -+remote_exec build "ln -s $binfile [standard_output_file ${build_id_without_debug}]" -+ -+# Reinitialize GDB to get the second yum/dnf warning -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+ -+with_test_prefix "second run:" { -+ gdb_test "set build-id-verbose 1" "" \ -+ "set build-id-verbose" -+ -+ gdb_test "set debug-file-directory [file dirname [standard_output_file gcore.test]]" "" \ -+ "set debug-file-directory" -+ -+ gdb_test "core-file [standard_output_file gcore.test]" \ -+ "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install $binfile\r\n.*" \ -+ "test second yum/dnf warning" -+} -+ -+# Leaving the link there will cause breakage in the next run. -+remote_exec build "rm -f [standard_output_file ${build_id_without_debug}]" diff --git a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch index 22c29eb..dd669af 100644 --- a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +++ b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch @@ -9,7 +9,7 @@ Subject: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch 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 #endif diff --git a/gdb-6.6-buildid-locate-rpm-scl.patch b/gdb-6.6-buildid-locate-rpm-scl.patch index 806849a..cc6b9ba 100644 --- a/gdb-6.6-buildid-locate-rpm-scl.patch +++ b/gdb-6.6-buildid-locate-rpm-scl.patch @@ -12,7 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=953585 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 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c { 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 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c { 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 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c 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 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c +{ + 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 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c 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; diff --git a/gdb-6.6-buildid-locate-rpm-suse.patch b/gdb-6.6-buildid-locate-rpm-suse.patch index b92b444..84c02f7 100644 --- a/gdb-6.6-buildid-locate-rpm-suse.patch +++ b/gdb-6.6-buildid-locate-rpm-suse.patch @@ -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 @@ Index: gdb-7.12.1/gdb/build-id.c &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 @@ Index: gdb-7.12.1/gdb/build-id.c /* 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 @@ Index: gdb-7.12.1/gdb/build-id.c -#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 @@ Index: gdb-7.12.1/gdb/build-id.c } } -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); diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch index 388b345..2bef433 100644 --- a/gdb-6.6-buildid-locate-rpm.patch +++ b/gdb-6.6-buildid-locate-rpm.patch @@ -235,16 +235,15 @@ diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4 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 -+#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 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + 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 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c +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 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); + -+ qsort (array, missing_rpm_list_entries, sizeof (*array), -+ (int (*) (const void *, const void *)) missing_rpm_list_compar); ++ std::sort (array.begin (), array.end (), missing_rpm_list_compar); ++ ++ /* We zero out the number of missing RPMs here because of a nasty ++ bug (see RHBZ 1801974). ++ ++ When we call 'puts_unfiltered' below, if pagination is on and if ++ the number of missing RPMs is big enough to trigger pagination, ++ we will end up in an infinite recursion. The call chain looks ++ like this: ++ ++ missing_rpm_list_print -> puts_unfiltered -> fputs_maybe_filtered ++ -> prompt_for_continue -> display_gdb_prompt -> ++ debug_flush_missing -> missing_rpm_list_print ... ++ ++ For this reason, we make sure MISSING_RPM_LIST_ENTRIES is zero ++ *before* calling any print function. */ ++ 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 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + missing_rpm_list = list_iter->next; + xfree (list_iter); + } -+ missing_rpm_list_entries = 0; -+ -+ do_cleanups (cleanups); +} + +static void @@ -612,7 +619,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c 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 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c 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 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c +#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/build-id.c b/gdb/build-id.c 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 @@ diff --git a/gdb/config.in b/gdb/config.in /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS -@@ -261,6 +264,9 @@ - /* 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/config.in b/gdb/config.in 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 @@ diff --git a/gdb/configure b/gdb/configure 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 @@ diff --git a/gdb/configure b/gdb/configure 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 @@ diff --git a/gdb/configure b/gdb/configure 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 @@ diff --git a/gdb/configure b/gdb/configure --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 @@ diff --git a/gdb/configure b/gdb/configure 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 b/gdb/configure 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 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac 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 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c /* 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 &&rl) +@@ -772,7 +775,10 @@ command_line_handler (gdb::unique_xmalloc_ptr &&rl) command_handler (cmd); if (ui->prompt_state != PROMPTED) @@ -1503,7 +1497,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c diff --git a/gdb/symfile.h b/gdb/symfile.h --- a/gdb/symfile.h +++ b/gdb/symfile.h -@@ -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); diff --git a/gdb-6.6-buildid-locate-solib-missing-ids.patch b/gdb-6.6-buildid-locate-solib-missing-ids.patch index 4eebbd1..7a346e3 100644 --- a/gdb-6.6-buildid-locate-solib-missing-ids.patch +++ b/gdb-6.6-buildid-locate-solib-missing-ids.patch @@ -14,7 +14,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1339862 diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c -@@ -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 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c 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 diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index 599fbad..5744c67 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -6,22 +6,50 @@ Subject: gdb-6.6-buildid-locate.patch ;; New locating of the matching binaries from the pure core file (build-id). ;;=push+jan +diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h +--- a/bfd/libbfd-in.h ++++ b/bfd/libbfd-in.h +@@ -127,7 +127,7 @@ static inline char * + bfd_strdup (const char *str) + { + size_t len = strlen (str) + 1; +- char *buf = bfd_malloc (len); ++ char *buf = (char *) bfd_malloc (len); + if (buf != NULL) + memcpy (buf, str, len); + return buf; +diff --git a/bfd/libbfd.h b/bfd/libbfd.h +--- a/bfd/libbfd.h ++++ b/bfd/libbfd.h +@@ -132,7 +132,7 @@ static inline char * + bfd_strdup (const char *str) + { + size_t len = strlen (str) + 1; +- char *buf = bfd_malloc (len); ++ char *buf = (char *) bfd_malloc (len); + if (buf != NULL) + memcpy (buf, str, len); + return buf; diff --git a/gdb/build-id.c b/gdb/build-id.c --- a/gdb/build-id.c +++ b/gdb/build-id.c -@@ -26,11 +26,67 @@ +@@ -24,13 +24,71 @@ + #include "gdbsupport/gdb_vecs.h" + #include "symfile.h" #include "objfiles.h" - #include "filenames.h" - #include "gdbcore.h" -+#include "libbfd.h" -+#include "gdbcore.h" -+#include "gdbcmd.h" -+#include "observable.h" ++#include ++#include "elf-bfd.h" ++#include "elf/common.h" +#include "elf/external.h" +#include "elf/internal.h" -+#include "elf/common.h" -+#include "elf-bfd.h" -+#include + #include "filenames.h" ++#include "gdb_bfd.h" ++#include "gdbcmd.h" + #include "gdbcore.h" ++#include "libbfd.h" ++#include "objfiles.h" ++#include "observable.h" ++#include "symfile.h" + +#define BUILD_ID_VERBOSE_NONE 0 +#define BUILD_ID_VERBOSE_FILENAMES 1 @@ -76,9 +104,9 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c -build_id_bfd_get (bfd *abfd) +build_id_bfd_shdr_get (bfd *abfd) { - if (!bfd_check_format (abfd, bfd_object)) - return NULL; -@@ -42,6 +98,348 @@ build_id_bfd_get (bfd *abfd) + if (!bfd_check_format (abfd, bfd_object) + && !bfd_check_format (abfd, bfd_core)) +@@ -43,6 +101,348 @@ build_id_bfd_get (bfd *abfd) return NULL; } @@ -367,7 +395,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + +static void build_id_addr_candidate (bfd *abfd, asection *sect, void *obj) +{ -+ if (build_id_addr >= bfd_section_vma (abfd, sect)) ++ if (build_id_addr >= bfd_section_vma (sect)) + { + struct build_id_addr_sect *candidate; + @@ -402,7 +430,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + candidate = candidate->next) + { + i_phdr = elf_get_phdr (core_bfd, -+ bfd_section_vma (core_bfd, candidate->sect), ++ bfd_section_vma (candidate->sect), + &e_phnum, &loadbase); + if (i_phdr != NULL) + break; @@ -427,7 +455,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c /* See build-id.h. */ int -@@ -50,7 +448,7 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) +@@ -51,7 +451,7 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) const struct bfd_build_id *found; int retval = 0; @@ -436,7 +464,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c if (found == NULL) warning (_("File \"%s\" has no build-id, file skipped"), -@@ -65,62 +463,173 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) +@@ -66,56 +466,159 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) return retval; } @@ -482,8 +510,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c -build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len, - const bfd_byte *build_id) +build_id_to_debug_bfd_1 (const std::string &orig_link, size_t build_id_len, -+ const bfd_byte *build_id, char **link_return, -+ int add_debug_suffix) ++ const bfd_byte *build_id, char **link_return) { + gdb_bfd_ref_ptr ret_bfd = {}; + std::string ret_link; @@ -524,9 +551,6 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c - { - if (separate_debug_file_debug) - printf_unfiltered (_(" no, unable to open.\n")); -+ if (add_debug_suffix) -+ link += ".debug"; -+ + ret_link = link; + + struct stat statbuf_trash; @@ -551,7 +575,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + + continue; + } -+ + +- return {}; + /* We expect to be silent on the non-existing files. */ + gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename.get (), gnutarget, -1); + @@ -570,8 +595,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + + continue; + } - -- return {}; ++ + ret_bfd = debug_bfd; + break; } @@ -583,6 +607,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c { if (separate_debug_file_debug) - printf_unfiltered (_(" no, build-id does not match.\n")); +- +- return {}; + printf_unfiltered (_(" yes!\n")); + } + else @@ -591,15 +617,11 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + always the non-.%u-suffixed file. */ + std::string link0 = orig_link; + -+ if (add_debug_suffix) -+ link0 += ".debug"; -+ + /* If the symlink has target request to install the target. + BASE-debuginfo.rpm contains the symlink but BASE.rpm may be missing. + https://bugzilla.redhat.com/show_bug.cgi?id=981154 */ + std::string link0_resolved (link_resolve (link0.c_str (), 0)); - -- return {}; ++ + if (link_all.empty ()) + link_all = link0_resolved; + else @@ -628,16 +650,17 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + return ret_bfd; } - /* See build-id.h. */ + /* Common code for finding BFDs of a given build-id. This function +@@ -124,7 +627,7 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len, - gdb_bfd_ref_ptr --build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id) -+build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id, -+ char **link_return, int add_debug_suffix) + static gdb_bfd_ref_ptr + build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, +- const char *suffix) ++ const char *suffix, char **link_return) { /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will cause "/.build-id/..." lookups. */ -@@ -143,16 +652,16 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id) +@@ -147,16 +650,17 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, if (size > 0) { size--; @@ -650,26 +673,25 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c while (size-- > 0) string_appendf (link, "%02x", (unsigned) *data++); -- link += ".debug"; -- + link += suffix; + gdb_bfd_ref_ptr debug_bfd - = build_id_to_debug_bfd_1 (link, build_id_len, build_id); -+ = build_id_to_debug_bfd_1 (link, build_id_len, build_id, -+ link_return, add_debug_suffix); ++ = build_id_to_debug_bfd_1 (link, build_id_len, build_id, link_return); if (debug_bfd != NULL) return debug_bfd; -@@ -166,7 +675,8 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id) +@@ -170,7 +674,8 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, if (strcmp (gdb_sysroot, TARGET_SYSROOT_PREFIX) != 0) { link = gdb_sysroot + link; - debug_bfd = build_id_to_debug_bfd_1 (link, build_id_len, build_id); + debug_bfd = build_id_to_debug_bfd_1 (link, build_id_len, build_id, -+ link_return, add_debug_suffix); ++ link_return); if (debug_bfd != NULL) return debug_bfd; } -@@ -175,22 +685,190 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id) +@@ -179,38 +684,208 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, return {}; } @@ -679,12 +701,11 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + gdb_bfd_ref_ptr abfd; + char *result; + -+ abfd = build_id_to_debug_bfd (build_id->size, build_id->data, link_return, 0); ++ abfd = build_id_to_exec_bfd (build_id->size, build_id->data, link_return); + if (abfd == NULL) + return NULL; + -+ result = xstrdup (bfd_get_filename (abfd)); -+ abfd.release (); ++ result = xstrdup (bfd_get_filename (abfd.get ())); + return result; +} + @@ -826,6 +847,29 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + /* See build-id.h. */ + gdb_bfd_ref_ptr +-build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id) ++build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id, ++ char **link_return) + { +- return build_id_to_bfd_suffix (build_id_len, build_id, ".debug"); ++ return build_id_to_bfd_suffix (build_id_len, build_id, ".debug", ++ link_return); + } + + /* See build-id.h. */ + + gdb_bfd_ref_ptr +-build_id_to_exec_bfd (size_t build_id_len, const bfd_byte *build_id) ++build_id_to_exec_bfd (size_t build_id_len, const bfd_byte *build_id, ++ char **link_return) + { +- return build_id_to_bfd_suffix (build_id_len, build_id, ""); ++ return build_id_to_bfd_suffix (build_id_len, build_id, "", link_return); + } + + /* See build-id.h. */ + std::string -find_separate_debug_file_by_buildid (struct objfile *objfile) +find_separate_debug_file_by_buildid (struct objfile *objfile, @@ -848,7 +892,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c gdb_bfd_ref_ptr abfd (build_id_to_debug_bfd (build_id->size, - build_id->data)); + build_id->data, -+ (!build_id_filename_return ? NULL : &build_id_filename_cstr), 1)); ++ (!build_id_filename_return ? NULL : &build_id_filename_cstr))); + if (build_id_filename_return) + { + if (!build_id_filename_cstr) @@ -863,7 +907,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c /* Prevent looping on a stripped .debug file. */ if (abfd != NULL && filename_cmp (bfd_get_filename (abfd.get ()), -@@ -203,3 +881,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile) +@@ -223,3 +898,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile) return std::string (); } @@ -890,7 +934,7 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h +++ b/gdb/build-id.h @@ -23,9 +23,10 @@ #include "gdb_bfd.h" - #include "common/rsp-low.h" + #include "gdbsupport/rsp-low.h" -/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */ +/* Separate debuginfo files have corrupted PHDR but SHDR is correct there. @@ -901,18 +945,26 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h /* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value. Otherwise, issue a warning and return false. */ -@@ -39,14 +40,19 @@ extern int build_id_verify (bfd *abfd, - the caller. */ +@@ -38,21 +39,26 @@ extern int build_id_verify (bfd *abfd, + can be found, return NULL. */ extern gdb_bfd_ref_ptr build_id_to_debug_bfd (size_t build_id_len, - const bfd_byte *build_id); + const bfd_byte *build_id, -+ char **link_return, -+ int add_debug_suffix); ++ char **link_return); + +extern char *build_id_to_filename (const struct bfd_build_id *build_id, + char **link_return); + /* Find and open a BFD for an executable file given a build-id. If no BFD + can be found, return NULL. The returned reference to the BFD must be + released by the caller. */ + + extern gdb_bfd_ref_ptr build_id_to_exec_bfd (size_t build_id_len, +- const bfd_byte *build_id); ++ const bfd_byte *build_id, ++ char **link_return); + /* Find the separate debug file for OBJFILE, by using the build-id associated with OBJFILE's BFD. If successful, returns the file name for the separate debug file, otherwise, return an empty string. */ @@ -927,7 +979,7 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h diff --git a/gdb/coffread.c b/gdb/coffread.c --- a/gdb/coffread.c +++ b/gdb/coffread.c -@@ -732,7 +732,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) +@@ -709,7 +709,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) /* Try to add separate debug file if no symbols table found. */ if (!objfile_has_partial_symbols (objfile)) { @@ -940,88 +992,55 @@ diff --git a/gdb/coffread.c b/gdb/coffread.c diff --git a/gdb/corelow.c b/gdb/corelow.c --- a/gdb/corelow.c +++ b/gdb/corelow.c -@@ -43,6 +43,10 @@ - #include "gdb_bfd.h" - #include "completer.h" - #include "common/filestuff.h" +@@ -22,6 +22,10 @@ + #include + #include + #include "frame.h" /* required by inferior.h */ +#include "auxv.h" ++#include "build-id.h" +#include "elf/common.h" +#include "gdbcmd.h" -+#include "build-id.h" - - #ifndef O_LARGEFILE - #define O_LARGEFILE 0 -@@ -320,6 +324,54 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg) + #include "inferior.h" + #include "infrun.h" + #include "symtab.h" +@@ -322,6 +326,8 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg) inferior_ptid = ptid; /* Yes, make it current. */ } -+static int build_id_core_loads = 1; -+ -+static void -+build_id_locate_exec (int from_tty) -+{ -+ CORE_ADDR at_entry; -+ struct bfd_build_id *build_id; -+ char *execfilename; -+ char *build_id_filename; -+ struct cleanup *back_to; -+ -+ if (exec_bfd != NULL || symfile_objfile != NULL) -+ return; -+ -+ if (target_auxv_search (current_top_target (), AT_ENTRY, &at_entry) <= 0) -+ return; -+ -+ build_id = build_id_addr_get (at_entry); -+ if (build_id == NULL) -+ return; -+ back_to = make_cleanup (xfree, build_id); -+ -+ /* SYMFILE_OBJFILE should refer to the main executable (not only to its -+ separate debug info file). gcc44+ keeps .eh_frame only in the main -+ executable without its duplicate .debug_frame in the separate debug info -+ file - such .eh_frame would not be found if SYMFILE_OBJFILE would refer -+ directly to the separate debug info file. */ -+ -+ execfilename = build_id_to_filename (build_id, &build_id_filename); -+ make_cleanup (xfree, build_id_filename); -+ -+ if (execfilename != NULL) -+ { -+ make_cleanup (xfree, execfilename); -+ exec_file_attach (execfilename, from_tty); -+ symbol_file_add_main (execfilename, -+ symfile_add_flag (!from_tty ? 0 : SYMFILE_VERBOSE)); -+ if (symfile_objfile != NULL) -+ symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED; -+ } -+ else -+ debug_print_missing (_("the main executable file"), build_id_filename); -+ -+ do_cleanups (back_to); -+ -+ /* No automatic SOLIB_ADD as the libraries would get read twice. */ -+} ++static bool build_id_core_loads = true; + /* Issue a message saying we have no core to debug, if FROM_TTY. */ static void -@@ -455,6 +507,14 @@ core_target_open (const char *arg, int from_tty) - switch_to_thread (thread); +@@ -358,19 +364,25 @@ core_file_command (const char *filename, int from_tty) + static void + locate_exec_from_corefile_build_id (bfd *abfd, int from_tty) + { +- const bfd_build_id *build_id = build_id_bfd_get (abfd); ++ const bfd_build_id *build_id = build_id_bfd_shdr_get (abfd); + if (build_id == nullptr) + return; + ++ char *build_id_filename; + gdb_bfd_ref_ptr execbfd +- = build_id_to_exec_bfd (build_id->size, build_id->data); ++ = build_id_to_exec_bfd (build_id->size, build_id->data, ++ &build_id_filename); + + if (execbfd != nullptr) + { + exec_file_attach (bfd_get_filename (execbfd.get ()), from_tty); + symbol_file_add_main (bfd_get_filename (execbfd.get ()), + symfile_add_flag (from_tty ? SYMFILE_VERBOSE : 0)); ++ if (symfile_objfile != NULL) ++ symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED; } ++ else ++ debug_print_missing (BUILD_ID_MAIN_EXECUTABLE_FILENAME, build_id_filename); + } -+ /* Find the build_id identifiers. If it gets executed after -+ POST_CREATE_INFERIOR we would clash with asking to discard the already -+ loaded VDSO symbols. If it gets executed before bfd_map_over_sections -+ INFERIOR_PTID is still not set and libthread_db initialization crashes on -+ PID == 0 in ps_pglobal_lookup. */ -+ if (build_id_core_loads != 0) -+ build_id_locate_exec (from_tty); -+ - post_create_inferior (target, from_tty); - - /* Now go through the target stack looking for threads since there -@@ -1063,4 +1123,11 @@ void + /* See gdbcore.h. */ +@@ -998,4 +1010,11 @@ void _initialize_corelow (void) { add_target (core_target_info, core_target_open, filename_completer); @@ -1036,7 +1055,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo -@@ -19949,6 +19949,27 @@ information files. +@@ -20862,6 +20862,27 @@ information files. @end table @@ -1067,28 +1086,38 @@ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo diff --git a/gdb/dwarf-index-cache.c b/gdb/dwarf-index-cache.c --- a/gdb/dwarf-index-cache.c +++ b/gdb/dwarf-index-cache.c -@@ -93,7 +93,7 @@ index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile) - if (!enabled ()) +@@ -94,7 +94,7 @@ index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile) return; + /* Get build id of objfile. */ - const bfd_build_id *build_id = build_id_bfd_get (obj->obfd); + const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd); if (build_id == nullptr) { if (debug_index_cache) +@@ -112,7 +112,8 @@ index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile) + + if (dwz != nullptr) + { +- const bfd_build_id *dwz_build_id = build_id_bfd_get (dwz->dwz_bfd.get ()); ++ const bfd_build_id *dwz_build_id ++ = build_id_bfd_shdr_get (dwz->dwz_bfd.get ()); + + if (dwz_build_id == nullptr) + { diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -2727,7 +2727,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile) +@@ -2718,7 +2718,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile) } if (dwz_bfd == NULL) - dwz_bfd = build_id_to_debug_bfd (buildid_len, buildid); -+ dwz_bfd = build_id_to_debug_bfd (buildid_len, buildid, NULL, 1); ++ dwz_bfd = build_id_to_debug_bfd (buildid_len, buildid, NULL); if (dwz_bfd == NULL) error (_("could not find '.gnu_debugaltlink' file for %s"), -@@ -6237,7 +6237,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner) +@@ -6276,7 +6276,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner) static gdb::array_view get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj) { @@ -1097,7 +1126,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c if (build_id == nullptr) return {}; -@@ -6250,7 +6250,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj) +@@ -6289,7 +6289,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj) static gdb::array_view get_gdb_index_contents_from_cache_dwz (objfile *obj, dwz_file *dwz) { @@ -1109,7 +1138,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c diff --git a/gdb/elfread.c b/gdb/elfread.c --- a/gdb/elfread.c +++ b/gdb/elfread.c -@@ -1287,7 +1287,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) +@@ -1299,7 +1299,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) && objfile->separate_debug_objfile == NULL && objfile->separate_debug_objfile_backlink == NULL) { @@ -1120,22 +1149,26 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c if (debugfile.empty ()) debugfile = find_separate_debug_file_by_debuglink (objfile); -@@ -1299,6 +1301,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) +@@ -1311,8 +1313,12 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) symbol_file_add_separate (debug_bfd.get (), debugfile.c_str (), symfile_flags, objfile); } +- else +- has_dwarf2 = false; + /* Check if any separate debug info has been extracted out. */ + else if (bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink") + != NULL) + debug_print_missing (objfile_name (objfile), build_id_filename.get ()); ++ else ++ has_dwarf2 = false; } - } + /* Read the CTF section only if there is no DWARF info. */ diff --git a/gdb/objfiles.h b/gdb/objfiles.h --- a/gdb/objfiles.h +++ b/gdb/objfiles.h -@@ -554,6 +554,10 @@ struct objfile - htab_t static_links {}; +@@ -627,6 +627,10 @@ struct objfile + htab_up static_links; }; +/* This file was loaded according to the BUILD_ID_CORE_LOADS rules. */ @@ -1150,14 +1183,14 @@ diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c +++ b/gdb/python/py-objfile.c @@ -132,7 +132,7 @@ objfpy_get_build_id (PyObject *self, void *closure) - TRY + try { - build_id = build_id_bfd_get (objfile->obfd); + build_id = build_id_bfd_shdr_get (objfile->obfd); } - CATCH (except, RETURN_MASK_ALL) + catch (const gdb_exception &except) { -@@ -535,7 +535,7 @@ objfpy_lookup_objfile_by_build_id (const char *build_id) +@@ -600,7 +600,7 @@ objfpy_lookup_objfile_by_build_id (const char *build_id) /* Don't return separate debug files. */ if (objfile->separate_debug_objfile_backlink != NULL) continue; @@ -1177,7 +1210,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c static struct link_map_offsets *svr4_fetch_link_map_offsets (void); static int svr4_have_link_map_offsets (void); -@@ -1345,9 +1346,51 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, +@@ -1344,9 +1345,51 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, continue; } @@ -1235,10 +1268,17 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c diff --git a/gdb/symfile.h b/gdb/symfile.h --- a/gdb/symfile.h +++ b/gdb/symfile.h -@@ -531,6 +531,10 @@ void expand_symtabs_matching +@@ -532,12 +532,17 @@ void expand_symtabs_matching void map_symbol_filenames (symbol_filename_ftype *fun, void *data, int need_fullname); ++ + /* Target-agnostic function to load the sections of an executable into memory. + + ARGS should be in the form "EXECUTABLE [OFFSET]", where OFFSET is an + optional offset to apply to each section. */ + extern void generic_load (const char *args, int from_tty); + +/* build-id support. */ +extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr); +extern void debug_print_missing (const char *binary, const char *debug); @@ -1297,10 +1337,10 @@ diff --git a/gdb/testsuite/gdb.base/new-ui-pending-input.exp b/gdb/testsuite/gdb diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp -@@ -1716,6 +1716,16 @@ proc default_gdb_start { } { - warning "Couldn't set the width to 0." +@@ -1891,6 +1891,17 @@ proc default_gdb_start { } { } } + + # Turn off the missing warnings as the testsuite does not expect it. + send_gdb "set build-id-verbose 0\n" + gdb_expect 10 { @@ -1311,9 +1351,10 @@ diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp + warning "Could not disable the missing debug infos warnings.." + } + } ++ + gdb_debug_init return 0 } - diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp diff --git a/gdb-6.6-scheduler_locking-step-is-default.patch b/gdb-6.6-scheduler_locking-step-is-default.patch deleted file mode 100644 index 837c073..0000000 --- a/gdb-6.6-scheduler_locking-step-is-default.patch +++ /dev/null @@ -1,78 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.6-scheduler_locking-step-is-default.patch - -;; Make upstream `set scheduler-locking step' as default. -;;=push+jan: How much is scheduler-locking relevant after non-stop? - -diff --git a/gdb/infrun.c b/gdb/infrun.c ---- a/gdb/infrun.c -+++ b/gdb/infrun.c -@@ -2075,7 +2075,7 @@ static const char *const scheduler_enums[] = { - schedlock_replay, - NULL - }; --static const char *scheduler_mode = schedlock_replay; -+static const char *scheduler_mode = schedlock_step; - static void - show_scheduler_mode (struct ui_file *file, int from_tty, - struct cmd_list_element *c, const char *value) -diff --git a/gdb/testsuite/gdb.mi/mi-cli.exp b/gdb/testsuite/gdb.mi/mi-cli.exp ---- a/gdb/testsuite/gdb.mi/mi-cli.exp -+++ b/gdb/testsuite/gdb.mi/mi-cli.exp -@@ -199,7 +199,7 @@ mi_expect_stop "breakpoint-hit" "main" "" ".*basics.c" \ - # Test that the token is output even for CLI commands - # Also test that *stopped includes frame information. - mi_gdb_test "34 next" \ -- ".*34\\\^running.*\\*running,thread-id=\"all\"" \ -+ ".*34\\\^running.*\\*running,thread-id=\"1\"" \ - "34 next: run" - - # Test that the new current source line is output to the console -diff --git a/gdb/testsuite/gdb.mi/mi-console.exp b/gdb/testsuite/gdb.mi/mi-console.exp ---- a/gdb/testsuite/gdb.mi/mi-console.exp -+++ b/gdb/testsuite/gdb.mi/mi-console.exp -@@ -60,6 +60,9 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb - - mi_run_to_main - -+# thread-id=\"all\" vs. thread-id=\"1\" below: -+mi_gdb_test "210-gdb-set scheduler-locking off" "210\\^done" "set scheduler-locking off" -+ - # The output we get from the target depends on how it is hosted. If - # we are semihosted (e.g., the sim or a remote target that supports - # the File I/O remote protocol extension), we see the target I/O -diff --git a/gdb/testsuite/gdb.mi/mi-logging.exp b/gdb/testsuite/gdb.mi/mi-logging.exp ---- a/gdb/testsuite/gdb.mi/mi-logging.exp -+++ b/gdb/testsuite/gdb.mi/mi-logging.exp -@@ -53,7 +53,7 @@ close $chan - - set mi_log_prompt "\[(\]gdb\[)\] \[\r\n\]+" - --if [regexp "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] { -+if [regexp "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] { - pass "log file contents" - } else { - fail "log file contents" -@@ -76,7 +76,7 @@ set chan [open $milogfile] - set logcontent [read $chan] - close $chan - --if [regexp "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] { -+if [regexp "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] { - pass "redirect log file contents" - } else { - fail "redirect log file contents" -diff --git a/gdb/testsuite/gdb.opt/inline-cmds.exp b/gdb/testsuite/gdb.opt/inline-cmds.exp ---- a/gdb/testsuite/gdb.opt/inline-cmds.exp -+++ b/gdb/testsuite/gdb.opt/inline-cmds.exp -@@ -331,7 +331,7 @@ proc mi_cli_step {cli_output_re message} { - - send_gdb "interpreter-exec console \"step\"\n" - gdb_expect { -- -re "\\^running\r\n\\*running,thread-id=\"all\"\r\n${mi_gdb_prompt}${cli_output_re}" { -+ -re "\\^running\r\n\\*running,thread-id=\"1\"\r\n${mi_gdb_prompt}${cli_output_re}" { - pass $message - } - timeout { diff --git a/gdb-6.8-bz436037-reg-no-longer-active.patch b/gdb-6.8-bz436037-reg-no-longer-active.patch deleted file mode 100644 index cc97016..0000000 --- a/gdb-6.8-bz436037-reg-no-longer-active.patch +++ /dev/null @@ -1,37 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.8-bz436037-reg-no-longer-active.patch - -;; Fix register assignments with no GDB stack frames (BZ 436037). -;;=push+jan: This fix is incorrect. - -diff --git a/gdb/valops.c b/gdb/valops.c ---- a/gdb/valops.c -+++ b/gdb/valops.c -@@ -1092,6 +1092,8 @@ value_assign (struct value *toval, struct value *fromval) - struct gdbarch *gdbarch; - int value_reg; - -+ value_reg = VALUE_REGNUM (toval); -+ - /* Figure out which frame this is in currently. - - We use VALUE_FRAME_ID for obtaining the value's frame id instead of -@@ -1101,8 +1103,14 @@ value_assign (struct value *toval, struct value *fromval) - frame. */ - frame = frame_find_by_id (VALUE_FRAME_ID (toval)); - -- value_reg = VALUE_REGNUM (toval); -- -+ /* "set $reg+=1" should work on programs with no debug info, -+ but frame_find_by_id returns NULL here (RH bug 436037). -+ Use current frame, it represents CPU state in this case. -+ If frame_find_by_id is changed to do it internally -+ (it is contemplated there), remove this. */ -+ if (!frame) -+ frame = get_current_frame (); -+ /* Probably never happens. */ - if (!frame) - error (_("Value being assigned to is no longer active.")); - diff --git a/gdb-6.8-quit-never-aborts.patch b/gdb-6.8-quit-never-aborts.patch index 8137b96..1935ce7 100644 --- a/gdb-6.8-quit-never-aborts.patch +++ b/gdb-6.8-quit-never-aborts.patch @@ -30,7 +30,7 @@ diff --git a/gdb/defs.h b/gdb/defs.h 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/extension.c b/gdb/extension.c 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 @@ diff --git a/gdb/top.c b/gdb/top.c +#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 @@ diff --git a/gdb/utils.c b/gdb/utils.c +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.) */ diff --git a/gdb-8.3.1.tar.bz2 b/gdb-8.3.1.tar.bz2 deleted file mode 100644 index a37b156..0000000 --- a/gdb-8.3.1.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:05c64ab7298487fde1aac402026ef0569cf7e703054d2a42e272292a0b096fdf -size 29382553 diff --git a/gdb-9.1.tar.bz2 b/gdb-9.1.tar.bz2 new file mode 100644 index 0000000..a9845c3 --- /dev/null +++ b/gdb-9.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:75530013754ba712eda5236c4c48057f909b0ac34be63737b303c2be8ae5e7bc +size 30227990 diff --git a/gdb-arch13-1.diff b/gdb-arch13-1.diff deleted file mode 100644 index bb0613c..0000000 --- a/gdb-arch13-1.diff +++ /dev/null @@ -1,238 +0,0 @@ -commit ba354106f02e25c9adc3dc1364d6a974216ec94e -Author: Andreas Krebbel -Date: Tue Mar 12 14:09:55 2019 +0100 - - S/390: arch13: Add instruction descriptions - - opcodes/ChangeLog: - - 2019-03-12 Andreas Krebbel - - * s390-opc.txt: Add instruction descriptions. - -diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt -index be4c97d..58a2490 100644 ---- a/opcodes/s390-opc.txt -+++ b/opcodes/s390-opc.txt -@@ -1888,106 +1888,120 @@ e70000000036 vlm VRS_VVRDU "vector load multiple" arch12 zarch optparm - e7000000000e vst VRX_VRRDU "vector store" arch12 zarch optparm - e7000000003e vstm VRS_VVRDU "vector store multiple" arch12 zarch optparm - -+ - # arch13 instructions - --b9f5 ncrk RRF_R0RR2 " " arch13 zarch --b9e5 ncgrk RRF_R0RR2 " " arch13 zarch --e50a mvcrl SSE_RDRD " " arch13 zarch --b974 nnrk RRF_R0RR2 " " arch13 zarch --b964 nngrk RRF_R0RR2 " " arch13 zarch --b976 nork RRF_R0RR2 " " arch13 zarch --b966 nogrk RRF_R0RR2 " " arch13 zarch --b977 nxrk RRF_R0RR2 " " arch13 zarch --b967 nxgrk RRF_R0RR2 " " arch13 zarch --b975 ocrk RRF_R0RR2 " " arch13 zarch --b965 ocgrk RRF_R0RR2 " " arch13 zarch --b9e1 popcnt RRF_U0RR " " arch13 zarch optparm --b9f0 selr RRF_RURR " " arch13 zarch --b9f00000 selr*20 RRF_R0RR3 " " arch13 zarch --b9e3 selgr RRF_RURR " " arch13 zarch --b9e30000 selgr*20 RRF_R0RR3 " " arch13 zarch --b9c0 selhhhr RRF_RURR " " arch13 zarch --b9c00000 selhhhr*20 RRF_R0RR3 " " arch13 zarch -- --e60000000006 vlbr VRX_VRRDU " " arch13 zarch --e60000001006 vlbrh VRX_VRRD " " arch13 zarch --e60000002006 vlbrf VRX_VRRD " " arch13 zarch --e60000003006 vlbrg VRX_VRRD " " arch13 zarch --e60000004006 vlbrq VRX_VRRD " " arch13 zarch -- --e60000000007 vler VRX_VRRDU " " arch13 zarch --e60000001007 vlerh VRX_VRRD " " arch13 zarch --e60000002007 vlerf VRX_VRRD " " arch13 zarch --e60000003007 vlerg VRX_VRRD " " arch13 zarch -- --e60000000004 vllebrz VRX_VRRDU " " arch13 zarch --e60000001004 vllebrzh VRX_VRRD " " arch13 zarch --e60000002004 vllebrzf VRX_VRRD " " arch13 zarch --e60000003004 ldrv VRX_VRRD " " arch13 zarch --e60000003004 vllebrzg VRX_VRRD " " arch13 zarch --e60000006004 lerv VRX_VRRD " " arch13 zarch --e60000006004 vllebrze VRX_VRRD " " arch13 zarch -- --e60000000001 vlebrh VRX_VRRDU " " arch13 zarch --e60000000003 vlebrf VRX_VRRDU " " arch13 zarch --e60000000002 vlebrg VRX_VRRDU " " arch13 zarch -- --e60000000005 vlbrrep VRX_VRRDU " " arch13 zarch --e60000001005 vlbrreph VRX_VRRD " " arch13 zarch --e60000002005 vlbrrepf VRX_VRRD " " arch13 zarch --e60000003005 vlbrrepg VRX_VRRD " " arch13 zarch -- --e6000000000e vstbr VRX_VRRDU " " arch13 zarch --e6000000100e vstbrh VRX_VRRD " " arch13 zarch --e6000000200e vstbrf VRX_VRRD " " arch13 zarch --e6000000300e vstbrg VRX_VRRD " " arch13 zarch --e6000000400e vstbrq VRX_VRRD " " arch13 zarch -- --e6000000000f vster VRX_VRRDU " " arch13 zarch --e6000000100f vsterh VRX_VRRD " " arch13 zarch --e6000000200f vsterf VRX_VRRD " " arch13 zarch --e6000000300f vsterg VRX_VRRD " " arch13 zarch -- --e60000000009 vstebrh VRX_VRRDU " " arch13 zarch --e6000000000b vstebrf VRX_VRRDU " " arch13 zarch --e6000000000b sterv VRX_VRRD " " arch13 zarch --e6000000000a vstebrg VRX_VRRDU " " arch13 zarch --e6000000000a stdrv VRX_VRRD " " arch13 zarch -- --e70000000086 vsld VRI_VVV0U " " arch13 zarch --e70000000087 vsrd VRI_VVV0U " " arch13 zarch -- --e7000000008b vstrs VRR_VVVUU0V " " arch13 zarch optparm -- --e7000000008b vstrsb VRR_VVVU0VB " " arch13 zarch optparm --e7000100008b vstrsh VRR_VVVU0VB " " arch13 zarch optparm --e7000200008b vstrsf VRR_VVVU0VB " " arch13 zarch optparm -- --e7000020008b vstrszb VRR_VVVU0VB2 " " arch13 zarch optparm --e7000120008b vstrszh VRR_VVVU0VB2 " " arch13 zarch optparm --e7000220008b vstrszf VRR_VVVU0VB2 " " arch13 zarch optparm -- --e700000000c3 vcfps VRR_VV0UUU " " arch13 zarch --e700000020c3 vcefb VRR_VV0UU " " arch13 zarch --e700000820c3 wcefb VRR_VV0UU8 " " arch13 zarch -- --e700000000c1 vcfpl VRR_VV0UUU " " arch13 zarch --e700000020c1 vcelfb VRR_VV0UU " " arch13 zarch --e700000820c1 wcelfb VRR_VV0UU8 " " arch13 zarch -- --e700000000c2 vcsfp VRR_VV0UUU " " arch13 zarch --e700000020c2 vcfeb VRR_VV0UU " " arch13 zarch --e700000820c2 wcfeb VRR_VV0UU8 " " arch13 zarch -- --e700000000c0 vclfp VRR_VV0UUU " " arch13 zarch --e700000020c0 vclfeb VRR_VV0UU " " arch13 zarch --e700000820c0 wclfeb VRR_VV0UU8 " " arch13 zarch -- --b939 dfltcc RRF_R0RR2 " " arch13 zarch -- --b938 sortl RRE_RR " " arch13 zarch -- --e60000000050 vcvb VRR_RV0UU " " arch13 zarch optparm --e60000000052 vcvbg VRR_RV0UU " " arch13 zarch optparm -- --b93a kdsa RRE_RR " " arch13 zarch -+ -+# Miscellaneous Instruction Extensions Facility 2 -+ -+b9f5 ncrk RRF_R0RR2 "and with complement 32 bit" arch13 zarch -+b9e5 ncgrk RRF_R0RR2 "and with complement 64 bit" arch13 zarch -+e50a mvcrl SSE_RDRD "move right to left" arch13 zarch -+b974 nnrk RRF_R0RR2 "nand 32 bit" arch13 zarch -+b964 nngrk RRF_R0RR2 "nand 64 bit" arch13 zarch -+b976 nork RRF_R0RR2 "nor 32 bit" arch13 zarch -+b966 nogrk RRF_R0RR2 "nor 64 bit" arch13 zarch -+b977 nxrk RRF_R0RR2 "not exclusive or 32 bit" arch13 zarch -+b967 nxgrk RRF_R0RR2 "not exclusive or 64 bit" arch13 zarch -+b975 ocrk RRF_R0RR2 "or with complement 32 bit" arch13 zarch -+b965 ocgrk RRF_R0RR2 "or with complement 64 bit" arch13 zarch -+b9e1 popcnt RRF_U0RR "population count arch13" arch13 zarch optparm -+b9f0 selr RRF_RURR "select 32 bit" arch13 zarch -+b9f00000 selr*20 RRF_R0RR3 "select 32 bit" arch13 zarch -+b9e3 selgr RRF_RURR "select 64 bit" arch13 zarch -+b9e30000 selgr*20 RRF_R0RR3 "select 64 bit" arch13 zarch -+b9c0 selhhhr RRF_RURR "select high" arch13 zarch -+b9c00000 selhhhr*20 RRF_R0RR3 "select high" arch13 zarch -+ -+# Vector Enhancements Facility 2 -+ -+e60000000006 vlbr VRX_VRRDU "vector load byte reversed elements" arch13 zarch -+e60000001006 vlbrh VRX_VRRD "vector load byte reversed halfword elements" arch13 zarch -+e60000002006 vlbrf VRX_VRRD "vector load byte reversed word elements" arch13 zarch -+e60000003006 vlbrg VRX_VRRD "vector load byte reversed doubleword elements" arch13 zarch -+e60000004006 vlbrq VRX_VRRD "vector load byte reversed quadword elements" arch13 zarch -+ -+e60000000007 vler VRX_VRRDU "vector load elements reversed" arch13 zarch -+e60000001007 vlerh VRX_VRRD "vector load halfword elements reversed" arch13 zarch -+e60000002007 vlerf VRX_VRRD "vector load word elements reversed" arch13 zarch -+e60000003007 vlerg VRX_VRRD "vector load doubleword elements reversed" arch13 zarch -+ -+e60000000004 vllebrz VRX_VRRDU "vector load byte reversed element and zero" arch13 zarch -+e60000001004 vllebrzh VRX_VRRD "vector load byte reversed halfword element and zero" arch13 zarch -+e60000002004 vllebrzf VRX_VRRD "vector load byte reversed word element and zero" arch13 zarch -+e60000003004 ldrv VRX_VRRD "load byte reversed doubleword" arch13 zarch -+e60000003004 vllebrzg VRX_VRRD "vector load byte reversed doubleword element and zero" arch13 zarch -+e60000006004 lerv VRX_VRRD "load byte reversed word" arch13 zarch -+e60000006004 vllebrze VRX_VRRD "vector load byte reversed word element left-aligned and zero" arch13 zarch -+ -+e60000000001 vlebrh VRX_VRRDU "vector load byte reversed halfword element" arch13 zarch -+e60000000003 vlebrf VRX_VRRDU "vector load byte reversed word element" arch13 zarch -+e60000000002 vlebrg VRX_VRRDU "vector load byte reversed doubleword element" arch13 zarch -+ -+e60000000005 vlbrrep VRX_VRRDU "vector load byte reversed element and replicate" arch13 zarch -+e60000001005 vlbrreph VRX_VRRD "vector load byte reversed halfword element and replicate" arch13 zarch -+e60000002005 vlbrrepf VRX_VRRD "vector load byte reversed word element and replicate" arch13 zarch -+e60000003005 vlbrrepg VRX_VRRD "vector load byte reversed doubleword element and replicate" arch13 zarch -+ -+e6000000000e vstbr VRX_VRRDU "vector store byte reversed elements" arch13 zarch -+e6000000100e vstbrh VRX_VRRD "vector store byte reversed halfword elements" arch13 zarch -+e6000000200e vstbrf VRX_VRRD "vector store byte reversed word elements" arch13 zarch -+e6000000300e vstbrg VRX_VRRD "vector store byte reversed doubleword elements" arch13 zarch -+e6000000400e vstbrq VRX_VRRD "vector store byte reversed quadword elements" arch13 zarch -+ -+e6000000000f vster VRX_VRRDU "vector store elements reversed" arch13 zarch -+e6000000100f vsterh VRX_VRRD "vector store halfword elements reversed" arch13 zarch -+e6000000200f vsterf VRX_VRRD "vector store word elements reversed" arch13 zarch -+e6000000300f vsterg VRX_VRRD "vector store doubleword elements reversed" arch13 zarch -+ -+e60000000009 vstebrh VRX_VRRDU "vector store byte reversed halfword element" arch13 zarch -+e6000000000b vstebrf VRX_VRRDU "vector store byte reversed word element" arch13 zarch -+e6000000000b sterv VRX_VRRD "store byte reversed word" arch13 zarch -+e6000000000a vstebrg VRX_VRRDU "vector store byte reversed doubleword element" arch13 zarch -+e6000000000a stdrv VRX_VRRD "store byte reversed doubleword" arch13 zarch -+ -+e70000000086 vsld VRI_VVV0U "vector shift left double by bit" arch13 zarch -+e70000000087 vsrd VRI_VVV0U "vector shift right double by bit" arch13 zarch -+ -+e7000000008b vstrs VRR_VVVUU0V "vector string search" arch13 zarch optparm -+ -+e7000000008b vstrsb VRR_VVVU0VB "vector string search byte" arch13 zarch optparm -+e7000100008b vstrsh VRR_VVVU0VB "vector string search halfword" arch13 zarch optparm -+e7000200008b vstrsf VRR_VVVU0VB "vector string search word" arch13 zarch optparm -+ -+e7000020008b vstrszb VRR_VVVU0VB2 "vector string search byte zero" arch13 zarch optparm -+e7000120008b vstrszh VRR_VVVU0VB2 "vector string search halfword zero" arch13 zarch optparm -+e7000220008b vstrszf VRR_VVVU0VB2 "vector string search word zero" arch13 zarch optparm -+ -+e700000000c3 vcfps VRR_VV0UUU "vector fp convert from fixed" arch13 zarch -+e700000020c3 vcefb VRR_VV0UU "vector fp convert from fixed 32 bit" arch13 zarch -+e700000820c3 wcefb VRR_VV0UU8 "vector fp convert from fixed 32 bit" arch13 zarch -+ -+e700000000c1 vcfpl VRR_VV0UUU "vector fp convert from logical" arch13 zarch -+e700000020c1 vcelfb VRR_VV0UU "vector fp convert from logical 32 bit" arch13 zarch -+e700000820c1 wcelfb VRR_VV0UU8 "vector fp convert from logical 32 bit" arch13 zarch -+ -+e700000000c2 vcsfp VRR_VV0UUU "vector fp convert to fixed" arch13 zarch -+e700000020c2 vcfeb VRR_VV0UU "vector fp convert to fixed 32 bit" arch13 zarch -+e700000820c2 wcfeb VRR_VV0UU8 "vector fp convert to fixed 32 bit" arch13 zarch -+ -+e700000000c0 vclfp VRR_VV0UUU "vector fp convert to logical" arch13 zarch -+e700000020c0 vclfeb VRR_VV0UU "vector fp convert to logical 32 bit" arch13 zarch -+e700000820c0 wclfeb VRR_VV0UU8 "vector fp convert to logical 32 bit" arch13 zarch -+ -+# Deflate conversion facility -+ -+b939 dfltcc RRF_R0RR2 "deflate conversion call" arch13 zarch -+ -+# Enhanced-Sort Facility -+ -+b938 sortl RRE_RR "sort lists" arch13 zarch -+ -+# Vector packed decimal enhancement facility -+ -+e60000000050 vcvb VRR_RV0UU "vector convert to binary 32 bit" arch13 zarch optparm -+e60000000052 vcvbg VRR_RV0UU "vector convert to binary 64 bit" arch13 zarch optparm -+ -+# Message Security Assist Extension 9 -+ -+b93a kdsa RRE_RR "compute digital signature authentication" arch13 zarch diff --git a/gdb-arch13-2.diff b/gdb-arch13-2.diff deleted file mode 100644 index c7fec78..0000000 --- a/gdb-arch13-2.diff +++ /dev/null @@ -1,50 +0,0 @@ -[matz: removed hunk that are exclusive to binutils] - -commit 40f382e88d0391ffaa4098c92cbf339a7924a629 -Author: Andreas Krebbel -Date: Tue Mar 12 14:09:55 2019 +0100 - - S/390: arch13: Adjust to recent changes - - opcodes/ChangeLog: - - 2019-03-12 Andreas Krebbel - - * s390-opc.txt: Rename selhhhr to selfhr. Remove optional operand - from vstrszb, vstrszh, and vstrszf. - - gas/ChangeLog: - - 2019-03-12 Andreas Krebbel - - * testsuite/gas/s390/zarch-arch13.s: Adjust testcase to optable changes. - * testsuite/gas/s390/zarch-arch13.d: Likewise. - -diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt -index 58a2490..7569a56 100644 ---- a/opcodes/s390-opc.txt -+++ b/opcodes/s390-opc.txt -@@ -1910,8 +1910,8 @@ b9f0 selr RRF_RURR "select 32 bit" arch13 zarch - b9f00000 selr*20 RRF_R0RR3 "select 32 bit" arch13 zarch - b9e3 selgr RRF_RURR "select 64 bit" arch13 zarch - b9e30000 selgr*20 RRF_R0RR3 "select 64 bit" arch13 zarch --b9c0 selhhhr RRF_RURR "select high" arch13 zarch --b9c00000 selhhhr*20 RRF_R0RR3 "select high" arch13 zarch -+b9c0 selfhr RRF_RURR "select high" arch13 zarch -+b9c00000 selfhr*20 RRF_R0RR3 "select high" arch13 zarch - - # Vector Enhancements Facility 2 - -@@ -1969,9 +1969,9 @@ e7000000008b vstrsb VRR_VVVU0VB "vector string search byte" arch13 zarch optparm - e7000100008b vstrsh VRR_VVVU0VB "vector string search halfword" arch13 zarch optparm - e7000200008b vstrsf VRR_VVVU0VB "vector string search word" arch13 zarch optparm - --e7000020008b vstrszb VRR_VVVU0VB2 "vector string search byte zero" arch13 zarch optparm --e7000120008b vstrszh VRR_VVVU0VB2 "vector string search halfword zero" arch13 zarch optparm --e7000220008b vstrszf VRR_VVVU0VB2 "vector string search word zero" arch13 zarch optparm -+e7000020008b vstrszb VRR_VVV0V "vector string search byte zero" arch13 zarch -+e7000120008b vstrszh VRR_VVV0V "vector string search halfword zero" arch13 zarch -+e7000220008b vstrszf VRR_VVV0V "vector string search word zero" arch13 zarch - - e700000000c3 vcfps VRR_VV0UUU "vector fp convert from fixed" arch13 zarch - e700000020c3 vcefb VRR_VV0UU "vector fp convert from fixed 32 bit" arch13 zarch diff --git a/gdb-arch13-3.diff b/gdb-arch13-3.diff deleted file mode 100644 index e8a3a06..0000000 --- a/gdb-arch13-3.diff +++ /dev/null @@ -1,40 +0,0 @@ -[matz: removed hunks that are exclusive to binutils] -commit 46e292ab0af65d13675b54f808fa24e12999e405 -Author: Andreas Krebbel -Date: Tue Oct 8 11:23:57 2019 +0200 - - S/390: Add support for z15 as CPU name. - - So far z15 was identified as arch13. After the machine has been - announced we can now add the real name. - - gas/ChangeLog: - - 2019-10-08 Andreas Krebbel - - * config/tc-s390.c (s390_parse_cpu): Add z15 as alternate CPU - name. - * doc/as.texi: Add z15 to CPU string list. - * doc/c-s390.texi: Likewise. - - opcodes/ChangeLog: - - 2019-10-08 Andreas Krebbel - - * s390-mkopc.c (main): Enable z15 as CPU string in the opcode - table. - -diff --git a/opcodes/s390-mkopc.c b/opcodes/s390-mkopc.c -index 0d07678..fe21ea1 100644 ---- a/opcodes/s390-mkopc.c -+++ b/opcodes/s390-mkopc.c -@@ -377,7 +377,8 @@ main (void) - else if (strcmp (cpu_string, "z14") == 0 - || strcmp (cpu_string, "arch12") == 0) - min_cpu = S390_OPCODE_ARCH12; -- else if (strcmp (cpu_string, "arch13") == 0) -+ else if (strcmp (cpu_string, "z15") == 0 -+ || strcmp (cpu_string, "arch13") == 0) - min_cpu = S390_OPCODE_ARCH13; - else { - fprintf (stderr, "Couldn't parse cpu string %s\n", cpu_string); diff --git a/gdb-archer-pie-addons-keep-disabled.patch b/gdb-archer-pie-addons-keep-disabled.patch index a8b10f0..275b5c8 100644 --- a/gdb-archer-pie-addons-keep-disabled.patch +++ b/gdb-archer-pie-addons-keep-disabled.patch @@ -8,7 +8,7 @@ Subject: gdb-archer-pie-addons-keep-disabled.patch 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 @@ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c + } + + 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/breakpoint.h b/gdb/breakpoint.h 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 @@ diff --git a/gdb/objfiles.c b/gdb/objfiles.c /* 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: + { diff --git a/gdb-archer-pie-addons.patch b/gdb-archer-pie-addons.patch index 4f2d0a4..687331f 100644 --- a/gdb-archer-pie-addons.patch +++ b/gdb-archer-pie-addons.patch @@ -8,7 +8,7 @@ Subject: gdb-archer-pie-addons.patch 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 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h 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 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h 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 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h #define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr) #define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block) #define SET_FIELD_BITPOS(thisfld, bitpos) \ -@@ -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 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h #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/gdbtypes.h b/gdb/gdbtypes.h 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: { diff --git a/gdb-archer-vla-tests.patch b/gdb-archer-vla-tests.patch index 3eb880e..7671dd2 100644 --- a/gdb-archer-vla-tests.patch +++ b/gdb-archer-vla-tests.patch @@ -8,7 +8,7 @@ Subject: gdb-archer-vla-tests.patch 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 @@ new file mode 100644 +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 @@ new file mode 100644 +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 @@ new file mode 100644 +gdb_breakpoint [gdb_get_line_number "varx-deallocated"] +gdb_continue_to_breakpoint "varx-deallocated" +gdb_test "p varx" "\\$\[0-9\]* = " "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 @@ diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -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 @@ diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp + 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 diff --git a/gdb-archer.patch b/gdb-archer.patch index e1f9e48..77c0dee 100644 --- a/gdb-archer.patch +++ b/gdb-archer.patch @@ -14,22 +14,6 @@ commit 718a1618b2f691a7f407213bb50f100ac59f91c3 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 @@ diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in 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 @@ diff --git a/gdb/gdb-gdb.gdb.in b/gdb/gdb-gdb.gdb.in 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 @@ new file mode 100644 + 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-frame.exp b/gdb/testsuite/gdb.python/py 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 @@ diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py # 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 @@ diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py # 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); - diff --git a/gdb-attach-fail-reasons-5of5.patch b/gdb-attach-fail-reasons-5of5.patch index a30fdac..6f63648 100644 --- a/gdb-attach-fail-reasons-5of5.patch +++ b/gdb-attach-fail-reasons-5of5.patch @@ -45,7 +45,7 @@ gdb/gdbserver/ 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 @@ diff --git a/gdb/config.in b/gdb/config.in /* Define to 1 if you have the 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/config.in b/gdb/config.in 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 b/gdb/configure 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/configure.ac b/gdb/configure.ac 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 @@ diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in /* 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/config.in b/gdb/gdbserver/config.in 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 b/gdb/gdbserver/configure 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/configure.ac b/gdb/gdbserver/configure.ac 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/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c 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 diff --git a/gdb-btrobust.patch b/gdb-btrobust.patch index 8a67458..3e98a7c 100644 --- a/gdb-btrobust.patch +++ b/gdb-btrobust.patch @@ -14,7 +14,7 @@ printed, but a default backtrace will occur in this case. 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 @@ diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c 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 @@ diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c } 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) diff --git a/gdb-bz1219747-attach-kills.patch b/gdb-bz1219747-attach-kills.patch index 008274c..f6cb596 100644 --- a/gdb-bz1219747-attach-kills.patch +++ b/gdb-bz1219747-attach-kills.patch @@ -80,7 +80,7 @@ gdb/testsuite/ChangeLog 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); diff --git a/gdb-bz533176-fortran-omp-step.patch b/gdb-bz533176-fortran-omp-step.patch index 88212f4..28b6431 100644 --- a/gdb-bz533176-fortran-omp-step.patch +++ b/gdb-bz533176-fortran-omp-step.patch @@ -30,7 +30,7 @@ debugging problem of GOMP outside of the scope of this Bug. 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 @@ diff --git a/gdb/infrun.c b/gdb/infrun.c + 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; diff --git a/gdb-bz541866-rwatch-before-run.patch b/gdb-bz541866-rwatch-before-run.patch deleted file mode 100644 index 122af98..0000000 --- a/gdb-bz541866-rwatch-before-run.patch +++ /dev/null @@ -1,175 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-bz541866-rwatch-before-run.patch - -;; Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866). -;; Fix i386 rwatch+awatch before run (BZ 688788, on top of BZ 541866). -;;=push+jan: It should be fixed properly instead. - -diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c ---- a/gdb/breakpoint.c -+++ b/gdb/breakpoint.c -@@ -8773,7 +8773,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch, - int enabled, int internal, unsigned flags, - int display_canonical) - { -- int i; -+ int i ATTRIBUTE_UNUSED; - - if (type == bp_hardware_breakpoint) - { -@@ -14271,7 +14271,7 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition, - - if (bpt->type == bp_hardware_breakpoint) - { -- int i; -+ int i ATTRIBUTE_UNUSED; - i = hw_breakpoint_used_count (); - target_resources_ok = - target_can_use_hardware_watchpoint (bp_hardware_breakpoint, -diff --git a/gdb/config/i386/nm-linux.h b/gdb/config/i386/nm-linux.h -new file mode 100644 ---- /dev/null -+++ b/gdb/config/i386/nm-linux.h -@@ -0,0 +1,28 @@ -+/* Native support for GNU/Linux i386. -+ -+ Copyright 2010 Free Software Foundation, Inc. -+ -+ This file is part of GDB. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+#ifndef NM_LINUX_H -+#define NM_LINUX_H -+ -+#include "config/nm-linux.h" -+ -+/* Red Hat backward compatibility with gdb-6.8. */ -+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1 -+ -+#endif /* NM_LINUX64_H */ -diff --git a/gdb/config/i386/nm-linux64.h b/gdb/config/i386/nm-linux64.h -new file mode 100644 ---- /dev/null -+++ b/gdb/config/i386/nm-linux64.h -@@ -0,0 +1,28 @@ -+/* Native support for GNU/Linux amd64. -+ -+ Copyright 2010 Free Software Foundation, Inc. -+ -+ This file is part of GDB. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+#ifndef NM_LINUX64_H -+#define NM_LINUX64_H -+ -+#include "config/nm-linux.h" -+ -+/* Red Hat backward compatibility with gdb-6.8. */ -+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1 -+ -+#endif /* NM_LINUX64_H */ -diff --git a/gdb/configure.nat b/gdb/configure.nat ---- a/gdb/configure.nat -+++ b/gdb/configure.nat -@@ -245,6 +245,7 @@ case ${gdb_host} in - ;; - i386) - # Host: Intel 386 running GNU/Linux. -+ NAT_FILE="${srcdir}/config/${gdb_host_cpu}/nm-linux.h" - NATDEPFILES="${NATDEPFILES} x86-nat.o nat/x86-dregs.o \ - i386-linux-nat.o x86-linux-nat.o nat/linux-btrace.o \ - nat/x86-linux.o nat/x86-linux-dregs.o" -@@ -301,6 +302,7 @@ case ${gdb_host} in - case ${gdb_host_cpu} in - i386) - # Host: GNU/Linux x86-64 -+ NAT_FILE="${srcdir}/config/${gdb_host_cpu}/nm-linux64.h" - NATDEPFILES="${NATDEPFILES} x86-nat.o nat/x86-dregs.o \ - amd64-nat.o amd64-linux-nat.o x86-linux-nat.o \ - nat/linux-btrace.o \ -diff --git a/gdb/target.h b/gdb/target.h ---- a/gdb/target.h -+++ b/gdb/target.h -@@ -1971,9 +1971,11 @@ extern struct thread_info *target_thread_handle_to_thread_info - one. OTHERTYPE is the number of watchpoints of other types than - this one used so far. */ - -+#ifndef target_can_use_hardware_watchpoint - #define target_can_use_hardware_watchpoint(TYPE,CNT,OTHERTYPE) \ - (current_top_target ()->can_use_hw_breakpoint) ( \ - TYPE, CNT, OTHERTYPE) -+#endif - - /* Returns the number of debug registers needed to watch the given - memory region, or zero if not supported. */ -diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp b/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp -@@ -0,0 +1,40 @@ -+# Copyright 2009, 2010 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# Arch not supporting hw watchpoints does not imply no_hardware_watchpoints set. -+if {(![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] -+ && ![istarget "ia64-*-*"]) -+ || [target_info exists gdb,no_hardware_watchpoints]} then { -+ verbose "Skipping watchpoint-hw-before-run test." -+ return -+} -+ -+set test watchpoint-hw-before-run -+set srcfile watchpoint-hw-hit-once.c -+if { [prepare_for_testing ${test}.exp ${test} ${srcfile}] } { -+ return -1 -+} -+ -+gdb_test "rwatch watchee" "ardware read watchpoint 1: watchee" -+ -+# `runto_main' or `runto main' would delete the watchpoint created above. -+ -+if { [gdb_start_cmd] < 0 } { -+ untested start -+ return -1 -+} -+gdb_test "" "main .* at .*" "start" -+ -+gdb_test "continue" "Continuing.\r\n\r\nHardware read watchpoint \[0-9\]+: watchee\r\n\r\nValue = 0\r\n.*" diff --git a/gdb-bz568248-oom-is-error.patch b/gdb-bz568248-oom-is-error.patch deleted file mode 100644 index f65ebc1..0000000 --- a/gdb-bz568248-oom-is-error.patch +++ /dev/null @@ -1,71 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-bz568248-oom-is-error.patch - -;; Out of memory is just an error, not fatal (uninitialized VLS vars, BZ 568248). -;;=push+jan: Inferior objects should be read in parts, then this patch gets obsoleted. - -http://sourceware.org/ml/gdb-patches/2010-06/msg00005.html - -Hi, - -unfortunately I see this problem reproducible only with the -archer-jankratochvil-vla branch (VLA = Variable Length Arrays - char[var]). -OTOH this branch I hopefully submit in some form for FSF GDB later. - -In this case (a general problem but tested for example on Fedora 13 i686): - -int -main (int argc, char **argv) -{ - char a[argc]; - return a[0]; -} - -(gdb) start -(gdb) print a -../../gdb/utils.c:1251: internal-error: virtual memory exhausted: can't allocate 4294951689 bytes. - -It is apparently because boundary for the variable `a' is not initialized -there. Users notice it due to Eclipse-CDT trying to automatically display all -the local variables on each step. - -Apparentl no regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu. -But is anone aware of the reasons to use internal_error there? -I find simple error as a perfectly reasonable there. -(history only tracks it since the initial import) - -IIRC this idea has been discussed with Tom Tromey, not sure of its origin. - -I understand it may be offtopic for FSF GDB but from some GDB crashes I am not -sure if it can happen only due to the VLA variables. - -Thanks, -Jan - -gdb/ -2010-06-01 Jan Kratochvil - Tom Tromey - - * utils.c (nomem): Change internal_error to error. - -diff --git a/gdb/utils.c b/gdb/utils.c ---- a/gdb/utils.c -+++ b/gdb/utils.c -@@ -721,13 +721,11 @@ malloc_failure (long size) - { - if (size > 0) - { -- internal_error (__FILE__, __LINE__, -- _("virtual memory exhausted: can't allocate %ld bytes."), -- size); -+ error (_("virtual memory exhausted: can't allocate %ld bytes."), size); - } - else - { -- internal_error (__FILE__, __LINE__, _("virtual memory exhausted.")); -+ error (_("virtual memory exhausted.")); - } - } - diff --git a/gdb-container-rh-pkg.patch b/gdb-container-rh-pkg.patch index a1075fd..9e40341 100644 --- a/gdb-container-rh-pkg.patch +++ b/gdb-container-rh-pkg.patch @@ -9,7 +9,7 @@ Subject: gdb-container-rh-pkg.patch 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) diff --git a/gdb-core-open-vdso-warning.patch b/gdb-core-open-vdso-warning.patch index 18a20e4..fefe951 100644 --- a/gdb-core-open-vdso-warning.patch +++ b/gdb-core-open-vdso-warning.patch @@ -27,7 +27,7 @@ diff --git a/gdb/testsuite/gdb.base/solib-symbol.exp b/gdb/testsuite/gdb.base/so 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" diff --git a/gdb-dwarf-reader-reject-sections-with-invalid-sizes.patch b/gdb-dwarf-reader-reject-sections-with-invalid-sizes.patch deleted file mode 100644 index 25fdc6a..0000000 --- a/gdb-dwarf-reader-reject-sections-with-invalid-sizes.patch +++ /dev/null @@ -1,123 +0,0 @@ -DWARF reader: Reject sections with invalid sizes - -This is another fuzzer bug, gdb/23567. This time, the fuzzer has -specifically altered the size of .debug_str: - -$ eu-readelf -S objdump -Section Headers: -[Nr] Name Type Addr Off Size ES Flags Lk Inf Al -[31] .debug_str PROGBITS 0000000000000000 0057116d ffffffffffffffff 1 MS 0 0 1 - -When this file is loaded into GDB, the DWARF reader crashes attempting -to access the string table (or it may just store a bunch of nonsense): - -[gdb-8.3-6-fc30] -$ gdb -nx -q objdump -BFD: warning: /path/to/objdump has a corrupt section with a size (ffffffffffffffff) larger than the file size -Reading symbols from /path/to/objdump... -Segmentation fault (core dumped) - -Nick has already committed a BFD patch to issue the warning seen above. - -[gdb master 6acc1a0b] -$ gdb -BFD: warning: /path/to/objdump has a corrupt section with a size (ffffffffffffffff) larger than the file size -Reading symbols from /path/to/objdump... -(gdb) inf func -All defined functions: - -File ./../include/dwarf2.def: -186: const - - 8 *>(.: - ;'@�B); -747: const - - 8 *�(.: - ;'@�B); -701: const - - 8 *�D � - (.: - ;'@�B); -71: const - - 8 *(.: - ;'@�B); -/* and more gibberish */ - -Consider read_indirect_string_at_offset_from: - -static const char * -read_indirect_string_at_offset_from (struct objfile *objfile, - bfd *abfd, LONGEST str_offset, - struct dwarf2_section_info *sect, - const char *form_name, - const char *sect_name) -{ - dwarf2_read_section (objfile, sect); - if (sect->buffer == NULL) - error (_("%s used without %s section [in module %s]"), - form_name, sect_name, bfd_get_filename (abfd)); - if (str_offset >= sect->size) - error (_("%s pointing outside of %s section [in module %s]"), - form_name, sect_name, bfd_get_filename (abfd)); - gdb_assert (HOST_CHAR_BIT == 8); - if (sect->buffer[str_offset] == '\0') - return NULL; - return (const char *) (sect->buffer + str_offset); -} - -With sect_size being ginormous, the code attempts to access -sect->buffer[GINORMOUS], and depending on the layout of memory, -GDB either stores a bunch of gibberish strings or crashes. - -This is an attempt to mitigate this by implementing a similar approach -used by BFD. In our case, we simply reject the section with the invalid -length: - -$ ./gdb -nx -q objdump -BFD: warning: /path/to/objdump has a corrupt section with a size (ffffffffffffffff) larger than the file size -Reading symbols from /path/to/objdump... - -warning: Discarding section .debug_str which has a section size (ffffffffffffffff) larger than the file size [in module /path/to/objdump] -DW_FORM_strp used without .debug_str section [in module /path/to/objdump] -(No debugging symbols found in /path/to/objdump) -(gdb) - -Unfortunately, I have not found a way to regression test this, since it -requires poking ELF section headers. - -gdb/ChangeLog: -2019-10-16 Keith Seitz - - PR gdb/23567 - * dwarf2read.c (dwarf2_per_objfile::locate_sections): Discard - sections whose size is greater than the file size. - -Change-Id: I896ac3b4eb2207c54e8e05c16beab3051d9b4b2f - ---- - gdb/ChangeLog | 6 ++++++ - gdb/dwarf2read.c | 9 +++++++++ - 2 files changed, 15 insertions(+) - -diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index 0443b55d891..a78f818e0e8 100644 ---- a/gdb/dwarf2read.c -+++ b/gdb/dwarf2read.c -@@ -2338,6 +2338,15 @@ dwarf2_per_objfile::locate_sections (bfd *abfd, asection *sectp, - if ((aflag & SEC_HAS_CONTENTS) == 0) - { - } -+ else if (elf_section_data (sectp)->this_hdr.sh_size -+ > bfd_get_file_size (abfd)) -+ { -+ bfd_size_type size = elf_section_data (sectp)->this_hdr.sh_size; -+ warning (_("Discarding section %s which has a section size (%s" -+ ") larger than the file size [in module %s]"), -+ bfd_section_name (abfd, sectp), phex_nz (size, sizeof (size)), -+ bfd_get_filename (abfd)); -+ } - else if (section_is_p (sectp->name, &names.info)) - { - this->info.s.section = sectp; diff --git a/gdb-fedora-libncursesw.patch b/gdb-fedora-libncursesw.patch index 9e710a5..b7a3f2b 100644 --- a/gdb-fedora-libncursesw.patch +++ b/gdb-fedora-libncursesw.patch @@ -12,7 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1270534 diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -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 @@ diff --git a/gdb/configure b/gdb/configure { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5 $as_echo_n "checking for library containing waddstr... " >&6; } if ${ac_cv_search_waddstr+:} false; then : -@@ -9442,7 +9443,7 @@ return waddstr (); +@@ -9399,7 +9400,7 @@ return waddstr (); return 0; } _ACEOF @@ -29,7 +29,7 @@ diff --git a/gdb/configure b/gdb/configure 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 @@ diff --git a/gdb/configure b/gdb/configure { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5 $as_echo_n "checking for library containing tgetent... " >&6; } if ${ac_cv_search_tgetent+:} false; then : -@@ -9540,7 +9542,7 @@ return tgetent (); +@@ -9497,7 +9499,7 @@ return tgetent (); return 0; } _ACEOF @@ -49,7 +49,7 @@ diff --git a/gdb/configure b/gdb/configure diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -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 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac 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. diff --git a/gdb-fix-debug-agent-odr-bool-int.patch b/gdb-fix-debug-agent-odr-bool-int.patch new file mode 100644 index 0000000..0f149c2 --- /dev/null +++ b/gdb-fix-debug-agent-odr-bool-int.patch @@ -0,0 +1,19 @@ +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 diff --git a/gdb-fix-heap-use-after-free-in-typename-concat.patch b/gdb-fix-heap-use-after-free-in-typename-concat.patch deleted file mode 100644 index 3d53428..0000000 --- a/gdb-fix-heap-use-after-free-in-typename-concat.patch +++ /dev/null @@ -1,314 +0,0 @@ -commit 55db11619271cc820adccf35abafe18966ecbf4d -Author: Tom de Vries -Date: Thu May 2 17:48:44 2019 +0200 - - [gdb] Fix heap-use-after-free in typename_concat - - When running gdb using AddressSanitizer, and loading a cc1plus binary built - with profiledbootstrap and -flto, we run into a heap-use-after-free error: - ... - $ LD_PRELOAD=/usr/lib64/libasan.so.3 ./gdb -batch cc1plus - ==26855==ERROR: AddressSanitizer: heap-use-after-free on address \ - 0x62100ad8a8b0 at pc 0x7f13803cc9e3 bp 0x7ffe55b0d090 sp 0x7ffe55b0c840 - READ of size 47 at 0x62100ad8a8b0 thread T0 - #0 0x7f13803cc9e2 (/usr/lib64/libasan.so.3+0x3e9e2) - #1 0x5e7a0d in typename_concat gdb/dwarf2read.c:22661 - #2 0x5c6437 in partial_die_full_name gdb/dwarf2read.c:8876 - #3 0x5c6555 in add_partial_symbol gdb/dwarf2read.c:8893 - #4 0x5c6ecf in add_partial_subprogram gdb/dwarf2read.c:9156 - #5 0x5c5e90 in scan_partial_symbols gdb/dwarf2read.c:8668 - #6 0x5c6c0a in add_partial_namespace gdb/dwarf2read.c:9081 - #7 0x5c5f99 in scan_partial_symbols gdb/dwarf2read.c:8702 - #8 0x5c48b6 in process_psymtab_comp_unit_reader gdb/dwarf2read.c:8056 - #9 0x5c3c1f in init_cutu_and_read_dies gdb/dwarf2read.c:7689 - #10 0x5c4c03 in process_psymtab_comp_unit gdb/dwarf2read.c:8140 - #11 0x5c58a2 in dwarf2_build_psymtabs_hard gdb/dwarf2read.c:8500 - #12 0x5c0d03 in dwarf2_build_psymtabs(objfile*) gdb/dwarf2read.c:6337 - #13 0x612359 in read_psyms gdb/elfread.c:1311 - #14 0x798a64 in require_partial_symbols(objfile*, int) gdb/psymtab.c:115 - #15 0x867d7b in read_symbols gdb/symfile.c:821 - #16 0x8683d9 in syms_from_objfile_1 gdb/symfile.c:1000 - #17 0x8684a1 in syms_from_objfile gdb/symfile.c:1017 - #18 0x868873 in symbol_file_add_with_addrs gdb/symfile.c:1124 - #19 0x868b0a in symbol_file_add_from_bfd(bfd*, char const*, \ - enum_flags, std::vector >*, \ - enum_flags, objfile*) gdb/symfile.c:1204 - #20 0x868b64 in symbol_file_add(char const*, \ - enum_flags, \ - std::vector >*, \ - enum_flags) gdb/symfile.c:1217 - #21 0x868c39 in symbol_file_add_main_1 gdb/symfile.c:1240 - #22 0x868bd0 in symbol_file_add_main(char const*, \ - enum_flags) gdb/symfile.c:1231 - #23 0x71f1b2 in symbol_file_add_main_adapter gdb/main.c:395 - #24 0x71f10e in catch_command_errors gdb/main.c:372 - #25 0x71ff5f in captured_main_1 gdb/main.c:1043 - #26 0x72045d in captured_main gdb/main.c:1163 - #27 0x7204c8 in gdb_main(captured_main_args*) gdb/main.c:1188 - #28 0x40fd7d in main gdb/gdb.c:32 - #29 0x7f137e300f49 in __libc_start_main (/lib64/libc.so.6+0x20f49) - #30 0x40fc89 in _start (/data/gdb_versions/devel/build/gdb/gdb+0x40fc89) - - 0x62100ad8a8b0 is located 944 bytes inside of 4064-byte region \ - [0x62100ad8a500,0x62100ad8b4e0) - freed by thread T0 here: - #0 0x7f13804523a0 in __interceptor_free (/usr/lib64/libasan.so.3+0xc43a0) - #1 0x435e44 in xfree gdb/common/common-utils.h:60 - #2 0xa82c25 in call_freefun libiberty/obstack.c:103 - #3 0xa83098 in _obstack_free libiberty/obstack.c:280 - #4 0x4367da in auto_obstack::~auto_obstack() gdb/gdb_obstack.h:101 - #5 0x5ed72c in dwarf2_cu::~dwarf2_cu() gdb/dwarf2read.c:25341 - #6 0x5fb5bb in std::default_delete::operator()(dwarf2_cu*) const \ - /usr/include/c++/7/bits/unique_ptr.h:78 - #7 0x5f7334 in std::unique_ptr >::~unique_ptr() \ - /usr/include/c++/7/bits/unique_ptr.h:268 - #8 0x5c3ce5 in init_cutu_and_read_dies gdb/dwarf2read.c:7624 - #9 0x5c4c03 in process_psymtab_comp_unit gdb/dwarf2read.c:8140 - #10 0x5c58a2 in dwarf2_build_psymtabs_hard gdb/dwarf2read.c:8500 - #11 0x5c0d03 in dwarf2_build_psymtabs(objfile*) gdb/dwarf2read.c:6337 - #12 0x612359 in read_psyms gdb/elfread.c:1311 - #13 0x798a64 in require_partial_symbols(objfile*, int) gdb/psymtab.c:115 - #14 0x867d7b in read_symbols gdb/symfile.c:821 - #15 0x8683d9 in syms_from_objfile_1 gdb/symfile.c:1000 - #16 0x8684a1 in syms_from_objfile gdb/symfile.c:1017 - #17 0x868873 in symbol_file_add_with_addrs gdb/symfile.c:1124 - #18 0x868b0a in symbol_file_add_from_bfd(bfd*, char const*, \ - enum_flags, std::vector >*, \ - enum_flags, objfile*) gdb/symfile.c:1204 - #19 0x868b64 in symbol_file_add(char const*, \ - enum_flags, std::vector >*, \ - enum_flags) gdb/symfile.c:1217 - #20 0x868c39 in symbol_file_add_main_1 gdb/symfile.c:1240 - #21 0x868bd0 in symbol_file_add_main(char const*, \ - enum_flags) gdb/symfile.c:1231 - #22 0x71f1b2 in symbol_file_add_main_adapter gdb/main.c:395 - #23 0x71f10e in catch_command_errors gdb/main.c:372 - #24 0x71ff5f in captured_main_1 gdb/main.c:1043 - #25 0x72045d in captured_main gdb/main.c:1163 - #26 0x7204c8 in gdb_main(captured_main_args*) gdb/main.c:1188 - #27 0x40fd7d in main gdb/gdb.c:32 - #28 0x7f137e300f49 in __libc_start_main (/lib64/libc.so.6+0x20f49) - - previously allocated by thread T0 here: - #0 0x7f13804526b8 in __interceptor_malloc (/usr/lib64/libasan.so.3+0xc46b8) - #1 0x5114b5 in xmalloc gdb/common/common-utils.c:44 - #2 0xa82bd5 in call_chunkfun libiberty/obstack.c:94 - #3 0xa82eda in _obstack_newchunk libiberty/obstack.c:206 - #4 0x477310 in allocate_on_obstack::operator new(unsigned long, obstack*) \ - gdb/gdb_obstack.h:117 - #5 0x5dea8c in load_partial_dies gdb/dwarf2read.c:18571 - #6 0x5c487f in process_psymtab_comp_unit_reader gdb/dwarf2read.c:8054 - #7 0x5c3c1f in init_cutu_and_read_dies gdb/dwarf2read.c:7689 - #8 0x5c4c03 in process_psymtab_comp_unit gdb/dwarf2read.c:8140 - #9 0x5c58a2 in dwarf2_build_psymtabs_hard gdb/dwarf2read.c:8500 - #10 0x5c0d03 in dwarf2_build_psymtabs(objfile*) gdb/dwarf2read.c:6337 - #11 0x612359 in read_psyms gdb/elfread.c:1311 - #12 0x798a64 in require_partial_symbols(objfile*, int) gdb/psymtab.c:115 - #13 0x867d7b in read_symbols gdb/symfile.c:821 - #14 0x8683d9 in syms_from_objfile_1 gdb/symfile.c:1000 - #15 0x8684a1 in syms_from_objfile gdb/symfile.c:1017 - #16 0x868873 in symbol_file_add_with_addrs gdb/symfile.c:1124 - #17 0x868b0a in symbol_file_add_from_bfd(bfd*, char const*, \ - enum_flags, \ - std::vector >*, \ - enum_flags, objfile*) gdb/symfile.c:1204 - #18 0x868b64 in symbol_file_add(char const*, enum_flags, \ - std::vector >*, \ - enum_flags) gdb/symfile.c:1217 - #19 0x868c39 in symbol_file_add_main_1 gdb/symfile.c:1240 - #20 0x868bd0 in symbol_file_add_main(char const*, \ - enum_flags) gdb/symfile.c:1231 - #21 0x71f1b2 in symbol_file_add_main_adapter gdb/main.c:395 - #22 0x71f10e in catch_command_errors gdb/main.c:372 - #23 0x71ff5f in captured_main_1 gdb/main.c:1043 - #24 0x72045d in captured_main gdb/main.c:1163 - #25 0x7204c8 in gdb_main(captured_main_args*) gdb/main.c:1188 - #26 0x40fd7d in main gdb/gdb.c:32 - #27 0x7f137e300f49 in __libc_start_main (/lib64/libc.so.6+0x20f49) - ... - - This error happens as follows. - - The function find_partial_die has a cu argument, but returns a pdi which may - or may not be from that cu: - ... - /* Find a partial DIE at OFFSET, which may or may not be in CU, - except in the case of .debug_types DIEs which do not reference - outside their CU (they do however referencing other types via - DW_FORM_ref_sig8). */ - - static struct partial_die_info * - find_partial_die (sect_offset sect_off, int offset_in_dwz, struct dwarf2_cu *cu) - ... - - So the pdi returned by find_partial_die here in partial_die_parent_scope may - be from another cu: - ... - partial_die_parent_scope (struct partial_die_info *pdi, - struct dwarf2_cu *cu) - { - const char *grandparent_scope; - struct partial_die_info *parent, *real_pdi; - - /* We need to look at our parent DIE; if we have a DW_AT_specification, - then this means the parent of the specification DIE. */ - - real_pdi = pdi; - while (real_pdi->has_specification) - real_pdi = find_partial_die (real_pdi->spec_offset, - real_pdi->spec_is_dwz, cu); - - parent = real_pdi->die_parent; - ... - in which case both real_pdi and parent will be not from cu, but from another - one, say cu2. - - Subsequently, cu's comp_unit_obstack is used to set parent->scope: - ... - parent->scope = typename_concat (&cu->comp_unit_obstack, - grandparent_scope, - parent->name, 0, cu); - ... - - So, we use cu->comp_unit_obstack to assign a value to the scope field of - a pdi belonging to cu2, and when cu is deleted, the scope field points to a - freed value. - - Fix this by making find_partial_die return the cu corresponding to the - returned pdi, and handling this at the call sites. - - Tested on x86_64-linux. - - gdb/ChangeLog: - - 2019-05-03 Tom de Vries - - PR gdb/24094 - * dwarf2read.c (struct cu_partial_die_info): New struct. - (find_partial_die): Return cu_partial_die_info. - (partial_die_parent_scope, guess_partial_die_structure_name) - (partial_die_info::fixup): Handle new return type of find_partial_die. - -diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index b0bdecf96f..442b618f6e 100644 ---- a/gdb/dwarf2read.c -+++ b/gdb/dwarf2read.c -@@ -1518,8 +1518,14 @@ static unsigned int peek_abbrev_code (bfd *, const gdb_byte *); - static struct partial_die_info *load_partial_dies - (const struct die_reader_specs *, const gdb_byte *, int); - --static struct partial_die_info *find_partial_die (sect_offset, int, -- struct dwarf2_cu *); -+struct cu_partial_die_info -+{ -+ struct dwarf2_cu *cu; -+ struct partial_die_info *pdi; -+}; -+ -+static struct cu_partial_die_info find_partial_die (sect_offset, int, -+ struct dwarf2_cu *); - - static const gdb_byte *read_attribute (const struct die_reader_specs *, - struct attribute *, struct attr_abbrev *, -@@ -8771,14 +8777,19 @@ partial_die_parent_scope (struct partial_die_info *pdi, - { - const char *grandparent_scope; - struct partial_die_info *parent, *real_pdi; -+ struct cu_partial_die_info res; - - /* We need to look at our parent DIE; if we have a DW_AT_specification, - then this means the parent of the specification DIE. */ - - real_pdi = pdi; - while (real_pdi->has_specification) -- real_pdi = find_partial_die (real_pdi->spec_offset, -- real_pdi->spec_is_dwz, cu); -+ { -+ res = find_partial_die (real_pdi->spec_offset, -+ real_pdi->spec_is_dwz, cu); -+ real_pdi = res.pdi; -+ cu = res.cu; -+ } - - parent = real_pdi->die_parent; - if (parent == NULL) -@@ -18922,7 +18933,7 @@ dwarf2_cu::find_partial_die (sect_offset sect_off) - outside their CU (they do however referencing other types via - DW_FORM_ref_sig8). */ - --static struct partial_die_info * -+static struct cu_partial_die_info - find_partial_die (sect_offset sect_off, int offset_in_dwz, struct dwarf2_cu *cu) - { - struct dwarf2_per_objfile *dwarf2_per_objfile -@@ -18936,7 +18947,12 @@ find_partial_die (sect_offset sect_off, int offset_in_dwz, struct dwarf2_cu *cu) - { - pd = cu->find_partial_die (sect_off); - if (pd != NULL) -- return pd; -+ { -+ struct cu_partial_die_info res; -+ res.pdi = pd; -+ res.cu = cu; -+ return res; -+ } - /* We missed recording what we needed. - Load all dies and try again. */ - per_cu = cu->per_cu; -@@ -18984,7 +19000,12 @@ find_partial_die (sect_offset sect_off, int offset_in_dwz, struct dwarf2_cu *cu) - _("could not find partial DIE %s " - "in cache [from module %s]\n"), - sect_offset_str (sect_off), bfd_get_filename (objfile->obfd)); -- return pd; -+ { -+ struct cu_partial_die_info res; -+ res.pdi = pd; -+ res.cu = per_cu->cu; -+ return res; -+ } - } - - /* See if we can figure out if the class lives in a namespace. We do -@@ -19003,6 +19024,7 @@ guess_partial_die_structure_name (struct partial_die_info *struct_pdi, - - struct partial_die_info *real_pdi; - struct partial_die_info *child_pdi; -+ struct cu_partial_die_info res; - - /* If this DIE (this DIE's specification, if any) has a parent, then - we should not do this. We'll prepend the parent's fully qualified -@@ -19010,8 +19032,12 @@ guess_partial_die_structure_name (struct partial_die_info *struct_pdi, - - real_pdi = struct_pdi; - while (real_pdi->has_specification) -- real_pdi = find_partial_die (real_pdi->spec_offset, -- real_pdi->spec_is_dwz, cu); -+ { -+ res = find_partial_die (real_pdi->spec_offset, -+ real_pdi->spec_is_dwz, cu); -+ real_pdi = res.pdi; -+ cu = res.cu; -+ } - - if (real_pdi->die_parent != NULL) - return; -@@ -19056,8 +19082,11 @@ partial_die_info::fixup (struct dwarf2_cu *cu) - if (name == NULL && has_specification) - { - struct partial_die_info *spec_die; -+ struct cu_partial_die_info res; - -- spec_die = find_partial_die (spec_offset, spec_is_dwz, cu); -+ res = find_partial_die (spec_offset, spec_is_dwz, cu); -+ spec_die = res.pdi; -+ cu = res.cu; - - spec_die->fixup (cu); - diff --git a/gdb-fix-incorrect-use-of-is-operator-for-comparison-in-python-lib-gdb-command-prompt.py.patch b/gdb-fix-incorrect-use-of-is-operator-for-comparison-in-python-lib-gdb-command-prompt.py.patch deleted file mode 100644 index 9aea6ef..0000000 --- a/gdb-fix-incorrect-use-of-is-operator-for-comparison-in-python-lib-gdb-command-prompt.py.patch +++ /dev/null @@ -1,32 +0,0 @@ -Fix incorrect use of 'is' operator for comparison in python/lib/gdb/command/prompt.py - -The 'is' operator is not meant to be used for comparisons. It currently working -is an implementation detail of CPython. CPython 3.8 has added a SyntaxWarning -for this. - ---- - gdb/python/lib/gdb/command/prompt.py | 4 ++-- - 2 files changed, 8 insertions(+), 2 deletions(-) - -diff --git a/gdb/python/lib/gdb/command/prompt.py b/gdb/python/lib/gdb/command/prompt.py -index 3d662a7d3f..04b9e49c22 100644 ---- a/gdb/python/lib/gdb/command/prompt.py -+++ b/gdb/python/lib/gdb/command/prompt.py -@@ -45,7 +45,7 @@ The currently defined substitutions are: - self.hook_set = False - - def get_show_string (self, pvalue): -- if self.value is not '': -+ if self.value: - return "The extended prompt is: " + self.value - else: - return "The extended prompt is not set." -@@ -57,7 +57,7 @@ The currently defined substitutions are: - return "" - - def before_prompt_hook(self, current): -- if self.value is not '': -+ if self.value: - return gdb.prompt.substitute_prompt(self.value) - else: - return None diff --git a/gdb-fix-python3.9-related-runtime-problems.patch b/gdb-fix-python3.9-related-runtime-problems.patch new file mode 100644 index 0000000..fcf54cf --- /dev/null +++ b/gdb-fix-python3.9-related-runtime-problems.patch @@ -0,0 +1,216 @@ +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 ) + 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::operator()(inferior*) const (__args#0=, this=0xccad20) + at /usr/include/c++/10/bits/std_function.h:617 + #6 gdb::observers::observable::notify (args#0=0xddeb10, + this=) + 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=) + at worktree-test1/gdb/python/python.c:278 + #3 gdbpy_check_quit_flag (extlang=) + 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 , + old_chain=0xae5720 ) + 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 + Keith Seitz + + * 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); + diff --git a/gdb-fix-range-loop-index-in-find_method.patch b/gdb-fix-range-loop-index-in-find_method.patch index de901db..2709e24 100644 --- a/gdb-fix-range-loop-index-in-find_method.patch +++ b/gdb-fix-range-loop-index-in-find_method.patch @@ -49,11 +49,11 @@ gdb/testsuite/ChangeLog: 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 *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 @@ index e902b11c8e8..2231a5674c8 100644 /* Program spaces that are executing startup should have been filtered out earlier. */ -@@ -3716,7 +3716,6 @@ find_method (struct linespec_state *self, std::vector *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 @@ index e902b11c8e8..2231a5674c8 100644 } } -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 @@ index 00000000000..9499aecf4c6 +# 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 # diff --git a/gdb-fix-riscv-tdep.patch b/gdb-fix-riscv-tdep.patch deleted file mode 100644 index c995a58..0000000 --- a/gdb-fix-riscv-tdep.patch +++ /dev/null @@ -1,30 +0,0 @@ -In gdb-rhbz795424-bitpos-20of25.patch, the TYPE_LENGTH is changed from -unsigned to ULONGEST. - -This breaks the build on RISC-V: -... -gdb/riscv-tdep.c: In function 'int riscv_type_alignment(type*)': -gdb/riscv-tdep.c:1648:64: error: no matching function for call to \ - 'min(ULONGEST&, unsigned int)' - return std::min (TYPE_LENGTH (t), (unsigned) BIGGEST_ALIGNMENT); -... - -Fix this by backporting a fragment of an unrelated commit on master that -also changes TYPE_LENGTH from unsigned to ULONGEST. -... -$ git show --pretty=%p cc1defb1dc gdb/riscv-tdep.c -... - -diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c -index 8a996f32d3..ff5f36e762 100644 ---- a/gdb/riscv-tdep.c -+++ b/gdb/riscv-tdep.c -@@ -1645,7 +1645,7 @@ riscv_type_alignment (struct type *t) - - case TYPE_CODE_ARRAY: - if (TYPE_VECTOR (t)) -- return std::min (TYPE_LENGTH (t), (unsigned) BIGGEST_ALIGNMENT); -+ return std::min (TYPE_LENGTH (t), (ULONGEST) BIGGEST_ALIGNMENT); - /* FALLTHROUGH */ - - case TYPE_CODE_COMPLEX: diff --git a/gdb-fix-s390-build.diff b/gdb-fix-s390-build.diff deleted file mode 100644 index 0c5f890..0000000 --- a/gdb-fix-s390-build.diff +++ /dev/null @@ -1,76 +0,0 @@ -Index: gdb-8.2/gdb/dwarf2read.c -=================================================================== ---- gdb-8.2.orig/gdb/dwarf2read.c 2018-09-11 15:25:32.000000000 +0200 -+++ gdb-8.2/gdb/dwarf2read.c 2018-09-12 15:44:50.000000000 +0200 -@@ -3236,7 +3236,7 @@ create_addrmap_from_aranges (struct dwar - const uint8_t offset_size = dwarf5_is_dwarf64 ? 8 : 4; - if (addr + entry_length > section->buffer + section->size) - { -- warning (_("Section .debug_aranges in %s entry at offset %zu " -+ warning (_("Section .debug_aranges in %s entry at offset %td " - "length %s exceeds section length %s, " - "ignoring .debug_aranges."), - objfile_name (objfile), entry_addr - section->buffer, -@@ -3250,7 +3250,7 @@ create_addrmap_from_aranges (struct dwar - addr += 2; - if (version != 2) - { -- warning (_("Section .debug_aranges in %s entry at offset %zu " -+ warning (_("Section .debug_aranges in %s entry at offset %tu " - "has unsupported version %d, ignoring .debug_aranges."), - objfile_name (objfile), entry_addr - section->buffer, - version); -@@ -3264,7 +3264,7 @@ create_addrmap_from_aranges (struct dwar - = debug_info_offset_to_per_cu.find (sect_offset (debug_info_offset)); - if (per_cu_it == debug_info_offset_to_per_cu.cend ()) - { -- warning (_("Section .debug_aranges in %s entry at offset %zu " -+ warning (_("Section .debug_aranges in %s entry at offset %tu " - "debug_info_offset %s does not exists, " - "ignoring .debug_aranges."), - objfile_name (objfile), entry_addr - section->buffer, -@@ -3276,7 +3276,7 @@ create_addrmap_from_aranges (struct dwar - const uint8_t address_size = *addr++; - if (address_size < 1 || address_size > 8) - { -- warning (_("Section .debug_aranges in %s entry at offset %zu " -+ warning (_("Section .debug_aranges in %s entry at offset %tu " - "address_size %u is invalid, ignoring .debug_aranges."), - objfile_name (objfile), entry_addr - section->buffer, - address_size); -@@ -3286,7 +3286,7 @@ create_addrmap_from_aranges (struct dwar - const uint8_t segment_selector_size = *addr++; - if (segment_selector_size != 0) - { -- warning (_("Section .debug_aranges in %s entry at offset %zu " -+ warning (_("Section .debug_aranges in %s entry at offset %tu " - "segment_selector_size %u is not supported, " - "ignoring .debug_aranges."), - objfile_name (objfile), entry_addr - section->buffer, -@@ -3302,7 +3302,7 @@ create_addrmap_from_aranges (struct dwar - padding > 0; padding--) - if (*addr++ != 0) - { -- warning (_("Section .debug_aranges in %s entry at offset %zu " -+ warning (_("Section .debug_aranges in %s entry at offset %tu " - "padding is not zero, ignoring .debug_aranges."), - objfile_name (objfile), entry_addr - section->buffer); - return; -@@ -3312,7 +3312,7 @@ create_addrmap_from_aranges (struct dwar - { - if (addr + 2 * address_size > entry_end) - { -- warning (_("Section .debug_aranges in %s entry at offset %zu " -+ warning (_("Section .debug_aranges in %s entry at offset %tu " - "address list is not properly terminated, " - "ignoring .debug_aranges."), - objfile_name (objfile), entry_addr - section->buffer); -@@ -5537,7 +5537,7 @@ read_debug_names_from_section (struct ob - if (addr != abbrev_table_start + abbrev_table_size) - { - warning (_("Section .debug_names in %s has abbreviation_table " -- "of size %zu vs. written as %u, ignoring .debug_names."), -+ "of size %tu vs. written as %u, ignoring .debug_names."), - filename, addr - abbrev_table_start, abbrev_table_size); - return false; - } diff --git a/gdb-fix-the-thread-pool.c-compilation.patch b/gdb-fix-the-thread-pool.c-compilation.patch new file mode 100644 index 0000000..ca62b64 --- /dev/null +++ b/gdb-fix-the-thread-pool.c-compilation.patch @@ -0,0 +1,65 @@ +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 + + * 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 +-#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 + +-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 diff --git a/gdb-fix-toplevel-types-with-fdebug-types-section.patch b/gdb-fix-toplevel-types-with-fdebug-types-section.patch index 3a89148..6d6582e 100644 --- a/gdb-fix-toplevel-types-with-fdebug-types-section.patch +++ b/gdb-fix-toplevel-types-with-fdebug-types-section.patch @@ -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 - - 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 - - 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 @@ index 4251ed03b46..7e6f1a0ff62 100644 } 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 @@ index 00000000000..c47598c46ef +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. + diff --git a/gdb-fix-unused-function-error.patch b/gdb-fix-unused-function-error.patch new file mode 100644 index 0000000..a415218 --- /dev/null +++ b/gdb-fix-unused-function-error.patch @@ -0,0 +1,123 @@ +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 + + * 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 + + * 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 . */ + + #include "common-defs.h" +-#include "diagnostics.h" + #include + + /* 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 diff --git a/gdb-follow-child-stale-parent.patch b/gdb-follow-child-stale-parent.patch deleted file mode 100644 index e5b137e..0000000 --- a/gdb-follow-child-stale-parent.patch +++ /dev/null @@ -1,36 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-follow-child-stale-parent.patch - -;; Fix regression by python on ia64 due to stale current frame. -;;=push+jan - -Problem occurs with python and its get_current_arch () as it selects -selected_frame and current_frame while still inferior_ptid is valid for the -original parent. But since this place it is already attached and later -unwinders try to access it, breaking: - -PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the first fork - -PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the first fork - -PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the second fork - -PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the second fork - -PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: finish - +FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the first fork - +FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the first fork - +FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the second fork - +FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the second fork - +FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: finish - -diff --git a/gdb/infrun.c b/gdb/infrun.c ---- a/gdb/infrun.c -+++ b/gdb/infrun.c -@@ -754,6 +754,9 @@ follow_fork (void) - } - else - { -+ /* Possibly referenced PARENT is no longer valid. */ -+ reinit_frame_cache (); -+ - /* This pending follow fork event is now handled, one way - or another. The previous selected thread may be gone - from the lists by now, but if it is still around, need diff --git a/gdb-gcore-bash.patch b/gdb-gcore-bash.patch index 14c7299..db1b616 100644 --- a/gdb-gcore-bash.patch +++ b/gdb-gcore-bash.patch @@ -6,5 +6,5 @@ index b9770ea415..3149f6e1fe 100644 -#!/usr/bin/env bash +#!/bin/bash - # Copyright (C) 2003-2019 Free Software Foundation, Inc. + # Copyright (C) 2003-2020 Free Software Foundation, Inc. diff --git a/gdb-gnat-dwarf-crash-3of3.patch b/gdb-gnat-dwarf-crash-3of3.patch index 48fb794..4635ca4 100644 --- a/gdb-gnat-dwarf-crash-3of3.patch +++ b/gdb-gnat-dwarf-crash-3of3.patch @@ -42,7 +42,7 @@ gdb/ 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/dwarf2read.c b/gdb/dwarf2read.c 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/infrun.c b/gdb/infrun.c 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 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c 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 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c /* 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 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c 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 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c } } -@@ -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 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c + +#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); diff --git a/gdb-jit-reader-multilib.patch b/gdb-jit-reader-multilib.patch index be6d1b0..562bea2 100644 --- a/gdb-jit-reader-multilib.patch +++ b/gdb-jit-reader-multilib.patch @@ -9,7 +9,7 @@ Subject: gdb-jit-reader-multilib.patch 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 b/gdb/configure 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) diff --git a/gdb-libexec-add-index.patch b/gdb-libexec-add-index.patch deleted file mode 100644 index 0d7408b..0000000 --- a/gdb-libexec-add-index.patch +++ /dev/null @@ -1,23 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-libexec-add-index.patch - -;; Fix gdb-headless /usr/bin/ executables (BZ 1390251). -;;=fedora - -diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh ---- a/gdb/contrib/gdb-add-index.sh -+++ b/gdb/contrib/gdb-add-index.sh -@@ -21,6 +21,11 @@ - GDB=${GDB:=gdb} - OBJCOPY=${OBJCOPY:=objcopy} - -+GDB2=/usr/libexec/gdb -+if test -x $GDB2 && ! which $GDB &>/dev/null; then -+ GDB=$GDB2 -+fi -+ - myname="${0##*/}" - - dwarf5="" diff --git a/gdb-linux_perf-bundle.patch b/gdb-linux_perf-bundle.patch index cdabd51..d1189a6 100644 --- a/gdb-linux_perf-bundle.patch +++ b/gdb-linux_perf-bundle.patch @@ -9,7 +9,7 @@ Subject: gdb-linux_perf-bundle.patch 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 #ifndef PERF_ATTR_SIZE_VER5 @@ -21,7 +21,7 @@ diff --git a/gdb/configure b/gdb/configure diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -1500,7 +1500,7 @@ else +@@ -1414,7 +1414,7 @@ else AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ #include #ifndef PERF_ATTR_SIZE_VER5 @@ -56,7 +56,7 @@ diff --git a/gdb/gdb.c b/gdb/gdb.c 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 #endif diff --git a/gdb-moribund-utrace-workaround.patch b/gdb-moribund-utrace-workaround.patch index 202dc6b..37aa4f5 100644 --- a/gdb-moribund-utrace-workaround.patch +++ b/gdb-moribund-utrace-workaround.patch @@ -14,7 +14,7 @@ Bug in FSF GDB exploited by the ptrace-on-utrace interaction. 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); diff --git a/gdb-only-force-interp_console-ui_out-for-breakpoint-commands-in-mi-mode.patch b/gdb-only-force-interp_console-ui_out-for-breakpoint-commands-in-mi-mode.patch deleted file mode 100644 index 1e7aa41..0000000 --- a/gdb-only-force-interp_console-ui_out-for-breakpoint-commands-in-mi-mode.patch +++ /dev/null @@ -1,178 +0,0 @@ -[gdb] Only force INTERP_CONSOLE ui_out for breakpoint commands in MI mode - -The problem reported in PR mi/25055 is that the output of the backtrace -command, when executed as breakpoint command does not show when executing -using the MI interpreter: -... -$ gdb a.out -Reading symbols from a.out... -(gdb) break main -Breakpoint 1 at 0x4003c0: file test.c, line 19. -(gdb) commands -Type commands for breakpoint(s) 1, one per line. -End with a line saying just "end". ->bt ->end -(gdb) interpreter-exec mi "-exec-run" -^done - -Breakpoint 1, main () at test.c:19 -19 return foo (4); -(gdb) -... - -Interestingly, the function print_frame is called twice during -exec-run: -- once during tui_on_normal_stop where the ui_out is temporarily set to - tui->interp_ui_out (), resulting in the part after the comma in - "Breakpoint 1, main () at test.c:19" -- once during execute_control_command, where the ui_out is the default for the - current interpreter: mi_ui_out, which ignores calls to output text. - -The commit 3a87ae656c2 "Use console uiout when executing breakpoint commands" -fixes the problem by temporarily switching to the ui_out of INTERP_CONSOLE in -execute_control_command. - -This however caused a regression in redirection (escaping '#' using '\' for -git commit message convenience): -... -$ rm -f gdb.txt; gdb a.out -Reading symbols from a.out... -(gdb) break main -Breakpoint 1 at 0x4003c0: file test.c, line 19. -(gdb) commands -Type commands for breakpoint(s) 1, one per line. -End with a line saying just "end". ->bt ->end -(gdb) set logging redirect on -(gdb) set logging on -Redirecting output to gdb.txt. -Copying debug output to gdb.txt. -(gdb) run -\#0 main () at test.c:19 -(gdb) q -A debugging session is active. - - Inferior 1 [process 22428] will be killed. - -Quit anyway? (y or n) y -$ cat gdb.txt -Starting program: /data/gdb_versions/devel/a.out - -Breakpoint 1, main () at test.c:19 -19 return foo (4); -... - -The problem is that the '#0 main () at test.c:19' ends up in the gdb output -output rather than in gdb.txt. This is due to the fact that the redirect is -setup for the current ui_out (which is tui->interp_ui_out ()), while the -backtrace output is printed to the INTERP_CONSOLE ui_out. - -Fix this by limiting switching to INTERP_CONSOLE ui_out to when INTERP_MI is -active. - -Tested on x86_64-linux. - -gdb/ChangeLog: - -2019-10-02 Tom de Vries - - PR gdb/24956 - * cli/cli-script.c (execute_control_command): Only switch to - INTERP_CONSOLE's ui_out when INTERP_MI is active. - -gdb/testsuite/ChangeLog: - -2019-10-02 Tom de Vries - - PR gdb/24956 - * gdb.base/ui-redirect.exp: Test output of user-defined command. - -Change-Id: Id1771e7fcc9496a7d97ec2b2ea6b1487596f1ef7 - ---- - gdb/cli/cli-script.c | 3 +++ - gdb/testsuite/gdb.base/ui-redirect.exp | 47 +++++++++++++++++++++++++++++++++- - 2 files changed, 49 insertions(+), 1 deletion(-) - -diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c -index 85f00c75b3f..4d216f15dae 100644 ---- a/gdb/cli/cli-script.c -+++ b/gdb/cli/cli-script.c -@@ -697,6 +697,9 @@ execute_control_command_1 (struct command_line *cmd, int from_tty) - enum command_control_type - execute_control_command (struct command_line *cmd, int from_tty) - { -+ if (!current_uiout->is_mi_like_p ()) -+ return execute_control_command_1 (cmd, from_tty); -+ - /* Make sure we use the console uiout. It's possible that we are executing - breakpoint commands while running the MI interpreter. */ - interp *console = interp_lookup (current_ui, INTERP_CONSOLE); -diff --git a/gdb/testsuite/gdb.base/ui-redirect.exp b/gdb/testsuite/gdb.base/ui-redirect.exp -index 1ebff790e57..ab85eb059a0 100644 ---- a/gdb/testsuite/gdb.base/ui-redirect.exp -+++ b/gdb/testsuite/gdb.base/ui-redirect.exp -@@ -17,7 +17,10 @@ if { [prepare_for_testing "failed to prepare" ui-redirect start.c] } { - return -1 - } - --gdb_breakpoint main -+if ![runto_main] { -+ fail "can't run to main" -+ return -1 -+} - - set test "commands" - gdb_test_multiple $test $test { -@@ -34,8 +37,50 @@ gdb_test_multiple $test $test { - } - gdb_test_no_output "end" - -+with_test_prefix "userdefined" { -+ set test "define userdefined" -+ gdb_test_multiple $test $test { -+ -re "End with a line saying just \"end\"\\.\r\n>$" { -+ pass $test -+ } -+ } -+ -+ set test "bt" -+ gdb_test_multiple $test $test { -+ -re "\r\n>$" { -+ pass $test -+ } -+ } -+ -+ gdb_test_no_output "end" -+} -+ - gdb_test_no_output "set logging file /dev/null" - gdb_test "set logging on" "Copying output to /dev/null\\." - gdb_test "save breakpoints /dev/null" "Saved to file '/dev/null'\\." -+gdb_test "userdefined" "#0 main ().*" - gdb_test "set logging off" "Done logging to /dev/null\\." - gdb_test "help" "List of classes of commands:.*" -+ -+with_test_prefix "redirect" { -+ gdb_test "set logging redirect on" -+ gdb_test "set logging on" \ -+ "Redirecting output to /dev/null\\." -+ gdb_test_no_output "save breakpoints /dev/null" "Saved to file '/dev/null'\\." -+ gdb_test_no_output "userdefined" -+ gdb_test "set logging off" "Done logging to /dev/null\\." -+ gdb_test "help" "List of classes of commands:.*" -+} -+ -+with_test_prefix "redirect while already logging" { -+ gdb_test_no_output "set logging redirect off" -+ gdb_test "set logging on" \ -+ "Copying output to /dev/null\\." -+ gdb_test "set logging redirect on" \ -+ ".*warning: Currently logging .*Turn the logging off and on to make the new setting effective.*" -+ gdb_test "save breakpoints /dev/null" "Saved to file '/dev/null'\\." -+ gdb_test "userdefined" "#0 main ().*" -+ gdb_test "set logging off" "Done logging to /dev/null\\." -+ gdb_test "help" "List of classes of commands:.*" -+ gdb_test_no_output "set logging redirect off" -+} diff --git a/gdb-readline62-ask-more-rh.patch b/gdb-readline62-ask-more-rh.patch deleted file mode 100644 index 1b6d476..0000000 --- a/gdb-readline62-ask-more-rh.patch +++ /dev/null @@ -1,25 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-readline62-ask-more-rh.patch - -;; Work around readline-6.2 incompatibility not asking for --more-- (BZ 701131). -;;=fedora - -diff --git a/gdb/event-top.c b/gdb/event-top.c ---- a/gdb/event-top.c -+++ b/gdb/event-top.c -@@ -1179,6 +1179,13 @@ gdb_setup_readline (int editing) - { - struct ui *ui = current_ui; - -+#ifdef NEED_RL_STATE_FEDORA_GDB -+ /* 6.2 regression: no longed asks for --more-- -+ gdb.base/readline-ask.exp -+ https://bugzilla.redhat.com/show_bug.cgi?id=701131 */ -+ RL_SETSTATE (RL_STATE_FEDORA_GDB); -+#endif -+ - /* This function is a noop for the sync case. The assumption is - that the sync setup is ALL done in gdb_init, and we would only - mess it up here. The sync stuff should really go away over diff --git a/gdb-rhbz1371380-gcore-elf-headers.patch b/gdb-rhbz1371380-gcore-elf-headers.patch deleted file mode 100644 index 84feeb7..0000000 --- a/gdb-rhbz1371380-gcore-elf-headers.patch +++ /dev/null @@ -1,461 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Sergio Durigan Junior -Date: Tue, 23 Apr 2019 18:17:57 -0400 -Subject: gdb-rhbz1371380-gcore-elf-headers.patch - -;; Implement dump of mappings with ELF headers by gcore -;; RHBZ 1371380, Sergio Durigan Junior. - -Implement dump of mappings with ELF headers by gcore - -This patch has a long story, but it all started back in 2015, with -commit df8411da087dc05481926f4c4a82deabc5bc3859 ("Implement support -for checking /proc/PID/coredump_filter"). The purpose of that commit -was to bring GDB's corefile generation closer to what the Linux kernel -does. However, back then, I did not implement the full support for -the dumping of memory mappings containing ELF headers (like mappings -of DSOs or executables). These mappings were being dumped most of -time, though, because the default value of /proc/PID/coredump_filter -is 0x33, which would cause anonymous private mappings (DSOs/executable -code mappings have this type) to be dumped. Well, until something -happened on binutils... - -A while ago, I noticed something strange was happening with one of our -local testcases on Fedora GDB: it was failing due to some strange -build-id problem. On Fedora GDB, we (unfortunately) carry a bunch of -"local" patches, and some of these patches actually extend upstream's -build-id support in order to generate more useful information for the -user of a Fedora system (for example, when the user loads a corefile -into GDB, we detect whether the executable that generated that -corefile is present, and if it's not we issue a warning suggesting -that it should be installed, while also providing the build-id of the -executable). A while ago, Fedora GDB stopped printing those warnings. - -I wanted to investigate this right away, and spent some time trying to -determine what was going on, but other things happened and I got -sidetracked. Meanwhile, the bug started to be noticed by some of our -users, and its priority started changing. Then, someone on IRC also -mentioned the problem, and when I tried helping him, I noticed he -wasn't running Fedora. Hm... So maybe the bug was *also* present -upstream. - -After "some" time investigating, and with a lot of help from Keith and -others, I was finally able to determine that yes, the bug is also -present upstream, and that even though it started with a change in ld, -it is indeed a GDB issue. - -So, as I said, the problem started with binutils, more specifically -after the following commit was pushed: - - commit f6aec96dce1ddbd8961a3aa8a2925db2021719bb - Author: H.J. Lu - Date: Tue Feb 27 11:34:20 2018 -0800 - - ld: Add --enable-separate-code - -This commit makes ld use "-z separate-code" by default on x86-64 -machines. What this means is that code pages and data pages are now -separated in the binary, which is confusing GDB when it tries to decide -what to dump. - -BTW, Fedora 28 binutils doesn't have this code, which means that -Fedora 28 GDB doesn't have the problem. From Fedora 29 on, binutils -was rebased and incorporated the commit above, which started causing -Fedora GDB to fail. - -Anyway, the first thing I tried was to pass "-z max-page-size" and -specify a bigger page size (I saw a patch that did this and was -proposed to Linux, so I thought it might help). Obviously, this -didn't work, because the real "problem" is that ld will always use -separate pages for code and data. So I decided to look into how GDB -dumped the pages, and that's where I found the real issue. - -What happens is that, because of "-z separate-code", the first two pages -of the ELF binary are (from /proc/PID/smaps): - - 00400000-00401000 r--p 00000000 fc:01 799548 /file - Size: 4 kB - KernelPageSize: 4 kB - MMUPageSize: 4 kB - Rss: 4 kB - Pss: 4 kB - Shared_Clean: 0 kB - Shared_Dirty: 0 kB - Private_Clean: 4 kB - Private_Dirty: 0 kB - Referenced: 4 kB - Anonymous: 0 kB - LazyFree: 0 kB - AnonHugePages: 0 kB - ShmemPmdMapped: 0 kB - Shared_Hugetlb: 0 kB - Private_Hugetlb: 0 kB - Swap: 0 kB - SwapPss: 0 kB - Locked: 0 kB - THPeligible: 0 - VmFlags: rd mr mw me dw sd - 00401000-00402000 r-xp 00001000 fc:01 799548 /file - Size: 4 kB - KernelPageSize: 4 kB - MMUPageSize: 4 kB - Rss: 4 kB - Pss: 4 kB - Shared_Clean: 0 kB - Shared_Dirty: 0 kB - Private_Clean: 0 kB - Private_Dirty: 4 kB - Referenced: 4 kB - Anonymous: 4 kB - LazyFree: 0 kB - AnonHugePages: 0 kB - ShmemPmdMapped: 0 kB - Shared_Hugetlb: 0 kB - Private_Hugetlb: 0 kB - Swap: 0 kB - SwapPss: 0 kB - Locked: 0 kB - THPeligible: 0 - VmFlags: rd ex mr mw me dw sd - -Whereas before, we had only one: - - 00400000-00401000 r-xp 00000000 fc:01 798593 /file - Size: 4 kB - KernelPageSize: 4 kB - MMUPageSize: 4 kB - Rss: 4 kB - Pss: 4 kB - Shared_Clean: 0 kB - Shared_Dirty: 0 kB - Private_Clean: 0 kB - Private_Dirty: 4 kB - Referenced: 4 kB - Anonymous: 4 kB - LazyFree: 0 kB - AnonHugePages: 0 kB - ShmemPmdMapped: 0 kB - Shared_Hugetlb: 0 kB - Private_Hugetlb: 0 kB - Swap: 0 kB - SwapPss: 0 kB - Locked: 0 kB - THPeligible: 0 - VmFlags: rd ex mr mw me dw sd - -Notice how we have "Anonymous" data mapped into the page. This will be -important. - -So, the way GDB decides which pages it should dump has been revamped -by my patch in 2015, and now it takes the contents of -/proc/PID/coredump_filter into account. The default value for Linux -is 0x33, which means: - - Dump anonymous private, anonymous shared, ELF headers and HugeTLB - private pages. - -Or: - - filter_flags filterflags = (COREFILTER_ANON_PRIVATE - | COREFILTER_ANON_SHARED - | COREFILTER_ELF_HEADERS - | COREFILTER_HUGETLB_PRIVATE); - -Now, it is important to keep in mind that GDB doesn't always have *all* -of the necessary information to exactly determine the type of a page, so -the whole algorithm is based on heuristics (you can take a look at -linux-tdep.c:dump_mapping_p and -linux-tdep.c:linux_find_memory_regions_full for more info). - -Before the patch to make ld use "-z separate-code", the (single) page -containing data and code was being flagged as an anonymous (due to the -non-zero "Anonymous:" field) private (due to the "r-xp" permission), -which means that it was being dumped into the corefile. That's why it -was working fine. - -Now, as you can imagine, when "-z separate-code" is used, the *data* -page (which is where the ELF notes are, including the build-id one) now -doesn't have any "Anonymous:" mapping, so the heuristic is flagging it -as file-backed private, which is *not* dumped by default. - -The next question I had to answer was: how come a corefile generated by -the Linux kernel was correct? Well, the answer is that GDB, unlike -Linux, doesn't actually implement the COREFILTER_ELF_HEADERS support. -On Linux, even though the data page is also treated as a file-backed -private mapping, it is also checked to see if there are any ELF headers -in the page, and then, because we *do* have ELF headers there, it is -dumped. - -So, after more time trying to think of ways to fix this, I was able to -implement an algorithm that reads the first few bytes of the memory -mapping being processed, and checks to see if the ELF magic code is -present. This is basically what Linux does as well, except that, if -it finds the ELF magic code, it just dumps one page to the corefile, -whereas GDB will dump the whole mapping. But I don't think that's a -big issue, to be honest. - -It's also important to explain that we *only* perform the ELF magic -code check if: - - - The algorithm has decided *not* to dump the mapping so far, and; - - The mapping is private, and; - - The mapping's offset is zero, and; - - The user has requested us to dump mappings with ELF headers. - -IOW, we're not going to blindly check every mapping. - -As for the testcase, I struggled even more trying to write it. Since -our build-id support on upstream GDB is not very extensive, it's not -really possible to determine whether a corefile contains build-id -information or not just by using GDB. So, after thinking a lot about -the problem, I decided to rely on an external tool, eu-unstrip, in -order to verify whether the dump was successful. I verified the test -here on my machine, and everything seems to work as expected (i.e., it -fails without the patch, and works with the patch applied). We are -working hard to upstream our "local" Fedora GDB patches, and we intend -to submit our build-id extension patches "soon", so hopefully we'll be -able to use GDB itself to perform this verification. - -I built and regtested this on the BuildBot, and no problems were -found. - -gdb/ChangeLog: -2019-04-25 Sergio Durigan Junior - - PR corefiles/11608 - PR corefiles/18187 - * linux-tdep.c (dump_mapping_p): Add new parameters ADDR and - OFFSET. Verify if current mapping contains an ELF header. - (linux_find_memory_regions_full): Adjust call to - dump_mapping_p. - -gdb/testsuite/ChangeLog: -2019-04-25 Sergio Durigan Junior - - PR corefiles/11608 - PR corefiles/18187 - * gdb.base/coredump-filter-build-id.exp: New file. - -diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c ---- a/gdb/linux-tdep.c -+++ b/gdb/linux-tdep.c -@@ -591,8 +591,8 @@ mapping_is_anonymous_p (const char *filename) - } - - /* Return 0 if the memory mapping (which is related to FILTERFLAGS, V, -- MAYBE_PRIVATE_P, and MAPPING_ANONYMOUS_P) should not be dumped, or -- greater than 0 if it should. -+ MAYBE_PRIVATE_P, MAPPING_ANONYMOUS_P, ADDR and OFFSET) should not -+ be dumped, or greater than 0 if it should. - - In a nutshell, this is the logic that we follow in order to decide - if a mapping should be dumped or not. -@@ -630,12 +630,17 @@ mapping_is_anonymous_p (const char *filename) - see 'p' in the permission flags, then we assume that the mapping - is private, even though the presence of the 's' flag there would - mean VM_MAYSHARE, which means the mapping could still be private. -- This should work OK enough, however. */ -+ This should work OK enough, however. -+ -+ - Even if, at the end, we decided that we should not dump the -+ mapping, we still have to check if it is something like an ELF -+ header (of a DSO or an executable, for example). If it is, and -+ if the user is interested in dump it, then we should dump it. */ - - static int - dump_mapping_p (filter_flags filterflags, const struct smaps_vmflags *v, - int maybe_private_p, int mapping_anon_p, int mapping_file_p, -- const char *filename) -+ const char *filename, ULONGEST addr, ULONGEST offset) - { - /* Initially, we trust in what we received from our caller. This - value may not be very precise (i.e., it was probably gathered -@@ -645,6 +650,7 @@ dump_mapping_p (filter_flags filterflags, const struct smaps_vmflags *v, - (assuming that the version of the Linux kernel being used - supports it, of course). */ - int private_p = maybe_private_p; -+ int dump_p; - - /* We always dump vDSO and vsyscall mappings, because it's likely that - there'll be no file to read the contents from at core load time. -@@ -685,13 +691,13 @@ dump_mapping_p (filter_flags filterflags, const struct smaps_vmflags *v, - /* This is a special situation. It can happen when we see a - mapping that is file-backed, but that contains anonymous - pages. */ -- return ((filterflags & COREFILTER_ANON_PRIVATE) != 0 -- || (filterflags & COREFILTER_MAPPED_PRIVATE) != 0); -+ dump_p = ((filterflags & COREFILTER_ANON_PRIVATE) != 0 -+ || (filterflags & COREFILTER_MAPPED_PRIVATE) != 0); - } - else if (mapping_anon_p) -- return (filterflags & COREFILTER_ANON_PRIVATE) != 0; -+ dump_p = (filterflags & COREFILTER_ANON_PRIVATE) != 0; - else -- return (filterflags & COREFILTER_MAPPED_PRIVATE) != 0; -+ dump_p = (filterflags & COREFILTER_MAPPED_PRIVATE) != 0; - } - else - { -@@ -700,14 +706,55 @@ dump_mapping_p (filter_flags filterflags, const struct smaps_vmflags *v, - /* This is a special situation. It can happen when we see a - mapping that is file-backed, but that contains anonymous - pages. */ -- return ((filterflags & COREFILTER_ANON_SHARED) != 0 -- || (filterflags & COREFILTER_MAPPED_SHARED) != 0); -+ dump_p = ((filterflags & COREFILTER_ANON_SHARED) != 0 -+ || (filterflags & COREFILTER_MAPPED_SHARED) != 0); - } - else if (mapping_anon_p) -- return (filterflags & COREFILTER_ANON_SHARED) != 0; -+ dump_p = (filterflags & COREFILTER_ANON_SHARED) != 0; - else -- return (filterflags & COREFILTER_MAPPED_SHARED) != 0; -+ dump_p = (filterflags & COREFILTER_MAPPED_SHARED) != 0; - } -+ -+ /* Even if we decided that we shouldn't dump this mapping, we still -+ have to check whether (a) the user wants us to dump mappings -+ containing an ELF header, and (b) the mapping in question -+ contains an ELF header. If (a) and (b) are true, then we should -+ dump this mapping. -+ -+ A mapping contains an ELF header if it is a private mapping, its -+ offset is zero, and its first word is ELFMAG. */ -+ if (!dump_p && private_p && offset == 0 -+ && (filterflags & COREFILTER_ELF_HEADERS) != 0) -+ { -+ /* Let's check if we have an ELF header. */ -+ gdb::unique_xmalloc_ptr header; -+ int errcode; -+ -+ /* Useful define specifying the size of the ELF magical -+ header. */ -+#ifndef SELFMAG -+#define SELFMAG 4 -+#endif -+ -+ /* Read the first SELFMAG bytes and check if it is ELFMAG. */ -+ if (target_read_string (addr, &header, SELFMAG, &errcode) == SELFMAG -+ && errcode == 0) -+ { -+ const char *h = header.get (); -+ -+ /* The EI_MAG* and ELFMAG* constants come from -+ . */ -+ if (h[EI_MAG0] == ELFMAG0 && h[EI_MAG1] == ELFMAG1 -+ && h[EI_MAG2] == ELFMAG2 && h[EI_MAG3] == ELFMAG3) -+ { -+ /* This mapping contains an ELF header, so we -+ should dump it. */ -+ dump_p = 1; -+ } -+ } -+ } -+ -+ return dump_p; - } - - /* Implement the "info proc" command. */ -@@ -1311,7 +1358,7 @@ linux_find_memory_regions_full (struct gdbarch *gdbarch, - if (has_anonymous) - should_dump_p = dump_mapping_p (filterflags, &v, priv, - mapping_anon_p, mapping_file_p, -- filename); -+ filename, addr, offset); - else - { - /* Older Linux kernels did not support the "Anonymous:" counter. -diff --git a/gdb/testsuite/gdb.base/coredump-filter-build-id.exp b/gdb/testsuite/gdb.base/coredump-filter-build-id.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/coredump-filter-build-id.exp -@@ -0,0 +1,69 @@ -+# Copyright 2019 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# Test whether GDB's gcore/generate-core-file command can dump memory -+# mappings with ELF headers, containing a build-id note. -+# -+# Due to the fact that we don't have an easy way to process a corefile -+# and look for specific notes using GDB/dejagnu, we rely on an -+# external tool, eu-unstrip, to verify if the corefile contains -+# build-ids. -+ -+standard_testfile "normal.c" -+ -+# This test is Linux x86_64 only. -+if { ![istarget *-*-linux*] } { -+ untested "$testfile.exp" -+ return -1 -+} -+if { ![istarget "x86_64-*-*"] || ![is_lp64_target] } { -+ untested "$testfile.exp" -+ return -1 -+} -+ -+if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } { -+ return -1 -+} -+ -+if { ![runto_main] } { -+ untested "could not run to main" -+ return -1 -+} -+ -+# First we need to generate a corefile. -+set corefilename "[standard_output_file gcore.test]" -+if { ![gdb_gcore_cmd "$corefilename" "save corefile"] } { -+ verbose -log "Could not save corefile" -+ untested "$testfile.exp" -+ return -1 -+} -+ -+# Determine if GDB dumped the mapping containing the build-id. This -+# is done by invoking an external program (eu-unstrip). -+if { [catch "exec [gdb_find_eu-unstrip] -n --core $corefilename" output] == 0 } { -+ set line [lindex [split $output "\n"] 0] -+ set test "gcore dumped mapping with build-id" -+ -+ verbose -log "First line of eu-unstrip: $line" -+ -+ if { [regexp "^${hex}\\+${hex} \[a-f0-9\]+@${hex}.*[string_to_regexp $binfile]$" $line] } { -+ pass "$test" -+ } else { -+ fail "$test" -+ } -+} else { -+ verbose -log "Could not execute eu-unstrip program" -+ untested "$testfile.exp" -+} -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 -@@ -162,6 +162,16 @@ proc gdb_find_readelf {} { - return $readelf - } - -+proc gdb_find_eu-unstrip {} { -+ global EU_UNSTRIP_FOR_TARGET -+ if [info exists EU_UNSTRIP_FOR_TARGET] { -+ set eu_unstrip $EU_UNSTRIP_FOR_TARGET -+ } else { -+ set eu_unstrip [transform eu-unstrip] -+ } -+ return $eu_unstrip -+} -+ - proc gdb_default_target_compile {source destfile type options} { - global target_triplet - global tool_root_dir diff --git a/gdb-rhbz1553086-binutils-warning-loadable-section-outside-elf.patch b/gdb-rhbz1553086-binutils-warning-loadable-section-outside-elf.patch deleted file mode 100644 index 7c8c31e..0000000 --- a/gdb-rhbz1553086-binutils-warning-loadable-section-outside-elf.patch +++ /dev/null @@ -1,84 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Nick Clifton -Date: Tue, 2 Jul 2019 15:58:29 +0100 -Subject: gdb-rhbz1553086-binutils-warning-loadable-section-outside-elf.patch - -;; Fix 'gdb: warning: Loadable section ".note.gnu.property" outside of -;; ELF segments' (Nick Clifton, RH BZ 1553086). -;; This is a binutils patch. - -Stop the BFD library from issuing a warning message when processing allocated sections in debuginfo files that lie outside of any loadable segment. - - PR 24717 - * elf.c (is_debuginfo_file): New function. - (assign_file_positions_for_non_load_sections): Do not warn about - allocated sections outside of loadable segments if they are found - in a debuginfo file. - * elf-bfd.h (is_debuginfo_file): Prototype. - -diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h ---- a/bfd/elf-bfd.h -+++ b/bfd/elf-bfd.h -@@ -2751,6 +2751,8 @@ extern bfd_vma elf64_r_sym (bfd_vma); - extern bfd_vma elf32_r_info (bfd_vma, bfd_vma); - extern bfd_vma elf32_r_sym (bfd_vma); - -+extern bfd_boolean is_debuginfo_file (bfd *); -+ - /* Large common section. */ - extern asection _bfd_elf_large_com_section; - -diff --git a/bfd/elf.c b/bfd/elf.c ---- a/bfd/elf.c -+++ b/bfd/elf.c -@@ -5800,6 +5800,35 @@ assign_file_positions_for_load_sections (bfd *abfd, - return TRUE; - } - -+/* Determine if a bfd is a debuginfo file. Unfortunately there -+ is no defined method for detecting such files, so we have to -+ use heuristics instead. */ -+ -+bfd_boolean -+is_debuginfo_file (bfd *abfd) -+{ -+ if (abfd == NULL || bfd_get_flavour (abfd) != bfd_target_elf_flavour) -+ return FALSE; -+ -+ Elf_Internal_Shdr **start_headers = elf_elfsections (abfd); -+ Elf_Internal_Shdr **end_headers = start_headers + elf_numsections (abfd); -+ Elf_Internal_Shdr **headerp; -+ -+ for (headerp = start_headers; headerp < end_headers; headerp ++) -+ { -+ Elf_Internal_Shdr *header = * headerp; -+ -+ /* Debuginfo files do not have any allocated SHT_PROGBITS sections. -+ The only allocated sections are SHT_NOBITS or SHT_NOTES. */ -+ if ((header->sh_flags & SHF_ALLOC) == SHF_ALLOC -+ && header->sh_type != SHT_NOBITS -+ && header->sh_type != SHT_NOTE) -+ return FALSE; -+ } -+ -+ return TRUE; -+} -+ - /* Assign file positions for the other sections. */ - - static bfd_boolean -@@ -5833,7 +5862,13 @@ assign_file_positions_for_non_load_sections (bfd *abfd, - BFD_ASSERT (hdr->sh_offset == hdr->bfd_section->filepos); - else if ((hdr->sh_flags & SHF_ALLOC) != 0) - { -- if (hdr->sh_size != 0) -+ if (hdr->sh_size != 0 -+ /* PR 24717 - debuginfo files are known to be not strictly -+ compliant with the ELF standard. In particular they often -+ have .note.gnu.property sections that are outside of any -+ loadable segment. This is not a problem for such files, -+ so do not warn about them. */ -+ && ! is_debuginfo_file (abfd)) - _bfd_error_handler - /* xgettext:c-format */ - (_("%pB: warning: allocated section `%s' not in segment"), diff --git a/gdb-rhbz1704406-disable-style-log-output-1of3.patch b/gdb-rhbz1704406-disable-style-log-output-1of3.patch deleted file mode 100644 index 2afde91..0000000 --- a/gdb-rhbz1704406-disable-style-log-output-1of3.patch +++ /dev/null @@ -1,88 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Tom Tromey -Date: Tue, 14 May 2019 08:04:22 -0600 -Subject: gdb-rhbz1704406-disable-style-log-output-1of3.patch - -;; Fix 'Color control codes should not appear in logging output' -;; Tom Tromey, RH BZ 1704406 - -Add "style" proc to the test suite - -This adds a "style" helper proc to the test suite, and updates -existing style tests to use it. Thanks to Sergio for the idea. - -Tested on x86-64 Fedora 29. - -gdb/testsuite/ChangeLog -2019-05-22 Tom Tromey - - * gdb.base/info-shared.exp (check_info_shared): Use "style". - * gdb.base/style.exp: Use "style". - * lib/gdb-utils.exp (style): New proc. - -diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp ---- a/gdb/testsuite/gdb.base/style.exp -+++ b/gdb/testsuite/gdb.base/style.exp -@@ -41,10 +41,10 @@ save_vars { env(TERM) } { - - gdb_test_no_output "set style enabled on" - -- set main_expr "\033\\\[33mmain\033\\\[m" -- set base_file_expr "\033\\\[32m.*style\\.c\033\\\[m" -+ set main_expr [style main function] -+ set base_file_expr [style ".*style\\.c" file] - set file_expr "$base_file_expr:\[0-9\]" -- set arg_expr "\033\\\[36marg.\033\\\[m" -+ set arg_expr [style "arg." variable] - - gdb_test "frame" \ - "$main_expr.*$arg_expr.*$arg_expr.*$file_expr.*" -@@ -58,7 +58,7 @@ save_vars { env(TERM) } { - - gdb_test "break main" "file $base_file_expr.*" - -- gdb_test "print &main" " = .* \033\\\[34m$hex\033\\\[m <$main_expr>" -+ gdb_test "print &main" " = .* [style $hex address] <$main_expr>" - - # Regression test for a bug where line-wrapping would occur at the - # wrong spot with styling. There were different bugs at different -@@ -86,11 +86,12 @@ save_vars { env(TERM) } { - gdb_exit - gdb_spawn - -- gdb_test "" "\033\\\[35;1mGNU gdb.*\033\\\[m.*" \ -+ set vers [style "GNU gdb.*" "35;1"] -+ gdb_test "" "${vers}.*" \ - "version is styled" - - set quoted [string_to_regexp $binfile] - gdb_test "file $binfile" \ -- "Reading symbols from \033\\\[32m${quoted}\033\\\[m..." \ -+ "Reading symbols from [style $quoted file]..." \ - "filename is styled when loading symbol file" - } -diff --git a/gdb/testsuite/lib/gdb-utils.exp b/gdb/testsuite/lib/gdb-utils.exp ---- a/gdb/testsuite/lib/gdb-utils.exp -+++ b/gdb/testsuite/lib/gdb-utils.exp -@@ -37,3 +37,21 @@ proc string_to_regexp {str} { - regsub -all {[]*+.|(){}^$\[\\]} $str {\\&} result - return $result - } -+ -+# Wrap STR in an ANSI terminal escape sequences -- one to set the -+# style to STYLE, and one to reset the style to the default. The -+# return value is suitable for use as a regular expression. -+ -+# STYLE can either be the payload part of an ANSI terminal sequence, -+# or a shorthand for one of the gdb standard styles: "file", -+# "function", "variable", or "address". -+ -+proc style {str style} { -+ switch -exact -- $style { -+ file { set style 32 } -+ function { set style 33 } -+ variable { set style 36 } -+ address { set style 34 } -+ } -+ return "\033\\\[${style}m${str}\033\\\[m" -+} diff --git a/gdb-rhbz1704406-disable-style-log-output-2of3.patch b/gdb-rhbz1704406-disable-style-log-output-2of3.patch deleted file mode 100644 index aac03c9..0000000 --- a/gdb-rhbz1704406-disable-style-log-output-2of3.patch +++ /dev/null @@ -1,194 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Tom Tromey -Date: Tue, 30 Apr 2019 11:17:15 -0600 -Subject: gdb-rhbz1704406-disable-style-log-output-2of3.patch - -;; Fix 'Color control codes should not appear in logging output' -;; Tom Tromey, RH BZ 1704406 - -Do not emit style escape sequences to log file - -PR gdb/24502 requests that the "set logging" log file not contain -style escape sequences emitted by gdb. - -This seemed like a reasonable request to me, so this patch implements -filtering for the log file. - -This also updates a comment in ui-style.h that I noticed while writing -the patch. - -Tested on x86-64 Fedora 29. - -gdb/ChangeLog -2019-06-14 Tom Tromey - - PR gdb/24502: - * ui-style.h (skip_ansi_escape): Update comment. - * ui-file.h (class no_terminal_escape_file): New class. - * ui-file.c (no_terminal_escape_file::write) - (no_terminal_escape_file::puts): New methods. - * cli/cli-logging.c (handle_redirections): Use - no_terminal_escape_file. - -gdb/testsuite/ChangeLog -2019-06-14 Tom Tromey - - PR gdb/24502: - * gdb.base/style-logging.exp: New file. - -diff --git a/gdb/cli/cli-logging.c b/gdb/cli/cli-logging.c ---- a/gdb/cli/cli-logging.c -+++ b/gdb/cli/cli-logging.c -@@ -117,7 +117,7 @@ handle_redirections (int from_tty) - return; - } - -- stdio_file_up log (new stdio_file ()); -+ stdio_file_up log (new no_terminal_escape_file ()); - if (!log->open (logging_filename, logging_overwrite ? "w" : "a")) - perror_with_name (_("set logging")); - -diff --git a/gdb/testsuite/gdb.base/style-logging.exp b/gdb/testsuite/gdb.base/style-logging.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/style-logging.exp -@@ -0,0 +1,64 @@ -+# Copyright 2019 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# Test that logging does not style. -+ -+if {[is_remote host]} { -+ untested "does not work on remote host" -+ return 0 -+} -+ -+standard_testfile style.c -+ -+save_vars { env(TERM) } { -+ # We need an ANSI-capable terminal to get the output. -+ setenv TERM ansi -+ -+ if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { -+ return -1 -+ } -+ -+ if {![runto_main]} { -+ fail "style tests failed" -+ return -+ } -+ -+ gdb_test_no_output "set style enabled on" -+ -+ set log_name [standard_output_file log.txt] -+ gdb_test_no_output "set logging file $log_name" -+ gdb_test_no_output "set logging overwrite on" -+ gdb_test "set logging on" "Copying output to .*" -+ -+ set main_expr [style main function] -+ set base_file_expr [style ".*style\\.c" file] -+ set file_expr "$base_file_expr:\[0-9\]" -+ set arg_expr [style "arg." variable] -+ gdb_test "frame" \ -+ "$main_expr.*$arg_expr.*$arg_expr.*$file_expr.*" -+ -+ gdb_test "set logging off" "Done logging to .*" -+ -+ set fd [open $log_name] -+ set data [read -nonewline $fd] -+ close $fd -+ -+ set testname "log is escape-free" -+ if {[regexp "\033" $data]} { -+ fail $testname -+ } else { -+ pass $testname -+ } -+} -diff --git a/gdb/ui-file.c b/gdb/ui-file.c ---- a/gdb/ui-file.c -+++ b/gdb/ui-file.c -@@ -332,3 +332,33 @@ tee_file::isatty () - { - return m_one->isatty (); - } -+ -+void -+no_terminal_escape_file::write (const char *buf, long length_buf) -+{ -+ std::string copy (buf, length_buf); -+ this->puts (copy.c_str ()); -+} -+ -+/* See ui-file.h. */ -+ -+void -+no_terminal_escape_file::puts (const char *buf) -+{ -+ while (*buf != '\0') -+ { -+ const char *esc = strchr (buf, '\033'); -+ if (esc == nullptr) -+ break; -+ -+ int n_read = 0; -+ if (!skip_ansi_escape (esc, &n_read)) -+ ++esc; -+ -+ this->stdio_file::write (buf, esc - buf); -+ buf = esc + n_read; -+ } -+ -+ if (*buf != '\0') -+ this->stdio_file::write (buf, strlen (buf)); -+} -diff --git a/gdb/ui-file.h b/gdb/ui-file.h ---- a/gdb/ui-file.h -+++ b/gdb/ui-file.h -@@ -264,4 +264,20 @@ private: - bool m_close_one, m_close_two; - }; - -+/* A ui_file implementation that filters out terminal escape -+ sequences. */ -+ -+class no_terminal_escape_file : public stdio_file -+{ -+public: -+ no_terminal_escape_file () -+ { -+ } -+ -+ /* Like the stdio_file methods, but these filter out terminal escape -+ sequences. */ -+ void write (const char *buf, long length_buf) override; -+ void puts (const char *linebuffer) override; -+}; -+ - #endif -diff --git a/gdb/ui-style.h b/gdb/ui-style.h ---- a/gdb/ui-style.h -+++ b/gdb/ui-style.h -@@ -233,8 +233,8 @@ private: - - /* Skip an ANSI escape sequence in BUF. BUF must begin with an ESC - character. Return true if an escape sequence was successfully -- skipped; false otherwise. In either case, N_READ is updated to -- reflect the number of chars read from BUF. */ -+ skipped; false otherwise. If an escape sequence was skipped, -+ N_READ is updated to reflect the number of chars read from BUF. */ - - extern bool skip_ansi_escape (const char *buf, int *n_read); - diff --git a/gdb-rhbz1704406-disable-style-log-output-3of3.patch b/gdb-rhbz1704406-disable-style-log-output-3of3.patch deleted file mode 100644 index 9ffd67d..0000000 --- a/gdb-rhbz1704406-disable-style-log-output-3of3.patch +++ /dev/null @@ -1,30 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Andrew Burgess -Date: Fri, 14 Jun 2019 23:31:10 +0100 -Subject: gdb-rhbz1704406-disable-style-log-output-3of3.patch - -;; Fix 'Color control codes should not appear in logging output' -;; Tom Tromey, RH BZ 1704406 - -gdb: Remove file path from test name - -Having paths in test names makes comparing sum files difficult, rename -a test to avoid paths in test names. - -gdb/testsuite/ChangeLog: - - * gdb.base/style-logging.exp: Remove path from test name. - -diff --git a/gdb/testsuite/gdb.base/style-logging.exp b/gdb/testsuite/gdb.base/style-logging.exp ---- a/gdb/testsuite/gdb.base/style-logging.exp -+++ b/gdb/testsuite/gdb.base/style-logging.exp -@@ -38,7 +38,8 @@ save_vars { env(TERM) } { - gdb_test_no_output "set style enabled on" - - set log_name [standard_output_file log.txt] -- gdb_test_no_output "set logging file $log_name" -+ gdb_test_no_output "set logging file $log_name" \ -+ "set logging filename" - gdb_test_no_output "set logging overwrite on" - gdb_test "set logging on" "Copying output to .*" - diff --git a/gdb-rhbz1708192-parse_macro_definition-crash.patch b/gdb-rhbz1708192-parse_macro_definition-crash.patch deleted file mode 100644 index 84d5f92..0000000 --- a/gdb-rhbz1708192-parse_macro_definition-crash.patch +++ /dev/null @@ -1,69 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Sergio Durigan Junior -Date: Fri, 10 May 2019 16:57:26 -0400 -Subject: gdb-rhbz1708192-parse_macro_definition-crash.patch - -;; "Fix" segfault that happens on parse_macro_definition because -;; debugedit corrupts the .debug_macro section. -;; Sergio Durigan Junior, RH BZ 1708192. - -Don't crash if dwarf_decode_macro_bytes's 'body' is NULL - -Hi, - -Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1708192 - https://bugzilla.redhat.com/show_bug.cgi?id=1708786 - -During the Fedora RPM build process, gdb-add-index is invoked to -extract the DWARF index from the binary, and GDB will segfault because -dwarf2read.c:parse_definition_macro's 'body' variable is NULL. - -The underlying problem is that Fedora's rpm-build's "debugedit" -program will silently corrupt .debug_macro strings when a binary is -compiled with -g3. This is being taken care of by Mark Wielaard, -here: - - https://bugzilla.redhat.com/show_bug.cgi?id=1708786 - -However, I still feel it's important to make GDB more resilient -against invalid DWARF input, so I'm proposing this rather simple patch -to catch the situation when "body == NULL" (i.e., it's probably been -corrupted) and issue a complaint. This is not a real fix to the -problem, of course, but at least GDB is able to finish without -segfaulting. - -OK for master? - -gdb/ChangeLog: -2019-05-15 Sergio Durigan Junior - - Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1708192 - * dwarf2read.c (dwarf_decode_macro_bytes): Check whether 'body' is - NULL, and complain if that's the case. - -diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c ---- a/gdb/dwarf2read.c -+++ b/gdb/dwarf2read.c -@@ -24627,7 +24627,21 @@ dwarf_decode_macro_bytes (struct dwarf2_cu *cu, - is_define ? _("definition") : _("undefinition"), - line == 0 ? _("zero") : _("non-zero"), line, body); - -- if (is_define) -+ if (body == NULL) -+ { -+ /* Fedora's rpm-build's "debugedit" binary -+ corrupted .debug_macro sections. -+ -+ For more info, see -+ https://bugzilla.redhat.com/show_bug.cgi?id=1708786 */ -+ complaint (_("debug info gives %s invalid macro %s " -+ "without body (corrupted?) at line %d " -+ "on file %s"), -+ at_commandline ? _("command-line") : _("in-file"), -+ is_define ? _("definition") : _("undefinition"), -+ line, current_file->filename); -+ } -+ else if (is_define) - parse_macro_definition (current_file, line, body); - else - { diff --git a/gdb-rhbz1723564-gdb-crash-PYTHONMALLOC-debug.patch b/gdb-rhbz1723564-gdb-crash-PYTHONMALLOC-debug.patch deleted file mode 100644 index 2a61e12..0000000 --- a/gdb-rhbz1723564-gdb-crash-PYTHONMALLOC-debug.patch +++ /dev/null @@ -1,110 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Sergio Durigan Junior -Date: Thu, 27 Jun 2019 13:14:26 -0400 -Subject: gdb-rhbz1723564-gdb-crash-PYTHONMALLOC-debug.patch - -;; Fix 'gdb crash when using PYTHONMALLOC=debug on Python' -;; RHBZ 1723564, Sergio Durigan Junior. - -Fix crash when using PYTHONMALLOC=debug (PR python/24742) - -This bug was originally reported against Fedora GDB: - - https://bugzilla.redhat.com/show_bug.cgi?id=1723564 - -The problem is that GDB will crash in the following scenario: - -- PYTHONMALLOC=debug or PYTHONDEVMODE=1 is set. - -- The Python debuginfo is installed. - -- GDB is used to debug Python. - -The crash looks like this: - - $ PYTHONMALLOC=debug gdb -args python3 -c pass - GNU gdb (GDB) Fedora 8.3-3.fc30 - Reading symbols from python3... - Reading symbols from /usr/lib/debug/usr/bin/python3.7m-3.7.3-3.fc30.x86_64.debug... - (gdb) run - Starting program: /usr/bin/python3 -c pass - Missing separate debuginfos, use: dnf debuginfo-install glibc-2.29-9.fc30.x86_64 - Debug memory block at address p=0x5603977bf330: API '' - 8098648152243306496 bytes originally requested - The 7 pad bytes at p-7 are not all FORBIDDENBYTE (0xfb): - at p-7: 0x03 *** OUCH - at p-6: 0x00 *** OUCH - at p-5: 0x00 *** OUCH - at p-4: 0x00 *** OUCH - at p-3: 0x00 *** OUCH - at p-2: 0x00 *** OUCH - at p-1: 0x00 *** OUCH - Because memory is corrupted at the start, the count of bytes requested - may be bogus, and checking the trailing pad bytes may segfault. - The 8 pad bytes at tail=0x706483999ad1f330 are Segmentation fault (core dumped) - -It's hard to determine what happens, but after doing some -investigation and talking to Victor Stinner I found that GDB should -not use the Python memory allocation functions before the Python -interpreter is initialized (which makes sense). However, we do just -that on python/python.c:do_start_initialization: - - ... - progsize = strlen (progname.get ()); - progname_copy = (wchar_t *) PyMem_Malloc ((progsize + 1) * sizeof (wchar_t)); - ... - /* Note that Py_SetProgramName expects the string it is passed to - remain alive for the duration of the program's execution, so - it is not freed after this call. */ - Py_SetProgramName (progname_copy); - ... - Py_Initialize (); - PyEval_InitThreads (); - -Upon reading the Python 3 C API documentation, I -found (https://docs.python.org/3.5/c-api/memory.html): - - To avoid memory corruption, extension writers should never try to - operate on Python objects with the functions exported by the C - library: malloc(), calloc(), realloc() and free(). This will result in - mixed calls between the C allocator and the Python memory manager with - fatal consequences, because they implement different algorithms and - operate on different heaps. However, one may safely allocate and - release memory blocks with the C library allocator for individual - purposes[...] - -And Py_SetProgramName seems like a very simple call that doesn't need -a Python-allocated memory to work on. So I'm proposing this patch, -which simply replaces PyMem_Malloc by xmalloc. - -Testing this is more complicated. First, the crash is completely -non-deterministic; I was able to reproduce it 10 times in a row, and -then I wasn't able to reproduce it anymore. I found that if you -completely remove your build directory and rebuild GDB from scratch, -you can reproduce it again confidently. And with my patch, I -confirmed that the bug doesn't manifest even in this situation. - -No regressions found. - -OK to apply? - -gdb/ChangeLog: -2019-06-28 Sergio Durigan Junior - - PR python/24742 - https://bugzilla.redhat.com/show_bug.cgi?id=1723564 - * python/python.c (do_start_initialization): Use 'xmalloc' - instead of 'PyMem_Malloc'. - -diff --git a/gdb/python/python.c b/gdb/python/python.c ---- a/gdb/python/python.c -+++ b/gdb/python/python.c -@@ -1720,7 +1720,7 @@ do_start_initialization () - std::string oldloc = setlocale (LC_ALL, NULL); - setlocale (LC_ALL, ""); - progsize = strlen (progname.get ()); -- progname_copy = (wchar_t *) PyMem_Malloc ((progsize + 1) * sizeof (wchar_t)); -+ progname_copy = (wchar_t *) xmalloc ((progsize + 1) * sizeof (wchar_t)); - if (!progname_copy) - { - fprintf (stderr, "out of memory\n"); diff --git a/bfd-change-num_group-to-unsigned-int.patch b/gdb-rhbz1818011-bfd-gcc10-error.patch similarity index 74% rename from bfd-change-num_group-to-unsigned-int.patch rename to gdb-rhbz1818011-bfd-gcc10-error.patch index 7c19bf7..0f8140a 100644 --- a/bfd-change-num_group-to-unsigned-int.patch +++ b/gdb-rhbz1818011-bfd-gcc10-error.patch @@ -1,3 +1,15 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Kevin Buettner +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 is below: + bfd: Change num_group to unsigned int elf.c failed with to with GCC 10 as of @@ -23,15 +35,10 @@ 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. ---- - bfd/elf-bfd.h | 2 +- - 2 files changed, 6 insertions(+), 1 deletion(-) - diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h -index c546b583b8..5f3a5cc04b 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h -@@ -1953,7 +1953,7 @@ struct elf_obj_tdata +@@ -1937,7 +1937,7 @@ struct elf_obj_tdata struct sdt_note *sdt_note_head; Elf_Internal_Shdr **group_sect_ptr; diff --git a/gdb-rhbz795424-bitpos-20of25.patch b/gdb-rhbz795424-bitpos-20of25.patch deleted file mode 100644 index 8ea4e53..0000000 --- a/gdb-rhbz795424-bitpos-20of25.patch +++ /dev/null @@ -1,3435 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz795424-bitpos-20of25.patch - -;; Fix `GDB cannot access struct member whose offset is larger than 256MB' -;; (RH BZ 795424). -;;=push - -http://sourceware.org/ml/gdb-patches/2012-09/msg00631.html - ---MP_/yp5f+W_ED2JtUlSyBi8xujr -Content-Type: text/plain; charset=US-ASCII -Content-Transfer-Encoding: 7bit -Content-Disposition: inline - -Hi, - -This is patch 1/4, which implements the bulk of the changes in type -length and bitpos/type offset. I have verified that there are no -regressions resulting from this patch by running the testsuite on -Fedora 16 x86_64. Patch and changelog attached. - -Regards, -Siddhesh - ---MP_/yp5f+W_ED2JtUlSyBi8xujr -Content-Type: text/plain -Content-Transfer-Encoding: quoted-printable -Content-Disposition: attachment; filename=ChangeLog-main - -gdb/ChangeLog - -2012-08-05 Siddhesh Poyarekar - - * ada-lang.c (fat_pntr_bounds_bitpos): Return LONGEST. - (fat_pntr_data_bitpos): Likewise. - (desc_bound_bitpos): Likewise. - (constrained_packed_array_type): Expand ELT_BITS parameter to - LONGEST. - (move_bits): Expand parameters SRC_OFFSET and N to LONGEST. - (cond_offset_host): Expand parameter OFFSET to LONGEST. - (cond_offset_target): Likewise. - (ada_type_of_array): Expand ARRAY_BITSIZE to LONGEST. - (decode_constrained_packed_array_type): Expand BITS to LONGEST. - (decode_constrained_packed_array): Expand BIT_POS to LONGEST. - (ada_value_primitive_packed_val): Expand parameter OFFSET to - LONGEST. Expand TARG, NTARG and NEW_OFFSET to LONGEST. - (ada_value_assign): Expand FROM_SIZE to LONGEST. - (value_assign_to_component): Expand BITS to LONGEST. - (ensure_lval): Expand LEN to LONGEST. - (value_pointer): Expand LEN to ULONGEST. - (value_tag_from_contents_and_address): Expand TAG_BYTE_OFFSET to - LONGEST. - (ada_value_primitive_field): Expand parameter OFFSET to LONGEST. - Expand bit_pos to LONGEST. - (find_struct_field): Expand parameters OFFSET and BYTE_OFFSET_P to - LONGEST. Expand BIT_POS and FLD_OFFSET to LONGEST. - (ada_search_struct_field): Expand parameter OFFSET to LONGEST. - Expand VAR_OFFSET to LONGEST. - (ada_index_struct_field): Expand parameters INDEX and OFFSET to - LONGEST. - (ada_index_struct_field_1): Expand parameters INDEX_P and OFFSET - to LONGEST. - (ada_value_struct_elt): Expand BYTE_OFFSET to LONGEST. - (align_value): Return ULONGEST. Expand parameter OFF and - ALIGNMENT to ULONGEST. - (ada_template_to_fixed_record_type_1): Expand OFF, BIT_LEN and - fld_bit_len to LONGEST. Expand FIELD_OFFSET to LONGEST. Use - pulongest function to print TYPE_LENGTH. - (to_fixed_array_type): Expand LEN to LONGEST. - * ada-lang.h (ada_val_print): Expand parameter EMBEDDED_OFFSET to - LONGEST. - (ada_printstr): Expand parameter LENGTH to ULONGEST. - (ada_value_primitive_packed_val): Expand parameter OFFSET to - LONGEST. - * ada-typeprint.c (ada_print_type): Use pulongest to print - TYPE_LENGTH. - * ada-valprint.c (val_print_packed_array_elements): Expand ELTLEN - to ULONGEST. - (char_at): Expand parameter I to LONGEST. - (printstr): Expand parameter LENGTH, I, REP1, REPS to ULONGEST. - Use pulongest to format print REPS. - (ada_printstr): Expand parameter LENGTH to LONGEST. - (ada_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. - (ada_val_print_array): Expand ELTLEN, LEN to ULONGEST and TEMP_LEN - to LONGEST. - (ada_val_print_1): Expand parameter OFFSET to LONGEST. - (print_variant_part): Expand parameters OFFSET and OUTER_OFFSET to - LONGEST. - (print_field_values): Likewise. Expand BIT_POS to LONGEST. - * annotate.c (annotate_array_section_begin): Expand parameter - IDX to LONGEST. Use plongest to format-print IDX. - (annotate_elt_rep): Expand parameter REPCOUNT to ULONGEST. Use - plongest to format-print REPCOUNT. - * annotate.h: Likewise. - * arm-linux-nat.c (arm_linux_region_ok_for_hw_watchpoint): - Expand parameter parameter LEN to LONGEST. - * ax-gdb.c (gen_left_shift): Expand parameter DISTANCE to LONGEST. - (gen_offset): Expand parameter OFFSET to LONGEST. - (gen_bitfield_ref): Expand parameters START, END to LONGEST. - Expand BOUND_START, BOUND_END, OFFSET to LONGEST. - (gen_primitive_field): Expand parameter OFFSET to LONGEST. - (gen_struct_ref_recursive): Likewise. - * ax-general.c (ax_trace_quick): Expand parameter N to LONGEST. - * ax.h (ax_trace_quick): Likewise. - * breakpoint.c (breakpoint_address_match_range): Expand parameter - LEN1 to LONGEST. - (can_use_hardware_watchpoint): Expand LEN to LONGEST. - * breakpoint.h (struct bp_target_info): Expand member LENGTH to - LONGEST. - (struct bp_location): Likewise. - * c-lang.c (c_printstr): Expand parameter LENGTH to ULONGEST. - (evaluate_subexp_c): Expand ELEMENT_SIZE, I to LONGEST. - * c-lang.h (c_val_print): Expand parameter EMBEDDED_OFFSET to - LONGEST. - (c_printstr): Expand parameter LENGTH to ULONGEST. - (cp_print_value_fields): Expand parameter OFFSET to LONGEST. - (cp_print_value_fields_rtti): Likewise. - * c-typeprint.c (c_type_print_varspec_suffix): Remove cast down to - int and use plongest to print LONGEST. - * c-valprint.c (c_val_print): Expand parameter EMBEDDED_OFFSET to - LONGEST. Expand OFFSET to LONGEST, ELTLEN to ULONGEST. - (c_value_print): Expand TOP to LONGEST. - * cp-abi.c (baseclass_offset): Return LONGEST. Expand parameter - EMBEDDED_OFFSET to LONGEST. Expand RES to LONGEST. - (value_virtual_fn_field): Expand parameter OFFSET to LONGEST. - (value_rtti_type): Expand parameter TOP to point to LONGEST. - * cp-abi.h (value_virtual_fn_field): Expand OFFSET to LONGEST. - (value_rtti_type): Expand TOP to point to LONGEST. - (baseclass_offset): Return LONGEST. Expand parameter - EMBEDDED_OFFSET to LONGEST. - (struct cp_abi_ops): Expand parameter OFFSET for VIRTUAL_FN_FIELD - to LONGEST. Expand parameter TOP to point to LONGEST in - VALUE_RTTI_TYPE. Return LONGEST from BASECLASS_OFFSET and expand - parameter EMBEDDED_OFFSET to LONGEST. - * cp-valprint.c (cp_print_value_fields): Expand parameter OFFSET - to LONGEST. Expand I_OFFSET to LONGEST. - (cp_print_value_fields_rtti): Expand parameter OFFSET to - LONGEST. Expand TOP to LONGEST. - (cp_print_value): Expand parameter OFFSET to LONGEST. Expand - THISOFFSET, BOFFSET to LONGEST. - * d-lang.h (d_val_print): Expand parameter EMBEDDED_OFFSET to - LONGEST. - * d-valprint.c (dynamic_array_type): Likewise. - (d_val_print): Likewise. - * doublest.c (floatformat_from_length): Expand parameter LEN to - LONGEST. Use plongest to format string for LONGEST. - * dwarf2loc.c (copy_bitwise): Expand parameters DEST_OFFSET_BITS, - BIT_COUNT to ULONGEST. Rename parameter SOURCE_OFFSET_BITS to - SOURCE_OFFSET and expand to ULONGEST. New variable - SOURCE_OFFSET_BITS. - (read_pieced_value): Expand OFFSET, DEST_OFFSET_BITS, - SOURCE_OFFSET_BITS, SOURCE_OFFSET to LONGEST. Expand TYPE_LEN, - THIS_SIZE, THIS_SIZE_BITS to ULONGEST. - (write_pieced_value): Likewise. - (check_pieced_value_bits): Expand parameters BIT_OFFSET and - BIT_LENGTH to LONGEST. Expand THIS_SIZE_BITS to ULONGEST. - (check_pieced_value_validity): Expand parameters BIT_OFFSET and - BIT_LENGTH to LONGEST. - (check_pieced_synthetic_pointer): Likewise. - (indirect_pieced_value): Expand BIT_LENGTH, BYTE_OFFSET and - BIT_OFFSET to LONGEST. - (dwarf2_evaluate_loc_desc_full): Expand N to ULONGEST. - * dwarf2read.c (dwarf2_const_value_length_mismatch_complaint): - Expand parameters ARG2 and ARG3 to LONGEST. Use plongest to - print ARG2 and ARG3. - (dwarf2_add_field): Expand ANONYMOUS_SIZE, BIT_OFFSET to - LONGEST. - * eval.c (evaluate_struct_tuple): Expand BITPOS to LONGEST. - (init_array_element): Expand ELEMENT_SIZE to LONGEST. - (binop_promote): Expand PROMOTED_LEN1, PROMOTED_LEN2, RESULT_LEN - to ULONGEST. - (evaluate_subexp_standard): Expand MEM_OFFSET, TOP, ELEMENT_SIZE - to LONGEST. - * f-lang.c (f_printstr): Expand parameter LENGTH to ULONGEST. - * f-lang.h (f_val_print): Expand parameter EMBEDDED_OFFSET to - LONGEST. - * f-valprint.c (f77_array_offset_tbl): Make LONGEST. - (f77_create_arrayprint_offset_tbl): Expand ELTLEN to LONGEST. - (f77_print_array_1): Expand parameter EMBEDDED_OFFSET to - LONGEST. Expand I to LONGEST. - (f77_print_array): Expand parameter EMBEDDED_OFFSET to LONGEST. - (f_val_print): Likewise. Expand OFFSET to LONGEST. - * findvar.c (default_value_from_register): Expand LEN to LONGEST. - (read_frame_register_value): Expand OFFSET, REG_OFFSET, LEN, - REG_LEN to LONGEST. - * frame.c (get_frame_register_bytes): Expand parameter LEN to - LONGEST. - * frame.h (get_frame_register_bytes): Likewise. - * gdbtypes.c (init_type): Expand parameter LENGTH to LONGEST. - (is_unique_ancestor_worker): Expand parameters OFFSET, - EMBEDDED_OFFSET to LONGEST. Expand THIS_OFFSET to LONGEST. - (is_unique_ancestor): Expand OFFSET to LONGEST. - (recursive_dump_type): Use pulongest to format print TYPE_LENGTH. - Use plongest to format print TYPE_FIELD_BITPOS. - (arch_type): Expand parameter LENGTH to LONGEST. - * gdbtypes.h (struct type.main_type.fld_bnds.fields): Expand - member BITPOS to LONGEST. - (struct type): Expand member LENGTH to ULONGEST. - (init_type): Expand parameter LENGTH to LONGEST. - (arch_type): Likewise. - * gnu-v2-abi.c (gnuv2_virtual_fn_field): Expand parameter OFFSET - to LONGEST. - (gnuv2_value_rtti_type): Expand parameter TOP to point to LONGEST. - (gnuv2_baseclass_offset): Return LONGEST. Expand parameter - EMBEDDED_OFFSET to LONGEST. Expand FIELD_OFFSET, BOFFSET, - FIELD_LENGTH to LONGEST. - * gnu-v3-abi.c (build_gdb_vtable_type): Expand OFFSET to LONGEST. - (vtable_address_point_offset): Return LONGEST. - (gnuv3_rtti_type): Expand parameter TOP_P to point to LONGEST. - (gnuv3_virtual_fn_field): Expand parameter OFFSET to LONGEST. - (gnuv3_baseclass_offset): Return LONGEST. Expand parameter - EMBEDDED_OFSET to LONGEST. Expand CUR_BASE_OFFSET, BASE_OFFSET to - LONGEST. - (gnuv3_find_method_in): Expand POS to LONGEST. - * go-lang.h (go_val_print): Expand parameter EMBEDDED_OFFSET to - LONGEST. - * go-valprint.c (print_go_string): Likewise. - (go_val_print): Likewise. - * i386-nat.c (i386_handle_nonaligned_watchpoint): Expand - parameter LEN to LONGEST. - (i386_region_ok_for_watchpoint): Likewise. - * inf-ttrace.c (inf_ttrace_region_ok_for_hw_watchpoint): Expand - parameter LEN to LONGEST. - * jv-lang.c (java_link_class_type): Expand BOFFSET to LONGEST. - (java_printstr): Expand parameter LENGTH to ULONGEST. - * jv-lang.h (java_val_print): Expand parameter EMBEDDED_OFFSET to - LONGEST. - * jv-valprint.c (java_print_value_fields): Expand parameter OFFSET - to LONGEST. - (java_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. - * language.c (unk_lang_printstr): Expand parameter LENGTH to - ULONGEST. - (unk_lang_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. - * language.h (language_defn): Expand parameter LENGTH of - LA_PRINTSTR to ULONGEST. Expand parameter EMBEDDED_OFFSET of - LA_VAL_PRINT to LONGEST. - * m2-lang.c (m2_printstr): Expand parameter LENGTH to ULONGEST. - Expand I, REP1, REPS to ULONGEST. Use pulongest to format print - REPS. - * m2-lang.h (m2_val_print): Expand parameter embedded_offset to - LONGEST. - * m2-typeprint.c (m2_array): New variable VAL. Use pulongest to - * format print VAL. - (m2_enum): expand LASTVAL to LONGEST. - * m2-valprint.c (m2_print_long_set): Expand parameter - EMBEDDED_OFFSET to LONGEST. - (m2_print_unbounded_array): Likewise. - (m2_print_array_contents): Likewise. - (m2_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. - Expand I, LEN, TEMP_LEN to ULONGEST. - * memrange.c (mem_ranges_overlap): Expand parameters LEN1, LEN2 to - LONGEST. - * memrange.h (struct mem_range): Expand member LENGTH to LONGEST. - (mem_ranges_overlap): Expand parameters LEN1, LEN2 to LONGEST. - * mips-linux-nat.c (mips_linux_region_ok_for_hw_watchpoint): - Expand parameter LEN to LONGEST. - * objc-lang.c (objc_printstr): Expand parameter LENGTH to - ULONGEST. Expand I, REP1, REPS to ULONGEST. use pulongest to - format print REPS. - * opencl-lang.c (lookup_opencl_vector_type): Expand parameter - EL_LENGTH to ULONGEST. Expand LENGTH to ULONGEST. - (lval_func_read): Expand OFFSET, N, I, J and ELSIZE to LONGEST. - (lval_func_write): Likewise. - (lval_func_check_validity): Expand parameter LENGTH to LONGEST. - Expand ELSIZE, START, END, I, STARTREST, ENDREST, COMP_OFFSET, - COMP_LENGTH to LONGEST. - (lval_func_check_any_valid): Expand ELSIZE to LONGEST. - (lval_func_check_synthetic_pointer): Expand parameters OFFSET and - LENGTH to LONGEST. Expand ELSIZE, START, END, I, STARTREST, - ENDREST, COMP_LENGTH, COMP_OFFSET to LONGEST. - * p-lang.c (is_pascal_string_type): Expand parameters LENGTH_POS, - STRING_POS, LENGTH_SIZE to point to LONGEST. - (pascal_printstr): Expand parameter LENGTH to ULONGEST. Expand - I, REP1, REPS to ULONGEST. Use pulongest to format print REPS. - * p-lang.h (pascal_val_print): Expand parameter EMBEDDED_OFFSET - to LONGEST. - (is_pascal_string_type): Expand parameters LENGTH_POS, STRING_POS, - LENGTH_SIZE to point to LONGEST. - (pascal_printstr): Expand parameter LENGTH to ULONGEST. - (pascal_object_print_value_fields): Expand parameter OFFSET to - LONGEST. - * p-valprint.c (pascal_val_print): Expand parameter - EMBEDDED_OFFSET to LONGEST. Expand ELTLEN to ULONGEST. Expand - LENGTH_SIZE, LENGTH_POS, STRING_POS to LONGEST. - (pascal_object_print_value_fields): Expand parameter OFFSET to - LONGEST. - (pascal_object_print_value): Likewise. Expand BOFFSET, - THISOFFSET to LONGEST. - * ppc-linux-nat.c (ppc_linux_region_ok_for_hw_watchpoint): - Expand parameter LEN to point to LONGEST. - * printcmd.c (print_formatted): Expand LEN to LONGEST. - (print_scalar_formatted): Likewise. - * procfs.c (procfs_region_ok_for_hw_watchpoint): Expand - parameter LEN to LONGEST. - * python/py-prettyprint.c (apply_val_pretty_printer): Expand - parameter EMBEDDED_OFFSET to LONGEST. - * python/python.h (apply_val_pretty_printer): Likewise. - * regcache.c (regcache_xfer_part): Expand parameter OFFSET to - LONGEST. - (regcache_raw_read_part): Likewise. - (regcache_raw_write_part): Likewise. - (regcache_cooked_read_part): Likewise. - (regcache_cooked_write_part): Likewise. - * regcache.h (regcache_raw_read_part): Likewise. - (regcache_raw_write_part): Likewise. - (regcache_cooked_read_part): Likewise. - (regcache_cooked_write_part): Likewise. - * remote.c (remote_region_ok_for_hw_watchpoint): Expand - parameter LEN to LONGEST. - * s390-nat.c (s390_region_ok_for_hw_watchpoint): Expand - parameter LEN to LONGEST. - * spu-multiarch.c (spu_region_ok_for_hw_watchpoint): Expand - parameter len to LONGEST. - * stack.c (print_frame_nameless_args): Expand parameter START to - LONGEST. - (print_frame_args): Expand HIGHEST_OFFSET, CURRENT_OFFSET, - ARG_SIZE, START to LONGEST. - * symmisc.c (print_symbol): Expand I to ULONGEST. Use pulongest - to format print TYPE_LENGTH. - * target.c (default_region_ok_for_hw_watchpoint): Expand parameter - LEN to LONGEST. - (debug_to_region_ok_for_hw_watchpoint): Likewise. - * target.h (struct target_ops): Expand parameter LEN to LONGEST - for TO_REGION_OK_FOR_HW_WATCHPOINT. - * tracepoint.c (add_memrange): Expand parameter LEN to LONGEST. - Use plongest to format print LEN. - (collect_symbol): Expand LEN to ULONGEST. Use pulongest to - format print LEN. - (scope_info): Expand J to LONGEST. Use pulongest to format - print TYPE_LENGTH. - * typeprint.c (whatis_exp): Expand TOP to LONGEST. - * valarith.c (value_subscripted_rvalue): Expand parameters INDEX - and LOWERBOUND to LONGEST. Expand ELT_SIZE, ELT_OFFS to ULONGEST. - (value_concat): expand INVAL1LEN and INVAL2LEN to ssize_t. - (value_logical_not): Expand LEN to LONGEST. - (value_strcmp): Expand LEN1, LEN2, I, LEN to LONGEST. - * valops.c (value_allocate_space_in_inferior): Expand parameter - LEN to LONGEST. - (value_cast_structs): Expand TOP to LONGEST. - (value_cast): Expand ELEMENT_LENGTH to ULONGEST. Expand - VAL_LENGTH to LONGEST. - (dynamic_cast_check_1): Expand parameter EMBEDDED_OFFSET to - LONGEST. Expand OFFSET to LONGEST. - (dynamic_cast_check_2): Likewise. - (value_dynamic_cast): Expand TOP to LONGEST. - (read_value_memory): Expand EMBEDDED_OFFSET to LONGEST. - (value_assign): Expand CHANGED_LEN, OFFSET to LONGEST. - (value_array): Expand TYPELENGTH to ULONGEST. - (update_search_result): Expand parameters LAST_BOFFSET, BOFFSET - to LONGEST. - (do_search_struct_field): Expand parameter OFFSET, LAST_BOFFSET - to LONGEST. Expand NEW_OFFSET, BOFFSET to LONGEST. - (search_struct_field): Expand parameter OFFSET to LONGEST. - Expand BOFFSET to LONGEST. - (search_struct_method): Expand parameter OFFSET to LONGEST. - Expand BASE_OFFSET, THIS_OFFSET to LONGEST. - (find_method_list): Expand parameters OFFSET, BOFFSET to - LONGEST. Expand BASE_OFFSET to LONGEST. - (value_find_oload_method_list): Expand parameter BOFFSET to point - to LONGEST. - (find_overload_match): Expand BOFFSET to LONGEST. - (value_struct_elt_for_reference): Expand parameter OFFSET to - LONGEST. Remove unneeded cast. Expand BASE_OFFSET to LONGEST. - (value_rtti_indirect_type): Expand parameter TOP to point to - LONGEST. - (value_full_object): Expand parameter XTOP to LONGEST. Expand - TOP to LONGEST. - * valprint.c (valprint_check_validity): Expand parameter - EMBEDDED_OFFSET to LONGEST. - (generic_val_print): Likewise. - (val_print): Likewise. - (val_print_scalar_formatted): Likewise. - (print_hex_chars): Expand parameter LEN to ULONGEST. - (val_print_array_elements): Expand parameter EMBEDDED_OFFSET to - LONGEST, I to ULONGEST. Expand LEN, ELTLEN, REP1, REPS to - ULONGEST. Use pulongest to format print REPS. - (generic_printstr): Expand parameter LENGTH to ULONGEST. - * valprint.h (val_print_array_elements): Expand parameter - EMBEDDED_OFFSET to LONGEST. - (val_print_scalar_formatted): Likewise. - (print_hex_chars): Expand parameter LEN to ULONGEST. - (generic_val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. - (generic_printstr): Expand parameter LENGTH to ULONGEST. - * value.c (struct range): Expand members OFFSET, LENGTH to - LONGEST. - (ranges_overlap): Expand parameters OFFSET1, OFFSET2, LEN1 AND - LEN2 to LONGEST. - (range_contain): Expand parameter OFFSET, LENGTH to LONGEST. - (struct value): Expand members OFFSET, EMBEDDED_OFFSET, - POINTED_TO_OFFSET to LONGEST. - (value_bytes_available): Expand parameters OFFSET, LENGTH to - LONGEST. - (mark_value_bytes_unavailable): Likewise. - (find_first_range_overlap): Likewise. - (value_available_contents_eq): Expand parameters OFFSET1, OFFSET2 - and LENGTH to LONGEST. - (value_offset): Return LONGEST. - (set_value_offset): Expand parameter OFFSET to LONGEST. - (value_contents_copy_raw): Expand parameters SRC_OFFSET, - DST_OFFSET, LENGTH to ssize_t. - (value_contents_copy): Likewise. - (value_bits_valid): Expand parameters OFFSET, LENGTH to LONGEST. - (value_bits_synthetic_pointer): Likewise. - (value_embedded_offset): Return LONGEST. - (set_value_embedded_offset): Expand parameter VAL to LONGEST. - (value_pointed_to_offset): Return LONGEST. - (set_value_pointed_to_offset): Expand parameter VAL to LONGEST. - (set_internalvar_component): Expand parameter OFFSET to LONGEST. - (value_primitive_field): Likewise. Expand BITPOS, BOFFSET, - CONTAINER_BITSIZE to LONGEST. - (value_fn_field): Expand parameter OFFSET to LONGEST. - (unpack_value_bits_as_long_1): Expand parameters EMBEDDED_OFFSET, - BITPOS to LONGEST. Expand READ_OFFSET to LONGEST. - (unpack_value_bits_as_long): Expand parameter EMBEDED_OFFSET to - LONGEST. - (unpack_value_field_as_long_1): Likewise. Expand BITPOS to - LONGEST. - (unpack_value_field_as_long): Expand parameter EMBEDDED_OFFSET to - LONGEST. - (value_field_bitfield): Likewise. - (modify_field): Expand parameter BITPOS to LONGEST. Expand - BYTESIZE to LONGEST. - * value.h (value_offset): Return LONGEST. - (set_value_offset): Expand parameter OFFSET to LONGEST. - (value_pointed_to_offset): Return LONGEST. - (set_value_pointed_to_offset): Expand parameter VAL to LONGEST. - (value_embedded_offset): Return LONGEST. - (set_value_embedded_offset): Expand parameter VAL to LONGEST. - (struct lval_funcs): Expand parameters OFFSET and LENGTH to - LONGEST for CHECK_VALIDITY. Likewise for CHECK_SYNTHETIC_POINTER. - (valprint_check_validity): Expand parameter EMBEDDED_OFFSET to - LONGEST. - (value_bits_valid): Expand parameters OFFSET, LENGTH to LONGEST. - (value_bits_synthetic_pointer): Likewise. - (value_bytes_available): Likewise. - (mark_value_bytes_unavailable): Likewise. - (value_available_contents_eq): Fix comment. Expand parameters - OFFSET1, OFFSET2, LENGTH to LONGEST. - (read_value_memory): Expand parameter EMBEDDED_OFFSET to - LONGEST. - (unpack_value_bits_as_long): Expand parameter EMBEDDED_OFFSET to - LONGEST. - (unpack_value_field_as_long): Likewise. - (value_field_bitfield): Likewise. - (value_contents_copy_raw): Expand parameters SRC_OFFSET, - DST_OFFSET, LENGTH to LONGEST. - (value_contents_copy): Likewise. - (value_primitive_field): Expand parameter OFFSET to LONGEST. - (value_rtti_indirect_type): Expand parameter TOP to point to - LONGEST. - (value_full_object): Expand parameter XTOP to LONGEST. - (set_internalvar_component): Expand parameter OFFSET to LONGEST. - (value_fn_field): Expand parameter OFFSET to LONGEST. - (modify_field): Expand parameter BITPOS to LONGEST. - (val_print): Expand parameter EMBEDDED_OFFSET to LONGEST. - (value_allocate_space_in_inferior): Expand parameter LEN to - LONGEST. - -gdb/testsuite/ChangeLog: - -2012-08-05 Siddhesh Poyarekar - - * gdb.base/longest-types.exp: Add test case to get offset of - BUF2. - ---MP_/yp5f+W_ED2JtUlSyBi8xujr -Content-Type: text/x-patch -Content-Transfer-Encoding: 7bit -Content-Disposition: attachment; filename=bitpos-main.patch - -diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c ---- a/gdb/aarch64-linux-nat.c -+++ b/gdb/aarch64-linux-nat.c -@@ -808,7 +808,7 @@ aarch64_linux_nat_target::remove_watchpoint (CORE_ADDR addr, int len, - /* Implement the "region_ok_for_hw_watchpoint" target_ops method. */ - - int --aarch64_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) -+aarch64_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) - { - return aarch64_linux_region_ok_for_watchpoint (addr, len); - } -diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c ---- a/gdb/ada-lang.c -+++ b/gdb/ada-lang.c -@@ -78,7 +78,7 @@ static struct type *desc_bounds_type (struct type *); - - static struct value *desc_bounds (struct value *); - --static int fat_pntr_bounds_bitpos (struct type *); -+static LONGEST fat_pntr_bounds_bitpos (struct type *); - - static int fat_pntr_bounds_bitsize (struct type *); - -@@ -86,13 +86,13 @@ static struct type *desc_data_target_type (struct type *); - - static struct value *desc_data (struct value *); - --static int fat_pntr_data_bitpos (struct type *); -+static LONGEST fat_pntr_data_bitpos (struct type *); - - static int fat_pntr_data_bitsize (struct type *); - - static struct value *desc_one_bound (struct value *, int, int); - --static int desc_bound_bitpos (struct type *, int, int); -+static LONGEST desc_bound_bitpos (struct type *, int, int); - - static int desc_bound_bitsize (struct type *, int, int); - -@@ -175,7 +175,7 @@ static struct type *static_unwrap_type (struct type *type); - - static struct value *unwrap_value (struct value *); - --static struct type *constrained_packed_array_type (struct type *, long *); -+static struct type *constrained_packed_array_type (struct type *, LONGEST *); - - static struct type *decode_constrained_packed_array_type (struct type *); - -@@ -214,14 +214,14 @@ static struct value *value_val_atr (struct type *, struct value *); - static struct symbol *standard_lookup (const char *, const struct block *, - domain_enum); - --static struct value *ada_search_struct_field (const char *, struct value *, int, -+static struct value *ada_search_struct_field (const char *, struct value *, LONGEST, - struct type *); - --static struct value *ada_value_primitive_field (struct value *, int, int, -+static struct value *ada_value_primitive_field (struct value *, LONGEST, int, - struct type *); - --static int find_struct_field (const char *, struct type *, int, -- struct type **, int *, int *, int *, int *); -+static int find_struct_field (const char *, struct type *, LONGEST, -+ struct type **, LONGEST *, int *, int *, int *); - - static int ada_resolve_function (struct block_symbol *, int, - struct value **, int, const char *, -@@ -232,7 +232,7 @@ static int ada_is_direct_array_type (struct type *); - static void ada_language_arch_info (struct gdbarch *, - struct language_arch_info *); - --static struct value *ada_index_struct_field (int, struct value *, int, -+static struct value *ada_index_struct_field (LONGEST, struct value *, LONGEST, - struct type *); - - static struct value *assign_aggregate (struct value *, struct value *, -@@ -701,7 +701,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type) - } - - static const gdb_byte * --cond_offset_host (const gdb_byte *valaddr, long offset) -+cond_offset_host (const gdb_byte *valaddr, LONGEST offset) - { - if (valaddr == NULL) - return NULL; -@@ -710,7 +710,7 @@ cond_offset_host (const gdb_byte *valaddr, long offset) - } - - static CORE_ADDR --cond_offset_target (CORE_ADDR address, long offset) -+cond_offset_target (CORE_ADDR address, LONGEST offset) - { - if (address == 0) - return 0; -@@ -1752,7 +1752,7 @@ desc_bounds (struct value *arr) - /* If TYPE is the type of an array-descriptor (fat pointer), the bit - position of the field containing the address of the bounds data. */ - --static int -+static LONGEST - fat_pntr_bounds_bitpos (struct type *type) - { - return TYPE_FIELD_BITPOS (desc_base_type (type), 1); -@@ -1818,7 +1818,7 @@ desc_data (struct value *arr) - /* If TYPE is the type of an array-descriptor (fat pointer), the bit - position of the field containing the address of the data. */ - --static int -+static LONGEST - fat_pntr_data_bitpos (struct type *type) - { - return TYPE_FIELD_BITPOS (desc_base_type (type), 0); -@@ -1853,7 +1853,7 @@ desc_one_bound (struct value *bounds, int i, int which) - of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper - bound, if WHICH is 1. The first bound is I=1. */ - --static int -+static LONGEST - desc_bound_bitpos (struct type *type, int i, int which) - { - return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2); -@@ -2043,7 +2043,7 @@ ada_type_of_array (struct value *arr, int bounds) - zero, and does not need to be recomputed. */ - if (lo < hi) - { -- int array_bitsize = -+ LONGEST array_bitsize = - (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0); - - TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8; -@@ -2203,7 +2203,7 @@ decode_packed_array_bitsize (struct type *type) - the length is arbitrary. */ - - static struct type * --constrained_packed_array_type (struct type *type, long *elt_bits) -+constrained_packed_array_type (struct type *type, LONGEST *elt_bits) - { - struct type *new_elt_type; - struct type *new_type; -@@ -2257,7 +2257,7 @@ decode_constrained_packed_array_type (struct type *type) - char *name; - const char *tail; - struct type *shadow_type; -- long bits; -+ LONGEST bits; - - if (!raw_name) - raw_name = ada_type_name (desc_base_type (type)); -@@ -2328,7 +2328,8 @@ decode_constrained_packed_array (struct value *arr) - array with no wrapper. In order to interpret the value through - the (left-justified) packed array type we just built, we must - first left-justify it. */ -- int bit_size, bit_pos; -+ int bit_size; -+ LONGEST bit_pos; - ULONGEST mod; - - mod = ada_modulus (value_type (arr)) - 1; -@@ -2556,7 +2557,7 @@ ada_unpack_from_contents (const gdb_byte *src, int bit_offset, int bit_size, - - struct value * - ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, -- long offset, int bit_offset, int bit_size, -+ LONGEST offset, int bit_offset, int bit_size, - struct type *type) - { - struct value *v; -@@ -2626,7 +2627,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, - - if (obj != NULL) - { -- long new_offset = offset; -+ LONGEST new_offset = offset; - - set_value_component_location (v, obj); - set_value_bitpos (v, bit_offset + value_bitpos (obj)); -@@ -2696,7 +2697,7 @@ ada_value_assign (struct value *toval, struct value *fromval) - { - int len = (value_bitpos (toval) - + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT; -- int from_size; -+ LONGEST from_size; - gdb_byte *buffer = (gdb_byte *) alloca (len); - struct value *val; - CORE_ADDR to_addr = value_address (toval); -@@ -2747,7 +2748,7 @@ value_assign_to_component (struct value *container, struct value *component, - (LONGEST) (value_address (component) - value_address (container)); - int bit_offset_in_container = - value_bitpos (component) - value_bitpos (container); -- int bits; -+ LONGEST bits; - - val = value_cast (value_type (component), val); - -@@ -4445,7 +4446,7 @@ ensure_lval (struct value *val) - if (VALUE_LVAL (val) == not_lval - || VALUE_LVAL (val) == lval_internalvar) - { -- int len = TYPE_LENGTH (ada_check_typedef (value_type (val))); -+ LONGEST len = TYPE_LENGTH (ada_check_typedef (value_type (val))); - const CORE_ADDR addr = - value_as_long (value_allocate_space_in_inferior (len)); - -@@ -4529,7 +4530,7 @@ static CORE_ADDR - value_pointer (struct value *value, struct type *type) - { - struct gdbarch *gdbarch = get_type_arch (type); -- unsigned len = TYPE_LENGTH (type); -+ ULONGEST len = TYPE_LENGTH (type); - gdb_byte *buf = (gdb_byte *) alloca (len); - CORE_ADDR addr; - -@@ -6642,7 +6643,7 @@ value_tag_from_contents_and_address (struct type *type, - const gdb_byte *valaddr, - CORE_ADDR address) - { -- int tag_byte_offset; -+ LONGEST tag_byte_offset; - struct type *tag_type; - - if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset, -@@ -7135,7 +7136,7 @@ ada_in_variant (LONGEST val, struct type *type, int field_num) - only in that it can handle packed values of arbitrary type. */ - - static struct value * --ada_value_primitive_field (struct value *arg1, int offset, int fieldno, -+ada_value_primitive_field (struct value *arg1, LONGEST offset, int fieldno, - struct type *arg_type) - { - struct type *type; -@@ -7147,7 +7148,7 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, - - if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0) - { -- int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno); -+ LONGEST bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno); - int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno); - - return ada_value_primitive_packed_val (arg1, value_contents (arg1), -@@ -7224,9 +7225,9 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, - Returns 1 if found, 0 otherwise. */ - - static int --find_struct_field (const char *name, struct type *type, int offset, -+find_struct_field (const char *name, struct type *type, LONGEST offset, - struct type **field_type_p, -- int *byte_offset_p, int *bit_offset_p, int *bit_size_p, -+ LONGEST *byte_offset_p, int *bit_offset_p, int *bit_size_p, - int *index_p) - { - int i; -@@ -7245,8 +7246,8 @@ find_struct_field (const char *name, struct type *type, int offset, - - for (i = 0; i < TYPE_NFIELDS (type); i += 1) - { -- int bit_pos = TYPE_FIELD_BITPOS (type, i); -- int fld_offset = offset + bit_pos / 8; -+ LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i); -+ LONGEST fld_offset = offset + bit_pos / 8; - const char *t_field_name = TYPE_FIELD_NAME (type, i); - - if (t_field_name == NULL) -@@ -7348,7 +7349,7 @@ num_visible_fields (struct type *type) - long explanation in find_struct_field's function documentation. */ - - static struct value * --ada_search_struct_field (const char *name, struct value *arg, int offset, -+ada_search_struct_field (const char *name, struct value *arg, LONGEST offset, - struct type *type) - { - int i; -@@ -7396,7 +7397,7 @@ ada_search_struct_field (const char *name, struct value *arg, int offset, - int j; - struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type, - i)); -- int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; -+ LONGEST var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; - - for (j = 0; j < TYPE_NFIELDS (field_type); j += 1) - { -@@ -7428,8 +7429,8 @@ ada_search_struct_field (const char *name, struct value *arg, int offset, - return NULL; - } - --static struct value *ada_index_struct_field_1 (int *, struct value *, -- int, struct type *); -+static struct value *ada_index_struct_field_1 (LONGEST *, struct value *, -+ LONGEST, struct type *); - - - /* Return field #INDEX in ARG, where the index is that returned by -@@ -7438,7 +7439,7 @@ static struct value *ada_index_struct_field_1 (int *, struct value *, - * If found, return value, else return NULL. */ - - static struct value * --ada_index_struct_field (int index, struct value *arg, int offset, -+ada_index_struct_field (LONGEST index, struct value *arg, LONGEST offset, - struct type *type) - { - return ada_index_struct_field_1 (&index, arg, offset, type); -@@ -7450,7 +7451,7 @@ ada_index_struct_field (int index, struct value *arg, int offset, - * *INDEX_P. */ - - static struct value * --ada_index_struct_field_1 (int *index_p, struct value *arg, int offset, -+ada_index_struct_field_1 (LONGEST *index_p, struct value *arg, LONGEST offset, - struct type *type) - { - int i; -@@ -7541,7 +7542,8 @@ ada_value_struct_elt (struct value *arg, const char *name, int no_err) - v = ada_search_struct_field (name, arg, 0, t); - else - { -- int bit_offset, bit_size, byte_offset; -+ int bit_offset, bit_size; -+ LONGEST byte_offset; - struct type *field_type; - CORE_ADDR address; - -@@ -7890,8 +7892,8 @@ ada_coerce_ref (struct value *val0) - /* Return OFF rounded upward if necessary to a multiple of - ALIGNMENT (a power of 2). */ - --static unsigned int --align_value (unsigned int off, unsigned int alignment) -+static ULONGEST -+align_value (ULONGEST off, ULONGEST alignment) - { - return (off + alignment - 1) & ~(alignment - 1); - } -@@ -8281,10 +8283,9 @@ ada_template_to_fixed_record_type_1 (struct type *type, - struct value *mark = value_mark (); - struct value *dval; - struct type *rtype; -- int nfields, bit_len; -+ int nfields; - int variant_field; -- long off; -- int fld_bit_len; -+ LONGEST off, bit_len, fld_bit_len; - int f; - - /* Compute the number of fields in this record type that are going -@@ -8361,7 +8362,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, - that follow this one. */ - if (ada_is_aligner_type (field_type)) - { -- long field_offset = TYPE_FIELD_BITPOS (field_type, f); -+ LONGEST field_offset = TYPE_FIELD_BITPOS (field_type, f); - - field_valaddr = cond_offset_host (field_valaddr, field_offset); - field_address = cond_offset_target (field_address, field_offset); -@@ -8497,11 +8498,11 @@ ada_template_to_fixed_record_type_1 (struct type *type, - if (TYPE_LENGTH (type) <= 0) - { - if (TYPE_NAME (rtype)) -- warning (_("Invalid type size for `%s' detected: %d."), -- TYPE_NAME (rtype), TYPE_LENGTH (type)); -+ warning (_("Invalid type size for `%s' detected: %s."), -+ TYPE_NAME (rtype), pulongest (TYPE_LENGTH (type))); - else -- warning (_("Invalid type size for detected: %d."), -- TYPE_LENGTH (type)); -+ warning (_("Invalid type size for detected: %s."), -+ pulongest (TYPE_LENGTH (type))); - } - else - { -@@ -8965,7 +8966,8 @@ to_fixed_array_type (struct type *type0, struct value *dval, - type was a regular (non-packed) array type. As a result, the - bitsize of the array elements needs to be set again, and the array - length needs to be recomputed based on that bitsize. */ -- int len = TYPE_LENGTH (result) / TYPE_LENGTH (TYPE_TARGET_TYPE (result)); -+ LONGEST len = (TYPE_LENGTH (result) -+ / TYPE_LENGTH (TYPE_TARGET_TYPE (result))); - int elt_bitsize = TYPE_FIELD_BITSIZE (type0, 0); - - TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0); -diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h ---- a/gdb/ada-lang.h -+++ b/gdb/ada-lang.h -@@ -173,7 +173,7 @@ extern void ada_print_type (struct type *, const char *, struct ui_file *, int, - extern void ada_print_typedef (struct type *type, struct symbol *new_symbol, - struct ui_file *stream); - --extern void ada_val_print (struct type *, int, CORE_ADDR, -+extern void ada_val_print (struct type *, LONGEST, CORE_ADDR, - struct ui_file *, int, - struct value *, - const struct value_print_options *); -@@ -188,7 +188,7 @@ extern void ada_emit_char (int, struct type *, struct ui_file *, int, int); - extern void ada_printchar (int, struct type *, struct ui_file *); - - extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *, -- unsigned int, const char *, int, -+ ULONGEST, const char *, int, - const struct value_print_options *); - - struct value *ada_convert_actual (struct value *actual, -@@ -263,7 +263,7 @@ extern int ada_is_constrained_packed_array_type (struct type *); - - extern struct value *ada_value_primitive_packed_val (struct value *, - const gdb_byte *, -- long, int, int, -+ LONGEST, int, int, - struct type *); - - extern struct type *ada_coerce_to_simple_array_type (struct type *); -diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c ---- a/gdb/ada-typeprint.c -+++ b/gdb/ada-typeprint.c -@@ -895,8 +895,8 @@ ada_print_type (struct type *type0, const char *varstring, - const char *name = ada_type_name (type); - - if (!ada_is_range_type_name (name)) -- fprintf_filtered (stream, _("<%d-byte integer>"), -- TYPE_LENGTH (type)); -+ fprintf_filtered (stream, _("<%s-byte integer>"), -+ pulongest (TYPE_LENGTH (type))); - else - { - fprintf_filtered (stream, "range "); -@@ -917,7 +917,8 @@ ada_print_type (struct type *type0, const char *varstring, - } - break; - case TYPE_CODE_FLT: -- fprintf_filtered (stream, _("<%d-byte float>"), TYPE_LENGTH (type)); -+ fprintf_filtered (stream, _("<%s-byte float>"), -+ pulongest (TYPE_LENGTH (type))); - break; - case TYPE_CODE_ENUM: - if (show < 0) -diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c ---- a/gdb/ada-valprint.c -+++ b/gdb/ada-valprint.c -@@ -34,11 +34,11 @@ - #include "target-float.h" - - static int print_field_values (struct type *, const gdb_byte *, -- int, -+ LONGEST, - struct ui_file *, int, - struct value *, - const struct value_print_options *, -- int, struct type *, int, -+ int, struct type *, LONGEST, - const struct language_defn *); - - -@@ -316,7 +316,7 @@ ada_emit_char (int c, struct type *type, struct ui_file *stream, - of a character. */ - - static int --char_at (const gdb_byte *string, int i, int type_len, -+char_at (const gdb_byte *string, LONGEST i, int type_len, - enum bfd_endian byte_order) - { - if (type_len == 1) -@@ -476,11 +476,11 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream) - - static void - printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, -- unsigned int length, int force_ellipses, int type_len, -+ ULONGEST length, int force_ellipses, int type_len, - const struct value_print_options *options) - { - enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (elttype)); -- unsigned int i; -+ ULONGEST i; - unsigned int things_printed = 0; - int in_quotes = 0; - int need_comma = 0; -@@ -495,9 +495,9 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, - { - /* Position of the character we are examining - to see whether it is repeated. */ -- unsigned int rep1; -+ ULONGEST rep1; - /* Number of repetitions we have detected so far. */ -- unsigned int reps; -+ ULONGEST reps; - - QUIT; - -@@ -528,7 +528,8 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, - ada_emit_char (char_at (string, i, type_len, byte_order), - elttype, stream, '\'', type_len); - fputs_filtered ("'", stream); -- fprintf_filtered (stream, _(" "), reps); -+ fprintf_filtered (stream, _(" "), -+ pulongest (reps)); - i = rep1 - 1; - things_printed += options->repeat_count_threshold; - need_comma = 1; -@@ -556,7 +557,7 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, - - void - ada_printstr (struct ui_file *stream, struct type *type, -- const gdb_byte *string, unsigned int length, -+ const gdb_byte *string, ULONGEST length, - const char *encoding, int force_ellipses, - const struct value_print_options *options) - { -@@ -566,12 +567,12 @@ ada_printstr (struct ui_file *stream, struct type *type, - - static int - print_variant_part (struct type *type, int field_num, -- const gdb_byte *valaddr, int offset, -+ const gdb_byte *valaddr, LONGEST offset, - struct ui_file *stream, int recurse, - struct value *val, - const struct value_print_options *options, - int comma_needed, -- struct type *outer_type, int outer_offset, -+ struct type *outer_type, LONGEST outer_offset, - const struct language_defn *language) - { - struct type *var_type = TYPE_FIELD_TYPE (type, field_num); -@@ -607,11 +608,11 @@ print_variant_part (struct type *type, int field_num, - - static int - print_field_values (struct type *type, const gdb_byte *valaddr, -- int offset, struct ui_file *stream, int recurse, -+ LONGEST offset, struct ui_file *stream, int recurse, - struct value *val, - const struct value_print_options *options, - int comma_needed, -- struct type *outer_type, int outer_offset, -+ struct type *outer_type, LONGEST outer_offset, - const struct language_defn *language) - { - int i, len; -@@ -677,7 +678,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr, - else - { - struct value *v; -- int bit_pos = TYPE_FIELD_BITPOS (type, i); -+ LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i); - int bit_size = TYPE_FIELD_BITSIZE (type, i); - struct value_print_options opts; - -@@ -722,8 +723,8 @@ ada_val_print_string (struct type *type, const gdb_byte *valaddr, - { - enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); - struct type *elttype = TYPE_TARGET_TYPE (type); -- unsigned int eltlen; -- unsigned int len; -+ ULONGEST eltlen; -+ ULONGEST len; - - /* We know that ELTTYPE cannot possibly be null, because we assume - that we're called only when TYPE is a string-like type. -@@ -742,7 +743,7 @@ ada_val_print_string (struct type *type, const gdb_byte *valaddr, - elements up to it. */ - if (options->stop_print_at_null) - { -- int temp_len; -+ LONGEST temp_len; - - /* Look for a NULL char. */ - for (temp_len = 0; -@@ -1115,7 +1116,7 @@ ada_val_print_ref (struct type *type, const gdb_byte *valaddr, - - static void - ada_val_print_1 (struct type *type, -- int offset, CORE_ADDR address, -+ LONGEST offset, CORE_ADDR address, - struct ui_file *stream, int recurse, - struct value *original_value, - const struct value_print_options *options, -@@ -1199,7 +1200,7 @@ ada_val_print_1 (struct type *type, - - void - ada_val_print (struct type *type, -- int embedded_offset, CORE_ADDR address, -+ LONGEST embedded_offset, CORE_ADDR address, - struct ui_file *stream, int recurse, - struct value *val, - const struct value_print_options *options) -diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c ---- a/gdb/amd64-tdep.c -+++ b/gdb/amd64-tdep.c -@@ -732,7 +732,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function, - gdb_byte *readbuf, const gdb_byte *writebuf) - { - enum amd64_reg_class theclass[2]; -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM }; - static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM }; - int integer_reg = 0; -@@ -849,10 +849,10 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function, - gdb_assert (regnum != -1); - - if (readbuf) -- regcache->raw_read_part (regnum, offset, std::min (len, 8), -+ regcache->raw_read_part (regnum, offset, std::min (len, (LONGEST) 8), - readbuf + i * 8); - if (writebuf) -- regcache->raw_write_part (regnum, offset, std::min (len, 8), -+ regcache->raw_write_part (regnum, offset, std::min (len, (LONGEST) 8), - writebuf + i * 8); - } - -diff --git a/gdb/annotate.c b/gdb/annotate.c ---- a/gdb/annotate.c -+++ b/gdb/annotate.c -@@ -531,21 +531,21 @@ annotate_frame_end (void) - } - - void --annotate_array_section_begin (int idx, struct type *elttype) -+annotate_array_section_begin (LONGEST idx, struct type *elttype) - { - if (annotation_level == 2) - { -- printf_filtered (("\n\032\032array-section-begin %d "), idx); -+ printf_filtered (("\n\032\032array-section-begin %s "), plongest (idx)); - print_value_flags (elttype); - printf_filtered (("\n")); - } - } - - void --annotate_elt_rep (unsigned int repcount) -+annotate_elt_rep (ULONGEST repcount) - { - if (annotation_level == 2) -- printf_filtered (("\n\032\032elt-rep %u\n"), repcount); -+ printf_filtered (("\n\032\032elt-rep %s\n"), pulongest (repcount)); - } - - void -diff --git a/gdb/annotate.h b/gdb/annotate.h ---- a/gdb/annotate.h -+++ b/gdb/annotate.h -@@ -105,8 +105,8 @@ extern void annotate_frame_source_end (void); - extern void annotate_frame_where (void); - extern void annotate_frame_end (void); - --extern void annotate_array_section_begin (int, struct type *); --extern void annotate_elt_rep (unsigned int); -+extern void annotate_array_section_begin (LONGEST, struct type *); -+extern void annotate_elt_rep (ULONGEST); - extern void annotate_elt_rep_end (void); - extern void annotate_elt (void); - extern void annotate_array_section_end (void); -diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c ---- a/gdb/arch-utils.c -+++ b/gdb/arch-utils.c -@@ -227,7 +227,7 @@ legacy_virtual_frame_pointer (struct gdbarch *gdbarch, - - const struct floatformat ** - default_floatformat_for_type (struct gdbarch *gdbarch, -- const char *name, int len) -+ const char *name, LONGEST len) - { - const struct floatformat **format = NULL; - -diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h ---- a/gdb/arch-utils.h -+++ b/gdb/arch-utils.h -@@ -131,7 +131,7 @@ extern gdbarch_virtual_frame_pointer_ftype legacy_virtual_frame_pointer; - /* Default implementation of gdbarch_floatformat_for_type. */ - extern const struct floatformat ** - default_floatformat_for_type (struct gdbarch *gdbarch, -- const char *name, int len); -+ const char *name, LONGEST len); - - extern CORE_ADDR generic_skip_trampoline_code (struct frame_info *frame, - CORE_ADDR pc); -diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c ---- a/gdb/arm-linux-nat.c -+++ b/gdb/arm-linux-nat.c -@@ -1096,7 +1096,7 @@ arm_linux_nat_target::remove_hw_breakpoint (struct gdbarch *gdbarch, - /* Are we able to use a hardware watchpoint for the LEN bytes starting at - ADDR? */ - int --arm_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) -+arm_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) - { - const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap (); - CORE_ADDR max_wp_length, aligned_addr; -diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c ---- a/gdb/ax-gdb.c -+++ b/gdb/ax-gdb.c -@@ -82,12 +82,12 @@ static void gen_traced_pop (struct agent_expr *, struct axs_value *); - static void gen_sign_extend (struct agent_expr *, struct type *); - static void gen_extend (struct agent_expr *, struct type *); - static void gen_fetch (struct agent_expr *, struct type *); --static void gen_left_shift (struct agent_expr *, int); -+static void gen_left_shift (struct agent_expr *, LONGEST); - - - static void gen_frame_args_address (struct agent_expr *); - static void gen_frame_locals_address (struct agent_expr *); --static void gen_offset (struct agent_expr *ax, int offset); -+static void gen_offset (struct agent_expr *ax, LONGEST offset); - static void gen_sym_offset (struct agent_expr *, struct symbol *); - static void gen_var_ref (struct agent_expr *ax, struct axs_value *value, - struct symbol *var); -@@ -132,13 +132,13 @@ static void gen_complement (struct agent_expr *ax, struct axs_value *value); - static void gen_deref (struct axs_value *); - static void gen_address_of (struct axs_value *); - static void gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value, -- struct type *type, int start, int end); -+ struct type *type, LONGEST start, LONGEST end); - static void gen_primitive_field (struct agent_expr *ax, - struct axs_value *value, -- int offset, int fieldno, struct type *type); -+ LONGEST offset, int fieldno, struct type *type); - static int gen_struct_ref_recursive (struct agent_expr *ax, - struct axs_value *value, -- const char *field, int offset, -+ const char *field, LONGEST offset, - struct type *type); - static void gen_struct_ref (struct agent_expr *ax, - struct axs_value *value, -@@ -529,7 +529,7 @@ gen_fetch (struct agent_expr *ax, struct type *type) - right shift it by -DISTANCE bits if DISTANCE < 0. This generates - unsigned (logical) right shifts. */ - static void --gen_left_shift (struct agent_expr *ax, int distance) -+gen_left_shift (struct agent_expr *ax, LONGEST distance) - { - if (distance > 0) - { -@@ -583,7 +583,7 @@ gen_frame_locals_address (struct agent_expr *ax) - programming in ML, it would be clearer why these are the same - thing. */ - static void --gen_offset (struct agent_expr *ax, int offset) -+gen_offset (struct agent_expr *ax, LONGEST offset) - { - /* It would suffice to simply push the offset and add it, but this - makes it easier to read positive and negative offsets in the -@@ -1254,7 +1254,7 @@ gen_address_of (struct axs_value *value) - structure. */ - static void - gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value, -- struct type *type, int start, int end) -+ struct type *type, LONGEST start, LONGEST end) - { - /* Note that ops[i] fetches 8 << i bits. */ - static enum agent_op ops[] -@@ -1289,13 +1289,13 @@ gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value, - - /* The first and one-after-last bits in the field, but rounded down - and up to byte boundaries. */ -- int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT; -- int bound_end = (((end + TARGET_CHAR_BIT - 1) -- / TARGET_CHAR_BIT) -- * TARGET_CHAR_BIT); -+ LONGEST bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT; -+ LONGEST bound_end = (((end + TARGET_CHAR_BIT - 1) -+ / TARGET_CHAR_BIT) -+ * TARGET_CHAR_BIT); - - /* current bit offset within the structure */ -- int offset; -+ LONGEST offset; - - /* The index in ops of the opcode we're considering. */ - int op; -@@ -1413,7 +1413,7 @@ gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value, - - static void - gen_primitive_field (struct agent_expr *ax, struct axs_value *value, -- int offset, int fieldno, struct type *type) -+ LONGEST offset, int fieldno, struct type *type) - { - /* Is this a bitfield? */ - if (TYPE_FIELD_PACKED (type, fieldno)) -@@ -1437,7 +1437,7 @@ gen_primitive_field (struct agent_expr *ax, struct axs_value *value, - - static int - gen_struct_ref_recursive (struct agent_expr *ax, struct axs_value *value, -- const char *field, int offset, struct type *type) -+ const char *field, LONGEST offset, struct type *type) - { - int i, rslt; - int nbases = TYPE_N_BASECLASSES (type); -diff --git a/gdb/ax-general.c b/gdb/ax-general.c ---- a/gdb/ax-general.c -+++ b/gdb/ax-general.c -@@ -177,7 +177,7 @@ ax_zero_ext (struct agent_expr *x, int n) - - /* Append a trace_quick instruction to EXPR, to record N bytes. */ - void --ax_trace_quick (struct agent_expr *x, int n) -+ax_trace_quick (struct agent_expr *x, LONGEST n) - { - /* N must fit in a byte. */ - if (n < 0 || n > 255) -diff --git a/gdb/ax.h b/gdb/ax.h ---- a/gdb/ax.h -+++ b/gdb/ax.h -@@ -193,7 +193,7 @@ extern void ax_ext (struct agent_expr *EXPR, int N); - extern void ax_zero_ext (struct agent_expr *EXPR, int N); - - /* Append a trace_quick instruction to EXPR, to record N bytes. */ --extern void ax_trace_quick (struct agent_expr *EXPR, int N); -+extern void ax_trace_quick (struct agent_expr *EXPR, LONGEST N); - - /* Append a goto op to EXPR. OP is the actual op (must be aop_goto or - aop_if_goto). We assume we don't know the target offset yet, -diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c ---- a/gdb/breakpoint.c -+++ b/gdb/breakpoint.c -@@ -2056,9 +2056,9 @@ should_be_inserted (struct bp_location *bl) - { - fprintf_unfiltered (gdb_stdlog, - "infrun: stepping past non-steppable watchpoint. " -- "skipping watchpoint at %s:%d\n", -+ "skipping watchpoint at %s:%s\n", - paddress (bl->gdbarch, bl->address), -- bl->length); -+ plongest (bl->length)); - } - return 0; - } -@@ -6793,7 +6793,7 @@ breakpoint_address_match (const address_space *aspace1, CORE_ADDR addr1, - static int - breakpoint_address_match_range (const address_space *aspace1, - CORE_ADDR addr1, -- int len1, const address_space *aspace2, -+ LONGEST len1, const address_space *aspace2, - CORE_ADDR addr2) - { - return ((gdbarch_has_global_breakpoints (target_gdbarch ()) -@@ -10859,7 +10859,7 @@ can_use_hardware_watchpoint (const std::vector &vals) - && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) - { - CORE_ADDR vaddr = value_address (v); -- int len; -+ LONGEST len; - int num_regs; - - len = (target_exact_watchpoints -diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h ---- a/gdb/breakpoint.h -+++ b/gdb/breakpoint.h -@@ -252,7 +252,7 @@ struct bp_target_info - - /* If this is a ranged breakpoint, then this field contains the - length of the range that will be watched for execution. */ -- int length; -+ LONGEST length; - - /* If the breakpoint lives in memory and reading that memory would - give back the breakpoint, instead of the original contents, then -@@ -417,7 +417,7 @@ public: - /* For hardware watchpoints, the size of the memory region being - watched. For hardware ranged breakpoints, the size of the - breakpoint range. */ -- int length = 0; -+ LONGEST length = 0; - - /* Type of hardware watchpoint. */ - target_hw_bp_type watchpoint_type {}; -diff --git a/gdb/c-lang.c b/gdb/c-lang.c ---- a/gdb/c-lang.c -+++ b/gdb/c-lang.c -@@ -185,7 +185,7 @@ c_printchar (int c, struct type *type, struct ui_file *stream) - - void - c_printstr (struct ui_file *stream, struct type *type, -- const gdb_byte *string, unsigned int length, -+ const gdb_byte *string, ULONGEST length, - const char *user_encoding, int force_ellipses, - const struct value_print_options *options) - { -@@ -664,7 +664,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp, - } - else - { -- int i; -+ LONGEST i; - - /* Write the terminating character. */ - for (i = 0; i < TYPE_LENGTH (type); ++i) -@@ -673,7 +673,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp, - if (satisfy_expected) - { - LONGEST low_bound, high_bound; -- int element_size = TYPE_LENGTH (type); -+ LONGEST element_size = TYPE_LENGTH (type); - - if (get_discrete_bounds (TYPE_INDEX_TYPE (expect_type), - &low_bound, &high_bound) < 0) -diff --git a/gdb/c-lang.h b/gdb/c-lang.h ---- a/gdb/c-lang.h -+++ b/gdb/c-lang.h -@@ -82,7 +82,7 @@ extern void c_print_typedef (struct type *, - struct ui_file *); - - extern void c_val_print (struct type *, -- int, CORE_ADDR, -+ LONGEST, CORE_ADDR, - struct ui_file *, int, - struct value *, - const struct value_print_options *); -@@ -102,7 +102,7 @@ extern void c_printchar (int, struct type *, struct ui_file *); - extern void c_printstr (struct ui_file * stream, - struct type *elttype, - const gdb_byte *string, -- unsigned int length, -+ ULONGEST length, - const char *user_encoding, - int force_ellipses, - const struct value_print_options *options); -diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c ---- a/gdb/c-valprint.c -+++ b/gdb/c-valprint.c -@@ -247,7 +247,7 @@ c_val_print_array (struct type *type, const gdb_byte *valaddr, - if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (unresolved_elttype) > 0) - { - LONGEST low_bound, high_bound; -- int eltlen, len; -+ LONGEST eltlen, len; - struct gdbarch *gdbarch = get_type_arch (type); - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - unsigned int i = 0; /* Number of characters printed. */ -@@ -321,8 +321,8 @@ c_val_print_array (struct type *type, const gdb_byte *valaddr, - if (cp_is_vtbl_ptr_type (elttype)) - { - i = 1; -- fprintf_filtered (stream, _("%d vtable entries"), -- len - 1); -+ fprintf_filtered (stream, _("%s vtable entries"), -+ plongest (len - 1)); - } - else - { -@@ -399,7 +399,7 @@ c_val_print_struct (struct type *type, const gdb_byte *valaddr, - -fvtable_thunks. (Otherwise, look under - TYPE_CODE_PTR.) */ - struct gdbarch *gdbarch = get_type_arch (type); -- int offset = (embedded_offset -+ LONGEST offset = (embedded_offset - + TYPE_FIELD_BITPOS (type, - VTBL_FNADDR_OFFSET) / 8); - struct type *field_type = TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET); -@@ -498,7 +498,7 @@ c_val_print_memberptr (struct type *type, const gdb_byte *valaddr, - - void - c_val_print (struct type *type, -- int embedded_offset, CORE_ADDR address, -+ LONGEST embedded_offset, CORE_ADDR address, - struct ui_file *stream, int recurse, - struct value *original_value, - const struct value_print_options *options) -diff --git a/gdb/compile/compile-c-support.c b/gdb/compile/compile-c-support.c ---- a/gdb/compile/compile-c-support.c -+++ b/gdb/compile/compile-c-support.c -@@ -270,11 +270,11 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch, - - default: - fprintf_unfiltered (stream, -- " unsigned char %s[%d]" -+ " unsigned char %s[%s]" - " __attribute__((__aligned__(" - "__BIGGEST_ALIGNMENT__)))", - regname.c_str (), -- TYPE_LENGTH (regtype)); -+ pulongest (TYPE_LENGTH (regtype))); - } - fputs_unfiltered (";\n", stream); - } -diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c ---- a/gdb/cp-abi.c -+++ b/gdb/cp-abi.c -@@ -64,12 +64,12 @@ is_operator_name (const char *name) - return (*current_cp_abi.is_operator_name) (name); - } - --int -+LONGEST - baseclass_offset (struct type *type, int index, const gdb_byte *valaddr, - LONGEST embedded_offset, CORE_ADDR address, - const struct value *val) - { -- int res = 0; -+ LONGEST res = 0; - - gdb_assert (current_cp_abi.baseclass_offset != NULL); - -@@ -96,7 +96,7 @@ baseclass_offset (struct type *type, int index, const gdb_byte *valaddr, - struct value * - value_virtual_fn_field (struct value **arg1p, - struct fn_field *f, int j, -- struct type *type, int offset) -+ struct type *type, LONGEST offset) - { - if ((current_cp_abi.virtual_fn_field) == NULL) - return NULL; -diff --git a/gdb/cp-abi.h b/gdb/cp-abi.h ---- a/gdb/cp-abi.h -+++ b/gdb/cp-abi.h -@@ -108,7 +108,7 @@ extern struct value *value_virtual_fn_field (struct value **valuep, - struct fn_field *f, - int j, - struct type *type, -- int offset); -+ LONGEST offset); - - - /* Try to find the run-time type of VALUE, using C++ run-time type -@@ -144,11 +144,11 @@ extern struct type *value_rtti_type (struct value *value, - contents of VAL. The result is the offset of the baseclass value - relative to (the address of)(ARG) + OFFSET. */ - --extern int baseclass_offset (struct type *type, -- int index, const gdb_byte *valaddr, -- LONGEST embedded_offset, -- CORE_ADDR address, -- const struct value *val); -+extern LONGEST baseclass_offset (struct type *type, -+ int index, const gdb_byte *valaddr, -+ LONGEST embedded_offset, -+ CORE_ADDR address, -+ const struct value *val); - - /* Describe the target of a pointer to method. CONTENTS is the byte - pattern representing the pointer to method. TYPE is the pointer to -@@ -226,12 +226,12 @@ struct cp_abi_ops - struct value *(*virtual_fn_field) (struct value **arg1p, - struct fn_field * f, - int j, struct type * type, -- int offset); -+ LONGEST offset); - struct type *(*rtti_type) (struct value *v, int *full, - LONGEST *top, int *using_enc); -- int (*baseclass_offset) (struct type *type, int index, -- const bfd_byte *valaddr, LONGEST embedded_offset, -- CORE_ADDR address, const struct value *val); -+ LONGEST (*baseclass_offset) (struct type *type, int index, -+ const bfd_byte *valaddr, LONGEST embedded_offset, -+ CORE_ADDR address, const struct value *val); - void (*print_method_ptr) (const gdb_byte *contents, - struct type *type, - struct ui_file *stream); -diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c ---- a/gdb/cp-valprint.c -+++ b/gdb/cp-valprint.c -@@ -335,7 +335,7 @@ cp_print_value_fields (struct type *type, struct type *real_type, - } - else if (i == vptr_fieldno && type == vptr_basetype) - { -- int i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; -+ LONGEST i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; - struct type *i_type = TYPE_FIELD_TYPE (type, i); - - if (valprint_check_validity (stream, i_type, i_offset, val)) -diff --git a/gdb/d-lang.h b/gdb/d-lang.h ---- a/gdb/d-lang.h -+++ b/gdb/d-lang.h -@@ -79,7 +79,7 @@ extern struct block_symbol d_lookup_nested_symbol (struct type *, const char *, - /* Defined in d-valprint.c */ - - extern void d_val_print (struct type *type, -- int embedded_offset, CORE_ADDR address, -+ LONGEST embedded_offset, CORE_ADDR address, - struct ui_file *stream, int recurse, - struct value *val, - const struct value_print_options *options); -diff --git a/gdb/d-valprint.c b/gdb/d-valprint.c ---- a/gdb/d-valprint.c -+++ b/gdb/d-valprint.c -@@ -73,7 +73,7 @@ dynamic_array_type (struct type *type, - - /* Implements the la_val_print routine for language D. */ - void --d_val_print (struct type *type, int embedded_offset, -+d_val_print (struct type *type, LONGEST embedded_offset, - CORE_ADDR address, struct ui_file *stream, int recurse, - struct value *val, - const struct value_print_options *options) -diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -1625,7 +1625,7 @@ rw_pieced_value (struct value *v, struct value *from) - for (; i < c->pieces.size () && offset < max_offset; i++) - { - struct dwarf_expr_piece *p = &c->pieces[i]; -- size_t this_size_bits, this_size; -+ ULONGEST this_size_bits, this_size; - - this_size_bits = p->size - bits_to_skip; - if (this_size_bits > max_offset - offset) -@@ -1872,7 +1872,7 @@ write_pieced_value (struct value *to, struct value *from) - - static int - check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset, -- int bit_length) -+ LONGEST bit_length) - { - struct piece_closure *c - = (struct piece_closure *) value_computed_closure (value); -@@ -1885,7 +1885,7 @@ check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset, - for (i = 0; i < c->pieces.size () && bit_length > 0; i++) - { - struct dwarf_expr_piece *p = &c->pieces[i]; -- size_t this_size_bits = p->size; -+ ULONGEST this_size_bits = p->size; - - if (bit_offset > 0) - { -@@ -1989,8 +1989,8 @@ indirect_pieced_value (struct value *value) - = (struct piece_closure *) value_computed_closure (value); - struct type *type; - struct frame_info *frame; -- int i, bit_length; -- LONGEST bit_offset; -+ int i; -+ LONGEST bit_length, bit_offset; - struct dwarf_expr_piece *piece = NULL; - LONGEST byte_offset; - enum bfd_endian byte_order; -@@ -2007,7 +2007,7 @@ indirect_pieced_value (struct value *value) - for (i = 0; i < c->pieces.size () && bit_length > 0; i++) - { - struct dwarf_expr_piece *p = &c->pieces[i]; -- size_t this_size_bits = p->size; -+ ULONGEST this_size_bits = p->size; - - if (bit_offset > 0) - { -@@ -2296,9 +2296,9 @@ if (frame != NULL) select_frame (frame); - case DWARF_VALUE_STACK: - { - struct value *value = ctx.fetch (0); -- size_t n = TYPE_LENGTH (value_type (value)); -- size_t len = TYPE_LENGTH (subobj_type); -- size_t max = TYPE_LENGTH (type); -+ ULONGEST n = TYPE_LENGTH (value_type (value)); -+ ULONGEST len = TYPE_LENGTH (subobj_type); -+ ULONGEST max = TYPE_LENGTH (type); - struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile); - - if (subobj_byte_offset + len > max) -diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c ---- a/gdb/dwarf2read.c -+++ b/gdb/dwarf2read.c -@@ -2065,11 +2065,11 @@ dwarf2_complex_location_expr_complaint (void) - } - - static void --dwarf2_const_value_length_mismatch_complaint (const char *arg1, int arg2, -- int arg3) -+dwarf2_const_value_length_mismatch_complaint (const char *arg1, LONGEST arg2, -+ LONGEST arg3) - { -- complaint (_("const value length mismatch for '%s', got %d, expected %d"), -- arg1, arg2, arg3); -+ complaint (_("const value length mismatch for '%s', got %s, expected %s"), -+ arg1, plongest (arg2), plongest (arg3)); - } - - static void -@@ -15104,8 +15104,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, - object, and then subtract off the number of bits of - the field itself. The result is the bit offset of - the LSB of the field. */ -- int anonymous_size; -- int bit_offset = DW_UNSND (attr); -+ LONGEST anonymous_size; -+ LONGEST bit_offset = DW_UNSND (attr); - - attr = dwarf2_attr (die, DW_AT_byte_size, cu); - if (attr) -diff --git a/gdb/eval.c b/gdb/eval.c ---- a/gdb/eval.c -+++ b/gdb/eval.c -@@ -295,7 +295,8 @@ evaluate_struct_tuple (struct value *struct_val, - while (--nargs >= 0) - { - struct value *val = NULL; -- int bitpos, bitsize; -+ LONGEST bitpos; -+ int bitsize; - bfd_byte *addr; - - fieldno++; -@@ -356,7 +357,7 @@ init_array_element (struct value *array, struct value *element, - enum noside noside, LONGEST low_bound, LONGEST high_bound) - { - LONGEST index; -- int element_size = TYPE_LENGTH (value_type (element)); -+ LONGEST element_size = TYPE_LENGTH (value_type (element)); - - if (exp->elts[*pos].opcode == BINOP_COMMA) - { -@@ -799,11 +800,11 @@ binop_promote (const struct language_defn *language, struct gdbarch *gdbarch, - /* FIXME: Also mixed integral/booleans, with result an integer. */ - { - const struct builtin_type *builtin = builtin_type (gdbarch); -- unsigned int promoted_len1 = TYPE_LENGTH (type1); -- unsigned int promoted_len2 = TYPE_LENGTH (type2); -+ ULONGEST promoted_len1 = TYPE_LENGTH (type1); -+ ULONGEST promoted_len2 = TYPE_LENGTH (type2); - int is_unsigned1 = TYPE_UNSIGNED (type1); - int is_unsigned2 = TYPE_UNSIGNED (type2); -- unsigned int result_len; -+ ULONGEST result_len; - int unsigned_operation; - - /* Determine type length and signedness after promotion for -@@ -1553,7 +1554,7 @@ evaluate_subexp_standard (struct type *expect_type, - struct value **argvec; - int code; - int ix; -- long mem_offset; -+ LONGEST mem_offset; - struct type **arg_types; - - pc = (*pos)++; -@@ -1738,7 +1739,7 @@ evaluate_subexp_standard (struct type *expect_type, - struct type *range_type = TYPE_INDEX_TYPE (type); - struct type *element_type = TYPE_TARGET_TYPE (type); - struct value *array = allocate_value (expect_type); -- int element_size = TYPE_LENGTH (check_typedef (element_type)); -+ LONGEST element_size = TYPE_LENGTH (check_typedef (element_type)); - LONGEST low_bound, high_bound, index; - - if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) -diff --git a/gdb/f-lang.c b/gdb/f-lang.c ---- a/gdb/f-lang.c -+++ b/gdb/f-lang.c -@@ -101,7 +101,7 @@ f_printchar (int c, struct type *type, struct ui_file *stream) - - static void - f_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, -- unsigned int length, const char *encoding, int force_ellipses, -+ ULONGEST length, const char *encoding, int force_ellipses, - const struct value_print_options *options) - { - const char *type_encoding = f_get_encoding (type); -diff --git a/gdb/f-lang.h b/gdb/f-lang.h ---- a/gdb/f-lang.h -+++ b/gdb/f-lang.h -@@ -31,7 +31,7 @@ extern int f_parse (struct parser_state *); - extern void f_print_type (struct type *, const char *, struct ui_file *, int, - int, const struct type_print_options *); - --extern void f_val_print (struct type *, int, CORE_ADDR, -+extern void f_val_print (struct type *, LONGEST, CORE_ADDR, - struct ui_file *, int, - struct value *, - const struct value_print_options *); -diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c ---- a/gdb/f-valprint.c -+++ b/gdb/f-valprint.c -@@ -36,7 +36,7 @@ - - static void f77_get_dynamic_length_of_aggregate (struct type *); - --int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; -+LONGEST f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; - - /* Array which holds offsets to be applied to get a row's elements - for a given array. Array also holds the size of each subarray. */ -@@ -71,8 +71,8 @@ f77_get_upperbound (struct type *type) - static void - f77_get_dynamic_length_of_aggregate (struct type *type) - { -- int upper_bound = -1; -- int lower_bound = 1; -+ LONGEST upper_bound = -1; -+ LONGEST lower_bound = 1; - - /* Recursively go all the way down into a possibly multi-dimensional - F77 array and get the bounds. For simple arrays, this is pretty -@@ -104,7 +104,7 @@ f77_get_dynamic_length_of_aggregate (struct type *type) - static void - f77_print_array_1 (int nss, int ndimensions, struct type *type, - const gdb_byte *valaddr, -- int embedded_offset, CORE_ADDR address, -+ LONGEST embedded_offset, CORE_ADDR address, - struct ui_file *stream, int recurse, - const struct value *val, - const struct value_print_options *options, -@@ -113,7 +113,7 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, - struct type *range_type = TYPE_INDEX_TYPE (check_typedef (type)); - CORE_ADDR addr = address + embedded_offset; - LONGEST lowerbound, upperbound; -- int i; -+ LONGEST i; - - get_discrete_bounds (range_type, &lowerbound, &upperbound); - -@@ -175,7 +175,7 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, - - static void - f77_print_array (struct type *type, const gdb_byte *valaddr, -- int embedded_offset, -+ LONGEST embedded_offset, - CORE_ADDR address, struct ui_file *stream, - int recurse, - const struct value *val, -@@ -214,7 +214,7 @@ static const struct generic_val_print_decorations f_decorations = - function; they are identical. */ - - void --f_val_print (struct type *type, int embedded_offset, -+f_val_print (struct type *type, LONGEST embedded_offset, - CORE_ADDR address, struct ui_file *stream, int recurse, - struct value *original_value, - const struct value_print_options *options) -diff --git a/gdb/findvar.c b/gdb/findvar.c ---- a/gdb/findvar.c -+++ b/gdb/findvar.c -@@ -821,7 +821,7 @@ struct value * - default_value_from_register (struct gdbarch *gdbarch, struct type *type, - int regnum, struct frame_id frame_id) - { -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - struct value *value = allocate_value (type); - struct frame_info *frame; - -@@ -865,7 +865,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame) - LONGEST offset = 0; - LONGEST reg_offset = value_offset (value); - int regnum = VALUE_REGNUM (value); -- int len = type_length_units (check_typedef (value_type (value))); -+ LONGEST len = type_length_units (check_typedef (value_type (value))); - - gdb_assert (VALUE_LVAL (value) == lval_register); - -@@ -880,7 +880,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame) - while (len > 0) - { - struct value *regval = get_frame_register_value (frame, regnum); -- int reg_len = type_length_units (value_type (regval)) - reg_offset; -+ LONGEST reg_len = type_length_units (value_type (regval)) - reg_offset; - - /* If the register length is larger than the number of bytes - remaining to copy, then only copy the appropriate bytes. */ -diff --git a/gdb/frame.c b/gdb/frame.c ---- a/gdb/frame.c -+++ b/gdb/frame.c -@@ -1393,7 +1393,7 @@ deprecated_frame_register_read (struct frame_info *frame, int regnum, - - int - get_frame_register_bytes (struct frame_info *frame, int regnum, -- CORE_ADDR offset, int len, gdb_byte *myaddr, -+ CORE_ADDR offset, LONGEST len, gdb_byte *myaddr, - int *optimizedp, int *unavailablep) - { - struct gdbarch *gdbarch = get_frame_arch (frame); -@@ -1422,7 +1422,7 @@ get_frame_register_bytes (struct frame_info *frame, int regnum, - } - if (len > maxsize) - error (_("Bad debug information detected: " -- "Attempt to read %d bytes from registers."), len); -+ "Attempt to read %s bytes from registers."), plongest (len)); - - /* Copy the data. */ - while (len > 0) -diff --git a/gdb/frame.h b/gdb/frame.h ---- a/gdb/frame.h -+++ b/gdb/frame.h -@@ -620,7 +620,7 @@ extern void put_frame_register (struct frame_info *frame, int regnum, - contents are optimized out or unavailable, set *OPTIMIZEDP, - *UNAVAILABLEP accordingly. */ - extern int get_frame_register_bytes (struct frame_info *frame, int regnum, -- CORE_ADDR offset, int len, -+ CORE_ADDR offset, LONGEST len, - gdb_byte *myaddr, - int *optimizedp, int *unavailablep); - -diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c ---- a/gdb/gdbarch.c -+++ b/gdb/gdbarch.c -@@ -1795,7 +1795,7 @@ set_gdbarch_wchar_signed (struct gdbarch *gdbarch, - } - - const struct floatformat ** --gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length) -+gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, LONGEST length) - { - gdb_assert (gdbarch != NULL); - gdb_assert (gdbarch->floatformat_for_type != NULL); -diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h ---- a/gdb/gdbarch.h -+++ b/gdb/gdbarch.h -@@ -218,8 +218,8 @@ extern void set_gdbarch_wchar_signed (struct gdbarch *gdbarch, int wchar_signed) - NAME, if non-NULL, is the type name, which may be used to distinguish - different target formats of the same length. */ - --typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, int length); --extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, int length); -+typedef const struct floatformat ** (gdbarch_floatformat_for_type_ftype) (struct gdbarch *gdbarch, const char *name, LONGEST length); -+extern const struct floatformat ** gdbarch_floatformat_for_type (struct gdbarch *gdbarch, const char *name, LONGEST length); - extern void set_gdbarch_floatformat_for_type (struct gdbarch *gdbarch, gdbarch_floatformat_for_type_ftype *floatformat_for_type); - - /* For most targets, a pointer on the target and its representation as an -diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh ---- a/gdb/gdbarch.sh -+++ b/gdb/gdbarch.sh -@@ -385,7 +385,7 @@ v;int;wchar_signed;;;1;-1;1 - # Returns the floating-point format to be used for values of length LENGTH. - # NAME, if non-NULL, is the type name, which may be used to distinguish - # different target formats of the same length. --m;const struct floatformat **;floatformat_for_type;const char *name, int length;name, length;0;default_floatformat_for_type;;0 -+m;const struct floatformat **;floatformat_for_type;const char *name, LONGEST length;name, length;0;default_floatformat_for_type;;0 - - # For most targets, a pointer on the target and its representation as an - # address in GDB have the same size and "look the same". For such a -diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c ---- a/gdb/gdbtypes.c -+++ b/gdb/gdbtypes.c -@@ -2889,7 +2889,7 @@ floatformat_from_type (const struct type *type) - least as long as OBJFILE. */ - - struct type * --init_type (struct objfile *objfile, enum type_code code, int bit, -+init_type (struct objfile *objfile, enum type_code code, LONGEST bit, - const char *name) - { - struct type *type; -@@ -3340,8 +3340,8 @@ is_public_ancestor (struct type *base, struct type *dclass) - - static int - is_unique_ancestor_worker (struct type *base, struct type *dclass, -- int *offset, -- const gdb_byte *valaddr, int embedded_offset, -+ LONGEST *offset, -+ const gdb_byte *valaddr, LONGEST embedded_offset, - CORE_ADDR address, struct value *val) - { - int i, count = 0; -@@ -3352,7 +3352,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, - for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i) - { - struct type *iter; -- int this_offset; -+ LONGEST this_offset; - - iter = check_typedef (TYPE_BASECLASS (dclass, i)); - -@@ -3393,7 +3393,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, - int - is_unique_ancestor (struct type *base, struct value *val) - { -- int offset = -1; -+ LONGEST offset = -1; - - return is_unique_ancestor_worker (base, value_type (val), &offset, - value_contents_for_printing (val), -@@ -4620,7 +4620,7 @@ recursive_dump_type (struct type *type, int spaces) - break; - } - puts_filtered ("\n"); -- printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type)); -+ printfi_filtered (spaces, "length %s\n", pulongest (TYPE_LENGTH (type))); - if (TYPE_OBJFILE_OWNED (type)) - { - printfi_filtered (spaces, "objfile "); -@@ -5065,7 +5065,7 @@ copy_type (const struct type *type) - - struct type * - arch_type (struct gdbarch *gdbarch, -- enum type_code code, int bit, const char *name) -+ enum type_code code, LONGEST bit, const char *name) - { - struct type *type; - -diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h ---- a/gdb/gdbtypes.h -+++ b/gdb/gdbtypes.h -@@ -864,7 +864,7 @@ struct type - type_length_units function should be used in order to get the length - expressed in target addressable memory units. */ - -- unsigned int length; -+ ULONGEST length; - - /* * Core type, shared by a group of qualified types. */ - -@@ -1787,7 +1787,7 @@ extern unsigned int type_length_units (struct type *type); - - /* * Helper function to construct objfile-owned types. */ - --extern struct type *init_type (struct objfile *, enum type_code, int, -+extern struct type *init_type (struct objfile *, enum type_code, LONGEST, - const char *); - extern struct type *init_integer_type (struct objfile *, int, int, - const char *); -@@ -1804,7 +1804,7 @@ extern struct type *init_pointer_type (struct objfile *, int, const char *, - struct type *); - - /* Helper functions to construct architecture-owned types. */ --extern struct type *arch_type (struct gdbarch *, enum type_code, int, -+extern struct type *arch_type (struct gdbarch *, enum type_code, LONGEST, - const char *); - extern struct type *arch_integer_type (struct gdbarch *, int, int, - const char *); -diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c ---- a/gdb/gnu-v2-abi.c -+++ b/gdb/gnu-v2-abi.c -@@ -82,7 +82,7 @@ gnuv2_is_operator_name (const char *name) - TYPE is the type in which F is located. */ - static struct value * - gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j, -- struct type * type, int offset) -+ struct type *type, LONGEST offset) - { - struct value *arg1 = *arg1p; - struct type *type1 = check_typedef (value_type (arg1)); -@@ -338,7 +338,7 @@ vb_match (struct type *type, int index, struct type *basetype) - target). The result is the offset of the baseclass value relative - to (the address of)(ARG) + OFFSET. */ - --static int -+static LONGEST - gnuv2_baseclass_offset (struct type *type, int index, - const bfd_byte *valaddr, LONGEST embedded_offset, - CORE_ADDR address, const struct value *val) -@@ -358,8 +358,7 @@ gnuv2_baseclass_offset (struct type *type, int index, - if (vb_match (type, i, basetype)) - { - struct type *field_type; -- LONGEST field_offset; -- int field_length; -+ LONGEST field_offset, field_length; - CORE_ADDR addr; - - field_type = check_typedef (TYPE_FIELD_TYPE (type, i)); -@@ -383,7 +382,7 @@ gnuv2_baseclass_offset (struct type *type, int index, - /* Don't go through baseclass_offset, as that wraps - exceptions, thus, inner exceptions would be wrapped more - than once. */ -- int boffset = -+ LONGEST boffset = - gnuv2_baseclass_offset (type, i, valaddr, - embedded_offset, address, val); - -diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c ---- a/gdb/gnu-v3-abi.c -+++ b/gdb/gnu-v3-abi.c -@@ -109,7 +109,7 @@ build_gdb_vtable_type (struct gdbarch *arch) - { - struct type *t; - struct field *field_list, *field; -- int offset; -+ LONGEST offset; - - struct type *void_ptr_type - = builtin_type (arch)->builtin_data_ptr; -@@ -185,7 +185,7 @@ vtable_ptrdiff_type (struct gdbarch *gdbarch) - /* Return the offset from the start of the imaginary `struct - gdb_gnu_v3_abi_vtable' object to the vtable's "address point" - (i.e., where objects' virtual table pointers point). */ --static int -+static LONGEST - vtable_address_point_offset (struct gdbarch *gdbarch) - { - struct type *vtable_type -@@ -409,7 +409,7 @@ gnuv3_get_virtual_fn (struct gdbarch *gdbarch, struct value *container, - static struct value * - gnuv3_virtual_fn_field (struct value **value_p, - struct fn_field *f, int j, -- struct type *vfn_base, int offset) -+ struct type *vfn_base, LONGEST offset) - { - struct type *values_type = check_typedef (value_type (*value_p)); - struct gdbarch *gdbarch; -@@ -439,7 +439,7 @@ gnuv3_virtual_fn_field (struct value **value_p, - - -1 is returned on error. */ - --static int -+static LONGEST - gnuv3_baseclass_offset (struct type *type, int index, - const bfd_byte *valaddr, LONGEST embedded_offset, - CORE_ADDR address, const struct value *val) -@@ -448,7 +448,7 @@ gnuv3_baseclass_offset (struct type *type, int index, - struct type *ptr_type; - struct value *vtable; - struct value *vbase_array; -- long int cur_base_offset, base_offset; -+ LONGEST cur_base_offset, base_offset; - - /* Determine architecture. */ - gdbarch = get_type_arch (type); -@@ -471,7 +471,7 @@ gnuv3_baseclass_offset (struct type *type, int index, - cur_base_offset = cur_base_offset + vtable_address_point_offset (gdbarch); - if ((- cur_base_offset) % TYPE_LENGTH (ptr_type) != 0) - error (_("Misaligned vbase offset.")); -- cur_base_offset = cur_base_offset / ((int) TYPE_LENGTH (ptr_type)); -+ cur_base_offset = cur_base_offset / ((LONGEST) TYPE_LENGTH (ptr_type)); - - vtable = gnuv3_get_vtable (gdbarch, type, address + embedded_offset); - gdb_assert (vtable != NULL); -@@ -515,7 +515,7 @@ gnuv3_find_method_in (struct type *domain, CORE_ADDR voffset, - we're out of luck. */ - for (i = 0; i < TYPE_N_BASECLASSES (domain); i++) - { -- int pos; -+ LONGEST pos; - struct type *basetype; - - if (BASETYPE_VIA_VIRTUAL (domain, i)) -diff --git a/gdb/go-lang.h b/gdb/go-lang.h ---- a/gdb/go-lang.h -+++ b/gdb/go-lang.h -@@ -83,7 +83,7 @@ extern void go_print_type (struct type *type, const char *varstring, - /* Defined in go-valprint.c. */ - - extern void go_val_print (struct type *type, -- int embedded_offset, CORE_ADDR address, -+ LONGEST embedded_offset, CORE_ADDR address, - struct ui_file *stream, int recurse, - struct value *val, - const struct value_print_options *options); -diff --git a/gdb/go-valprint.c b/gdb/go-valprint.c ---- a/gdb/go-valprint.c -+++ b/gdb/go-valprint.c -@@ -86,7 +86,7 @@ print_go_string (struct type *type, - /* Implements the la_val_print routine for language Go. */ - - void --go_val_print (struct type *type, int embedded_offset, -+go_val_print (struct type *type, LONGEST embedded_offset, - CORE_ADDR address, struct ui_file *stream, int recurse, - struct value *val, - const struct value_print_options *options) -diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c ---- a/gdb/i386-tdep.c -+++ b/gdb/i386-tdep.c -@@ -8156,7 +8156,7 @@ i386_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, - - const struct floatformat ** - i386_floatformat_for_type (struct gdbarch *gdbarch, -- const char *name, int len) -+ const char *name, LONGEST len) - { - if (len == 128 && name) - if (strcmp (name, "__float128") == 0 -diff --git a/gdb/language.c b/gdb/language.c ---- a/gdb/language.c -+++ b/gdb/language.c -@@ -765,7 +765,7 @@ unk_lang_printchar (int c, struct type *type, struct ui_file *stream) - - static void - unk_lang_printstr (struct ui_file *stream, struct type *type, -- const gdb_byte *string, unsigned int length, -+ const gdb_byte *string, ULONGEST length, - const char *encoding, int force_ellipses, - const struct value_print_options *options) - { -@@ -784,7 +784,7 @@ unk_lang_print_type (struct type *type, const char *varstring, - - static void - unk_lang_val_print (struct type *type, -- int embedded_offset, CORE_ADDR address, -+ LONGEST embedded_offset, CORE_ADDR address, - struct ui_file *stream, int recurse, - struct value *val, - const struct value_print_options *options) -diff --git a/gdb/language.h b/gdb/language.h ---- a/gdb/language.h -+++ b/gdb/language.h -@@ -184,7 +184,7 @@ struct language_defn - struct ui_file * stream); - - void (*la_printstr) (struct ui_file * stream, struct type *elttype, -- const gdb_byte *string, unsigned int length, -+ const gdb_byte *string, ULONGEST length, - const char *encoding, int force_ellipses, - const struct value_print_options *); - -@@ -222,7 +222,7 @@ struct language_defn - printing. */ - - void (*la_val_print) (struct type *type, -- int embedded_offset, CORE_ADDR address, -+ LONGEST embedded_offset, CORE_ADDR address, - struct ui_file *stream, int recurse, - struct value *val, - const struct value_print_options *options); -diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c ---- a/gdb/m2-lang.c -+++ b/gdb/m2-lang.c -@@ -103,10 +103,10 @@ m2_printchar (int c, struct type *type, struct ui_file *stream) - - static void - m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, -- unsigned int length, const char *encoding, int force_ellipses, -+ ULONGEST length, const char *encoding, int force_ellipses, - const struct value_print_options *options) - { -- unsigned int i; -+ ULONGEST i; - unsigned int things_printed = 0; - int in_quotes = 0; - int need_comma = 0; -@@ -121,9 +121,9 @@ m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, - { - /* Position of the character we are examining - to see whether it is repeated. */ -- unsigned int rep1; -+ ULONGEST rep1; - /* Number of repetitions we have detected so far. */ -- unsigned int reps; -+ ULONGEST reps; - - QUIT; - -@@ -149,7 +149,7 @@ m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, - in_quotes = 0; - } - m2_printchar (string[i], type, stream); -- fprintf_filtered (stream, " ", reps); -+ fprintf_filtered (stream, " ", pulongest (reps)); - i = rep1 - 1; - things_printed += options->repeat_count_threshold; - need_comma = 1; -diff --git a/gdb/m2-lang.h b/gdb/m2-lang.h ---- a/gdb/m2-lang.h -+++ b/gdb/m2-lang.h -@@ -35,7 +35,7 @@ extern void m2_print_typedef (struct type *, struct symbol *, - extern int m2_is_long_set (struct type *type); - extern int m2_is_unbounded_array (struct type *type); - --extern void m2_val_print (struct type *, int, CORE_ADDR, -+extern void m2_val_print (struct type *, LONGEST, CORE_ADDR, - struct ui_file *, int, - struct value *, - const struct value_print_options *); -diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c ---- a/gdb/m2-typeprint.c -+++ b/gdb/m2-typeprint.c -@@ -234,9 +234,12 @@ static void m2_array (struct type *type, struct ui_file *stream, - m2_print_bounds (TYPE_INDEX_TYPE (type), stream, show, -1, 1); - } - else -- fprintf_filtered (stream, "%d", -- (TYPE_LENGTH (type) -- / TYPE_LENGTH (TYPE_TARGET_TYPE (type)))); -+ { -+ ULONGEST val = (TYPE_LENGTH (type) -+ / TYPE_LENGTH (TYPE_TARGET_TYPE (type))); -+ -+ fprintf_filtered (stream, "%s", pulongest (val)); -+ } - } - fprintf_filtered (stream, "] OF "); - m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags); -diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c ---- a/gdb/m2-valprint.c -+++ b/gdb/m2-valprint.c -@@ -35,7 +35,7 @@ static int print_unpacked_pointer (struct type *type, - struct ui_file *stream); - static void - m2_print_array_contents (struct type *type, const gdb_byte *valaddr, -- int embedded_offset, CORE_ADDR address, -+ LONGEST embedded_offset, CORE_ADDR address, - struct ui_file *stream, int recurse, - struct value *val, - const struct value_print_options *options, -@@ -67,7 +67,7 @@ get_long_set_bounds (struct type *type, LONGEST *low, LONGEST *high) - - static void - m2_print_long_set (struct type *type, const gdb_byte *valaddr, -- int embedded_offset, CORE_ADDR address, -+ LONGEST embedded_offset, CORE_ADDR address, - struct ui_file *stream) - { - int empty_set = 1; -@@ -158,7 +158,7 @@ m2_print_long_set (struct type *type, const gdb_byte *valaddr, - - static void - m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr, -- int embedded_offset, CORE_ADDR address, -+ LONGEST embedded_offset, CORE_ADDR address, - struct ui_file *stream, int recurse, - const struct value_print_options *options) - { -@@ -260,7 +260,7 @@ print_variable_at_address (struct type *type, - - static void - m2_print_array_contents (struct type *type, const gdb_byte *valaddr, -- int embedded_offset, CORE_ADDR address, -+ LONGEST embedded_offset, CORE_ADDR address, - struct ui_file *stream, int recurse, - struct value *val, - const struct value_print_options *options, -@@ -308,12 +308,12 @@ static const struct generic_val_print_decorations m2_decorations = - function; they are identical. */ - - void --m2_val_print (struct type *type, int embedded_offset, -+m2_val_print (struct type *type, LONGEST embedded_offset, - CORE_ADDR address, struct ui_file *stream, int recurse, - struct value *original_value, - const struct value_print_options *options) - { -- unsigned len; -+ ULONGEST len; - struct type *elttype; - CORE_ADDR addr; - const gdb_byte *valaddr = value_contents_for_printing (original_value); -@@ -339,7 +339,7 @@ m2_val_print (struct type *type, int embedded_offset, - elements up to it. */ - if (options->stop_print_at_null) - { -- unsigned int temp_len; -+ ULONGEST temp_len; - - /* Look for a NULL char. */ - for (temp_len = 0; -@@ -415,7 +415,7 @@ m2_val_print (struct type *type, int embedded_offset, - { - struct type *range = elttype; - LONGEST low_bound, high_bound; -- int i; -+ LONGEST i; - int need_comma = 0; - - fputs_filtered ("{", stream); -diff --git a/gdb/memrange.c b/gdb/memrange.c ---- a/gdb/memrange.c -+++ b/gdb/memrange.c -@@ -22,8 +22,8 @@ - #include - - int --mem_ranges_overlap (CORE_ADDR start1, int len1, -- CORE_ADDR start2, int len2) -+mem_ranges_overlap (CORE_ADDR start1, LONGEST len1, -+ CORE_ADDR start2, LONGEST len2) - { - ULONGEST h, l; - -diff --git a/gdb/memrange.h b/gdb/memrange.h ---- a/gdb/memrange.h -+++ b/gdb/memrange.h -@@ -28,7 +28,7 @@ struct mem_range - { - mem_range () = default; - -- mem_range (CORE_ADDR start_, int length_) -+ mem_range (CORE_ADDR start_, LONGEST length_) - : start (start_), length (length_) - {} - -@@ -47,14 +47,14 @@ struct mem_range - CORE_ADDR start; - - /* Length of the range. */ -- int length; -+ LONGEST length; - }; - - /* Returns true if the ranges defined by [start1, start1+len1) and - [start2, start2+len2) overlap. */ - --extern int mem_ranges_overlap (CORE_ADDR start1, int len1, -- CORE_ADDR start2, int len2); -+extern int mem_ranges_overlap (CORE_ADDR start1, LONGEST len1, -+ CORE_ADDR start2, LONGEST len2); - - /* Returns true if ADDR is in RANGE. */ - -diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c ---- a/gdb/mips-linux-nat.c -+++ b/gdb/mips-linux-nat.c -@@ -610,7 +610,7 @@ mips_linux_nat_target::stopped_data_address (CORE_ADDR *paddr) - the specified region can be covered by the watch registers. */ - - int --mips_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) -+mips_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) - { - struct pt_watch_regs dummy_regs; - int i; -diff --git a/gdb/nat/x86-dregs.c b/gdb/nat/x86-dregs.c ---- a/gdb/nat/x86-dregs.c -+++ b/gdb/nat/x86-dregs.c -@@ -380,7 +380,7 @@ x86_remove_aligned_watchpoint (struct x86_debug_reg_state *state, - - static int - x86_handle_nonaligned_watchpoint (struct x86_debug_reg_state *state, -- x86_wp_op_t what, CORE_ADDR addr, int len, -+ x86_wp_op_t what, CORE_ADDR addr, LONGEST len, - enum target_hw_bp_type type) - { - int retval = 0; -@@ -548,7 +548,7 @@ x86_dr_remove_watchpoint (struct x86_debug_reg_state *state, - - int - x86_dr_region_ok_for_watchpoint (struct x86_debug_reg_state *state, -- CORE_ADDR addr, int len) -+ CORE_ADDR addr, LONGEST len) - { - int nregs; - -diff --git a/gdb/nat/x86-dregs.h b/gdb/nat/x86-dregs.h ---- a/gdb/nat/x86-dregs.h -+++ b/gdb/nat/x86-dregs.h -@@ -117,7 +117,7 @@ extern int x86_dr_remove_watchpoint (struct x86_debug_reg_state *state, - /* Return non-zero if we can watch a memory region that starts at - address ADDR and whose length is LEN bytes. */ - extern int x86_dr_region_ok_for_watchpoint (struct x86_debug_reg_state *state, -- CORE_ADDR addr, int len); -+ CORE_ADDR addr, LONGEST len); - - /* If the inferior has some break/watchpoint that triggered, set the - address associated with that break/watchpoint and return true. -diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c ---- a/gdb/opencl-lang.c -+++ b/gdb/opencl-lang.c -@@ -76,11 +76,11 @@ builtin_opencl_type (struct gdbarch *gdbarch) - - static struct type * - lookup_opencl_vector_type (struct gdbarch *gdbarch, enum type_code code, -- unsigned int el_length, unsigned int flag_unsigned, -+ ULONGEST el_length, unsigned int flag_unsigned, - int n) - { - int i; -- unsigned int length; -+ ULONGEST length; - struct type *type = NULL; - struct type **types = builtin_opencl_type (gdbarch); - -@@ -172,7 +172,7 @@ lval_func_read (struct value *v) - struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val))); - LONGEST offset = value_offset (v); - LONGEST elsize = TYPE_LENGTH (eltype); -- int n, i, j = 0; -+ LONGEST n, i, j = 0; - LONGEST lowb = 0; - LONGEST highb = 0; - -@@ -201,7 +201,7 @@ lval_func_write (struct value *v, struct value *fromval) - struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val))); - LONGEST offset = value_offset (v); - LONGEST elsize = TYPE_LENGTH (eltype); -- int n, i, j = 0; -+ LONGEST n, i, j = 0; - LONGEST lowb = 0; - LONGEST highb = 0; - -@@ -241,17 +241,17 @@ lval_func_write (struct value *v, struct value *fromval) - - static int - lval_func_check_synthetic_pointer (const struct value *v, -- LONGEST offset, int length) -+ LONGEST offset, LONGEST length) - { - struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); - /* Size of the target type in bits. */ -- int elsize = -+ LONGEST elsize = - TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; -- int startrest = offset % elsize; -- int start = offset / elsize; -- int endrest = (offset + length) % elsize; -- int end = (offset + length) / elsize; -- int i; -+ LONGEST startrest = offset % elsize; -+ LONGEST start = offset / elsize; -+ LONGEST endrest = (offset + length) % elsize; -+ LONGEST end = (offset + length) / elsize; -+ LONGEST i; - - if (endrest) - end++; -@@ -261,8 +261,8 @@ lval_func_check_synthetic_pointer (const struct value *v, - - for (i = start; i < end; i++) - { -- int comp_offset = (i == start) ? startrest : 0; -- int comp_length = (i == end) ? endrest : elsize; -+ LONGEST comp_offset = (i == start) ? startrest : 0; -+ LONGEST comp_length = (i == end) ? endrest : elsize; - - if (!value_bits_synthetic_pointer (c->val, - c->indices[i] * elsize + comp_offset, -diff --git a/gdb/p-lang.c b/gdb/p-lang.c ---- a/gdb/p-lang.c -+++ b/gdb/p-lang.c -@@ -93,8 +93,8 @@ pascal_main_name (void) - are not multiple of TARGET_CHAR_BIT then the results are wrong - but this does not happen for Free Pascal nor for GPC. */ - int --is_pascal_string_type (struct type *type,int *length_pos, -- int *length_size, int *string_pos, -+is_pascal_string_type (struct type *type, LONGEST *length_pos, -+ LONGEST *length_size, LONGEST *string_pos, - struct type **char_type, - const char **arrayname) - { -@@ -214,12 +214,12 @@ pascal_printchar (int c, struct type *type, struct ui_file *stream) - - void - pascal_printstr (struct ui_file *stream, struct type *type, -- const gdb_byte *string, unsigned int length, -+ const gdb_byte *string, ULONGEST length, - const char *encoding, int force_ellipses, - const struct value_print_options *options) - { - enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); -- unsigned int i; -+ ULONGEST i; - unsigned int things_printed = 0; - int in_quotes = 0; - int need_comma = 0; -@@ -247,9 +247,9 @@ pascal_printstr (struct ui_file *stream, struct type *type, - { - /* Position of the character we are examining - to see whether it is repeated. */ -- unsigned int rep1; -+ ULONGEST rep1; - /* Number of repetitions we have detected so far. */ -- unsigned int reps; -+ ULONGEST reps; - unsigned long int current_char; - - QUIT; -@@ -281,7 +281,7 @@ pascal_printstr (struct ui_file *stream, struct type *type, - in_quotes = 0; - } - pascal_printchar (current_char, type, stream); -- fprintf_filtered (stream, " ", reps); -+ fprintf_filtered (stream, " ", pulongest (reps)); - i = rep1 - 1; - things_printed += options->repeat_count_threshold; - need_comma = 1; -diff --git a/gdb/p-lang.h b/gdb/p-lang.h ---- a/gdb/p-lang.h -+++ b/gdb/p-lang.h -@@ -37,7 +37,7 @@ extern void pascal_print_type (struct type *, const char *, struct ui_file *, - extern void pascal_print_typedef (struct type *, struct symbol *, - struct ui_file *); - --extern void pascal_val_print (struct type *, int, -+extern void pascal_val_print (struct type *, LONGEST, - CORE_ADDR, struct ui_file *, int, - struct value *, - const struct value_print_options *); -@@ -51,13 +51,13 @@ extern void pascal_type_print_method_args (const char *, const char *, - /* These are in p-lang.c: */ - - extern int -- is_pascal_string_type (struct type *, int *, int *, int *, -+ is_pascal_string_type (struct type *, LONGEST *, LONGEST *, LONGEST *, - struct type **, const char **); - - extern void pascal_printchar (int, struct type *, struct ui_file *); - - extern void pascal_printstr (struct ui_file *, struct type *, const gdb_byte *, -- unsigned int, const char *, int, -+ ULONGEST, const char *, int, - const struct value_print_options *); - - extern struct type **const pascal_builtin_types[]; -diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c ---- a/gdb/p-valprint.c -+++ b/gdb/p-valprint.c -@@ -60,7 +60,7 @@ static const struct generic_val_print_decorations p_decorations = - - void - pascal_val_print (struct type *type, -- int embedded_offset, CORE_ADDR address, -+ LONGEST embedded_offset, CORE_ADDR address, - struct ui_file *stream, int recurse, - struct value *original_value, - const struct value_print_options *options) -@@ -70,8 +70,8 @@ pascal_val_print (struct type *type, - unsigned int i = 0; /* Number of characters printed */ - unsigned len; - struct type *elttype; -- unsigned eltlen; -- int length_pos, length_size, string_pos; -+ ULONGEST eltlen; -+ LONGEST length_pos, length_size, string_pos; - struct type *char_type; - CORE_ADDR addr; - int want_space = 0; -diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c ---- a/gdb/ppc-linux-nat.c -+++ b/gdb/ppc-linux-nat.c -@@ -1716,7 +1716,7 @@ ppc_linux_nat_target::can_use_hw_breakpoint (enum bptype type, int cnt, int ot) - } - - int --ppc_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) -+ppc_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) - { - /* Handle sub-8-byte quantities. */ - if (len <= 0) -diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c ---- a/gdb/ppc-linux-tdep.c -+++ b/gdb/ppc-linux-tdep.c -@@ -2263,7 +2263,7 @@ ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep, - - const struct floatformat ** - ppc_floatformat_for_type (struct gdbarch *gdbarch, -- const char *name, int len) -+ const char *name, LONGEST len) - { - if (len == 128 && name) - { -diff --git a/gdb/printcmd.c b/gdb/printcmd.c ---- a/gdb/printcmd.c -+++ b/gdb/printcmd.c -@@ -276,7 +276,7 @@ print_formatted (struct value *val, int size, - struct ui_file *stream) - { - struct type *type = check_typedef (value_type (val)); -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - - if (VALUE_LVAL (val) == lval_memory) - next_address = value_address (val) + len; -@@ -352,7 +352,7 @@ print_scalar_formatted (const gdb_byte *valaddr, struct type *type, - int size, struct ui_file *stream) - { - struct gdbarch *gdbarch = get_type_arch (type); -- unsigned int len = TYPE_LENGTH (type); -+ ULONGEST len = TYPE_LENGTH (type); - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - - /* String printing should go through val_print_scalar_formatted. */ -diff --git a/gdb/procfs.c b/gdb/procfs.c ---- a/gdb/procfs.c -+++ b/gdb/procfs.c -@@ -3374,7 +3374,7 @@ procfs_target::remove_watchpoint (CORE_ADDR addr, int len, - } - - int --procfs_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) -+procfs_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) - { - /* The man page for proc(4) on Solaris 2.6 and up says that the - system can support "thousands" of hardware watchpoints, but gives -diff --git a/gdb/regcache.c b/gdb/regcache.c ---- a/gdb/regcache.c -+++ b/gdb/regcache.c -@@ -763,7 +763,7 @@ regcache::cooked_write (int regnum, const gdb_byte *buf) - /* See regcache.h. */ - - enum register_status --readable_regcache::read_part (int regnum, int offset, int len, -+readable_regcache::read_part (int regnum, LONGEST offset, LONGEST len, - gdb_byte *out, bool is_raw) - { - int reg_size = register_size (arch (), regnum); -@@ -830,7 +830,7 @@ reg_buffer::raw_collect_part (int regnum, int offset, int len, - /* See regcache.h. */ - - enum register_status --regcache::write_part (int regnum, int offset, int len, -+regcache::write_part (int regnum, LONGEST offset, LONGEST len, - const gdb_byte *in, bool is_raw) - { - int reg_size = register_size (arch (), regnum); -@@ -901,7 +901,7 @@ reg_buffer::raw_supply_part (int regnum, int offset, int len, - } - - enum register_status --readable_regcache::raw_read_part (int regnum, int offset, int len, -+readable_regcache::raw_read_part (int regnum, int offset, LONGEST len, - gdb_byte *buf) - { - assert_regnum (regnum); -@@ -911,7 +911,7 @@ readable_regcache::raw_read_part (int regnum, int offset, int len, - /* See regcache.h. */ - - void --regcache::raw_write_part (int regnum, int offset, int len, -+regcache::raw_write_part (int regnum, int offset, LONGEST len, - const gdb_byte *buf) - { - assert_regnum (regnum); -@@ -921,7 +921,7 @@ regcache::raw_write_part (int regnum, int offset, int len, - /* See regcache.h. */ - - enum register_status --readable_regcache::cooked_read_part (int regnum, int offset, int len, -+readable_regcache::cooked_read_part (int regnum, LONGEST offset, LONGEST len, - gdb_byte *buf) - { - gdb_assert (regnum >= 0 && regnum < m_descr->nr_cooked_registers); -@@ -931,7 +931,7 @@ readable_regcache::cooked_read_part (int regnum, int offset, int len, - /* See regcache.h. */ - - void --regcache::cooked_write_part (int regnum, int offset, int len, -+regcache::cooked_write_part (int regnum, LONGEST offset, LONGEST len, - const gdb_byte *buf) - { - gdb_assert (regnum >= 0 && regnum < m_descr->nr_cooked_registers); -diff --git a/gdb/regcache.h b/gdb/regcache.h ---- a/gdb/regcache.h -+++ b/gdb/regcache.h -@@ -273,8 +273,8 @@ public: - enum register_status raw_read (int regnum, T *val); - - /* Partial transfer of raw registers. Return the status of the register. */ -- enum register_status raw_read_part (int regnum, int offset, int len, -- gdb_byte *buf); -+ enum register_status raw_read_part (int regnum, int offset, -+ LONGEST len, gdb_byte *buf); - - /* Make certain that the register REGNUM is up-to-date. */ - virtual void raw_update (int regnum) = 0; -@@ -286,8 +286,8 @@ public: - enum register_status cooked_read (int regnum, T *val); - - /* Partial transfer of a cooked register. */ -- enum register_status cooked_read_part (int regnum, int offset, int len, -- gdb_byte *buf); -+ enum register_status cooked_read_part (int regnum, LONGEST offset, -+ LONGEST len, gdb_byte *buf); - - /* Read register REGNUM from the regcache and return a new value. This - will call mark_value_bytes_unavailable as appropriate. */ -@@ -297,7 +297,7 @@ protected: - - /* Perform a partial register transfer using a read, modify, write - operation. Will fail if register is currently invalid. */ -- enum register_status read_part (int regnum, int offset, int len, -+ enum register_status read_part (int regnum, LONGEST offset, LONGEST len, - gdb_byte *out, bool is_raw); - }; - -@@ -355,11 +355,12 @@ public: - - /* Partial transfer of raw registers. Perform read, modify, write style - operations. */ -- void raw_write_part (int regnum, int offset, int len, const gdb_byte *buf); -+ void raw_write_part (int regnum, int offset, LONGEST len, -+ const gdb_byte *buf); - - /* Partial transfer of a cooked register. Perform read, modify, write style - operations. */ -- void cooked_write_part (int regnum, int offset, int len, -+ void cooked_write_part (int regnum, LONGEST offset, LONGEST len, - const gdb_byte *buf); - - void supply_regset (const struct regset *regset, -@@ -410,7 +411,7 @@ private: - - /* Perform a partial register transfer using a read, modify, write - operation. */ -- enum register_status write_part (int regnum, int offset, int len, -+ enum register_status write_part (int regnum, LONGEST offset, LONGEST len, - const gdb_byte *in, bool is_raw); - - /* The address space of this register cache (for registers where it -diff --git a/gdb/remote.c b/gdb/remote.c ---- a/gdb/remote.c -+++ b/gdb/remote.c -@@ -458,7 +458,7 @@ public: - - int remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *) override; - -- int region_ok_for_hw_watchpoint (CORE_ADDR, int) override; -+ int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) override; - - int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type, - struct expression *) override; -@@ -10406,7 +10406,7 @@ int remote_hw_watchpoint_length_limit = -1; - int remote_hw_breakpoint_limit = -1; - - int --remote_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) -+remote_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) - { - if (remote_hw_watchpoint_length_limit == 0) - return 0; -diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c ---- a/gdb/rust-lang.c -+++ b/gdb/rust-lang.c -@@ -301,7 +301,7 @@ rust_printchar (int c, struct type *type, struct ui_file *stream) - - static void - rust_printstr (struct ui_file *stream, struct type *type, -- const gdb_byte *string, unsigned int length, -+ const gdb_byte *string, ULONGEST length, - const char *user_encoding, int force_ellipses, - const struct value_print_options *options) - { -@@ -517,7 +517,7 @@ static const struct generic_val_print_decorations rust_decorations = - /* la_val_print implementation for Rust. */ - - static void --rust_val_print (struct type *type, int embedded_offset, -+rust_val_print (struct type *type, LONGEST embedded_offset, - CORE_ADDR address, struct ui_file *stream, int recurse, - struct value *val, - const struct value_print_options *options) -diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c ---- a/gdb/s390-linux-nat.c -+++ b/gdb/s390-linux-nat.c -@@ -951,7 +951,8 @@ s390_linux_nat_target::remove_hw_breakpoint (struct gdbarch *gdbarch, - } - - int --s390_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int cnt) -+s390_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, -+ LONGEST cnt) - { - return 1; - } -diff --git a/gdb/spu-multiarch.c b/gdb/spu-multiarch.c ---- a/gdb/spu-multiarch.c -+++ b/gdb/spu-multiarch.c -@@ -65,7 +65,7 @@ struct spu_multiarch_target final : public target_ops - const gdb_byte *pattern, ULONGEST pattern_len, - CORE_ADDR *found_addrp) override; - -- int region_ok_for_hw_watchpoint (CORE_ADDR, int) override; -+ int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) override; - - struct gdbarch *thread_architecture (ptid_t) override; - }; -@@ -162,7 +162,7 @@ spu_multiarch_target::thread_architecture (ptid_t ptid) - /* Override the to_region_ok_for_hw_watchpoint routine. */ - - int --spu_multiarch_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) -+spu_multiarch_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) - { - /* We cannot watch SPU local store. */ - if (SPUADDR_SPU (addr) != -1) -diff --git a/gdb/stack.c b/gdb/stack.c ---- a/gdb/stack.c -+++ b/gdb/stack.c -@@ -194,7 +194,7 @@ print_stack_frame (struct frame_info *frame, int print_level, - argument (not just the first nameless argument). */ - - static void --print_frame_nameless_args (struct frame_info *frame, long start, int num, -+print_frame_nameless_args (struct frame_info *frame, LONGEST start, int num, - int first, struct ui_file *stream) - { - struct gdbarch *gdbarch = get_frame_arch (frame); -@@ -544,7 +544,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame, - /* Offset of next stack argument beyond the one we have seen that is - at the highest offset, or -1 if we haven't come to a stack - argument yet. */ -- long highest_offset = -1; -+ LONGEST highest_offset = -1; - /* Number of ints of arguments that we have printed so far. */ - int args_printed = 0; - /* True if we should print arguments, false otherwise. */ -@@ -573,8 +573,8 @@ print_frame_args (struct symbol *func, struct frame_info *frame, - case LOC_ARG: - case LOC_REF_ARG: - { -- long current_offset = SYMBOL_VALUE (sym); -- int arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym)); -+ LONGEST current_offset = SYMBOL_VALUE (sym); -+ LONGEST arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym)); - - /* Compute address of next argument by adding the size of - this argument and rounding to an int boundary. */ -@@ -709,7 +709,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame, - enough about the stack to find them. */ - if (num != -1) - { -- long start; -+ LONGEST start; - - if (highest_offset == -1) - start = gdbarch_frame_args_skip (get_frame_arch (frame)); -diff --git a/gdb/symmisc.c b/gdb/symmisc.c ---- a/gdb/symmisc.c -+++ b/gdb/symmisc.c -@@ -587,11 +587,11 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, - - case LOC_CONST_BYTES: - { -- unsigned i; -+ ULONGEST i; - struct type *type = check_typedef (SYMBOL_TYPE (symbol)); - -- fprintf_filtered (outfile, "const %u hex bytes:", -- TYPE_LENGTH (type)); -+ fprintf_filtered (outfile, "const %s hex bytes:", -+ pulongest (TYPE_LENGTH (type))); - for (i = 0; i < TYPE_LENGTH (type); i++) - fprintf_filtered (outfile, " %02x", - (unsigned) SYMBOL_VALUE_BYTES (symbol)[i]); -diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c ---- a/gdb/target-delegates.c -+++ b/gdb/target-delegates.c -@@ -38,7 +38,7 @@ struct dummy_target : public target_ops - bool have_steppable_watchpoint () override; - bool stopped_data_address (CORE_ADDR *arg0) override; - bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) override; -- int region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1) override; -+ int region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) override; - bool can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3) override; - int masked_watch_num_registers (CORE_ADDR arg0, CORE_ADDR arg1) override; - int can_do_single_step () override; -@@ -205,7 +205,7 @@ struct debug_target : public target_ops - bool have_steppable_watchpoint () override; - bool stopped_data_address (CORE_ADDR *arg0) override; - bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) override; -- int region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1) override; -+ int region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) override; - bool can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3) override; - int masked_watch_num_registers (CORE_ADDR arg0, CORE_ADDR arg1) override; - int can_do_single_step () override; -@@ -1071,19 +1071,19 @@ debug_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int - } - - int --target_ops::region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1) -+target_ops::region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) - { - return this->beneath ()->region_ok_for_hw_watchpoint (arg0, arg1); - } - - int --dummy_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1) -+dummy_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) - { - return default_region_ok_for_hw_watchpoint (this, arg0, arg1); - } - - int --debug_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1) -+debug_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) - { - int result; - fprintf_unfiltered (gdb_stdlog, "-> %s->region_ok_for_hw_watchpoint (...)\n", this->beneath ()->shortname ()); -@@ -1091,7 +1091,7 @@ debug_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1) - fprintf_unfiltered (gdb_stdlog, "<- %s->region_ok_for_hw_watchpoint (", this->beneath ()->shortname ()); - target_debug_print_CORE_ADDR (arg0); - fputs_unfiltered (", ", gdb_stdlog); -- target_debug_print_int (arg1); -+ target_debug_print_LONGEST (arg1); - fputs_unfiltered (") = ", gdb_stdlog); - target_debug_print_int (result); - fputs_unfiltered ("\n", gdb_stdlog); -diff --git a/gdb/target.c b/gdb/target.c ---- a/gdb/target.c -+++ b/gdb/target.c -@@ -58,7 +58,7 @@ static int default_watchpoint_addr_within_range (struct target_ops *, - CORE_ADDR, CORE_ADDR, int); - - static int default_region_ok_for_hw_watchpoint (struct target_ops *, -- CORE_ADDR, int); -+ CORE_ADDR, LONGEST); - - static void default_rcmd (struct target_ops *, const char *, struct ui_file *); - -@@ -3103,7 +3103,7 @@ target_fileio_read_stralloc (struct inferior *inf, const char *filename) - - static int - default_region_ok_for_hw_watchpoint (struct target_ops *self, -- CORE_ADDR addr, int len) -+ CORE_ADDR addr, LONGEST len) - { - return (len <= gdbarch_ptr_bit (target_gdbarch ()) / TARGET_CHAR_BIT); - } -diff --git a/gdb/target.h b/gdb/target.h ---- a/gdb/target.h -+++ b/gdb/target.h -@@ -566,7 +566,7 @@ struct target_ops - - /* Documentation of this routine is provided with the corresponding - target_* macro. */ -- virtual int region_ok_for_hw_watchpoint (CORE_ADDR, int) -+ virtual int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) - TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint); - - virtual bool can_accel_watchpoint_condition (CORE_ADDR, int, int, -diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c ---- a/gdb/tracepoint.c -+++ b/gdb/tracepoint.c -@@ -893,10 +893,10 @@ collection_list::add_local_register (struct gdbarch *gdbarch, - void - collection_list::add_memrange (struct gdbarch *gdbarch, - int type, bfd_signed_vma base, -- unsigned long len, CORE_ADDR scope) -+ ULONGEST len, CORE_ADDR scope) - { - if (info_verbose) -- printf_filtered ("(%d,%s,%ld)\n", type, paddress (gdbarch, base), len); -+ printf_filtered ("(%d,%s,%s)\n", type, paddress (gdbarch, base), pulongest (len)); - - /* type: memrange_absolute == memory, other n == basereg */ - /* base: addr if memory, offset if reg relative. */ -@@ -916,7 +916,7 @@ collection_list::collect_symbol (struct symbol *sym, - CORE_ADDR scope, - int trace_string) - { -- unsigned long len; -+ ULONGEST len; - unsigned int reg; - bfd_signed_vma offset; - int treat_as_expr = 0; -@@ -937,8 +937,8 @@ collection_list::collect_symbol (struct symbol *sym, - offset = SYMBOL_VALUE_ADDRESS (sym); - if (info_verbose) - { -- printf_filtered ("LOC_STATIC %s: collect %ld bytes at %s.\n", -- SYMBOL_PRINT_NAME (sym), len, -+ printf_filtered ("LOC_STATIC %s: collect %s bytes at %s.\n", -+ SYMBOL_PRINT_NAME (sym), pulongest (len), - paddress (gdbarch, offset)); - } - /* A struct may be a C++ class with static fields, go to general -@@ -970,9 +970,9 @@ collection_list::collect_symbol (struct symbol *sym, - offset = frame_offset + SYMBOL_VALUE (sym); - if (info_verbose) - { -- printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset %s" -+ printf_filtered ("LOC_LOCAL %s: Collect %s bytes at offset %s" - " from frame ptr reg %d\n", -- SYMBOL_PRINT_NAME (sym), len, -+ SYMBOL_PRINT_NAME (sym), pulongest (len), - paddress (gdbarch, offset), reg); - } - add_memrange (gdbarch, reg, offset, len, scope); -@@ -982,9 +982,9 @@ collection_list::collect_symbol (struct symbol *sym, - offset = 0; - if (info_verbose) - { -- printf_filtered ("LOC_REGPARM_ADDR %s: Collect %ld bytes at offset %s" -+ printf_filtered ("LOC_REGPARM_ADDR %s: Collect %s bytes at offset %s" - " from reg %d\n", -- SYMBOL_PRINT_NAME (sym), len, -+ SYMBOL_PRINT_NAME (sym), pulongest (len), - paddress (gdbarch, offset), reg); - } - add_memrange (gdbarch, reg, offset, len, scope); -@@ -994,9 +994,9 @@ collection_list::collect_symbol (struct symbol *sym, - offset = frame_offset + SYMBOL_VALUE (sym); - if (info_verbose) - { -- printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset %s" -+ printf_filtered ("LOC_LOCAL %s: Collect %s bytes at offset %s" - " from frame ptr reg %d\n", -- SYMBOL_PRINT_NAME (sym), len, -+ SYMBOL_PRINT_NAME (sym), pulongest (len), - paddress (gdbarch, offset), reg); - } - add_memrange (gdbarch, reg, offset, len, scope); -@@ -2492,7 +2492,8 @@ info_scope_command (const char *args_in, int from_tty) - const char *symname; - const char *save_args = args_in; - struct block_iterator iter; -- int j, count = 0; -+ int count = 0; -+ LONGEST j; - struct gdbarch *gdbarch; - int regno; - const char *args = args_in; -@@ -2636,8 +2637,11 @@ info_scope_command (const char *args_in, int from_tty) - } - } - if (SYMBOL_TYPE (sym)) -- printf_filtered (", length %d.\n", -- TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym)))); -+ { -+ ULONGEST len = TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym))); -+ -+ printf_filtered (", length %s.\n", pulongest (len)); -+ } - } - if (BLOCK_FUNCTION (block)) - break; -diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h ---- a/gdb/tracepoint.h -+++ b/gdb/tracepoint.h -@@ -269,7 +269,7 @@ public: - CORE_ADDR scope); - void add_memrange (struct gdbarch *gdbarch, - int type, bfd_signed_vma base, -- unsigned long len, CORE_ADDR scope); -+ ULONGEST len, CORE_ADDR scope); - void collect_symbol (struct symbol *sym, - struct gdbarch *gdbarch, - long frame_regno, long frame_offset, -diff --git a/gdb/typeprint.c b/gdb/typeprint.c ---- a/gdb/typeprint.c -+++ b/gdb/typeprint.c -@@ -120,7 +120,8 @@ print_offset_data::update (struct type *type, unsigned int field_idx, - { - /* Since union fields don't have the concept of offsets, we just - print their sizes. */ -- fprintf_filtered (stream, "/* %4u */", TYPE_LENGTH (ftype)); -+ fprintf_filtered (stream, "/* %4s */", -+ pulongest (TYPE_LENGTH (ftype))); - return; - } - -@@ -183,8 +184,8 @@ print_offset_data::finish (struct type *type, int level, - - fputs_filtered ("\n", stream); - print_spaces_filtered (level + 4 + print_offset_data::indentation, stream); -- fprintf_filtered (stream, "/* total size (bytes): %4u */\n", -- TYPE_LENGTH (type)); -+ fprintf_filtered (stream, "/* total size (bytes): %4s */\n", -+ pulongest (TYPE_LENGTH (type))); - } - - -diff --git a/gdb/valarith.c b/gdb/valarith.c ---- a/gdb/valarith.c -+++ b/gdb/valarith.c -@@ -182,7 +182,7 @@ value_subscript (struct value *array, LONGEST index) - to doubles, but no longer does. */ - - struct value * --value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) -+value_subscripted_rvalue (struct value *array, LONGEST index, LONGEST lowerbound) - { - struct type *array_type = check_typedef (value_type (array)); - struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type)); -@@ -656,7 +656,7 @@ value_concat (struct value *arg1, struct value *arg2) - struct value *inval1; - struct value *inval2; - struct value *outval = NULL; -- int inval1len, inval2len; -+ ssize_t inval1len, inval2len; - int count, idx; - char inchar; - struct type *type1 = check_typedef (value_type (arg1)); -@@ -1416,7 +1416,7 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) - int - value_logical_not (struct value *arg1) - { -- int len; -+ LONGEST len; - const gdb_byte *p; - struct type *type1; - -@@ -1444,11 +1444,11 @@ value_logical_not (struct value *arg1) - static int - value_strcmp (struct value *arg1, struct value *arg2) - { -- int len1 = TYPE_LENGTH (value_type (arg1)); -- int len2 = TYPE_LENGTH (value_type (arg2)); -+ LONGEST len1 = TYPE_LENGTH (value_type (arg1)); -+ LONGEST len2 = TYPE_LENGTH (value_type (arg2)); - const gdb_byte *s1 = value_contents (arg1); - const gdb_byte *s2 = value_contents (arg2); -- int i, len = len1 < len2 ? len1 : len2; -+ LONGEST i, len = len1 < len2 ? len1 : len2; - - for (i = 0; i < len; i++) - { -diff --git a/gdb/valops.c b/gdb/valops.c ---- a/gdb/valops.c -+++ b/gdb/valops.c -@@ -81,7 +81,7 @@ static enum oload_classification classify_oload_match - (const badness_vector &, int, int); - - static struct value *value_struct_elt_for_reference (struct type *, -- int, struct type *, -+ LONGEST, struct type *, - const char *, - struct type *, - int, enum noside); -@@ -171,7 +171,7 @@ find_function_in_inferior (const char *name, struct objfile **objf_p) - space. */ - - struct value * --value_allocate_space_in_inferior (int len) -+value_allocate_space_in_inferior (LONGEST len) - { - struct objfile *objf; - struct value *val = find_function_in_inferior ("malloc", &objf); -@@ -386,12 +386,12 @@ value_cast (struct type *type, struct value *arg2) - if (code1 == TYPE_CODE_ARRAY) - { - struct type *element_type = TYPE_TARGET_TYPE (type); -- unsigned element_length = TYPE_LENGTH (check_typedef (element_type)); -+ ULONGEST element_length = TYPE_LENGTH (check_typedef (element_type)); - - if (element_length > 0 && TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) - { - struct type *range_type = TYPE_INDEX_TYPE (type); -- int val_length = TYPE_LENGTH (type2); -+ LONGEST val_length = TYPE_LENGTH (type2); - LONGEST low_bound, high_bound, new_length; - - if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) -@@ -1043,7 +1043,7 @@ value_assign (struct value *toval, struct value *fromval) - { - const gdb_byte *dest_buffer; - CORE_ADDR changed_addr; -- int changed_len; -+ LONGEST changed_len; - gdb_byte buffer[sizeof (LONGEST)]; - - if (value_bitsize (toval)) -@@ -3335,7 +3335,7 @@ get_baseclass_offset (struct type *vt, struct type *cls, - the form "DOMAIN::NAME". */ - - static struct value * --value_struct_elt_for_reference (struct type *domain, int offset, -+value_struct_elt_for_reference (struct type *domain, LONGEST offset, - struct type *curtype, const char *name, - struct type *intype, - int want_address, -@@ -3369,7 +3369,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, - if (want_address) - return value_from_longest - (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain), -- offset + (LONGEST) (TYPE_FIELD_BITPOS (t, i) >> 3)); -+ offset + (TYPE_FIELD_BITPOS (t, i) >> 3)); - else if (noside != EVAL_NORMAL) - return allocate_value (TYPE_FIELD_TYPE (t, i)); - else -@@ -3548,7 +3548,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, - for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--) - { - struct value *v; -- int base_offset; -+ LONGEST base_offset; - - if (BASETYPE_VIA_VIRTUAL (t, i)) - base_offset = 0; -@@ -3697,7 +3697,7 @@ value_rtti_indirect_type (struct value *v, int *full, - struct value * - value_full_object (struct value *argp, - struct type *rtype, -- int xfull, int xtop, -+ int xfull, LONGEST xtop, - int xusing_enc) - { - struct type *real_type; -diff --git a/gdb/valprint.c b/gdb/valprint.c ---- a/gdb/valprint.c -+++ b/gdb/valprint.c -@@ -879,7 +879,7 @@ generic_val_print_complex (struct type *type, - - void - generic_val_print (struct type *type, -- int embedded_offset, CORE_ADDR address, -+ LONGEST embedded_offset, CORE_ADDR address, - struct ui_file *stream, int recurse, - struct value *original_value, - const struct value_print_options *options, -@@ -1774,7 +1774,7 @@ print_decimal_chars (struct ui_file *stream, const gdb_byte *valaddr, - - void - print_hex_chars (struct ui_file *stream, const gdb_byte *valaddr, -- unsigned len, enum bfd_endian byte_order, -+ ULONGEST len, enum bfd_endian byte_order, - bool zero_pad) - { - const gdb_byte *p; -@@ -1927,17 +1927,17 @@ val_print_array_elements (struct type *type, - int recurse, - struct value *val, - const struct value_print_options *options, -- unsigned int i) -+ ULONGEST i) - { - unsigned int things_printed = 0; -- unsigned len; -+ ULONGEST len; - struct type *elttype, *index_type, *base_index_type; -- unsigned eltlen; -+ ULONGEST eltlen; - /* Position of the array element we are examining to see - whether it is repeated. */ -- unsigned int rep1; -+ ULONGEST rep1; - /* Number of repetitions we have detected so far. */ -- unsigned int reps; -+ ULONGEST reps; - LONGEST low_bound, high_bound; - LONGEST low_pos, high_pos; - -@@ -2027,7 +2027,7 @@ val_print_array_elements (struct type *type, - address, stream, recurse + 1, val, options, - current_language); - annotate_elt_rep (reps); -- fprintf_filtered (stream, " ", reps); -+ fprintf_filtered (stream, " ", pulongest (reps)); - annotate_elt_rep_end (); - - i = rep1 - 1; -@@ -2669,7 +2669,7 @@ print_converted_chars_to_obstack (struct obstack *obstack, - - void - generic_printstr (struct ui_file *stream, struct type *type, -- const gdb_byte *string, unsigned int length, -+ const gdb_byte *string, ULONGEST length, - const char *encoding, int force_ellipses, - int quote_char, int c_style_terminator, - const struct value_print_options *options) -diff --git a/gdb/valprint.h b/gdb/valprint.h ---- a/gdb/valprint.h -+++ b/gdb/valprint.h -@@ -119,7 +119,7 @@ extern void val_print_array_elements (struct type *, LONGEST, - CORE_ADDR, struct ui_file *, int, - struct value *, - const struct value_print_options *, -- unsigned int); -+ ULONGEST); - - extern void val_print_scalar_formatted (struct type *, - LONGEST, -@@ -138,7 +138,7 @@ extern void print_decimal_chars (struct ui_file *, const gdb_byte *, - unsigned int, bool, enum bfd_endian); - - extern void print_hex_chars (struct ui_file *, const gdb_byte *, -- unsigned int, enum bfd_endian, bool); -+ ULONGEST, enum bfd_endian, bool); - - extern void print_char_chars (struct ui_file *, struct type *, - const gdb_byte *, unsigned int, enum bfd_endian); -@@ -192,7 +192,7 @@ struct generic_val_print_decorations - - - extern void generic_val_print (struct type *type, -- int embedded_offset, CORE_ADDR address, -+ LONGEST embedded_offset, CORE_ADDR address, - struct ui_file *stream, int recurse, - struct value *original_value, - const struct value_print_options *options, -@@ -202,7 +202,7 @@ extern void generic_emit_char (int c, struct type *type, struct ui_file *stream, - int quoter, const char *encoding); - - extern void generic_printstr (struct ui_file *stream, struct type *type, -- const gdb_byte *string, unsigned int length, -+ const gdb_byte *string, ULONGEST length, - const char *encoding, int force_ellipses, - int quote_char, int c_style_terminator, - const struct value_print_options *options); -diff --git a/gdb/value.c b/gdb/value.c ---- a/gdb/value.c -+++ b/gdb/value.c -@@ -383,7 +383,8 @@ value_bytes_available (const struct value *value, - } - - int --value_bits_any_optimized_out (const struct value *value, int bit_offset, int bit_length) -+value_bits_any_optimized_out (const struct value *value, LONGEST bit_offset, -+ LONGEST bit_length) - { - gdb_assert (!value->lazy); - -@@ -831,8 +832,8 @@ find_first_range_overlap_and_match (struct ranges_and_idx *rp1, - Return true if the available bits match. */ - - static bool --value_contents_bits_eq (const struct value *val1, int offset1, -- const struct value *val2, int offset2, -+value_contents_bits_eq (const struct value *val1, LONGEST offset1, -+ const struct value *val2, LONGEST offset2, - int length) - { - /* Each array element corresponds to a ranges source (unavailable, -@@ -1423,7 +1424,8 @@ value_optimized_out (struct value *value) - the following LENGTH bytes. */ - - void --mark_value_bytes_optimized_out (struct value *value, int offset, int length) -+mark_value_bytes_optimized_out (struct value *value, LONGEST offset, -+ LONGEST length) - { - mark_value_bits_optimized_out (value, - offset * TARGET_CHAR_BIT, -diff --git a/gdb/value.h b/gdb/value.h ---- a/gdb/value.h -+++ b/gdb/value.h -@@ -274,7 +274,7 @@ struct lval_funcs - /* If non-NULL, this is used to determine whether the indicated bits - of VALUE are a synthetic pointer. */ - int (*check_synthetic_pointer) (const struct value *value, -- LONGEST offset, int length); -+ LONGEST offset, LONGEST length); - - /* Return a duplicate of VALUE's closure, for use in a new value. - This may simply return the same closure, if VALUE's is -@@ -405,7 +405,8 @@ extern int value_optimized_out (struct value *value); - otherwise. */ - - extern int value_bits_any_optimized_out (const struct value *value, -- int bit_offset, int bit_length); -+ LONGEST bit_offset, -+ LONGEST bit_length); - - /* Like value_optimized_out, but return true iff the whole value is - optimized out. */ -@@ -415,7 +416,7 @@ extern int value_entirely_optimized_out (struct value *value); - LENGTH bytes as optimized out. */ - - extern void mark_value_bytes_optimized_out (struct value *value, -- int offset, int length); -+ LONGEST offset, LONGEST length); - - /* Mark VALUE's content bits starting at OFFSET and extending for - LENGTH bits as optimized out. */ -@@ -849,12 +850,11 @@ extern struct value *value_primitive_field (struct value *arg1, LONGEST offset, - int fieldno, - struct type *arg_type); - -- - extern struct type *value_rtti_indirect_type (struct value *, int *, LONGEST *, - int *); - - extern struct value *value_full_object (struct value *, struct type *, int, -- int, int); -+ LONGEST, int); - - extern struct value *value_cast_pointers (struct type *, struct value *, int); - -@@ -1147,10 +1147,11 @@ extern struct value *value_literal_complex (struct value *, struct value *, - extern struct value *find_function_in_inferior (const char *, - struct objfile **); - --extern struct value *value_allocate_space_in_inferior (int); -+extern struct value *value_allocate_space_in_inferior (LONGEST); - - extern struct value *value_subscripted_rvalue (struct value *array, -- LONGEST index, int lowerbound); -+ LONGEST index, -+ LONGEST lowerbound); - - /* User function handler. */ - -diff --git a/gdb/x86-nat.c b/gdb/x86-nat.c ---- a/gdb/x86-nat.c -+++ b/gdb/x86-nat.c -@@ -173,7 +173,7 @@ x86_remove_watchpoint (CORE_ADDR addr, int len, - address ADDR and whose length is LEN bytes. */ - - int --x86_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) -+x86_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) - { - struct x86_debug_reg_state *state - = x86_debug_reg_state (inferior_ptid.pid ()); -diff --git a/gdb/x86-nat.h b/gdb/x86-nat.h ---- a/gdb/x86-nat.h -+++ b/gdb/x86-nat.h -@@ -49,7 +49,7 @@ extern void x86_forget_process (pid_t pid); - definitions. */ - - extern int x86_can_use_hw_breakpoint (enum bptype type, int cnt, int othertype); --extern int x86_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len); -+extern int x86_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len); - extern int x86_stopped_by_watchpoint (); - extern int x86_stopped_data_address (CORE_ADDR *addr_p); - extern int x86_insert_watchpoint (CORE_ADDR addr, int len, -@@ -75,7 +75,7 @@ struct x86_nat_target : public BaseTarget - int can_use_hw_breakpoint (enum bptype type, int cnt, int othertype) override - { return x86_can_use_hw_breakpoint (type, cnt, othertype); } - -- int region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) override -+ int region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) override - { return x86_region_ok_for_hw_watchpoint (addr, len); } - - int insert_watchpoint (CORE_ADDR addr, int len, diff --git a/gdb-rhbz795424-bitpos-21of25.patch b/gdb-rhbz795424-bitpos-21of25.patch deleted file mode 100644 index a61de21..0000000 --- a/gdb-rhbz795424-bitpos-21of25.patch +++ /dev/null @@ -1,181 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz795424-bitpos-21of25.patch - -;; Fix `GDB cannot access struct member whose offset is larger than 256MB' -;; (RH BZ 795424). -;;=push - -http://sourceware.org/ml/gdb-patches/2012-09/msg00632.html - ---MP_/PnL6l3LUsXWpZ/olqawWlzb -Content-Type: text/plain; charset=US-ASCII -Content-Transfer-Encoding: 7bit -Content-Disposition: inline - -Hi, - -This is part two of the bitpos expansion patch. This implements checks -in some places in the code to ensure that a type size in ULONGEST is -small enough to fit into host memory. Tested for regressions on x86_64 -Fedora 16. - -Regards, -Siddhesh - ---MP_/PnL6l3LUsXWpZ/olqawWlzb -Content-Type: text/plain -Content-Transfer-Encoding: quoted-printable -Content-Disposition: attachment; filename=ChangeLog-ensure_sizet - -gdb/ChangeLog - - * alpha-tdep.c (alpha_push_dummy_call) Check for underflow in - SP. - * cp-valprint (cp_print_value): Ensure BASECLASS fits into - size_t. - * dwarf2loc.c (read_pieced_value): Ensure that THIS_SIZE fits - into size_t. - (write_pieced_value): Likewise. - * findcmd.c (parse_find_args): Ensure PATTERN_BUF_SIZE fits into - size_t. - * p-valprint (pascal_object_print_value): Ensure BASECLASS fits - into size_t. - * utils.c (ulongest_fits_host_or_error): New function to find if - a ULONGEST number fits into size_t. - * utils.h: Declare ulongest_fits_host_or_error. - * valops.c (search_struct_method): Ensure BASECLASS fits into - size_t. - * value.c (allocate_value_lazy): Ensure TYPE fits into size_t. - (allocate_value_contents): Likewise. - (set_value_enclosing_type): Ensure NEW_ENCL_TYPE fits into - size_t. - * vax-tdep.c (vax_return_value): Ensure that TYPE fits into - size_t. - ---MP_/PnL6l3LUsXWpZ/olqawWlzb -Content-Type: text/x-patch -Content-Transfer-Encoding: 7bit -Content-Disposition: attachment; filename=bitpos-ensure-size_t.patch - -diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c ---- a/gdb/alpha-tdep.c -+++ b/gdb/alpha-tdep.c -@@ -414,6 +414,13 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - accumulate_size = 0; - else - accumulate_size -= sizeof(arg_reg_buffer); -+ -+ /* Check for underflow. */ -+ if (sp - accumulate_size > sp) -+ error (_("Insufficient memory in GDB host for arguments, " -+ "need %s bytes, but less than %s bytes available."), -+ plongest (accumulate_size), plongest (CORE_ADDR_MAX - sp)); -+ - sp -= accumulate_size; - - /* Keep sp aligned to a multiple of 16 as the ABI requires. */ -diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c ---- a/gdb/cp-valprint.c -+++ b/gdb/cp-valprint.c -@@ -529,6 +529,7 @@ cp_print_value (struct type *type, struct type *real_type, - if ((boffset + offset) < 0 - || (boffset + offset) >= TYPE_LENGTH (real_type)) - { -+ ulongest_fits_host_or_error (TYPE_LENGTH (baseclass)); - gdb::byte_vector buf (TYPE_LENGTH (baseclass)); - - if (target_read_memory (address + boffset, buf.data (), -diff --git a/gdb/defs.h b/gdb/defs.h ---- a/gdb/defs.h -+++ b/gdb/defs.h -@@ -669,4 +669,6 @@ DEF_ENUM_FLAGS_TYPE (enum user_selected_what_flag, user_selected_what); - - #include "utils.h" - -+extern void ulongest_fits_host_or_error (ULONGEST num); -+ - #endif /* #ifndef DEFS_H */ -diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c ---- a/gdb/p-valprint.c -+++ b/gdb/p-valprint.c -@@ -775,6 +775,7 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr, - - if (boffset < 0 || boffset >= TYPE_LENGTH (type)) - { -+ ulongest_fits_host_or_error (TYPE_LENGTH (baseclass)); - buf.resize (TYPE_LENGTH (baseclass)); - - base_valaddr = buf.data (); -diff --git a/gdb/utils.c b/gdb/utils.c ---- a/gdb/utils.c -+++ b/gdb/utils.c -@@ -2957,6 +2957,17 @@ string_to_core_addr (const char *my_string) - return addr; - } - -+/* Ensure that the input NUM is not larger than the maximum capacity of the -+ host system. We choose SIZE_MAX / 8 as a conservative estimate of the size -+ of a resource that a system may allocate. */ -+void -+ulongest_fits_host_or_error (ULONGEST num) -+{ -+ if (num > SIZE_MAX / 8) -+ error (_("Insufficient memory in host GDB for object of size %s bytes, " -+ "maximum allowed %s bytes."), pulongest (num), -+ pulongest (SIZE_MAX / 8)); -+} - #if GDB_SELF_TEST - - static void -diff --git a/gdb/valops.c b/gdb/valops.c ---- a/gdb/valops.c -+++ b/gdb/valops.c -@@ -2064,6 +2064,7 @@ search_struct_method (const char *name, struct value **arg1p, - { - CORE_ADDR address; - -+ ulongest_fits_host_or_error (TYPE_LENGTH (baseclass)); - gdb::byte_vector tmp (TYPE_LENGTH (baseclass)); - address = value_address (*arg1p); - -diff --git a/gdb/value.c b/gdb/value.c ---- a/gdb/value.c -+++ b/gdb/value.c -@@ -933,6 +933,7 @@ allocate_value_lazy (struct type *type) - description correctly. */ - check_typedef (type); - -+ ulongest_fits_host_or_error (TYPE_LENGTH (type)); - val = new struct value (type); - - /* Values start out on the all_values chain. */ -@@ -1015,6 +1016,8 @@ check_type_length_before_alloc (const struct type *type) - static void - allocate_value_contents (struct value *val) - { -+ ulongest_fits_host_or_error (TYPE_LENGTH (val->enclosing_type)); -+ - if (!val->contents) - { - check_type_length_before_alloc (val->enclosing_type); -@@ -2874,6 +2877,7 @@ set_value_enclosing_type (struct value *val, struct type *new_encl_type) - if (TYPE_LENGTH (new_encl_type) > TYPE_LENGTH (value_enclosing_type (val))) - { - check_type_length_before_alloc (new_encl_type); -+ ulongest_fits_host_or_error (TYPE_LENGTH (new_encl_type)); - val->contents - .reset ((gdb_byte *) xrealloc (val->contents.release (), - TYPE_LENGTH (new_encl_type))); -diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c ---- a/gdb/vax-tdep.c -+++ b/gdb/vax-tdep.c -@@ -219,6 +219,7 @@ vax_return_value (struct gdbarch *gdbarch, struct value *function, - ULONGEST addr; - - regcache_raw_read_unsigned (regcache, VAX_R0_REGNUM, &addr); -+ ulongest_fits_host_or_error (TYPE_LENGTH (type)); - read_memory (addr, readbuf, len); - } - diff --git a/gdb-rhbz795424-bitpos-22of25.patch b/gdb-rhbz795424-bitpos-22of25.patch deleted file mode 100644 index d196e57..0000000 --- a/gdb-rhbz795424-bitpos-22of25.patch +++ /dev/null @@ -1,558 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz795424-bitpos-22of25.patch - -;; Fix `GDB cannot access struct member whose offset is larger than 256MB' -;; (RH BZ 795424). -;;=push - -http://sourceware.org/ml/gdb-patches/2012-09/msg00629.html - ---MP_/6HRlH6vpyqtSy4CYyMrX6b2 -Content-Type: text/plain; charset=US-ASCII -Content-Transfer-Encoding: 7bit -Content-Disposition: inline - -Hi, - -This is part three of the bitpos expansion change. Some architectures -allow arbitrary length watchpoints and combined with the fact that type -lengths could be large enough, we need LONGEST for watchpoint lengths. -It is architecture dependent however, whether the LONGEST is needed or -not. This patch updates the signatures of watchpoint insertion and -removal functions of all architectures (to comply with the function -signatures in the callback struct), but expands types only in -architectures that need it. Tested on Fedora 16 x86_64. - -Regards, -Siddhesh ---MP_/6HRlH6vpyqtSy4CYyMrX6b2 -Content-Type: text/plain -Content-Transfer-Encoding: quoted-printable -Content-Disposition: attachment; filename=ChangeLog-wp - -gdb/ChangeLog: - - * arm-linux-nat.c (arm_linux_insert_watchpoint): Expand - parameter LEN to LONGEST. - (arm_linux_remove_watchpoint): Likewise. - (arm_linux_watchpoint_addr_within_range): Expand parameter - LENGTH to LONGEST. - * i386-nat.c (i386_insert_watchpoint): Expand parameter LEN to - LONGEST. - (i386_remove_watchpoint): Likewise. - * ia64-linux-nat.c (ia64_linux_insert_watchpoint): Likewise. - (ia64_linux_remove_watchpoint): Likewise. - * inf-ttrace.c (inf_ttrace_insert_watchpoint): Likewise. - Expand NUM_PAGES, PAGE to LONGEST. - (inf_ttrace_remove_watchpoint): Likewise. - * mips-linux-nat.c (mips_linux_insert_watchpoint): Expand - parameter LEN to LONGEST. - (mips_linux_remove_watchpoint): Likewise. - * nto-procfs.c (procfs_remove_hw_watchpoint): Likewise. - (procfs_insert_hw_watchpoint): Likewise. - * ppc-linux-nat.c (calculate_dvc): Likewise. Expand I, - NUM_BYTE_ENABLE to LONGEST. - (check_condition): Expand parameter LEN to point to LONGEST. - (ppc_linux_can_accel_watchpoint_condition): Expand parameter - LEN to LONGEST. - (create_watchpoint_request): Likewise. - (ppc_linux_insert_watchpoint): Likewise. - (ppc_linux_remove_watchpoint): Likewise. - (ppc_linux_watchpoint_addr_within_range): Expand parameter - LENGTH to LONGEST. - * procfs.c (proc_set_watchpoint): Expand parameter LEN to - LONGEST. - (procfs_set_watchpoint): Likewise. - (procfs_insert_watchpoint): Likewise. - (procfs_remove_watchpoint): Likewise. - * remote-m32r-sdi.c (m32r_insert_watchpoint): Likewise. Use - plongest to format print LEN. - (m32r_remove_watchpoint): Likewise. - * remote-mips.c (mips_insert_watchpoint): Expand parameter LEN - to LONGEST. - (mips_remove_watchpoint): Likewise. - * remote.c (remote_insert_watchpoint): Likewise. - Use phex_nz to format print LEN. - (remote_remove_watchpoint): Likewise. - (remote_watchpoint_addr_within_range): Expand parameter LENGTH - to LONGEST. - * s390-linux-nat.c (s390_insert_watchpoint): Expand parameter LEN to - LONGEST. - (s390_remove_watchpoint): Likewise. - * target.c (update_current_target): Expand parameter LEN for - callbacks to TO_INSERT_WATCHPOINT, TO_REMOVE_WATCHPOINT, - TO_CAN_ACCEL_WATCHPOINT_CONDITION, to LONGEST. - (default_watchpoint_addr_within_range): Expand parameter - LENGTH to LONGEST. - (debug_to_can_accel_watchpoint_condition): Expand parameter LEN - to LONGEST. Use plongest to format print LEN. - (debug_to_watchpoint_addr_within_range): Expand parameter LENGTH - to LONGEST. Use plongest to format print LENGTH. - (debug_to_insert_watchpoint): Expand parameter LEN to LONGEST. - Use plongest to format print LEN. - (debug_to_remove_watchpoint): Likewise. - * target.h (struct target_ops): Expand parameter LEN of - TO_REMOVE_WATCHPOINT, TO_INSERT_WATCHPOINT, - TO_WATCHPOINT_ADDR_WITHIN_RANGE and - TO_CAN_ACCEL_WATCHPOINT_CONDITION to LONGEST. - ---MP_/6HRlH6vpyqtSy4CYyMrX6b2 -Content-Type: text/x-patch -Content-Transfer-Encoding: 7bit -Content-Disposition: attachment; filename=bitpos-wp.patch - -diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c ---- a/gdb/aarch64-linux-nat.c -+++ b/gdb/aarch64-linux-nat.c -@@ -63,14 +63,14 @@ public: - int can_use_hw_breakpoint (enum bptype, int, int) override; - int insert_hw_breakpoint (struct gdbarch *, struct bp_target_info *) override; - int remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *) override; -- int region_ok_for_hw_watchpoint (CORE_ADDR, int) override; -+ int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) override; - int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type, - struct expression *) override; - int remove_watchpoint (CORE_ADDR, int, enum target_hw_bp_type, - struct expression *) override; - bool stopped_by_watchpoint () override; - bool stopped_data_address (CORE_ADDR *) override; -- bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override; -+ bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, LONGEST) override; - - int can_do_single_step () override; - -@@ -887,7 +887,8 @@ aarch64_linux_nat_target::stopped_by_watchpoint () - - bool - aarch64_linux_nat_target::watchpoint_addr_within_range (CORE_ADDR addr, -- CORE_ADDR start, int length) -+ CORE_ADDR start, -+ LONGEST length) - { - return start <= addr && start + length - 1 >= addr; - } -diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c ---- a/gdb/arm-linux-nat.c -+++ b/gdb/arm-linux-nat.c -@@ -80,7 +80,7 @@ public: - - int remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *) override; - -- int region_ok_for_hw_watchpoint (CORE_ADDR, int) override; -+ int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) override; - - int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type, - struct expression *) override; -@@ -91,7 +91,7 @@ public: - - bool stopped_data_address (CORE_ADDR *) override; - -- bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override; -+ bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, LONGEST) override; - - const struct target_desc *read_description () override; - -@@ -1203,7 +1203,7 @@ arm_linux_nat_target::stopped_by_watchpoint () - bool - arm_linux_nat_target::watchpoint_addr_within_range (CORE_ADDR addr, - CORE_ADDR start, -- int length) -+ LONGEST length) - { - return start <= addr && start + length - 1 >= addr; - } -diff --git a/gdb/nat/aarch64-linux-hw-point.c b/gdb/nat/aarch64-linux-hw-point.c ---- a/gdb/nat/aarch64-linux-hw-point.c -+++ b/gdb/nat/aarch64-linux-hw-point.c -@@ -137,7 +137,7 @@ aarch64_point_encode_ctrl_reg (enum target_hw_bp_type type, int offset, int len) - Return 0 for any non-compliant ADDR and/or LEN; return 1 otherwise. */ - - static int --aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len) -+aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, LONGEST len) - { - unsigned int alignment = 0; - -@@ -212,9 +212,10 @@ aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len) - an address within the latter. */ - - static void --aarch64_align_watchpoint (CORE_ADDR addr, int len, CORE_ADDR *aligned_addr_p, -+aarch64_align_watchpoint (CORE_ADDR addr, LONGEST len, -+ CORE_ADDR *aligned_addr_p, - int *aligned_offset_p, int *aligned_len_p, -- CORE_ADDR *next_addr_p, int *next_len_p, -+ CORE_ADDR *next_addr_p, LONGEST *next_len_p, - CORE_ADDR *next_addr_orig_p) - { - int aligned_len; -@@ -611,7 +612,7 @@ aarch64_handle_aligned_watchpoint (enum target_hw_bp_type type, - - static int - aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type, -- CORE_ADDR addr, int len, int is_insert, -+ CORE_ADDR addr, LONGEST len, int is_insert, - struct aarch64_debug_reg_state *state) - { - CORE_ADDR addr_orig = addr; -@@ -641,12 +642,12 @@ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type, - " " - "addr_orig: %s\n" - " " -- "next_addr: %s, next_len: %d\n" -+ "next_addr: %s, next_len: %s\n" - " " - "addr_orig_next: %s\n", - is_insert, core_addr_to_string_nz (aligned_addr), - aligned_len, core_addr_to_string_nz (addr_orig), -- core_addr_to_string_nz (addr), len, -+ core_addr_to_string_nz (addr), plongest (len), - core_addr_to_string_nz (addr_orig_next)); - - addr_orig = addr_orig_next; -@@ -660,7 +661,7 @@ aarch64_handle_unaligned_watchpoint (enum target_hw_bp_type type, - - int - aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr, -- int len, int is_insert, -+ LONGEST len, int is_insert, - struct aarch64_debug_reg_state *state) - { - if (aarch64_point_is_aligned (1 /* is_watchpoint */ , addr, len)) -@@ -742,14 +743,14 @@ aarch64_linux_any_set_debug_regs_state (aarch64_debug_reg_state *state, - void - aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state, - const char *func, CORE_ADDR addr, -- int len, enum target_hw_bp_type type) -+ LONGEST len, enum target_hw_bp_type type) - { - int i; - - debug_printf ("%s", func); - if (addr || len) -- debug_printf (" (addr=0x%08lx, len=%d, type=%s)", -- (unsigned long) addr, len, -+ debug_printf (" (addr=0x%08lx, len=%s, type=%s)", -+ (unsigned long) addr, plongest (len), - type == hw_write ? "hw-write-watchpoint" - : (type == hw_read ? "hw-read-watchpoint" - : (type == hw_access ? "hw-access-watchpoint" -@@ -832,7 +833,7 @@ aarch64_linux_get_debug_reg_capacity (int tid) - ADDR and whose length is LEN in bytes. */ - - int --aarch64_linux_region_ok_for_watchpoint (CORE_ADDR addr, int len) -+aarch64_linux_region_ok_for_watchpoint (CORE_ADDR addr, LONGEST len) - { - CORE_ADDR aligned_addr; - -diff --git a/gdb/nat/aarch64-linux-hw-point.h b/gdb/nat/aarch64-linux-hw-point.h ---- a/gdb/nat/aarch64-linux-hw-point.h -+++ b/gdb/nat/aarch64-linux-hw-point.h -@@ -176,7 +176,7 @@ int aarch64_handle_breakpoint (enum target_hw_bp_type type, CORE_ADDR addr, - int len, int is_insert, - struct aarch64_debug_reg_state *state); - int aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr, -- int len, int is_insert, -+ LONGEST len, int is_insert, - struct aarch64_debug_reg_state *state); - - void aarch64_linux_set_debug_regs (struct aarch64_debug_reg_state *state, -@@ -189,12 +189,12 @@ bool aarch64_linux_any_set_debug_regs_state (aarch64_debug_reg_state *state, - - void aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state, - const char *func, CORE_ADDR addr, -- int len, enum target_hw_bp_type type); -+ LONGEST len, enum target_hw_bp_type type); - - void aarch64_linux_get_debug_reg_capacity (int tid); - - struct aarch64_debug_reg_state *aarch64_get_debug_reg_state (pid_t pid); - --int aarch64_linux_region_ok_for_watchpoint (CORE_ADDR addr, int len); -+int aarch64_linux_region_ok_for_watchpoint (CORE_ADDR addr, LONGEST len); - - #endif /* NAT_AARCH64_LINUX_HW_POINT_H */ -diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c ---- a/gdb/ppc-linux-nat.c -+++ b/gdb/ppc-linux-nat.c -@@ -284,7 +284,7 @@ struct ppc_linux_nat_target final : public linux_nat_target - int remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *) - override; - -- int region_ok_for_hw_watchpoint (CORE_ADDR, int) override; -+ int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) override; - - int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type, - struct expression *) override; -@@ -302,9 +302,9 @@ struct ppc_linux_nat_target final : public linux_nat_target - - bool stopped_data_address (CORE_ADDR *) override; - -- bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override; -+ bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, LONGEST) override; - -- bool can_accel_watchpoint_condition (CORE_ADDR, int, int, struct expression *) -+ bool can_accel_watchpoint_condition (CORE_ADDR, LONGEST, int, struct expression *) - override; - - int masked_watch_num_registers (CORE_ADDR, CORE_ADDR) override; -@@ -2065,11 +2065,11 @@ can_use_watchpoint_cond_accel (void) - CONDITION_VALUE will hold the value which should be put in the - DVC register. */ - static void --calculate_dvc (CORE_ADDR addr, int len, CORE_ADDR data_value, -+calculate_dvc (CORE_ADDR addr, LONGEST len, CORE_ADDR data_value, - uint32_t *condition_mode, uint64_t *condition_value) - { -- int i, num_byte_enable, align_offset, num_bytes_off_dvc, -- rightmost_enabled_byte; -+ LONGEST i, num_byte_enable; -+ int align_offset, num_bytes_off_dvc, rightmost_enabled_byte; - CORE_ADDR addr_end_data, addr_end_dvc; - - /* The DVC register compares bytes within fixed-length windows which -@@ -2157,7 +2157,7 @@ num_memory_accesses (const std::vector &chain) - of the constant. */ - static int - check_condition (CORE_ADDR watch_addr, struct expression *cond, -- CORE_ADDR *data_value, int *len) -+ CORE_ADDR *data_value, LONGEST *len) - { - int pc = 1, num_accesses_left, num_accesses_right; - struct value *left_val, *right_val; -@@ -2208,7 +2208,8 @@ check_condition (CORE_ADDR watch_addr, struct expression *cond, - the condition expression, thus only triggering the watchpoint when it is - true. */ - bool --ppc_linux_nat_target::can_accel_watchpoint_condition (CORE_ADDR addr, int len, -+ppc_linux_nat_target::can_accel_watchpoint_condition (CORE_ADDR addr, -+ LONGEST len, - int rw, - struct expression *cond) - { -@@ -2226,7 +2227,7 @@ ppc_linux_nat_target::can_accel_watchpoint_condition (CORE_ADDR addr, int len, - - static void - create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr, -- int len, enum target_hw_bp_type type, -+ LONGEST len, enum target_hw_bp_type type, - struct expression *cond, int insert) - { - if (len == 1 -@@ -2492,7 +2493,7 @@ ppc_linux_nat_target::stopped_by_watchpoint () - bool - ppc_linux_nat_target::watchpoint_addr_within_range (CORE_ADDR addr, - CORE_ADDR start, -- int length) -+ LONGEST length) - { - int mask; - -diff --git a/gdb/procfs.c b/gdb/procfs.c ---- a/gdb/procfs.c -+++ b/gdb/procfs.c -@@ -1546,7 +1546,7 @@ procfs_address_to_host_pointer (CORE_ADDR addr) - } - - static int --proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, int len, int wflags) -+proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, LONGEST len, int wflags) - { - struct { - procfs_ctl_t cmd; -@@ -3238,7 +3238,7 @@ procfs_target::pid_to_exec_file (int pid) - /* Insert a watchpoint. */ - - static int --procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag, -+procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, LONGEST len, int rwflag, - int after) - { - int pflags = 0; -diff --git a/gdb/remote.c b/gdb/remote.c ---- a/gdb/remote.c -+++ b/gdb/remote.c -@@ -450,7 +450,7 @@ public: - - bool stopped_data_address (CORE_ADDR *) override; - -- bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override; -+ bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, LONGEST) override; - - int can_use_hw_breakpoint (enum bptype, int, int) override; - -@@ -10335,7 +10335,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, - p = strchr (rs->buf.data (), '\0'); - addr = remote_address_masked (addr); - p += hexnumstr (p, (ULONGEST) addr); -- xsnprintf (p, endbuf - p, ",%x", len); -+ xsnprintf (p, endbuf - p, ",%s", phex_nz (len, sizeof (len))); - - putpkt (rs->buf); - getpkt (&rs->buf, 0); -@@ -10355,7 +10355,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len, - - bool - remote_target::watchpoint_addr_within_range (CORE_ADDR addr, -- CORE_ADDR start, int length) -+ CORE_ADDR start, LONGEST length) - { - CORE_ADDR diff = remote_address_masked (addr - start); - -@@ -10384,7 +10384,7 @@ remote_target::remove_watchpoint (CORE_ADDR addr, int len, - p = strchr (rs->buf.data (), '\0'); - addr = remote_address_masked (addr); - p += hexnumstr (p, (ULONGEST) addr); -- xsnprintf (p, endbuf - p, ",%x", len); -+ xsnprintf (p, endbuf - p, ",%s", phex_nz (len, sizeof (len))); - putpkt (rs->buf); - getpkt (&rs->buf, 0); - -diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c ---- a/gdb/s390-linux-nat.c -+++ b/gdb/s390-linux-nat.c -@@ -121,7 +121,7 @@ public: - override; - int remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *) - override; -- int region_ok_for_hw_watchpoint (CORE_ADDR, int) override; -+ int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) override; - bool stopped_by_watchpoint () override; - int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type, - struct expression *) override; -diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c ---- a/gdb/target-delegates.c -+++ b/gdb/target-delegates.c -@@ -37,9 +37,9 @@ struct dummy_target : public target_ops - bool stopped_by_watchpoint () override; - bool have_steppable_watchpoint () override; - bool stopped_data_address (CORE_ADDR *arg0) override; -- bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) override; -+ bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, LONGEST arg2) override; - int region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) override; -- bool can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3) override; -+ bool can_accel_watchpoint_condition (CORE_ADDR arg0, LONGEST arg1, int arg2, struct expression *arg3) override; - int masked_watch_num_registers (CORE_ADDR arg0, CORE_ADDR arg1) override; - int can_do_single_step () override; - bool supports_terminal_ours () override; -@@ -204,9 +204,9 @@ struct debug_target : public target_ops - bool stopped_by_watchpoint () override; - bool have_steppable_watchpoint () override; - bool stopped_data_address (CORE_ADDR *arg0) override; -- bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) override; -+ bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, LONGEST arg2) override; - int region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) override; -- bool can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3) override; -+ bool can_accel_watchpoint_condition (CORE_ADDR arg0, LONGEST arg1, int arg2, struct expression *arg3) override; - int masked_watch_num_registers (CORE_ADDR arg0, CORE_ADDR arg1) override; - int can_do_single_step () override; - bool supports_terminal_ours () override; -@@ -1041,19 +1041,19 @@ debug_target::stopped_data_address (CORE_ADDR *arg0) - } - - bool --target_ops::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) -+target_ops::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, LONGEST arg2) - { - return this->beneath ()->watchpoint_addr_within_range (arg0, arg1, arg2); - } - - bool --dummy_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) -+dummy_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, LONGEST arg2) - { - return default_watchpoint_addr_within_range (this, arg0, arg1, arg2); - } - - bool --debug_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) -+debug_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, LONGEST arg2) - { - bool result; - fprintf_unfiltered (gdb_stdlog, "-> %s->watchpoint_addr_within_range (...)\n", this->beneath ()->shortname ()); -@@ -1063,7 +1063,7 @@ debug_target::watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int - fputs_unfiltered (", ", gdb_stdlog); - target_debug_print_CORE_ADDR (arg1); - fputs_unfiltered (", ", gdb_stdlog); -- target_debug_print_int (arg2); -+ target_debug_print_LONGEST (arg2); - fputs_unfiltered (") = ", gdb_stdlog); - target_debug_print_bool (result); - fputs_unfiltered ("\n", gdb_stdlog); -@@ -1099,19 +1099,19 @@ debug_target::region_ok_for_hw_watchpoint (CORE_ADDR arg0, LONGEST arg1) - } - - bool --target_ops::can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3) -+target_ops::can_accel_watchpoint_condition (CORE_ADDR arg0, LONGEST arg1, int arg2, struct expression *arg3) - { - return this->beneath ()->can_accel_watchpoint_condition (arg0, arg1, arg2, arg3); - } - - bool --dummy_target::can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3) -+dummy_target::can_accel_watchpoint_condition (CORE_ADDR arg0, LONGEST arg1, int arg2, struct expression *arg3) - { - return false; - } - - bool --debug_target::can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2, struct expression *arg3) -+debug_target::can_accel_watchpoint_condition (CORE_ADDR arg0, LONGEST arg1, int arg2, struct expression *arg3) - { - bool result; - fprintf_unfiltered (gdb_stdlog, "-> %s->can_accel_watchpoint_condition (...)\n", this->beneath ()->shortname ()); -@@ -1119,7 +1119,7 @@ debug_target::can_accel_watchpoint_condition (CORE_ADDR arg0, int arg1, int arg2 - fprintf_unfiltered (gdb_stdlog, "<- %s->can_accel_watchpoint_condition (", this->beneath ()->shortname ()); - target_debug_print_CORE_ADDR (arg0); - fputs_unfiltered (", ", gdb_stdlog); -- target_debug_print_int (arg1); -+ target_debug_print_LONGEST (arg1); - fputs_unfiltered (", ", gdb_stdlog); - target_debug_print_int (arg2); - fputs_unfiltered (", ", gdb_stdlog); -diff --git a/gdb/target.c b/gdb/target.c ---- a/gdb/target.c -+++ b/gdb/target.c -@@ -55,7 +55,7 @@ static void generic_tls_error (void) ATTRIBUTE_NORETURN; - static void default_terminal_info (struct target_ops *, const char *, int); - - static int default_watchpoint_addr_within_range (struct target_ops *, -- CORE_ADDR, CORE_ADDR, int); -+ CORE_ADDR, CORE_ADDR, LONGEST); - - static int default_region_ok_for_hw_watchpoint (struct target_ops *, - CORE_ADDR, LONGEST); -@@ -3111,7 +3111,7 @@ default_region_ok_for_hw_watchpoint (struct target_ops *self, - static int - default_watchpoint_addr_within_range (struct target_ops *target, - CORE_ADDR addr, -- CORE_ADDR start, int length) -+ CORE_ADDR start, LONGEST length) - { - return addr >= start && addr < start + length; - } -diff --git a/gdb/target.h b/gdb/target.h ---- a/gdb/target.h -+++ b/gdb/target.h -@@ -561,7 +561,7 @@ struct target_ops - TARGET_DEFAULT_RETURN (false); - virtual bool stopped_data_address (CORE_ADDR *) - TARGET_DEFAULT_RETURN (false); -- virtual bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) -+ virtual bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, LONGEST) - TARGET_DEFAULT_FUNC (default_watchpoint_addr_within_range); - - /* Documentation of this routine is provided with the corresponding -@@ -569,7 +569,7 @@ struct target_ops - virtual int region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST) - TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint); - -- virtual bool can_accel_watchpoint_condition (CORE_ADDR, int, int, -+ virtual bool can_accel_watchpoint_condition (CORE_ADDR, LONGEST, int, - struct expression *) - TARGET_DEFAULT_RETURN (false); - virtual int masked_watch_num_registers (CORE_ADDR, CORE_ADDR) diff --git a/gdb-rhbz795424-bitpos-23of25.patch b/gdb-rhbz795424-bitpos-23of25.patch deleted file mode 100644 index 3f25c1f..0000000 --- a/gdb-rhbz795424-bitpos-23of25.patch +++ /dev/null @@ -1,1248 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz795424-bitpos-23of25.patch - -;; Fix `GDB cannot access struct member whose offset is larger than 256MB' -;; (RH BZ 795424). -;;=push - -http://sourceware.org/ml/gdb-patches/2012-09/msg00630.html - ---MP_/X_WjDOvz/B_fvlsrmCwRdxe -Content-Type: text/plain; charset=US-ASCII -Content-Transfer-Encoding: 7bit -Content-Disposition: inline - -Hi, - -This is the last part of the bitpos change. This patch does the same -thing that patch 1/4 does, except that it does so in the *-tdep files -wherever necessary. I separated these changes mainly because they are -related and can be reviewed independently. Tested on Fedora 16 x86_64. - -Regards, -Siddhesh - ---MP_/X_WjDOvz/B_fvlsrmCwRdxe -Content-Type: text/plain -Content-Transfer-Encoding: quoted-printable -Content-Disposition: attachment; filename=ChangeLog-tdep - -gdb/ChangeLog - - * alpha-tdep.c (alpha_push_dummy_call): Expand ACCUMULATE_SIZE, - REQUIRED_ARG_REGS, OFFSET, LEN, TLEN to ssize_t. - (struct alpha_arg): Expand members LEN, OFFSET to ssize_t. - * amd64-tdep.c (amd64_push_arguments): Expand NUM_ELEMENTS, - ELEMENT and LEN to LONGEST. - (amd64_return_value): Expand LEN to LONGEST. - * amd64-windows-tdep.c (amd64_windows_return_value): Expand LEN - to LONGEST. - * arm-tdep.c (arm_vfp_cprc_sub_candidate): Return LONGEST. - Expand COUNT, SUB_COUNT to LONGEST. - (arm_vfp_call_candidate): Expand C to LONGEST. - (arm_push_dummy_call): Expand LEN to LONGEST. - * avr-tdep.c (struct stack_item): Expand member LEN to ssize_t. - (push_stack_item): Expand parameter LEN to ssize_t. - (avr_push_dummy_call): Expand LAST_REGNUM, J, LEN to ssize_t. - * bfin-tdep.c (bfin_push_dummy_call): Expand TOTAL_LEN, - CONTAINER_LEN to ssize_t. - * cris-tdep.c (struct stack_item): Expand member LEN to ssize_t. - (push_stack_item): Expand parameter LEN to ssize_t. - (cris_push_dummy_call): Expand LEN, REG_DEMAND, I to ssize_t. - * h8300-tdep.c (h8300_push_dummy_call): Expand STACK_ALLOC, - STACK_OFFSET to LONGEST. Expand LEN, PADDED_LEN, OFFSET to - ssize_t. - * hppa-tdep.c (hppa64_push_dummy_call): Expand LEN to LONGEST. - (hppa64_return_value): Likewise. - * i386-darwin-tdep.c (i386_darwin_push_dummy_call): Expand - ARGS_SPACE to LONGEST. - * i386-tdep.c (i386_push_dummy_call): Expand ARG_SPACE, - ARG_SPACE_USED, LEN to LONGEST. - (i386_reg_struct_return_p): Expand LEN to LONGEST. - (i386_convert_register_p): Likewise. - (i386_register_to_value): Likewise. - (i386_value_to_register): Likewise. - * ia64-tdep.c (ia64_push_dummy_call): Expand ARGOFFSET, LEN, - NSLOTS, MEMSLOTS to LONGEST. - * iq2000-tdep.c (iq2000_push_dummy_call): Expand TYPELEN, - STACKSPACE to LONGEST. - * m32r-tdep.c (m32r_push_dummy_call): Expand LEN to LONGEST. - * m68k-tdep.c (m68k_reg_struct_return_p): Expand LEN to LONGEST. - (m68k_push_dummy_call): Expand LEN, CONTAINER_LEN, OFFSET to - LONGEST. - * m88k-tdep.c (m88k_store_arguments): Expand NUM_STACK_WORDS, - LEN, STACK_WORD to LONGEST. - * mep-tdep.c (push_large_arguments): Expand ARG_LEN to ULONGEST. - * microblaze-tdep.c (microblaze_store_return_value): Expand LEN to - LONGEST. - * mips-tdep.c (mips_xfer_register): Expand parameter BUF_OFFSET to - LONGEST. Use plongest to format print BUF_OFFSET. - (mips_eabi_push_dummy_call): Expand LEN to LONGEST. Use plongest - to format print LEN. - (mips_n32n64_fp_arg_chunk_p): Expand parameter OFFSET to LONGEST. - Expand POS to LONGEST. - (mips_n32n64_push_dummy_call): Expand LEN to LONGEST. - (mips_n32n64_return_value): Expand OFFSET to LONGEST. Use - plongest to format print OFFSET. - (mips_o32_push_dummy_call): Expand LEN to LONGEST. Use plongest - to format print LEN. - (mips_o64_push_dummy_call): Expand LEN, STACK_OFFSET to LONGEST. - Use plongest to format print LEN. - * mn10300-tdep.c (mn10300_push_dummy_call): Expand LEN to - LONGEST. - * mt-tdep.c (mt_push_dummy_call): Expand STACK_DEST, TYPELEN to - LONGEST. - * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Expand - ARGSPACE, ARGOFFSET, STRUCTOFFSET, LEN, to LONGEST. - (ppc64_sysv_abi_push_dummy_call): Expand BYTE, LEN to ssize_t. - * rl78-tdep.c (rl78_push_dummy_call): Expand LEN, CONTAINER_LEN - to LONGEST. - * rs6000-aix-tdep.c (rs6000_push_dummy_call): Expand ARGBYTES, - LEN to LONGEST. - (ran_out_of_registers_for_arguments): Expand SPACE, JJ to - LONGEST. - * s390-linux-tdep.c (s390_value_from_register): Expand LEN to LONGEST. - (is_power_of_two): Expand parameter N to ULONGEST. - (s390_push_dummy_call): Expand LENGTH to ULONGEST. - * score-tdep.c (score_push_dummy_call): Expand ARGLEN to - LONGEST. - * sh-tdep.c (sh_use_struct_convention) Expand len to LONGEST. - (sh_justify_value_in_reg): Expand parameter LEN to LONGEST. - (sh_push_dummy_call_fpu): Expand LEN to LONGEST. Expand REG_SIZE - to ssize_t. - (sh_push_dummy_call_nofpu): Likewise. - * sh64-tdep.c (sh64_push_dummy_call): Expand STACK_OFFSET, - STACK_ALLOC, LEN to LONGEST. - * sparc-tdep.c (sparc32_store_arguments): Expand LEN to LONGEST. - * sparc64-tdep.c (sparc64_store_floating_fields): Expand - parameter BITPOS to LONGEST. Expand SUBPOS to LONGEST. - (sparc64_extract_floating_fields): Likewise. - (sparc64_store_arguments): Expand LEN to LONGEST. - * spu-tdep.c (spu_push_dummy_call): Expand N_REGS, LEN to LONGEST. - (spu_value_from_register): Expand LEN to LONGEST. - * tic6x-tdep.c (tic6x_push_dummy_call): Expand REFERENCES_OFFST, - LEN to LONGEST. Expand LEN to ssize_t. Use plongest to format - print LEN. - * tilegx-tdep.c (tilegx_push_dummy_call): Expand TYPELEN, - SLACKLEN, ALIGNLEN to LONGEST. - * v850-tdep.c (v850_push_dummy_call): Expand LEN to LONGEST. - * vax-tdep.c (vax_store_arguments): Expand COUNT, LEN to LONGEST. - (vax_return_value): Expand LEN to LONGEST. - * xstormy16-tdep.c (xstormy16_push_dummy_call): Expand J, TYPELEN - to LONGEST. - * xtensa-tdep.c (xtensa_store_return_value): Print LEN instead of - TYPE_LENGTH.. - (struct argument_info): Expoand member LENGTH to ssize_t. - (struct argument_info.u): Expand member OFFSET to ssize_t. - (xtensa_push_dummy_call): Expand SIZE, ONSTACK_SIZE to LONGEST. - Expand N to ssize_t. Use pulongest to format print TYPE_LENGTH. - ---MP_/X_WjDOvz/B_fvlsrmCwRdxe -Content-Type: text/x-patch -Content-Transfer-Encoding: 7bit -Content-Disposition: attachment; filename=bitpos-tdep.patch - -diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c ---- a/gdb/alpha-tdep.c -+++ b/gdb/alpha-tdep.c -@@ -300,17 +300,17 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - { - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int i; -- int accumulate_size = (return_method == return_method_struct) ? 8 : 0; -+ ssize_t accumulate_size = (return_method == return_method_struct) ? 8 : 0; - struct alpha_arg - { - const gdb_byte *contents; -- int len; -- int offset; -+ ssize_t len; -+ ssize_t offset; - }; - struct alpha_arg *alpha_args = XALLOCAVEC (struct alpha_arg, nargs); - struct alpha_arg *m_arg; - gdb_byte arg_reg_buffer[ALPHA_REGISTER_SIZE * ALPHA_NUM_ARG_REGS]; -- int required_arg_regs; -+ ssize_t required_arg_regs; - CORE_ADDR func_addr = find_function_addr (function, NULL); - - /* The ABI places the address of the called function in T12. */ -@@ -430,8 +430,8 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - for (i = nargs; m_arg--, --i >= 0;) - { - const gdb_byte *contents = m_arg->contents; -- int offset = m_arg->offset; -- int len = m_arg->len; -+ ssize_t offset = m_arg->offset; -+ ssize_t len = m_arg->len; - - /* Copy the bytes destined for registers into arg_reg_buffer. */ - if (offset < sizeof(arg_reg_buffer)) -@@ -443,7 +443,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - } - else - { -- int tlen = sizeof(arg_reg_buffer) - offset; -+ ssize_t tlen = sizeof(arg_reg_buffer) - offset; - memcpy (arg_reg_buffer + offset, contents, tlen); - offset += tlen; - contents += tlen; -diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c ---- a/gdb/amd64-tdep.c -+++ b/gdb/amd64-tdep.c -@@ -883,8 +883,8 @@ amd64_push_arguments (struct regcache *regcache, int nargs, struct value **args, - }; - struct value **stack_args = XALLOCAVEC (struct value *, nargs); - int num_stack_args = 0; -- int num_elements = 0; -- int element = 0; -+ LONGEST num_elements = 0; -+ LONGEST element = 0; - int integer_reg = 0; - int sse_reg = 0; - int i; -@@ -896,7 +896,7 @@ if (return_method == return_method_struct) - for (i = 0; i < nargs; i++) - { - struct type *type = value_type (args[i]); -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - enum amd64_reg_class theclass[2]; - int needed_integer_regs = 0; - int needed_sse_regs = 0; -@@ -960,7 +960,7 @@ if (return_method == return_method_struct) - - gdb_assert (regnum != -1); - memset (buf, 0, sizeof buf); -- memcpy (buf, valbuf + j * 8, std::min (len, 8)); -+ memcpy (buf, valbuf + j * 8, std::min (len, (LONGEST) 8)); - regcache->raw_write_part (regnum, offset, 8, buf); - } - } -diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c ---- a/gdb/amd64-windows-tdep.c -+++ b/gdb/amd64-windows-tdep.c -@@ -291,7 +291,7 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function, - struct type *type, struct regcache *regcache, - gdb_byte *readbuf, const gdb_byte *writebuf) - { -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - int regnum = -1; - - /* See if our value is returned through a register. If it is, then -diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c ---- a/gdb/arm-tdep.c -+++ b/gdb/arm-tdep.c -@@ -3472,7 +3472,7 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc_base_type b) - array). Vector types are not currently supported, matching the - generic AAPCS support. */ - --static int -+static LONGEST - arm_vfp_cprc_sub_candidate (struct type *t, - enum arm_vfp_cprc_base_type *base_type) - { -@@ -3555,7 +3555,7 @@ arm_vfp_cprc_sub_candidate (struct type *t, - } - else - { -- int count; -+ LONGEST count; - unsigned unitlen; - - count = arm_vfp_cprc_sub_candidate (TYPE_TARGET_TYPE (t), -@@ -3578,12 +3578,12 @@ arm_vfp_cprc_sub_candidate (struct type *t, - - case TYPE_CODE_STRUCT: - { -- int count = 0; -+ LONGEST count = 0; - unsigned unitlen; - int i; - for (i = 0; i < TYPE_NFIELDS (t); i++) - { -- int sub_count = 0; -+ LONGEST sub_count = 0; - - if (!field_is_static (&TYPE_FIELD (t, i))) - sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i), -@@ -3607,13 +3607,15 @@ arm_vfp_cprc_sub_candidate (struct type *t, - - case TYPE_CODE_UNION: - { -- int count = 0; -+ LONGEST count = 0; - unsigned unitlen; - int i; - for (i = 0; i < TYPE_NFIELDS (t); i++) - { -- int sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i), -- base_type); -+ LONGEST sub_count; -+ -+ sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i), -+ base_type); - if (sub_count == -1) - return -1; - count = (count > sub_count ? count : sub_count); -@@ -3649,7 +3651,7 @@ arm_vfp_call_candidate (struct type *t, enum arm_vfp_cprc_base_type *base_type, - int *count) - { - enum arm_vfp_cprc_base_type b = VFP_CPRC_UNKNOWN; -- int c = arm_vfp_cprc_sub_candidate (t, &b); -+ LONGEST c = arm_vfp_cprc_sub_candidate (t, &b); - if (c <= 0 || c > 4) - return 0; - *base_type = b; -@@ -3731,7 +3733,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - - for (argnum = 0; argnum < nargs; argnum++) - { -- int len; -+ LONGEST len; - struct type *arg_type; - struct type *target_type; - enum type_code typecode; -diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c ---- a/gdb/avr-tdep.c -+++ b/gdb/avr-tdep.c -@@ -1192,13 +1192,13 @@ avr_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) - - struct stack_item - { -- int len; -+ ssize_t len; - struct stack_item *prev; - gdb_byte *data; - }; - - static struct stack_item * --push_stack_item (struct stack_item *prev, const bfd_byte *contents, int len) -+push_stack_item (struct stack_item *prev, const bfd_byte *contents, ssize_t len) - { - struct stack_item *si; - si = XNEW (struct stack_item); -@@ -1287,12 +1287,12 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - - for (i = 0; i < nargs; i++) - { -- int last_regnum; -- int j; -+ ssize_t last_regnum; -+ ssize_t j; - struct value *arg = args[i]; - struct type *type = check_typedef (value_type (arg)); - const bfd_byte *contents = value_contents (arg); -- int len = TYPE_LENGTH (type); -+ ssize_t len = TYPE_LENGTH (type); - - /* Calculate the potential last register needed. - E.g. For length 2, registers regnum and regnum-1 (say 25 and 24) -diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c ---- a/gdb/bfin-tdep.c -+++ b/gdb/bfin-tdep.c -@@ -504,7 +504,7 @@ bfin_push_dummy_call (struct gdbarch *gdbarch, - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int i; - long reg_r0, reg_r1, reg_r2; -- int total_len = 0; -+ ssize_t total_len = 0; - - for (i = nargs - 1; i >= 0; i--) - { -@@ -526,7 +526,7 @@ bfin_push_dummy_call (struct gdbarch *gdbarch, - { - struct type *value_type = value_enclosing_type (args[i]); - struct type *arg_type = check_typedef (value_type); -- int container_len = (TYPE_LENGTH (arg_type) + 3) & ~3; -+ ssize_t container_len = (TYPE_LENGTH (arg_type) + 3) & ~3; - - sp -= container_len; - write_memory (sp, value_contents (args[i]), container_len); -diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c ---- a/gdb/cris-tdep.c -+++ b/gdb/cris-tdep.c -@@ -663,13 +663,13 @@ static CORE_ADDR cris_unwind_sp (struct gdbarch *gdbarch, - - struct stack_item - { -- int len; -+ ssize_t len; - struct stack_item *prev; - gdb_byte *data; - }; - - static struct stack_item * --push_stack_item (struct stack_item *prev, const gdb_byte *contents, int len) -+push_stack_item (struct stack_item *prev, const gdb_byte *contents, ssize_t len) - { - struct stack_item *si = XNEW (struct stack_item); - si->data = (gdb_byte *) xmalloc (len); -@@ -832,13 +832,13 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - - for (argnum = 0; argnum < nargs; argnum++) - { -- int len; -+ ssize_t len; - const gdb_byte *val; -- int reg_demand; -- int i; -+ ssize_t reg_demand; -+ ssize_t i; - -- len = TYPE_LENGTH (value_type (args[argnum])); - val = value_contents (args[argnum]); -+ len = TYPE_LENGTH (value_type (args[argnum])); - - /* How may registers worth of storage do we need for this argument? */ - reg_demand = (len / 4) + (len % 4 != 0 ? 1 : 0); -diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c ---- a/gdb/h8300-tdep.c -+++ b/gdb/h8300-tdep.c -@@ -638,7 +638,7 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - CORE_ADDR struct_addr) - { - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); -- int stack_alloc = 0, stack_offset = 0; -+ LONGEST stack_alloc = 0, stack_offset = 0; - int wordsize = BINWORD (gdbarch); - int reg = E_ARG0_REGNUM; - int argument; -@@ -664,11 +664,11 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - for (argument = 0; argument < nargs; argument++) - { - struct type *type = value_type (args[argument]); -- int len = TYPE_LENGTH (type); -+ ssize_t len = TYPE_LENGTH (type); - char *contents = (char *) value_contents (args[argument]); - - /* Pad the argument appropriately. */ -- int padded_len = align_up (len, wordsize); -+ ssize_t padded_len = align_up (len, wordsize); - /* Use std::vector here to get zero initialization. */ - std::vector padded (padded_len); - -@@ -697,7 +697,7 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - /* Heavens to Betsy --- it's really going in registers! - Note that on the h8/300s, there are gaps between the - registers in the register file. */ -- int offset; -+ ssize_t offset; - - for (offset = 0; offset < padded_len; offset += wordsize) - { -diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c ---- a/gdb/hppa-tdep.c -+++ b/gdb/hppa-tdep.c -@@ -985,7 +985,7 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - { - struct value *arg = args[i]; - struct type *type = value_type (arg); -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - const bfd_byte *valbuf; - bfd_byte fptrbuf[8]; - int regnum; -@@ -1178,7 +1178,7 @@ hppa64_return_value (struct gdbarch *gdbarch, struct value *function, - struct type *type, struct regcache *regcache, - gdb_byte *readbuf, const gdb_byte *writebuf) - { -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - int regnum, offset; - - if (len > 16) -diff --git a/gdb/i386-darwin-tdep.c b/gdb/i386-darwin-tdep.c ---- a/gdb/i386-darwin-tdep.c -+++ b/gdb/i386-darwin-tdep.c -@@ -167,7 +167,7 @@ i386_darwin_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - - for (write_pass = 0; write_pass < 2; write_pass++) - { -- int args_space = 0; -+ LONGEST args_space = 0; - int num_m128 = 0; - - if (return_method == return_method_struct) -diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c ---- a/gdb/i386-tdep.c -+++ b/gdb/i386-tdep.c -@@ -2679,7 +2679,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - gdb_byte buf[4]; - int i; - int write_pass; -- int args_space = 0; -+ LONGEST args_space = 0; - - /* BND registers can be in arbitrary values at the moment of the - inferior call. This can cause boundary violations that are not -@@ -2694,7 +2694,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - - for (write_pass = 0; write_pass < 2; write_pass++) - { -- int args_space_used = 0; -+ LONGEST args_space_used = 0; - - if (return_method == return_method_struct) - { -@@ -2711,7 +2711,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - - for (i = 0; i < nargs; i++) - { -- int len = TYPE_LENGTH (value_enclosing_type (args[i])); -+ LONGEST len = TYPE_LENGTH (value_enclosing_type (args[i])); - - if (write_pass) - { -@@ -2918,7 +2918,7 @@ i386_reg_struct_return_p (struct gdbarch *gdbarch, struct type *type) - { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - enum type_code code = TYPE_CODE (type); -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - - gdb_assert (code == TYPE_CODE_STRUCT - || code == TYPE_CODE_UNION -@@ -3704,7 +3704,7 @@ static int - i386_convert_register_p (struct gdbarch *gdbarch, - int regnum, struct type *type) - { -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - - /* Values may be spread across multiple registers. Most debugging - formats aren't expressive enough to specify the locations, so -@@ -3737,7 +3737,7 @@ i386_register_to_value (struct frame_info *frame, int regnum, - int *optimizedp, int *unavailablep) - { - struct gdbarch *gdbarch = get_frame_arch (frame); -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - - if (i386_fp_regnum_p (gdbarch, regnum)) - return i387_register_to_value (frame, regnum, type, to, -@@ -3773,7 +3773,7 @@ static void - i386_value_to_register (struct frame_info *frame, int regnum, - struct type *type, const gdb_byte *from) - { -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - - if (i386_fp_regnum_p (get_frame_arch (frame), regnum)) - { -diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c ---- a/gdb/iq2000-tdep.c -+++ b/gdb/iq2000-tdep.c -@@ -652,8 +652,9 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - const bfd_byte *val; - bfd_byte buf[4]; - struct type *type; -- int i, argreg, typelen, slacklen; -- int stackspace = 0; -+ int i, argreg, slacklen; -+ LONGEST typelen; -+ LONGEST stackspace = 0; - /* Used to copy struct arguments into the stack. */ - CORE_ADDR struct_ptr; - -diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c ---- a/gdb/m32r-tdep.c -+++ b/gdb/m32r-tdep.c -@@ -671,7 +671,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - CORE_ADDR regval; - gdb_byte *val; - gdb_byte valbuf[M32R_ARG_REGISTER_SIZE]; -- int len; -+ LONGEST len; - - /* First force sp to a 4-byte alignment. */ - sp = sp & ~3; -diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c ---- a/gdb/m68k-tdep.c -+++ b/gdb/m68k-tdep.c -@@ -372,7 +372,7 @@ m68k_reg_struct_return_p (struct gdbarch *gdbarch, struct type *type) - { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - enum type_code code = TYPE_CODE (type); -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - - gdb_assert (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION - || code == TYPE_CODE_COMPLEX); -@@ -505,9 +505,9 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - for (i = nargs - 1; i >= 0; i--) - { - struct type *value_type = value_enclosing_type (args[i]); -- int len = TYPE_LENGTH (value_type); -- int container_len = (len + 3) & ~3; -- int offset; -+ LONGEST len = TYPE_LENGTH (value_type); -+ LONGEST container_len = (len + 3) & ~3; -+ LONGEST offset; - - /* Non-scalars bigger than 4 bytes are left aligned, others are - right aligned. */ -diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c ---- a/gdb/mep-tdep.c -+++ b/gdb/mep-tdep.c -@@ -2238,7 +2238,7 @@ push_large_arguments (CORE_ADDR sp, int argc, struct value **argv, - - for (i = 0; i < argc; i++) - { -- unsigned arg_len = TYPE_LENGTH (value_type (argv[i])); -+ ULONGEST arg_len = TYPE_LENGTH (value_type (argv[i])); - - if (arg_len > MEP_GPR_SIZE) - { -diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c ---- a/gdb/mips-tdep.c -+++ b/gdb/mips-tdep.c -@@ -489,7 +489,7 @@ static void - mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, - int reg_num, int length, - enum bfd_endian endian, gdb_byte *in, -- const gdb_byte *out, int buf_offset) -+ const gdb_byte *out, LONGEST buf_offset) - { - int reg_offset = 0; - -@@ -512,8 +512,8 @@ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, - } - if (mips_debug) - fprintf_unfiltered (gdb_stderr, -- "xfer $%d, reg offset %d, buf offset %d, length %d, ", -- reg_num, reg_offset, buf_offset, length); -+ "xfer $%d, reg offset %d, buf offset %s, length %d, ", -+ reg_num, reg_offset, plongest (buf_offset), length); - if (mips_debug && out != NULL) - { - int i; -@@ -4563,13 +4563,13 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - gdb_byte ref_valbuf[MAX_MIPS_ABI_REGSIZE]; - struct value *arg = args[argnum]; - struct type *arg_type = check_typedef (value_type (arg)); -- int len = TYPE_LENGTH (arg_type); -+ LONGEST len = TYPE_LENGTH (arg_type); - enum type_code typecode = TYPE_CODE (arg_type); - - if (mips_debug) - fprintf_unfiltered (gdb_stdlog, -- "mips_eabi_push_dummy_call: %d len=%d type=%d", -- argnum + 1, len, (int) typecode); -+ "mips_eabi_push_dummy_call: %d len=%s type=%d", -+ argnum + 1, plongest (len), (int) typecode); - - /* The EABI passes structures that do not fit in a register by - reference. */ -@@ -4839,7 +4839,7 @@ mips_eabi_return_value (struct gdbarch *gdbarch, struct value *function, - - static int - mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, -- int offset) -+ LONGEST offset) - { - int i; - -@@ -4854,7 +4854,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, - - for (i = 0; i < TYPE_NFIELDS (arg_type); i++) - { -- int pos; -+ LONGEST pos; - struct type *field_type; - - /* We're only looking at normal fields. */ -@@ -4897,7 +4897,8 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - int argreg; - int float_argreg; - int argnum; -- int arg_space = 0; -+ ULONGEST arg_space = 0; -+ LONGEST len = 0; - int stack_offset = 0; - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -4926,9 +4927,9 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - - if (mips_debug) - fprintf_unfiltered (gdb_stdlog, -- "mips_n32n64_push_dummy_call: sp=%s allocated %ld\n", -+ "mips_n32n64_push_dummy_call: sp=%s allocated %s\n", - paddress (gdbarch, sp), -- (long) align_up (arg_space, 16)); -+ pulongest (align_up (arg_space, 16))); - - /* Initialize the integer and float register pointers. */ - argreg = MIPS_A0_REGNUM; -@@ -5249,11 +5250,11 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function, - : MIPS_V0_REGNUM); - field < TYPE_NFIELDS (type); field++, regnum += 2) - { -- int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field]) -- / TARGET_CHAR_BIT); -+ LONGEST offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field]) -+ / TARGET_CHAR_BIT); - if (mips_debug) -- fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n", -- offset); -+ fprintf_unfiltered (gdb_stderr, "Return float struct+%s\n", -+ plongest (offset)); - if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16) - { - /* A 16-byte long double field goes in two consecutive -@@ -5295,8 +5296,8 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function, - if (offset + xfer > TYPE_LENGTH (type)) - xfer = TYPE_LENGTH (type) - offset; - if (mips_debug) -- fprintf_unfiltered (gdb_stderr, "Return struct+%d:%d in $%d\n", -- offset, xfer, regnum); -+ fprintf_unfiltered (gdb_stderr, "Return struct+%s:%d in $%d\n", -+ plongest (offset), xfer, regnum); - mips_xfer_register (gdbarch, regcache, - gdbarch_num_regs (gdbarch) + regnum, - xfer, BFD_ENDIAN_UNKNOWN, readbuf, writebuf, -@@ -5355,7 +5356,8 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - int argreg; - int float_argreg; - int argnum; -- int arg_space = 0; -+ ULONGEST arg_space = 0; -+ LONGEST len = 0; - int stack_offset = 0; - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5392,9 +5394,9 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - - if (mips_debug) - fprintf_unfiltered (gdb_stdlog, -- "mips_o32_push_dummy_call: sp=%s allocated %ld\n", -+ "mips_o32_push_dummy_call: sp=%s allocated %s\n", - paddress (gdbarch, sp), -- (long) align_up (arg_space, 16)); -+ pulongest (align_up (arg_space, 16))); - - /* Initialize the integer and float register pointers. */ - argreg = MIPS_A0_REGNUM; -@@ -5420,13 +5422,13 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - const gdb_byte *val; - struct value *arg = args[argnum]; - struct type *arg_type = check_typedef (value_type (arg)); -- int len = TYPE_LENGTH (arg_type); -+ LONGEST len = TYPE_LENGTH (arg_type); - enum type_code typecode = TYPE_CODE (arg_type); - - if (mips_debug) - fprintf_unfiltered (gdb_stdlog, -- "mips_o32_push_dummy_call: %d len=%d type=%d", -- argnum + 1, len, (int) typecode); -+ "mips_o32_push_dummy_call: %d len=%s type=%d", -+ argnum + 1, plongest (len), (int) typecode); - - val = value_contents (arg); - -@@ -5880,8 +5882,8 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - int argreg; - int float_argreg; - int argnum; -- int arg_space = 0; -- int stack_offset = 0; -+ ULONGEST arg_space = 0; -+ LONGEST stack_offset = 0; - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - CORE_ADDR func_addr = find_function_addr (function, NULL); - -@@ -5914,9 +5916,9 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - - if (mips_debug) - fprintf_unfiltered (gdb_stdlog, -- "mips_o64_push_dummy_call: sp=%s allocated %ld\n", -+ "mips_o64_push_dummy_call: sp=%s allocated %s\n", - paddress (gdbarch, sp), -- (long) align_up (arg_space, 16)); -+ pulongest (align_up (arg_space, 16))); - - /* Initialize the integer and float register pointers. */ - argreg = MIPS_A0_REGNUM; -@@ -5942,13 +5944,13 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - const gdb_byte *val; - struct value *arg = args[argnum]; - struct type *arg_type = check_typedef (value_type (arg)); -- int len = TYPE_LENGTH (arg_type); -+ LONGEST len = TYPE_LENGTH (arg_type); - enum type_code typecode = TYPE_CODE (arg_type); - - if (mips_debug) - fprintf_unfiltered (gdb_stdlog, -- "mips_o64_push_dummy_call: %d len=%d type=%d", -- argnum + 1, len, (int) typecode); -+ "mips_o64_push_dummy_call: %d len=%s type=%d", -+ argnum + 1, plongest (len), (int) typecode); - - val = value_contents (arg); - -diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c ---- a/gdb/mn10300-tdep.c -+++ b/gdb/mn10300-tdep.c -@@ -1197,7 +1197,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch, - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - const int push_size = register_size (gdbarch, E_PC_REGNUM); - int regs_used; -- int len, arg_len; -+ LONGEST len, arg_len; - int stack_offset = 0; - int argnum; - const gdb_byte *val; -diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c ---- a/gdb/ppc-sysv-tdep.c -+++ b/gdb/ppc-sysv-tdep.c -@@ -69,7 +69,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int opencl_abi = ppc_sysv_use_opencl_abi (value_type (function)); - ULONGEST saved_sp; -- int argspace = 0; /* 0 is an initial wrong guess. */ -+ LONGEST argspace = 0; /* 0 is an initial wrong guess. */ - int write_pass; - - gdb_assert (tdep->wordsize == 4); -@@ -100,9 +100,9 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - /* Next available vector register for vector arguments. */ - int vreg = 2; - /* Arguments start above the "LR save word" and "Back chain". */ -- int argoffset = 2 * tdep->wordsize; -+ LONGEST argoffset = 2 * tdep->wordsize; - /* Structures start after the arguments. */ -- int structoffset = argoffset + argspace; -+ LONGEST structoffset = argoffset + argspace; - - /* If the function is returning a `struct', then the first word - (which will be passed in r3) is used for struct return -@@ -121,7 +121,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - { - struct value *arg = args[argno]; - struct type *type = check_typedef (value_type (arg)); -- int len = TYPE_LENGTH (type); -+ ssize_t len = TYPE_LENGTH (type); - const bfd_byte *val = value_contents (arg); - - if (TYPE_CODE (type) == TYPE_CODE_FLT && len <= 8 -@@ -1247,11 +1247,11 @@ struct ppc64_sysv_argpos - - static void - ppc64_sysv_abi_push_val (struct gdbarch *gdbarch, -- const bfd_byte *val, int len, int align, -+ const bfd_byte *val, ssize_t len, int align, - struct ppc64_sysv_argpos *argpos) - { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); -- int offset = 0; -+ LONGEST offset = 0; - - /* Enforce alignment of stack location, if requested. */ - if (align > tdep->wordsize) -@@ -1288,7 +1288,7 @@ ppc64_sysv_abi_push_val (struct gdbarch *gdbarch, - { - if (argpos->regcache && argpos->greg <= 10) - argpos->regcache->cooked_write_part -- (tdep->ppc_gp0_regnum + argpos->greg, offset, len, val); -+ (tdep->ppc_gp0_regnum + argpos->greg, offset, (LONGEST) len, val); - argpos->greg++; - } - } -@@ -1347,7 +1347,7 @@ ppc64_sysv_abi_push_freg (struct gdbarch *gdbarch, - if (argpos->regcache && argpos->freg <= 13) - { - int regnum = tdep->ppc_fp0_regnum + argpos->freg; -- int offset = 0; -+ LONGEST offset = 0; - - if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) - offset = 8 - TYPE_LENGTH (type); -@@ -1797,7 +1797,7 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype, - && TYPE_CODE (valtype) == TYPE_CODE_DECFLOAT) - { - int regnum = tdep->ppc_fp0_regnum + 1 + index; -- int offset = 0; -+ LONGEST offset = 0; - - if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) - offset = 8 - TYPE_LENGTH (valtype); -@@ -1873,7 +1873,7 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype, - && TYPE_CODE (valtype) == TYPE_CODE_ARRAY && TYPE_VECTOR (valtype)) - { - int regnum = tdep->ppc_gp0_regnum + 3 + index; -- int offset = 0; -+ LONGEST offset = 0; - - if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) - offset = 8 - TYPE_LENGTH (valtype); -@@ -1981,7 +1981,8 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function, - && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1) - { - int regnum = tdep->ppc_gp0_regnum + 3; -- int offset = (register_size (gdbarch, regnum) - TYPE_LENGTH (valtype)); -+ LONGEST offset -+ = (register_size (gdbarch, regnum) - TYPE_LENGTH (valtype)); - - if (writebuf != NULL) - regcache->cooked_write_part (regnum, offset, TYPE_LENGTH (valtype), -diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c ---- a/gdb/rl78-tdep.c -+++ b/gdb/rl78-tdep.c -@@ -1347,8 +1347,8 @@ rl78_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - for (i = nargs - 1; i >= 0; i--) - { - struct type *value_type = value_enclosing_type (args[i]); -- int len = TYPE_LENGTH (value_type); -- int container_len = (len + 1) & ~1; -+ LONGEST len = TYPE_LENGTH (value_type); -+ LONGEST container_len = (len + 1) & ~1; - - sp -= container_len; - write_memory (rl78_make_data_address (sp), -diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c ---- a/gdb/rs6000-aix-tdep.c -+++ b/gdb/rs6000-aix-tdep.c -@@ -291,9 +291,9 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int ii; -- int len = 0; -+ LONGEST len = 0; - int argno; /* current argument number */ -- int argbytes; /* current argument byte */ -+ LONGEST argbytes; /* current argument byte */ - gdb_byte tmp_buffer[50]; - int f_argno = 0; /* current floating point argno */ - int wordsize = gdbarch_tdep (gdbarch)->wordsize; -@@ -421,7 +421,7 @@ ran_out_of_registers_for_arguments: - - if ((argno < nargs) || argbytes) - { -- int space = 0, jj; -+ LONGEST space = 0, jj; - - if (argbytes) - { -diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c ---- a/gdb/score-tdep.c -+++ b/gdb/score-tdep.c -@@ -517,7 +517,7 @@ score_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int argnum; - int argreg; -- int arglen = 0; -+ LONGEST arglen = 0; - CORE_ADDR stack_offset = 0; - CORE_ADDR addr = 0; - -diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c ---- a/gdb/sh-tdep.c -+++ b/gdb/sh-tdep.c -@@ -812,7 +812,7 @@ sh_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) - static int - sh_use_struct_convention (int renesas_abi, struct type *type) - { -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - int nelem = TYPE_NFIELDS (type); - - /* The Renesas ABI returns aggregate types always on stack. */ -@@ -914,7 +914,7 @@ sh_frame_align (struct gdbarch *ignore, CORE_ADDR sp) - - /* Helper function to justify value in register according to endianess. */ - static const gdb_byte * --sh_justify_value_in_reg (struct gdbarch *gdbarch, struct value *val, int len) -+sh_justify_value_in_reg (struct gdbarch *gdbarch, struct value *val, LONGEST len) - { - static gdb_byte valbuf[4]; - -@@ -1074,7 +1074,8 @@ sh_push_dummy_call_fpu (struct gdbarch *gdbarch, - struct type *type; - CORE_ADDR regval; - const gdb_byte *val; -- int len, reg_size = 0; -+ LONGEST len; -+ int reg_size = 0; - int pass_on_stack = 0; - int treat_as_flt; - int last_reg_arg = INT_MAX; -@@ -1216,7 +1217,8 @@ sh_push_dummy_call_nofpu (struct gdbarch *gdbarch, - struct type *type; - CORE_ADDR regval; - const gdb_byte *val; -- int len, reg_size = 0; -+ LONGEST len; -+ int reg_size = 0; - int pass_on_stack = 0; - int last_reg_arg = INT_MAX; - -diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c ---- a/gdb/sparc64-tdep.c -+++ b/gdb/sparc64-tdep.c -@@ -1206,7 +1206,7 @@ sparc64_16_byte_align_p (struct type *type) - - static void - sparc64_store_floating_fields (struct regcache *regcache, struct type *type, -- const gdb_byte *valbuf, int element, int bitpos) -+ const gdb_byte *valbuf, int element, LONGEST bitpos) - { - struct gdbarch *gdbarch = regcache->arch (); - int len = TYPE_LENGTH (type); -@@ -1266,7 +1266,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, - for (i = 0; i < TYPE_NFIELDS (type); i++) - { - struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); -- int subpos = bitpos + TYPE_FIELD_BITPOS (type, i); -+ LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i); - - sparc64_store_floating_fields (regcache, subtype, valbuf, - element, subpos); -@@ -1298,7 +1298,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, - - static void - sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, -- gdb_byte *valbuf, int bitpos) -+ gdb_byte *valbuf, LONGEST bitpos) - { - struct gdbarch *gdbarch = regcache->arch (); - -@@ -1354,7 +1354,7 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, - for (i = 0; i < TYPE_NFIELDS (type); i++) - { - struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); -- int subpos = bitpos + TYPE_FIELD_BITPOS (type, i); -+ LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i); - - sparc64_extract_floating_fields (regcache, subtype, valbuf, subpos); - } -@@ -1388,7 +1388,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, - for (i = 0; i < nargs; i++) - { - struct type *type = value_type (args[i]); -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - - if (sparc64_structure_or_union_p (type) - || (sparc64_complex_floating_p (type) && len == 32)) -@@ -1488,7 +1488,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, - { - const gdb_byte *valbuf = value_contents (args[i]); - struct type *type = value_type (args[i]); -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - int regnum = -1; - gdb_byte buf[16]; - -diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c ---- a/gdb/spu-tdep.c -+++ b/gdb/spu-tdep.c -@@ -1432,7 +1432,7 @@ spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - struct value *arg = args[i]; - struct type *type = check_typedef (value_type (arg)); - const gdb_byte *contents = value_contents (arg); -- int n_regs = align_up (TYPE_LENGTH (type), 16) / 16; -+ LONGEST n_regs = align_up (TYPE_LENGTH (type), 16) / 16; - - /* If the argument doesn't wholly fit into registers, it and - all subsequent arguments go to the stack. */ -@@ -1464,7 +1464,7 @@ spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - { - struct value *arg = args[i]; - struct type *type = check_typedef (value_type (arg)); -- int len = TYPE_LENGTH (type); -+ LONGEST len = TYPE_LENGTH (type); - int preferred_slot; - - if (spu_scalar_value_p (type)) -diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c ---- a/gdb/tic6x-tdep.c -+++ b/gdb/tic6x-tdep.c -@@ -881,7 +881,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - int argreg = 0; - int argnum; - int stack_offset = 4; -- int references_offset = 4; -+ LONGEST references_offset = 4; - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - struct type *func_type = value_type (function); - /* The first arg passed on stack. Mostly the first 10 args are passed by -@@ -914,7 +914,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - /* Now make space on the stack for the args. */ - for (argnum = 0; argnum < nargs; argnum++) - { -- int len = align_up (TYPE_LENGTH (value_type (args[argnum])), 4); -+ LONGEST len = align_up (TYPE_LENGTH (value_type (args[argnum])), 4); - if (argnum >= 10 - argreg) - references_offset += len; - stack_offset += len; -@@ -933,7 +933,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - const gdb_byte *val; - struct value *arg = args[argnum]; - struct type *arg_type = check_typedef (value_type (arg)); -- int len = TYPE_LENGTH (arg_type); -+ ssize_t len = TYPE_LENGTH (arg_type); - enum type_code typecode = TYPE_CODE (arg_type); - - val = value_contents (arg); -@@ -1088,7 +1088,8 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, - } - else - internal_error (__FILE__, __LINE__, -- _("unexpected length %d of arg %d"), len, argnum); -+ _("unexpected length %s of arg %d"), -+ plongest (len), argnum); - - addr = sp + stack_offset; - write_memory (addr, val, len); -diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c ---- a/gdb/tilegx-tdep.c -+++ b/gdb/tilegx-tdep.c -@@ -288,7 +288,7 @@ tilegx_push_dummy_call (struct gdbarch *gdbarch, - CORE_ADDR stack_dest = sp; - int argreg = TILEGX_R0_REGNUM; - int i, j; -- int typelen, slacklen; -+ LONGEST typelen, slacklen; - static const gdb_byte four_zero_words[16] = { 0 }; - - /* If struct_return is 1, then the struct return address will -diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c ---- a/gdb/v850-tdep.c -+++ b/gdb/v850-tdep.c -@@ -1019,7 +1019,8 @@ v850_push_dummy_call (struct gdbarch *gdbarch, - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int argreg; - int argnum; -- int arg_space = 0; -+ ULONGEST arg_space = 0; -+ LONGEST len = 0; - int stack_offset; - - if (gdbarch_tdep (gdbarch)->abi == V850_ABI_RH850) -@@ -1047,7 +1048,7 @@ v850_push_dummy_call (struct gdbarch *gdbarch, - in four registers available. Loop thru args from first to last. */ - for (argnum = 0; argnum < nargs; argnum++) - { -- int len; -+ LONGEST len; - gdb_byte *val; - gdb_byte valbuf[v850_reg_size]; - -diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c ---- a/gdb/vax-tdep.c -+++ b/gdb/vax-tdep.c -@@ -110,7 +110,7 @@ vax_store_arguments (struct regcache *regcache, int nargs, - struct gdbarch *gdbarch = regcache->arch (); - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - gdb_byte buf[4]; -- int count = 0; -+ LONGEST count = 0; - int i; - - /* We create an argument list on the stack, and make the argument -@@ -119,7 +119,7 @@ vax_store_arguments (struct regcache *regcache, int nargs, - /* Push arguments in reverse order. */ - for (i = nargs - 1; i >= 0; i--) - { -- int len = TYPE_LENGTH (value_enclosing_type (args[i])); -+ LONGEST len = TYPE_LENGTH (value_enclosing_type (args[i])); - - sp -= (len + 3) & ~3; - count += (len + 3) / 4; -diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c ---- a/gdb/xstormy16-tdep.c -+++ b/gdb/xstormy16-tdep.c -@@ -233,8 +233,10 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch, - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - CORE_ADDR stack_dest = sp; - int argreg = E_1ST_ARG_REGNUM; -- int i, j; -- int typelen, slacklen; -+ int i, slacklen; -+ LONGEST j; -+ LONGEST typelen; -+ const gdb_byte *val; - gdb_byte buf[xstormy16_pc_size]; - - /* If returning a struct using target ABI method, then the struct return -diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c ---- a/gdb/xtensa-tdep.c -+++ b/gdb/xtensa-tdep.c -@@ -1615,8 +1615,7 @@ xtensa_store_return_value (struct type *type, - - if (len > (callsize > 8 ? 8 : 16)) - internal_error (__FILE__, __LINE__, -- _("unimplemented for this length: %d"), -- TYPE_LENGTH (type)); -+ _("unimplemented for this length: %d"), len); - areg = arreg_number (gdbarch, - gdbarch_tdep (gdbarch)->a0_base + 2 + callsize, wb); - -@@ -1689,18 +1688,19 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, - CORE_ADDR struct_addr) - { - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); -- int size, onstack_size; -+ int i; -+ LONGEST size, onstack_size; - gdb_byte *buf = (gdb_byte *) alloca (16); - CORE_ADDR ra, ps; - struct argument_info - { - const bfd_byte *contents; -- int length; -+ ssize_t length; - int onstack; /* onstack == 0 => in reg */ - int align; /* alignment */ - union - { -- int offset; /* stack offset if on stack. */ -+ ssize_t offset; /* stack offset if on stack. */ - int regno; /* regno if in register. */ - } u; - }; -@@ -1723,9 +1723,10 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, - { - struct value *arg = args[i]; - struct type *arg_type = check_typedef (value_type (arg)); -- fprintf_unfiltered (gdb_stdlog, "%2d: %s %3d ", i, -- host_address_to_string (arg), -- TYPE_LENGTH (arg_type)); -+ const char *arg_type_len_s = pulongest (TYPE_LENGTH (arg_type)); -+ -+ fprintf_unfiltered (gdb_stdlog, "%2d: %s %s ", i, -+ host_address_to_string (arg), arg_type_len_s); - switch (TYPE_CODE (arg_type)) - { - case TYPE_CODE_INT: -@@ -1794,8 +1795,8 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, - info->align = TYPE_LENGTH (builtin_type (gdbarch)->builtin_long); - break; - } -- info->length = TYPE_LENGTH (arg_type); - info->contents = value_contents (arg); -+ info->length = TYPE_LENGTH (arg_type); - - /* Align size and onstack_size. */ - size = (size + info->align - 1) & ~(info->align - 1); -@@ -1840,7 +1841,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, - - if (info->onstack) - { -- int n = info->length; -+ ssize_t n = info->length; - CORE_ADDR offset = sp + info->u.offset; - - /* Odd-sized structs are aligned to the lower side of a memory -@@ -1856,7 +1857,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, - } - else - { -- int n = info->length; -+ ssize_t n = info->length; - const bfd_byte *cp = info->contents; - int r = info->u.regno; - diff --git a/gdb-rhbz795424-bitpos-25of25-test.patch b/gdb-rhbz795424-bitpos-25of25-test.patch deleted file mode 100644 index 7a376ee..0000000 --- a/gdb-rhbz795424-bitpos-25of25-test.patch +++ /dev/null @@ -1,638 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz795424-bitpos-25of25-test.patch - -;; Fix `GDB cannot access struct member whose offset is larger than 256MB' -;; (RH BZ 795424). -;;=push - -http://sourceware.org/ml/gdb-patches/2012-10/msg00231.html - -On Mon, 15 Oct 2012 15:25:55 +0200, Jan Kratochvil wrote: -> I have filed for it now: -> Invalid debug/ array bounds w/-fno-range-check and 32-bit target -> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54934 - -Therefore it looks as a valid gfortran FSF GCC HEAD bug so provided -a hand-patched .S file for i386; patched GDB PASSes with it. - -Thanks, -Jan - -2012-10-15 Siddhesh Poyarekar - Jan Kratochvil - - * gdb.fortran/array-bounds.exp: New test file. - * gdb.fortran/array-bounds.f: New test file. - * gdb.fortran/array-bounds.S: New test file. - -diff --git a/gdb/testsuite/gdb.fortran/array-bounds.S b/gdb/testsuite/gdb.fortran/array-bounds.S -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/array-bounds.S -@@ -0,0 +1,529 @@ -+/* Copyright 2012 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . -+ -+ This file is part of the gdb testsuite. */ -+ -+ .file "array-bounds.f" -+ .text -+.Ltext0: -+ .type MAIN__, @function -+MAIN__: -+.LFB0: -+ .file 1 "gdb.fortran/array-bounds.f" -+ # gdb.fortran/array-bounds.f:16 -+ .loc 1 16 0 -+ .cfi_startproc -+# BLOCK 2 seq:0 -+# PRED: ENTRY (FALLTHRU) -+ pushl %ebp -+.LCFI0: -+ .cfi_def_cfa_offset 8 -+ .cfi_offset 5, -8 -+ movl %esp, %ebp -+.LCFI1: -+ .cfi_def_cfa_register 5 -+ subl $40, %esp -+.LBB2: -+# SUCC: 3 (FALLTHRU) -+ # gdb.fortran/array-bounds.f:18 -+ .loc 1 18 0 -+ movl $-1, %eax -+# BLOCK 3 seq:1 -+# PRED: 2 (FALLTHRU) 4 [100.0%] -+.L3: -+ # gdb.fortran/array-bounds.f:18 -+ .loc 1 18 0 is_stmt 0 discriminator 1 -+ testl %eax, %eax -+# SUCC: 5 4 (FALLTHRU) -+ jg .L2 -+# BLOCK 4 seq:2 -+# PRED: 3 (FALLTHRU) -+ # gdb.fortran/array-bounds.f:18 -+ .loc 1 18 0 discriminator 2 -+ leal 1(%eax), %ecx -+ movl .LC0, %edx -+ movl %edx, -16(%ebp,%ecx,4) -+ addl $1, %eax -+# SUCC: 3 [100.0%] -+ jmp .L3 -+# BLOCK 5 seq:3 -+# PRED: 3 -+.L2: -+.LBE2: -+ # gdb.fortran/array-bounds.f:19 -+ .loc 1 19 0 is_stmt 1 -+ movl -16(%ebp), %eax -+ movl -12(%ebp), %edx -+ movl %eax, -24(%ebp) -+ movl %edx, -20(%ebp) -+ # gdb.fortran/array-bounds.f:20 -+ .loc 1 20 0 -+ movl $0, 4(%esp) -+ movl $0, (%esp) -+# SUCC: -+ call _gfortran_stop_string -+ .cfi_endproc -+.LFE0: -+ .size MAIN__, .-MAIN__ -+ .globl main -+ .type main, @function -+main: -+.LFB1: -+ # gdb.fortran/array-bounds.f:21 -+ .loc 1 21 0 -+ .cfi_startproc -+# BLOCK 2 seq:0 -+# PRED: ENTRY (FALLTHRU) -+ pushl %ebp -+.LCFI2: -+ .cfi_def_cfa_offset 8 -+ .cfi_offset 5, -8 -+ movl %esp, %ebp -+.LCFI3: -+ .cfi_def_cfa_register 5 -+ andl $-16, %esp -+ subl $16, %esp -+ # gdb.fortran/array-bounds.f:21 -+ .loc 1 21 0 -+ movl 12(%ebp), %eax -+ movl %eax, 4(%esp) -+ movl 8(%ebp), %eax -+ movl %eax, (%esp) -+ call _gfortran_set_args -+ movl $options.1.1824, 4(%esp) -+ movl $7, (%esp) -+ call _gfortran_set_options -+ call MAIN__ -+ movl $0, %eax -+ leave -+.LCFI4: -+ .cfi_restore 5 -+ .cfi_def_cfa 4, 4 -+# SUCC: EXIT [100.0%] -+ ret -+ .cfi_endproc -+.LFE1: -+ .size main, .-main -+ .section .rodata -+ .align 4 -+ .type options.1.1824, @object -+ .size options.1.1824, 28 -+options.1.1824: -+ .long 68 -+ .long 1023 -+ .long 0 -+ .long 0 -+ .long 1 -+ .long 1 -+ .long 0 -+ .align 4 -+.LC0: -+ .long 1109917696 -+ .text -+.Letext0: -+ .section .debug_info,"",@progbits -+.Ldebug_info0: -+ .long 2f - 1f # Length of Compilation Unit Info -+1: -+ .value 0x2 # DWARF version number -+ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section -+ .byte 0x4 # Pointer Size (in bytes) -+dieb: .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit) -+ .long .LASF5 # DW_AT_producer: "GNU Fortran 4.8.0 20121015 (experimental) -ffixed-form -m32 -mtune=generic -march=x86-64 -g -gdwarf-2 -fintrinsic-modules-path .../gcchead-root/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/finclude" -+ .byte 0xe # DW_AT_language -+ .byte 0x2 # DW_AT_identifier_case -+ .long .LASF6 # DW_AT_name: "gdb.fortran/array-bounds.f" -+ .long .LASF7 # DW_AT_comp_dir: "" -+ .long .Ltext0 # DW_AT_low_pc -+ .long .Letext0 # DW_AT_high_pc -+ .long .Ldebug_line0 # DW_AT_stmt_list -+die26: .uleb128 0x2 # (DIE (0x26) DW_TAG_subprogram) -+ .long .LASF8 # DW_AT_name: "MAIN__" -+ .byte 0x1 # DW_AT_decl_file (gdb.fortran/array-bounds.f) -+ .byte 0x10 # DW_AT_decl_line -+ .long .LFB0 # DW_AT_low_pc -+ .long .LFE0 # DW_AT_high_pc -+ .long .LLST0 # DW_AT_frame_base -+ .byte 0x1 # DW_AT_GNU_all_tail_call_sites -+ .byte 0x1 # DW_AT_main_subprogram -+ .byte 0x2 # DW_AT_calling_convention -+ .long die66 - .Ldebug_info0 # DW_AT_sibling -+die40: .uleb128 0x3 # (DIE (0x40) DW_TAG_variable) -+ .ascii "bar\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.fortran/array-bounds.f) -+ .byte 0x11 # DW_AT_decl_line -+ .long die66 - .Ldebug_info0 # DW_AT_type -+ .byte 0x2 # DW_AT_location -+ .byte 0x91 # DW_OP_fbreg -+ .sleb128 -24 -+die4e: .uleb128 0x3 # (DIE (0x4e) DW_TAG_variable) -+ .ascii "foo\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.fortran/array-bounds.f) -+ .byte 0x10 # DW_AT_decl_line -+ .long die88 - .Ldebug_info0 # DW_AT_type -+ .byte 0x2 # DW_AT_location -+ .byte 0x91 # DW_OP_fbreg -+ .sleb128 -32 -+die5c: .uleb128 0x4 # (DIE (0x5c) DW_TAG_lexical_block) -+ .long .LBB2 # DW_AT_low_pc -+ .long .LBE2 # DW_AT_high_pc -+ .byte 0 # end of children of DIE 0x26 -+die66: .uleb128 0x5 # (DIE (0x66) DW_TAG_array_type) -+ .long die81 - .Ldebug_info0 # DW_AT_type -+ .long die7a - .Ldebug_info0 # DW_AT_sibling -+die6f: .uleb128 0x6 # (DIE (0x6f) DW_TAG_subrange_type) -+ .long die7a - .Ldebug_info0 # DW_AT_type -+#if 0 -+ .long 0xffffffff # DW_AT_lower_bound -+ .byte 0 # DW_AT_upper_bound -+#else -+ .quad 0xfffffffeffffffff # DW_AT_lower_bound -+ .quad 0xffffffff00000000 # DW_AT_upper_bound -+#endif -+ .byte 0 # end of children of DIE 0x66 -+die7a: .uleb128 0x7 # (DIE (0x7a) DW_TAG_base_type) -+#if 0 -+ .byte 0x4 # DW_AT_byte_size -+#else -+ .byte 0x8 # DW_AT_byte_size -+#endif -+ .byte 0x5 # DW_AT_encoding -+ .long .LASF0 # DW_AT_name: "integer(kind=4)" -+die81: .uleb128 0x7 # (DIE (0x81) DW_TAG_base_type) -+ .byte 0x4 # DW_AT_byte_size -+ .byte 0x4 # DW_AT_encoding -+ .long .LASF1 # DW_AT_name: "real(kind=4)" -+die88: .uleb128 0x5 # (DIE (0x88) DW_TAG_array_type) -+ .long die81 - .Ldebug_info0 # DW_AT_type -+ .long die99 - .Ldebug_info0 # DW_AT_sibling -+die91: .uleb128 0x8 # (DIE (0x91) DW_TAG_subrange_type) -+ .long die7a - .Ldebug_info0 # DW_AT_type -+#if 0 -+ .byte 0 # DW_AT_lower_bound -+ .byte 0x1 # DW_AT_upper_bound -+#else -+ .quad 0x100000000 # DW_AT_lower_bound -+ .quad 0x100000001 # DW_AT_upper_bound -+#endif -+ .byte 0 # end of children of DIE 0x88 -+die99: .uleb128 0x9 # (DIE (0x99) DW_TAG_subprogram) -+ .byte 0x1 # DW_AT_external -+ .long .LASF9 # DW_AT_name: "main" -+ .byte 0x1 # DW_AT_decl_file (gdb.fortran/array-bounds.f) -+ .byte 0x15 # DW_AT_decl_line -+ .long die7a - .Ldebug_info0 # DW_AT_type -+ .long .LFB1 # DW_AT_low_pc -+ .long .LFE1 # DW_AT_high_pc -+ .long .LLST1 # DW_AT_frame_base -+ .byte 0x1 # DW_AT_GNU_all_tail_call_sites -+ .long died4 - .Ldebug_info0 # DW_AT_sibling -+dieb6: .uleb128 0xa # (DIE (0xb6) DW_TAG_formal_parameter) -+ .long .LASF2 # DW_AT_name: "argc" -+ .byte 0x1 # DW_AT_decl_file (gdb.fortran/array-bounds.f) -+ .byte 0x15 # DW_AT_decl_line -+ .long died4 - .Ldebug_info0 # DW_AT_type -+ .byte 0x2 # DW_AT_location -+ .byte 0x91 # DW_OP_fbreg -+ .sleb128 0 -+diec4: .uleb128 0xa # (DIE (0xc4) DW_TAG_formal_parameter) -+ .long .LASF3 # DW_AT_name: "argv" -+ .byte 0x1 # DW_AT_decl_file (gdb.fortran/array-bounds.f) -+ .byte 0x15 # DW_AT_decl_line -+ .long died9 - .Ldebug_info0 # DW_AT_type -+ .byte 0x3 # DW_AT_location -+ .byte 0x91 # DW_OP_fbreg -+ .sleb128 4 -+ .byte 0x6 # DW_OP_deref -+ .byte 0 # end of children of DIE 0x99 -+died4: .uleb128 0xb # (DIE (0xd4) DW_TAG_const_type) -+ .long die7a - .Ldebug_info0 # DW_AT_type -+died9: .uleb128 0xc # (DIE (0xd9) DW_TAG_pointer_type) -+ .byte 0x4 # DW_AT_byte_size -+ .long diedf - .Ldebug_info0 # DW_AT_type -+diedf: .uleb128 0x7 # (DIE (0xdf) DW_TAG_base_type) -+ .byte 0x1 # DW_AT_byte_size -+ .byte 0x8 # DW_AT_encoding -+ .long .LASF4 # DW_AT_name: "character(kind=1)" -+ .byte 0 # end of children of DIE 0xb -+2: -+ .section .debug_abbrev,"",@progbits -+.Ldebug_abbrev0: -+ .uleb128 0x1 # (abbrev code) -+ .uleb128 0x11 # (TAG: DW_TAG_compile_unit) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x25 # (DW_AT_producer) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x13 # (DW_AT_language) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x42 # (DW_AT_identifier_case) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x1b # (DW_AT_comp_dir) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x12 # (DW_AT_high_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x10 # (DW_AT_stmt_list) -+ .uleb128 0x6 # (DW_FORM_data4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x2 # (abbrev code) -+ .uleb128 0x2e # (TAG: DW_TAG_subprogram) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x12 # (DW_AT_high_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x40 # (DW_AT_frame_base) -+ .uleb128 0x6 # (DW_FORM_data4) -+ .uleb128 0x2116 # (DW_AT_GNU_all_tail_call_sites) -+ .uleb128 0xc # (DW_FORM_flag) -+ .uleb128 0x6a # (DW_AT_main_subprogram) -+ .uleb128 0xc # (DW_FORM_flag) -+ .uleb128 0x36 # (DW_AT_calling_convention) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x1 # (DW_AT_sibling) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x3 # (abbrev code) -+ .uleb128 0x34 # (TAG: DW_TAG_variable) -+ .byte 0 # DW_children_no -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x2 # (DW_AT_location) -+ .uleb128 0xa # (DW_FORM_block1) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x4 # (abbrev code) -+ .uleb128 0xb # (TAG: DW_TAG_lexical_block) -+ .byte 0 # DW_children_no -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x12 # (DW_AT_high_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x5 # (abbrev code) -+ .uleb128 0x1 # (TAG: DW_TAG_array_type) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x1 # (DW_AT_sibling) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x6 # (abbrev code) -+ .uleb128 0x21 # (TAG: DW_TAG_subrange_type) -+ .byte 0 # DW_children_no -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+#if 0 -+ .uleb128 0x22 # (DW_AT_lower_bound) -+ .uleb128 0x6 # (DW_FORM_data4) -+ .uleb128 0x2f # (DW_AT_upper_bound) -+ .uleb128 0xb # (DW_FORM_data1) -+#else -+ .uleb128 0x22 # (DW_AT_lower_bound) -+ .uleb128 0x7 # (DW_FORM_data8) -+ .uleb128 0x2f # (DW_AT_upper_bound) -+ .uleb128 0x7 # (DW_FORM_data8) -+#endif -+ .byte 0 -+ .byte 0 -+ .uleb128 0x7 # (abbrev code) -+ .uleb128 0x24 # (TAG: DW_TAG_base_type) -+ .byte 0 # DW_children_no -+ .uleb128 0xb # (DW_AT_byte_size) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3e # (DW_AT_encoding) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x8 # (abbrev code) -+ .uleb128 0x21 # (TAG: DW_TAG_subrange_type) -+ .byte 0 # DW_children_no -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+#if 0 -+ .uleb128 0x22 # (DW_AT_lower_bound) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x2f # (DW_AT_upper_bound) -+ .uleb128 0xb # (DW_FORM_data1) -+#else -+ .uleb128 0x22 # (DW_AT_lower_bound) -+ .uleb128 0x7 # (DW_FORM_data8) -+ .uleb128 0x2f # (DW_AT_upper_bound) -+ .uleb128 0x7 # (DW_FORM_data8) -+#endif -+ .byte 0 -+ .byte 0 -+ .uleb128 0x9 # (abbrev code) -+ .uleb128 0x2e # (TAG: DW_TAG_subprogram) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x3f # (DW_AT_external) -+ .uleb128 0xc # (DW_FORM_flag) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x12 # (DW_AT_high_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x40 # (DW_AT_frame_base) -+ .uleb128 0x6 # (DW_FORM_data4) -+ .uleb128 0x2116 # (DW_AT_GNU_all_tail_call_sites) -+ .uleb128 0xc # (DW_FORM_flag) -+ .uleb128 0x1 # (DW_AT_sibling) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0xa # (abbrev code) -+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter) -+ .byte 0 # DW_children_no -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x2 # (DW_AT_location) -+ .uleb128 0xa # (DW_FORM_block1) -+ .byte 0 -+ .byte 0 -+ .uleb128 0xb # (abbrev code) -+ .uleb128 0x26 # (TAG: DW_TAG_const_type) -+ .byte 0 # DW_children_no -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0xc # (abbrev code) -+ .uleb128 0xf # (TAG: DW_TAG_pointer_type) -+ .byte 0 # DW_children_no -+ .uleb128 0xb # (DW_AT_byte_size) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .byte 0 -+ .section .debug_loc,"",@progbits -+.Ldebug_loc0: -+.LLST0: -+ .long .LFB0-.Ltext0 # Location list begin address (*.LLST0) -+ .long .LCFI0-.Ltext0 # Location list end address (*.LLST0) -+ .value 0x2 # Location expression size -+ .byte 0x74 # DW_OP_breg4 -+ .sleb128 4 -+ .long .LCFI0-.Ltext0 # Location list begin address (*.LLST0) -+ .long .LCFI1-.Ltext0 # Location list end address (*.LLST0) -+ .value 0x2 # Location expression size -+ .byte 0x74 # DW_OP_breg4 -+ .sleb128 8 -+ .long .LCFI1-.Ltext0 # Location list begin address (*.LLST0) -+ .long .LFE0-.Ltext0 # Location list end address (*.LLST0) -+ .value 0x2 # Location expression size -+ .byte 0x75 # DW_OP_breg5 -+ .sleb128 8 -+ .long 0 # Location list terminator begin (*.LLST0) -+ .long 0 # Location list terminator end (*.LLST0) -+.LLST1: -+ .long .LFB1-.Ltext0 # Location list begin address (*.LLST1) -+ .long .LCFI2-.Ltext0 # Location list end address (*.LLST1) -+ .value 0x2 # Location expression size -+ .byte 0x74 # DW_OP_breg4 -+ .sleb128 4 -+ .long .LCFI2-.Ltext0 # Location list begin address (*.LLST1) -+ .long .LCFI3-.Ltext0 # Location list end address (*.LLST1) -+ .value 0x2 # Location expression size -+ .byte 0x74 # DW_OP_breg4 -+ .sleb128 8 -+ .long .LCFI3-.Ltext0 # Location list begin address (*.LLST1) -+ .long .LCFI4-.Ltext0 # Location list end address (*.LLST1) -+ .value 0x2 # Location expression size -+ .byte 0x75 # DW_OP_breg5 -+ .sleb128 8 -+ .long .LCFI4-.Ltext0 # Location list begin address (*.LLST1) -+ .long .LFE1-.Ltext0 # Location list end address (*.LLST1) -+ .value 0x2 # Location expression size -+ .byte 0x74 # DW_OP_breg4 -+ .sleb128 4 -+ .long 0 # Location list terminator begin (*.LLST1) -+ .long 0 # Location list terminator end (*.LLST1) -+ .section .debug_aranges,"",@progbits -+ .long 0x1c # Length of Address Ranges Info -+ .value 0x2 # DWARF Version -+ .long .Ldebug_info0 # Offset of Compilation Unit Info -+ .byte 0x4 # Size of Address -+ .byte 0 # Size of Segment Descriptor -+ .value 0 # Pad to 8 byte boundary -+ .value 0 -+ .long .Ltext0 # Address -+ .long .Letext0-.Ltext0 # Length -+ .long 0 -+ .long 0 -+ .section .debug_line,"",@progbits -+.Ldebug_line0: -+ .section .debug_str,"MS",@progbits,1 -+.LASF4: -+ .string "character(kind=1)" -+.LASF5: -+ .string "GNU Fortran 4.8.0 20121015 (experimental) -ffixed-form -m32 -mtune=generic -march=x86-64 -g -gdwarf-2 -fintrinsic-modules-path .../gcchead-root/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/finclude" -+.LASF7: -+ .string "" -+.LASF0: -+#if 0 -+ .string "integer(kind=4)" -+#else -+ .string "integer(kind=8)" -+#endif -+.LASF9: -+ .string "main" -+.LASF8: -+ .string "MAIN__" -+.LASF6: -+ .string "gdb.fortran/array-bounds.f" -+.LASF2: -+ .string "argc" -+.LASF1: -+ .string "real(kind=4)" -+.LASF3: -+ .string "argv" -+ .ident "GCC: (GNU) 4.8.0 20121015 (experimental)" -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.fortran/array-bounds.exp b/gdb/testsuite/gdb.fortran/array-bounds.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/array-bounds.exp -@@ -0,0 +1,43 @@ -+# Copyright 2012 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# This file is part of the gdb testsuite. It contains test to ensure that -+# array bounds accept LONGEST. -+ -+if { [skip_fortran_tests] } { return -1 } -+ -+set testfile "array-bounds" -+ -+if { [is_ilp32_target] && ([istarget "i\[34567\]86-*-linux*"] -+ || [istarget "x86_64-*-linux*"]) } { -+ set srcfile ${testfile}.S -+ set opts {nodebug f90} -+} else { -+ set srcfile ${testfile}.f -+ set opts {debug f90} -+} -+ -+if {[prepare_for_testing $testfile.exp $testfile $srcfile $opts]} { -+ print "compile failed" -+ return -1 -+} -+ -+if { ![runto MAIN__] } { -+ perror "Could not run to breakpoint `MAIN__'." -+ continue -+} -+ -+gdb_test "print &foo" {.*\(4294967296:4294967297\).*} -+gdb_test "print &bar" {.*\(-4294967297:-4294967296\).*} -diff --git a/gdb/testsuite/gdb.fortran/array-bounds.f b/gdb/testsuite/gdb.fortran/array-bounds.f -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/array-bounds.f -@@ -0,0 +1,22 @@ -+c Copyright 2012 Free Software Foundation, Inc. -+ -+c This program is free software; you can redistribute it and/or modify -+c it under the terms of the GNU General Public License as published by -+c the Free Software Foundation; either version 3 of the License, or -+c (at your option) any later version. -+c -+c This program is distributed in the hope that it will be useful, -+c but WITHOUT ANY WARRANTY; without even the implied warranty of -+c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+c GNU General Public License for more details. -+c -+c You should have received a copy of the GNU General Public License -+c along with this program. If not, see . -+ -+ dimension foo(4294967296_8:4294967297_8) -+ dimension bar(-4294967297_8:-4294967296_8) -+ bar = 42 -+ foo=bar -+ stop -+ end -+ diff --git a/gdb-rhbz795424-bitpos-25of25.patch b/gdb-rhbz795424-bitpos-25of25.patch deleted file mode 100644 index 2e3121e..0000000 --- a/gdb-rhbz795424-bitpos-25of25.patch +++ /dev/null @@ -1,140 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz795424-bitpos-25of25.patch - -;; Fix `GDB cannot access struct member whose offset is larger than 256MB' -;; (RH BZ 795424). -;;=push - -http://sourceware.org/ml/gdb-patches/2012-08/msg00562.html - ---MP_/90J7bck2fqDySEX9JkZtaqL -Content-Type: text/plain; charset=US-ASCII -Content-Transfer-Encoding: 7bit -Content-Disposition: inline - -Hi, - -Range bounds for a gdb type can have LONGEST values for low and high -bounds. Fortran range bounds functions however use only int. The larger -ranges don't compile by default on gcc, but it is possible to override -the check in the compiler by using -fno-range-check. As a result, this -check is necessary so that we don't print junk in case of an overflow. - -Attached patch does this expansion and also includes a test case that -verifies that the problem is fixed. I have also verified on x86_64 that -this patch does not cause any regressions. - -Regards, -Siddhesh - -gdb/ChangeLog: - - * f-lang.h (f77_get_upperbound): Return LONGEST. - (f77_get_lowerbound): Likewise. - * f-typeprint.c (f_type_print_varspec_suffix): Expand - UPPER_BOUND and LOWER_BOUND to LONGEST. Use plongest to format - print them. - (f_type_print_base): Expand UPPER_BOUND to LONGEST. Use - plongest to format print it. - * f-valprint.c (f77_get_lowerbound): Return LONGEST. - (f77_get_upperbound): Likewise. - (f77_get_dynamic_length_of_aggregate): Expand UPPER_BOUND, - LOWER_BOUND to LONGEST. - (f77_create_arrayprint_offset_tbl): Likewise. - -testsuite/ChangeLog: - - * gdb.fortran/array-bounds.exp: New test case. - * gdb.fortran/array-bounds.f: New test case. - ---MP_/90J7bck2fqDySEX9JkZtaqL -Content-Type: text/x-patch -Content-Transfer-Encoding: 7bit -Content-Disposition: attachment; filename=f77-bounds.patch - -diff --git a/gdb/f-lang.h b/gdb/f-lang.h ---- a/gdb/f-lang.h -+++ b/gdb/f-lang.h -@@ -50,9 +50,9 @@ struct common_block - struct symbol *contents[1]; - }; - --extern int f77_get_upperbound (struct type *); -+extern LONGEST f77_get_upperbound (struct type *); - --extern int f77_get_lowerbound (struct type *); -+extern LONGEST f77_get_lowerbound (struct type *); - - extern void f77_get_dynamic_array_length (struct type *); - -diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c ---- a/gdb/f-typeprint.c -+++ b/gdb/f-typeprint.c -@@ -149,7 +149,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, - int show, int passed_a_ptr, int demangled_args, - int arrayprint_recurse_level, int print_rank_only) - { -- int upper_bound, lower_bound; -+ LONGEST upper_bound, lower_bound; - - /* No static variables are permitted as an error call may occur during - execution of this function. */ -@@ -196,7 +196,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, - { - lower_bound = f77_get_lowerbound (type); - if (lower_bound != 1) /* Not the default. */ -- fprintf_filtered (stream, "%d:", lower_bound); -+ fprintf_filtered (stream, "%s:", plongest (lower_bound)); - - /* Make sure that, if we have an assumed size array, we - print out a warning and print the upperbound as '*'. */ -@@ -206,7 +206,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, - else - { - upper_bound = f77_get_upperbound (type); -- fprintf_filtered (stream, "%d", upper_bound); -+ fprintf_filtered (stream, "%s", plongest (upper_bound)); - } - } - -@@ -278,7 +278,7 @@ void - f_type_print_base (struct type *type, struct ui_file *stream, int show, - int level) - { -- int upper_bound; -+ LONGEST upper_bound; - int index; - - QUIT; -@@ -370,7 +370,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show, - else - { - upper_bound = f77_get_upperbound (type); -- fprintf_filtered (stream, "character*%d", upper_bound); -+ fprintf_filtered (stream, "character*%s", plongest (upper_bound)); - } - break; - -diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c ---- a/gdb/f-valprint.c -+++ b/gdb/f-valprint.c -@@ -41,7 +41,7 @@ LONGEST f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; - /* Array which holds offsets to be applied to get a row's elements - for a given array. Array also holds the size of each subarray. */ - --int -+LONGEST - f77_get_lowerbound (struct type *type) - { - if (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED (type)) -@@ -50,7 +50,7 @@ f77_get_lowerbound (struct type *type) - return TYPE_ARRAY_LOWER_BOUND_VALUE (type); - } - --int -+LONGEST - f77_get_upperbound (struct type *type) - { - if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) diff --git a/gdb-rhbz795424-bitpos-arrayview.patch b/gdb-rhbz795424-bitpos-arrayview.patch deleted file mode 100644 index 73bce88..0000000 --- a/gdb-rhbz795424-bitpos-arrayview.patch +++ /dev/null @@ -1,60 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Sergio Durigan Junior -Date: Wed, 12 Sep 2018 00:02:17 -0400 -Subject: gdb-rhbz795424-bitpos-arrayview.patch - -;; This patch is needed to compile GDB after -Werror=narrowing has -;; been enabled by default. -;; Author: Sergio Durigan Junior. - -diff --git a/gdb/common/array-view.h b/gdb/common/array-view.h ---- a/gdb/common/array-view.h -+++ b/gdb/common/array-view.h -@@ -85,7 +85,7 @@ public: - using value_type = T; - using reference = T &; - using const_reference = const T &; -- using size_type = size_t; -+ using size_type = ULONGEST; - - /* Default construction creates an empty view. */ - constexpr array_view () noexcept -@@ -114,7 +114,7 @@ public: - count. */ - template>> -- constexpr array_view (U *array, size_t size) noexcept -+ constexpr array_view (U *array, ULONGEST size) noexcept - : m_array (array), m_size (size) - {} - -@@ -128,7 +128,7 @@ public: - {} - - /* Create an array view from an array. */ -- template>> - constexpr array_view (U (&array)[Size]) noexcept - : m_array (array), m_size (Size) -@@ -161,9 +161,9 @@ public: - /*constexpr14*/ T *end () noexcept { return m_array + m_size; } - constexpr const T *end () const noexcept { return m_array + m_size; } - -- /*constexpr14*/ reference operator[] (size_t index) noexcept -+ /*constexpr14*/ reference operator[] (ULONGEST index) noexcept - { return m_array[index]; } -- constexpr const_reference operator[] (size_t index) const noexcept -+ constexpr const_reference operator[] (ULONGEST index) const noexcept - { return m_array[index]; } - - constexpr size_type size () const noexcept { return m_size; } -@@ -196,7 +196,7 @@ operator== (const gdb::array_view &lhs, const gdb::array_view &rhs) - if (lhs.size () != rhs.size ()) - return false; - -- for (size_t i = 0; i < lhs.size (); i++) -+ for (ULONGEST i = 0; i < lhs.size (); i++) - if (!(lhs[i] == rhs[i])) - return false; - diff --git a/gdb-rhbz795424-bitpos-lazyvalue.patch b/gdb-rhbz795424-bitpos-lazyvalue.patch deleted file mode 100644 index d87e308..0000000 --- a/gdb-rhbz795424-bitpos-lazyvalue.patch +++ /dev/null @@ -1,432 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-rhbz795424-bitpos-lazyvalue.patch - -;; Fix `GDB cannot access struct member whose offset is larger than 256MB' -;; (RH BZ 795424). -;;=push - -diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.S b/gdb/testsuite/gdb.base/longest-types-64bit.S -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/longest-types-64bit.S -@@ -0,0 +1,249 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2012 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+ .file "longest-types-64bit.c" -+ .text -+.Ltext0: -+ .globl main -+main: -+ .comm f,8,8 -+.Letext0: -+ .file 1 "gdb.base/longest-types-64bit.c" -+ .section .debug_info,"",@progbits -+.Ldebug_info0: -+ .4byte 0x9a /* Length of Compilation Unit Info */ -+ .2byte 0x2 /* DWARF version number */ -+ .4byte .Ldebug_abbrev0 /* Offset Into Abbrev. Section */ -+ .byte 0x8 /* Pointer Size (in bytes) */ -+ .uleb128 0x1 /* (DIE (0xb) DW_TAG_compile_unit) */ -+ .4byte .LASF3 /* DW_AT_producer: "GNU C 4.7.3 20121109 (prerelease)" */ -+ .byte 0x1 /* DW_AT_language */ -+ .4byte .LASF4 /* DW_AT_name: "gdb.base/longest-types-64bit.c" */ -+ .4byte .LASF5 /* DW_AT_comp_dir: "" */ -+ .4byte .Ldebug_line0 /* DW_AT_stmt_list */ -+ .uleb128 0x2 /* (DIE (0x1d) DW_TAG_structure_type) */ -+ .ascii "foo\0" /* DW_AT_name */ -+ .4byte 0xff000002 /* DW_AT_byte_size */ -+ .byte 0x1 /* DW_AT_decl_file (gdb.base/longest-types-64bit.c) */ -+ .byte 0x12 /* DW_AT_decl_line */ -+ .4byte 0x4e /* DW_AT_sibling */ -+ .uleb128 0x3 /* (DIE (0x2c) DW_TAG_member) */ -+ .ascii "buf\0" /* DW_AT_name */ -+ .byte 0x1 /* DW_AT_decl_file (gdb.base/longest-types-64bit.c) */ -+ .byte 0x14 /* DW_AT_decl_line */ -+ .4byte 0x4e /* DW_AT_type */ -+ .byte 0x2 /* DW_AT_data_member_location */ -+ .byte 0x23 /* DW_OP_plus_uconst */ -+ .uleb128 0 -+ .uleb128 0x4 /* (DIE (0x3a) DW_TAG_member) */ -+ .4byte .LASF0 /* DW_AT_name: "buf2" */ -+ .byte 0x1 /* DW_AT_decl_file (gdb.base/longest-types-64bit.c) */ -+ .byte 0x15 /* DW_AT_decl_line */ -+ .4byte 0x73 /* DW_AT_type */ -+ .byte 0x7 /* DW_AT_data_member_location */ -+ .byte 0x23 /* DW_OP_plus_uconst */ -+ .uleb128 0xffff000000 -+ .byte 0 /* end of children of DIE 0x1d */ -+ .uleb128 0x5 /* (DIE (0x4e) DW_TAG_array_type) */ -+ .4byte 0x6c /* DW_AT_type */ -+ .4byte 0x65 /* DW_AT_sibling */ -+ .uleb128 0x6 /* (DIE (0x57) DW_TAG_subrange_type) */ -+ .4byte 0x65 /* DW_AT_type */ -+ .quad 0xfffeffffff /* DW_AT_upper_bound */ -+ .byte 0 /* end of children of DIE 0x4e */ -+ .uleb128 0x7 /* (DIE (0x65) DW_TAG_base_type) */ -+ .byte 0x8 /* DW_AT_byte_size */ -+ .byte 0x7 /* DW_AT_encoding */ -+ .4byte .LASF1 /* DW_AT_name: "sizetype" */ -+ .uleb128 0x7 /* (DIE (0x6c) DW_TAG_base_type) */ -+ .byte 0x1 /* DW_AT_byte_size */ -+ .byte 0x6 /* DW_AT_encoding */ -+ .4byte .LASF2 /* DW_AT_name: "char" */ -+ .uleb128 0x5 /* (DIE (0x73) DW_TAG_array_type) */ -+ .4byte 0x6c /* DW_AT_type */ -+ .4byte 0x83 /* DW_AT_sibling */ -+ .uleb128 0x8 /* (DIE (0x7c) DW_TAG_subrange_type) */ -+ .4byte 0x65 /* DW_AT_type */ -+ .byte 0x1 /* DW_AT_upper_bound */ -+ .byte 0 /* end of children of DIE 0x73 */ -+ .uleb128 0x9 /* (DIE (0x83) DW_TAG_variable) */ -+ .ascii "f\0" /* DW_AT_name */ -+ .byte 0x1 /* DW_AT_decl_file (gdb.base/longest-types-64bit.c) */ -+ .byte 0x16 /* DW_AT_decl_line */ -+ .4byte 0x97 /* DW_AT_type */ -+ .byte 0x1 /* DW_AT_external */ -+ .byte 0x9 /* DW_AT_location */ -+ .byte 0x3 /* DW_OP_addr */ -+ .quad f -+ .uleb128 0xa /* (DIE (0x97) DW_TAG_pointer_type) */ -+ .byte 0x8 /* DW_AT_byte_size */ -+ .4byte 0x1d /* DW_AT_type */ -+ .byte 0 /* end of children of DIE 0xb */ -+ .section .debug_abbrev,"",@progbits -+.Ldebug_abbrev0: -+ .uleb128 0x1 /* (abbrev code) */ -+ .uleb128 0x11 /* (TAG: DW_TAG_compile_unit) */ -+ .byte 0x1 /* DW_children_yes */ -+ .uleb128 0x25 /* (DW_AT_producer) */ -+ .uleb128 0xe /* (DW_FORM_strp) */ -+ .uleb128 0x13 /* (DW_AT_language) */ -+ .uleb128 0xb /* (DW_FORM_data1) */ -+ .uleb128 0x3 /* (DW_AT_name) */ -+ .uleb128 0xe /* (DW_FORM_strp) */ -+ .uleb128 0x1b /* (DW_AT_comp_dir) */ -+ .uleb128 0xe /* (DW_FORM_strp) */ -+ .uleb128 0x10 /* (DW_AT_stmt_list) */ -+ .uleb128 0x6 /* (DW_FORM_data4) */ -+ .byte 0 -+ .byte 0 -+ .uleb128 0x2 /* (abbrev code) */ -+ .uleb128 0x13 /* (TAG: DW_TAG_structure_type) */ -+ .byte 0x1 /* DW_children_yes */ -+ .uleb128 0x3 /* (DW_AT_name) */ -+ .uleb128 0x8 /* (DW_FORM_string) */ -+ .uleb128 0xb /* (DW_AT_byte_size) */ -+ .uleb128 0x6 /* (DW_FORM_data4) */ -+ .uleb128 0x3a /* (DW_AT_decl_file) */ -+ .uleb128 0xb /* (DW_FORM_data1) */ -+ .uleb128 0x3b /* (DW_AT_decl_line) */ -+ .uleb128 0xb /* (DW_FORM_data1) */ -+ .uleb128 0x1 /* (DW_AT_sibling) */ -+ .uleb128 0x13 /* (DW_FORM_ref4) */ -+ .byte 0 -+ .byte 0 -+ .uleb128 0x3 /* (abbrev code) */ -+ .uleb128 0xd /* (TAG: DW_TAG_member) */ -+ .byte 0 /* DW_children_no */ -+ .uleb128 0x3 /* (DW_AT_name) */ -+ .uleb128 0x8 /* (DW_FORM_string) */ -+ .uleb128 0x3a /* (DW_AT_decl_file) */ -+ .uleb128 0xb /* (DW_FORM_data1) */ -+ .uleb128 0x3b /* (DW_AT_decl_line) */ -+ .uleb128 0xb /* (DW_FORM_data1) */ -+ .uleb128 0x49 /* (DW_AT_type) */ -+ .uleb128 0x13 /* (DW_FORM_ref4) */ -+ .uleb128 0x38 /* (DW_AT_data_member_location) */ -+ .uleb128 0xa /* (DW_FORM_block1) */ -+ .byte 0 -+ .byte 0 -+ .uleb128 0x4 /* (abbrev code) */ -+ .uleb128 0xd /* (TAG: DW_TAG_member) */ -+ .byte 0 /* DW_children_no */ -+ .uleb128 0x3 /* (DW_AT_name) */ -+ .uleb128 0xe /* (DW_FORM_strp) */ -+ .uleb128 0x3a /* (DW_AT_decl_file) */ -+ .uleb128 0xb /* (DW_FORM_data1) */ -+ .uleb128 0x3b /* (DW_AT_decl_line) */ -+ .uleb128 0xb /* (DW_FORM_data1) */ -+ .uleb128 0x49 /* (DW_AT_type) */ -+ .uleb128 0x13 /* (DW_FORM_ref4) */ -+ .uleb128 0x38 /* (DW_AT_data_member_location) */ -+ .uleb128 0xa /* (DW_FORM_block1) */ -+ .byte 0 -+ .byte 0 -+ .uleb128 0x5 /* (abbrev code) */ -+ .uleb128 0x1 /* (TAG: DW_TAG_array_type) */ -+ .byte 0x1 /* DW_children_yes */ -+ .uleb128 0x49 /* (DW_AT_type) */ -+ .uleb128 0x13 /* (DW_FORM_ref4) */ -+ .uleb128 0x1 /* (DW_AT_sibling) */ -+ .uleb128 0x13 /* (DW_FORM_ref4) */ -+ .byte 0 -+ .byte 0 -+ .uleb128 0x6 /* (abbrev code) */ -+ .uleb128 0x21 /* (TAG: DW_TAG_subrange_type) */ -+ .byte 0 /* DW_children_no */ -+ .uleb128 0x49 /* (DW_AT_type) */ -+ .uleb128 0x13 /* (DW_FORM_ref4) */ -+ .uleb128 0x2f /* (DW_AT_upper_bound) */ -+ .uleb128 0x7 /* (DW_FORM_data8) */ -+ .byte 0 -+ .byte 0 -+ .uleb128 0x7 /* (abbrev code) */ -+ .uleb128 0x24 /* (TAG: DW_TAG_base_type) */ -+ .byte 0 /* DW_children_no */ -+ .uleb128 0xb /* (DW_AT_byte_size) */ -+ .uleb128 0xb /* (DW_FORM_data1) */ -+ .uleb128 0x3e /* (DW_AT_encoding) */ -+ .uleb128 0xb /* (DW_FORM_data1) */ -+ .uleb128 0x3 /* (DW_AT_name) */ -+ .uleb128 0xe /* (DW_FORM_strp) */ -+ .byte 0 -+ .byte 0 -+ .uleb128 0x8 /* (abbrev code) */ -+ .uleb128 0x21 /* (TAG: DW_TAG_subrange_type) */ -+ .byte 0 /* DW_children_no */ -+ .uleb128 0x49 /* (DW_AT_type) */ -+ .uleb128 0x13 /* (DW_FORM_ref4) */ -+ .uleb128 0x2f /* (DW_AT_upper_bound) */ -+ .uleb128 0xb /* (DW_FORM_data1) */ -+ .byte 0 -+ .byte 0 -+ .uleb128 0x9 /* (abbrev code) */ -+ .uleb128 0x34 /* (TAG: DW_TAG_variable) */ -+ .byte 0 /* DW_children_no */ -+ .uleb128 0x3 /* (DW_AT_name) */ -+ .uleb128 0x8 /* (DW_FORM_string) */ -+ .uleb128 0x3a /* (DW_AT_decl_file) */ -+ .uleb128 0xb /* (DW_FORM_data1) */ -+ .uleb128 0x3b /* (DW_AT_decl_line) */ -+ .uleb128 0xb /* (DW_FORM_data1) */ -+ .uleb128 0x49 /* (DW_AT_type) */ -+ .uleb128 0x13 /* (DW_FORM_ref4) */ -+ .uleb128 0x3f /* (DW_AT_external) */ -+ .uleb128 0xc /* (DW_FORM_flag) */ -+ .uleb128 0x2 /* (DW_AT_location) */ -+ .uleb128 0xa /* (DW_FORM_block1) */ -+ .byte 0 -+ .byte 0 -+ .uleb128 0xa /* (abbrev code) */ -+ .uleb128 0xf /* (TAG: DW_TAG_pointer_type) */ -+ .byte 0 /* DW_children_no */ -+ .uleb128 0xb /* (DW_AT_byte_size) */ -+ .uleb128 0xb /* (DW_FORM_data1) */ -+ .uleb128 0x49 /* (DW_AT_type) */ -+ .uleb128 0x13 /* (DW_FORM_ref4) */ -+ .byte 0 -+ .byte 0 -+ .byte 0 -+ .section .debug_aranges,"",@progbits -+ .4byte 0x1c /* Length of Address Ranges Info */ -+ .2byte 0x2 /* DWARF Version */ -+ .4byte .Ldebug_info0 /* Offset of Compilation Unit Info */ -+ .byte 0x8 /* Size of Address */ -+ .byte 0 /* Size of Segment Descriptor */ -+ .2byte 0 /* Pad to 16 byte boundary */ -+ .2byte 0 -+ .quad 0 -+ .quad 0 -+ .section .debug_line,"",@progbits -+.Ldebug_line0: -+ .section .debug_str,"MS",@progbits,1 -+.LASF4: -+ .string "gdb.base/longest-types-64bit.c" -+.LASF3: -+ .string "GNU C 4.7.3 20121109 (prerelease)" -+.LASF0: -+ .string "buf2" -+.LASF1: -+ .string "sizetype" -+.LASF5: -+ .string "" -+.LASF2: -+ .string "char" -+ .ident "GCC: (GNU) 4.7.3 20121109 (prerelease)" -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu b/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu -@@ -0,0 +1,67 @@ -+begin 755 gdb.base/longest-types-64bit.bz2 -+M0EIH.3%!62936<'N#OH`"G/________^______?_Y______//]7SQD5'^/_% -+M=VY7?F_[X`F]]SG7531-==V:Z-.FW;M.U7=';:UH@<&FD31,E3]J'HE-/TR@ -+M]4_5/32;%/U3]1--HU/U$#$R'I'J,FC0T-,)B'J#:CU,F@]0`/4:>F@CU/4, -+MA@$S2>IH!H`TR/0-$$:9`C(&FHU3VE-J;4\%,@>4T:#]49-J/4`>HT!H#3)^ -+MJ`!H-``T]0&@-```:'J``&@`:9!`R9,@&3(`#3!#0!H``-#$--`,@``T`T#( -+M:`:`&0&@::,0:-```:``-`E-$1#4-3:4]3R9-39(Q/)#3R-30:9#$T!D!H&@ -+M,CTGI!H#(#0T`#0``T`T`:``-``T`0,F3(!DR``TP0T`:``#0Q#30#(``-`- -+M`R&@&@!D!H&FC$&C0``&@`#0)%)H32>JGZ&!)Z1B1X@)DTVC4>H`&0:``R&@ -+M,C0:``T``,C0``!H``#(`T`:#0U^\?]7K8M.96V/2[?M*DC)>WIUF)H7T\$:KKRE&\Q -+M..M]L1*,!>D!X)RW,[,1I,9N%X-N&2+*:&)DJY4(VFQG%9K[/?J06WACF6-I -+MJ&JJ9,ZK4;X28M@[==%ME(A54:%>+3->MRK(G!8#TY>@E$6DR&<_5:C&/RZE -+MI,!E6#`;*8R*E@++*))U)[6=OKFM%'+$-H5\X@1D)_Y*"NKV. -+M&\F8?SXW^HQ:Y@(Q[.>PEG=]@^ -+M%C"3EZ/1X'H*02ZQH":6"@;8Z0LEW6)> -+M6^V=*`FB'5G4MD8L3J5XT#SW;J1]ZO+"SPIS%J(P46+Q=CC2$H-`-B&TD)M` -+M&A:066DA%AB0C6,460>M8B+$:-BR&@NM()F`S',,F8+#&0.SMOK@.G<'83N. -+MDA"#5-`JVC("1*TA;/M()&8J0+YH%IFV)+OA@4,`E?3M$[$@&Q`3]A!$&A(- -+M$PBT+2,@PU+2H9(T-H3N6'(2;""%2T*1I2P@`L?AG8&A!=31J7)1(9FB'8X= -+MWJ0S#YEG9K$.#.[L.[CNA"4JSJ^GK2*)UH=MC0.R8+E75'.09[G -+MMQ1*[GI:>#>K`_NZS:V6>$K;OX6#!!N'"2413$DTL&]7KY>B<3V5!!C8#X5+ -+MF%9X!8NOKM5 -+M+"N&P4.75C16!A9Q;:C.6N`WZDV=-]!,5PG]SNP[GV^L?YGI]7_'D8N?XV -+M'[7KZJWYVMXGBQS[`!)YI%3:D)I2!;%'R`W&YB<`9O2#F"C/)F;JK9P+@3&( -+MAH31[W)=YCODQDUKNM7A"3.C!2%CHTJNZ"Z\+#F-?(DLE>XAC%07B8;$%J_L -+MJPK48QC&,916=IM+<1&WRKLB6&Q2O79*!7S$,`7J8*!`!=K:5W550[NH9M#_ -+MKL!LT,&;59GZW7S"5Z4%`%&!`9"J9`0:IR&H=MTKT=PEYC$,4K90M9AT'%;_ -+MB0HVLE)(W&YWF,C:TURXO:`M[RX(A-GT97456Q4Z*HPU*4J:*[WU-4GD.9UV -+MSA#L4X[[*Y+)8IF.EO<.TP4IC2?(4HX)W1#:GOMOD2F;HM1BV#;PH[ -+M7:PJ-!#,!6N<3')-0C,>15'IZ>@U^CJJJ+>+>%%)%BBATD\)*F6&BLMIR&?\ -+MQ2_?33@"NR1/CN\:)>5DG6`>$;$3QA94'-3]*CU6YG])<=2)'GC"RP-RK&-3 -+MZDT-M_)R+F06DS?CR>E@^!,33"U6X<@OXO$Q>U$\T@IU'@T=>K`G7H8K5GLXMS3*^@JLVBHHE'.&?9RKC?Y`&&3J5!/C$++<@U#Q' -+M9R3I.$+S`%]-.UO>WH^C73F<&;RIJR+(Q@7(3PP*W[-O,,DD3S7BUK^I@D%* -+M`Y<*2TXJ&7;2'6'R.U>]0-="M`K+&N%/==N4U@9%@M1)U&251C($^S"WL"]T -+M-XN'D2[II3-$K%+&`3['O)%,8G*E%_8RV6A5B_4(2/?-AIC.\/>,YFJ<(G.8 -+MAVP?UN*=ME:7&T!C%)I:&4H:-5>&^!&0>A.O'0G'/6&ZZ964@04&=#DC`%&: -+MUNLOS?,?'T:T!8L80='M:96K4;JX)6.('1#J$.1/L)$IS<4/*'2D34 -+M/@J\BA(I2T40JS%9G8F!7U5_!#'U!+[7$ES&)@:*QAET-IBX6'_N5^7/#>@V -+MN3&,-6(AG[8&!8LV+F_U"W?/)+Y^,;=1K:SW28<0WA2"UPHP^8FG#R$!`Y`, -+MLF<`U*NNU\[6N03"*?I8D=K7.Z*H=A_37;S=LVC(BQ,58Q_\#G`'P*_-]T!G4$`V0BS]'S)D/;V7R?.2F?SF)N+2+#P2_G(49TCE&*UIVT-MP808VTVV-$(*`VT<%>%96AHOL`(7%SI2%-R -+M#G2F02VQQH-7KT3E05I9Z)E\$Y8ED1KU`(4QHT%B]1$F:F1&8DAN.Q4&*?F@ -+M.8D965.$PRHT5HD,G=G!KTF3D -+M94"&ZA-F,.19=8`\(Q;A07Q%!19*3#*F9Q+D(0K@V87@O.=7EJIM6`!4`>D! -+M)49QHA!BV+:4O@K00$$!5*6>A@2@4D)@R\"%$2F"O:24J*L(RP#N;O4K7I&2 -+M[#)KR47H-N[VJ%3>$`9,AF8QID&I3G+D`*]BX98B$2K":A7_\ -+M_]7LT!4,$NL5)NE>9[:MK2_/'GO:7"P`=P(\L]O?"-APH(834$,W!IJS+U1F1C.!D$!&KS^-6%F90PQ[F]F=$^QE\X+- -+M@.W*LPH_78B>MHH@69RU[*'1J@8QAC\KSV@IG\(;_CUW:ZR2.,0$E3LZ_^P= -+M<_DCP"Q<`;+_;YP#^U%&E^#2M%,T?F3UN^>TSH)GFL"\%RF[KNZ+[R+@<&.$ -+MC42)B96\1-.O_I).K7)X]W>EQ):4C(XB*+:S%0_37D^EBP+1HU(D?3"%_O2R -+M6-#X>AU#<$*!/,W6QC^;O^%]LR&_X'<8X$<3CUU_QFAJ;">H)2443GD4W!4# -+?<55!2^6_8J$)-O<>\H0U/6Q^>UG0%W)%.%"0P>X.^@`` -+` -+end -diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.c b/gdb/testsuite/gdb.base/longest-types-64bit.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/longest-types-64bit.c -@@ -0,0 +1,28 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2012 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+struct foo -+{ -+ char buf[0xffff000000]; -+ char buf2[2]; -+} *f; -+ -+int -+main (void) -+{ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.base/longest-types-64bit.exp b/gdb/testsuite/gdb.base/longest-types-64bit.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/longest-types-64bit.exp -@@ -0,0 +1,59 @@ -+# This testcase is part of GDB, the GNU debugger. -+ -+# Copyright 2012 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+standard_testfile .c longest-types-64bit.S -+ -+proc test { name } { with_test_prefix $name { -+ # 64-bit array size should not overflow -+ gdb_test "print &f->buf" {= \(char \(\*\)\[1099494850560\]\) 0x0} -+ -+ # The offset should not overflow -+ gdb_test "print &f->buf2" {= \(char \(\*\)\[2\]\) 0xffff000000} -+}} -+ -+ -+# Test 64-bit file first as it is not compiled so its compilation never fails. -+ -+set file64bitbz2uu ${srcdir}/${subdir}/${testfile}.bz2.uu -+set file64bit [standard_output_file ${testfile}] -+ -+if {[catch "system \"uudecode -o - ${file64bitbz2uu} | bzip2 -dc >${file64bit}\""] != 0} { -+ untested "failed uudecode or bzip2" -+ return -1 -+} -+file stat ${file64bit} file64bitstat -+if {$file64bitstat(size) != 9501} { -+ untested "uudecode or bzip2 produce invalid result" -+ return -1 -+} -+ -+clean_restart ${file64bit} -+ -+#if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile2 {nodebug}] } { -+# return -1 -+#} -+ -+test "64bit" -+ -+ -+# And here is the native build test. -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {debug quiet}] } { -+ return -1 -+} -+ -+test "native" diff --git a/gdb-runtest-pie-override.patch b/gdb-runtest-pie-override.patch index a0b3863..c4b3782 100644 --- a/gdb-runtest-pie-override.patch +++ b/gdb-runtest-pie-override.patch @@ -25,7 +25,7 @@ a problem with make -j parallelization of the testsuite. 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 @@ diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp 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} { } } diff --git a/gdb-s390-handle-arch13.diff b/gdb-s390-handle-arch13.diff deleted file mode 100644 index 4dd7d95..0000000 --- a/gdb-s390-handle-arch13.diff +++ /dev/null @@ -1,168 +0,0 @@ -commit 6d9d6da48e84a65871a9d72fa785105d603990a6 -Author: Andreas Arnez -Date: Wed Oct 9 11:09:22 2019 +0200 - - s390: Add record/replay support for arch13 instructions - - Enable recording most of the new "arch13" instructions on z/Architecture - targets, except for the specialized-function-assist instructions: - - SORTL - sort lists - DFLTCC - deflate conversion call - KDSA - compute digital signature authentication - - gdb/ChangeLog: - - * s390-tdep.c (390_process_record): Handle new arch13 instructions - except SORTL, DFLTCC, and KDSA. - -diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c -index 463c0a0..e7f1215 100644 ---- a/gdb/s390-tdep.c -+++ b/gdb/s390-tdep.c -@@ -4134,6 +4134,7 @@ ex: - case 0xb998: /* ALCR - add logical with carry */ - case 0xb999: /* SLBR - subtract logical with borrow */ - case 0xb9f4: /* NRK - and */ -+ case 0xb9f5: /* NCRK - and with complement */ - case 0xb9f6: /* ORK - or */ - case 0xb9f7: /* XRK - xor */ - case 0xb9f8: /* ARK - add */ -@@ -4166,20 +4167,32 @@ ex: - case 0xb919: /* SGFR - subtract */ - case 0xb91a: /* ALGFR - add logical */ - case 0xb91b: /* SLGFR - subtract logical */ -+ case 0xb964: /* NNGRK - and 64 bit */ -+ case 0xb965: /* OCGRK - or with complement 64 bit */ -+ case 0xb966: /* NOGRK - or 64 bit */ -+ case 0xb967: /* NXGRK - not exclusive or 64 bit */ -+ case 0xb974: /* NNRK - and 32 bit */ -+ case 0xb975: /* OCRK - or with complement 32 bit */ -+ case 0xb976: /* NORK - or 32 bit */ -+ case 0xb977: /* NXRK - not exclusive or 32 bit */ - case 0xb980: /* NGR - and */ - case 0xb981: /* OGR - or */ - case 0xb982: /* XGR - xor */ - case 0xb988: /* ALCGR - add logical with carry */ - case 0xb989: /* SLBGR - subtract logical with borrow */ -+ case 0xb9c0: /* SELFHR - select high */ - case 0xb9e1: /* POPCNT - population count */ - case 0xb9e4: /* NGRK - and */ -+ case 0xb9e5: /* NCGRK - and with complement */ - case 0xb9e6: /* OGRK - or */ - case 0xb9e7: /* XGRK - xor */ - case 0xb9e8: /* AGRK - add */ - case 0xb9e9: /* SGRK - subtract */ - case 0xb9ea: /* ALGRK - add logical */ -+ case 0xb9e3: /* SELGR - select 64 bit */ - case 0xb9eb: /* SLGRK - subtract logical */ - case 0xb9ed: /* MSGRKC - multiply single 64x64 -> 64 */ -+ case 0xb9f0: /* SELR - select 32 bit */ - case 0xb9fd: /* MSRKC - multiply single 32x32 -> 32 */ - /* 64-bit gpr destination + flags */ - if (s390_record_gpr_g (gdbarch, regcache, inib[6])) -@@ -4555,7 +4568,13 @@ ex: - return -1; - break; - -- /* 0xb932-0xb93b undefined */ -+ /* 0xb932-0xb937 undefined */ -+ -+ /* 0xb938 unsupported: SORTL - sort lists */ -+ /* 0xb939 unsupported: DFLTCC - deflate conversion call */ -+ /* 0xb93a unsupported: KDSA - compute dig. signature auth. */ -+ -+ /* 0xb93b undefined */ - - case 0xb93c: /* PPNO - perform pseudorandom number operation [partial] */ - regcache_raw_read_unsigned (regcache, S390_R1_REGNUM, &tmp); -@@ -5485,6 +5504,13 @@ ex: - /* 0xe3ce undefined */ - /* 0xe3d0-0xe3ff undefined */ - -+ case 0xe601: /* VLEBRH - vector load byte reversed element */ -+ case 0xe602: /* VLEBRG - vector load byte reversed element */ -+ case 0xe603: /* VLEBRF - vector load byte reversed element */ -+ case 0xe604: /* VLLEBRZ - vector load byte rev. el. and zero */ -+ case 0xe605: /* VLBRREP - vector load byte rev. el. and replicate */ -+ case 0xe606: /* VLBR - vector load byte reversed elements */ -+ case 0xe607: /* VLER - vector load elements reversed */ - case 0xe634: /* VPKZ - vector pack zoned */ - case 0xe635: /* VLRL - vector load rightmost with immed. length */ - case 0xe637: /* VLRLR - vector load rightmost with length */ -@@ -5547,6 +5573,9 @@ ex: - case 0xe77f: /* VSRAB - vector shift right arithmetic by byte */ - case 0xe784: /* VPDI - vector permute doubleword immediate */ - case 0xe785: /* VBPERM - vector bit permute */ -+ case 0xe786: /* VSLD - vector shift left double by bit */ -+ case 0xe787: /* VSRD - vector shift right double by bit */ -+ case 0xe78b: /* VSTRS - vector string search */ - case 0xe78c: /* VPERM - vector permute */ - case 0xe78d: /* VSEL - vector select */ - case 0xe78e: /* VFMS - vector fp multiply and subtract */ -@@ -5575,10 +5604,10 @@ ex: - case 0xe7bc: /* VGFMA - vector Galois field multiply sum and accumulate */ - case 0xe7bd: /* VSBCBI - vector subtract with borrow compute borrow indication */ - case 0xe7bf: /* VSBI - vector subtract with borrow indication */ -- case 0xe7c0: /* VCLGD - vector convert to logical 64-bit */ -- case 0xe7c1: /* VCDLG - vector convert from logical 64-bit */ -- case 0xe7c2: /* VCGD - vector convert to fixed 64-bit */ -- case 0xe7c3: /* VCDG - vector convert from fixed 64-bit */ -+ case 0xe7c0: /* VCLFP - vector fp convert to logical */ -+ case 0xe7c1: /* VCFPL - vector fp convert from logical */ -+ case 0xe7c2: /* VCSFP - vector fp convert to fixed */ -+ case 0xe7c3: /* VCFPS - vector fp convert from fixed */ - case 0xe7c4: /* VLDE/VFLL - vector fp load lengthened */ - case 0xe7c5: /* VLED/VFLR - vector fp load rounded */ - case 0xe7c7: /* VFI - vector load fp integer */ -@@ -5629,6 +5658,7 @@ ex: - return -1; - break; - -+ case 0xe609: /* VSTEBRH - vector store byte reversed element */ - case 0xe709: /* VSTEH - vector store element */ - oaddr = s390_record_calc_disp (gdbarch, regcache, inib[3], insn[1], 0); - if (record_full_arch_list_add_mem (oaddr, 2)) -@@ -5637,6 +5667,7 @@ ex: - return -1; - break; - -+ case 0xe60a: /* VSTEBRG - vector store byte reversed element */ - case 0xe70a: /* VSTEG - vector store element */ - oaddr = s390_record_calc_disp (gdbarch, regcache, inib[3], insn[1], 0); - if (record_full_arch_list_add_mem (oaddr, 8)) -@@ -5645,6 +5676,7 @@ ex: - return -1; - break; - -+ case 0xe60b: /* VSTEBRF - vector store byte reversed element */ - case 0xe70b: /* VSTEF - vector store element */ - oaddr = s390_record_calc_disp (gdbarch, regcache, inib[3], insn[1], 0); - if (record_full_arch_list_add_mem (oaddr, 4)) -@@ -5655,6 +5687,8 @@ ex: - - /* 0xe70c-0xe70d undefined */ - -+ case 0xe60e: /* VSTBR - vector store byte reversed elements */ -+ case 0xe60f: /* VSTER - vector store elements reversed */ - case 0xe70e: /* VST - vector store */ - oaddr = s390_record_calc_disp (gdbarch, regcache, inib[3], insn[1], 0); - if (record_full_arch_list_add_mem (oaddr, 16)) -@@ -6234,7 +6268,16 @@ ex: - /* SSE/SIL-format instruction */ - switch (insn[0]) - { -- /* 0xe500-0xe543 undefined, privileged, or unsupported */ -+ /* 0xe500-0xe509 undefined, privileged, or unsupported */ -+ -+ case 0xe50a: /* MVCRL - move right to left */ -+ regcache_raw_read_unsigned (regcache, S390_R0_REGNUM, &tmp); -+ oaddr = s390_record_calc_disp (gdbarch, regcache, 0, insn[1], 0); -+ if (record_full_arch_list_add_mem (oaddr, (tmp & 0xff) + 1)) -+ return -1; -+ break; -+ -+ /* 0xe50b-0xe543 undefined, privileged, or unsupported */ - - case 0xe544: /* MVHHI - move */ - oaddr = s390_record_calc_disp (gdbarch, regcache, 0, insn[1], 0); diff --git a/gdb-symtab-prefer-var-def-over-decl.patch b/gdb-symtab-prefer-var-def-over-decl.patch deleted file mode 100644 index 5cd4b87..0000000 --- a/gdb-symtab-prefer-var-def-over-decl.patch +++ /dev/null @@ -1,232 +0,0 @@ -[gdb/symtab] Prefer var def over decl - -Consider the DWARF as generated by gcc with the tentative patch to fix gcc -PR91507 - "wrong debug for completed array with previous incomplete -declaration": -... - <1>: Abbrev Number: 2 (DW_TAG_array_type) - DW_AT_type : <0xff> - DW_AT_sibling : <0xff> - <2>: Abbrev Number: 3 (DW_TAG_subrange_type) - <2>: Abbrev Number: 0 - <1>: Abbrev Number: 4 (DW_TAG_pointer_type) - <100> DW_AT_byte_size : 8 - <101> DW_AT_type : <0x105> - <1><105>: Abbrev Number: 5 (DW_TAG_base_type) - <106> DW_AT_byte_size : 1 - <107> DW_AT_encoding : 6 (signed char) - <108> DW_AT_name : (indirect string, offset: 0x19f): char - <1><10c>: Abbrev Number: 6 (DW_TAG_variable) - <10d> DW_AT_name : zzz - <111> DW_AT_decl_file : 1 - <112> DW_AT_decl_line : 1 - <113> DW_AT_decl_column : 14 - <114> DW_AT_type : <0xf4> - <118> DW_AT_external : 1 - <118> DW_AT_declaration : 1 - <1><118>: Abbrev Number: 2 (DW_TAG_array_type) - <119> DW_AT_type : <0xff> - <11d> DW_AT_sibling : <0x128> - <1><12f>: Abbrev Number: 8 (DW_TAG_variable) - <130> DW_AT_specification: <0x10c> - <134> DW_AT_decl_line : 2 - <135> DW_AT_decl_column : 7 - <136> DW_AT_type : <0x118> - <13a> DW_AT_location : 9 byte block: 3 30 10 60 0 0 0 0 0 (DW_OP_addr: 601030) -... - -The DWARF will result in two entries in the symbol table, a decl with type -char *[] and a def with type char*[2]. - -When trying to print the value of zzz: -... -$ gdb a.spec.out -batch -ex "p zzz" -... -the decl (rather than the def) will be found in the symbol table, which is -missing the location information, and consequently we get: -... -$1 = 0x601030 -... - -[ There is a fallback mechanism that finds the address of the variable in the -minimal symbol table, but that's not used here, because the type of the decl -does not specify a size. We could use the symbol size here to get the size -of the type, but that's currently not done: PR exp/24989. Still, fixing that -PR would not fix the generic case, where minimal symbol info is not -available. ] - -Fix this by preferring defs over decls when searching in the symbol table. - -Build and reg-tested on x86_64-linux. - -[ The test-case is a bit simpler than the DWARF example listed above, because -the new variable varval3 that is used is not listed in the minimal symbols, so -there's no need to work around the fallback mechanism to trigger the problem. ] - -gdb/ChangeLog: - -2019-09-10 Tom de Vries - - PR symtab/24971 - * block.c (best_symbol, better_symbol): New function. - (block_lookup_symbol_primary): Prefer def over decl. - -gdb/testsuite/ChangeLog: - -2019-09-10 Tom de Vries - - * gdb.dwarf2/varval.exp: Add decl before def test. - -Change-Id: Id92326cb8ef9903b121ef9e320658eb565d0f5a9 - ---- - gdb/block.c | 68 +++++++++++++++++++++++++++++++++++-- - gdb/testsuite/gdb.dwarf2/varval.exp | 28 +++++++++++++-- - 2 files changed, 92 insertions(+), 4 deletions(-) - -diff --git a/gdb/block.c b/gdb/block.c -index 3192b33e9e9..37f9d4f8d21 100644 ---- a/gdb/block.c -+++ b/gdb/block.c -@@ -726,6 +726,43 @@ block_lookup_symbol (const struct block *block, const char *name, - } - } - -+/* Return true if symbol A is the best match possible for DOMAIN. */ -+ -+static bool -+best_symbol (struct symbol *a, const domain_enum domain) -+{ -+ return (SYMBOL_DOMAIN (a) == domain -+ && SYMBOL_CLASS (a) != LOC_UNRESOLVED); -+} -+ -+/* Return symbol B if it is a better match than symbol A for DOMAIN. -+ Otherwise return A. */ -+ -+static struct symbol * -+better_symbol (struct symbol *a, struct symbol *b, const domain_enum domain) -+{ -+ if (a == NULL) -+ return b; -+ if (b == NULL) -+ return a; -+ -+ if (SYMBOL_DOMAIN (a) == domain -+ && SYMBOL_DOMAIN (b) != domain) -+ return a; -+ if (SYMBOL_DOMAIN (b) == domain -+ && SYMBOL_DOMAIN (a) != domain) -+ return b; -+ -+ if (SYMBOL_CLASS (a) != LOC_UNRESOLVED -+ && SYMBOL_CLASS (b) == LOC_UNRESOLVED) -+ return a; -+ if (SYMBOL_CLASS (b) != LOC_UNRESOLVED -+ && SYMBOL_CLASS (a) == LOC_UNRESOLVED) -+ return b; -+ -+ return a; -+} -+ - /* See block.h. */ - - struct symbol * -@@ -747,7 +784,34 @@ block_lookup_symbol_primary (const struct block *block, const char *name, - sym != NULL; - sym = mdict_iter_match_next (lookup_name, &mdict_iter)) - { -- if (SYMBOL_DOMAIN (sym) == domain) -+ /* With the fix for PR gcc/debug/91507, we get for: -+ ... -+ extern char *zzz[]; -+ char *zzz[ ] = { -+ "abc", -+ "cde" -+ }; -+ ... -+ DWARF which will result in two entries in the symbol table, a decl -+ with type char *[] and a def with type char *[2]. -+ -+ If we return the decl here, we don't get the value of zzz: -+ ... -+ $ gdb a.spec.out -batch -ex "p zzz" -+ $1 = 0x601030 -+ ... -+ because we're returning the symbol without location information, and -+ because the fallback that uses the address from the minimal symbols -+ doesn't work either because the type of the decl does not specify a -+ size. -+ -+ To fix this, we prefer def over decl in best_symbol and -+ better_symbol. -+ -+ In absence of the gcc fix, both def and decl have type char *[], so -+ the only option to make this work is improve the fallback to use the -+ size of the minimal symbol. Filed as PR exp/24989. */ -+ if (best_symbol (sym, domain)) - return sym; - - /* This is a bit of a hack, but symbol_matches_domain might ignore -@@ -756,7 +820,7 @@ block_lookup_symbol_primary (const struct block *block, const char *name, - exactly the same domain. PR 16253. */ - if (symbol_matches_domain (SYMBOL_LANGUAGE (sym), - SYMBOL_DOMAIN (sym), domain)) -- other = sym; -+ other = better_symbol (other, sym, domain); - } - - return other; -diff --git a/gdb/testsuite/gdb.dwarf2/varval.exp b/gdb/testsuite/gdb.dwarf2/varval.exp -index 4711f4a24ae..fa3d90eb3d9 100644 ---- a/gdb/testsuite/gdb.dwarf2/varval.exp -+++ b/gdb/testsuite/gdb.dwarf2/varval.exp -@@ -51,7 +51,7 @@ Dwarf::assemble ${asm_file} { - var_b_label var_c_label var_p_label var_bad_label \ - varval_label var_s_label var_untyped_label \ - var_a_abstract_label var_a_concrete_label \ -- varval2_label -+ varval2_label varval3_decl_label varval3_def_label - - set int_size [get_sizeof "int" -1] - -@@ -165,6 +165,18 @@ Dwarf::assemble ${asm_file} { - {DW_AT_location {DW_OP_addr [gdb_target_symbol "var_b"]} SPECIAL_expr} - } - -+ varval3_decl_label: DW_TAG_variable { -+ {DW_AT_name "varval3"} -+ {DW_AT_type :${int_label}} -+ {DW_AT_external 1 DW_FORM_flag} -+ {DW_AT_declaration 1 DW_FORM_flag} -+ } -+ varval3_def_label: DW_TAG_variable { -+ {DW_AT_name "varval3"} -+ {DW_AT_external 1 DW_FORM_flag} -+ {DW_AT_type :${int_label}} -+ {DW_AT_location {DW_OP_addr [gdb_target_symbol "var_a"]} SPECIAL_expr} -+ } - DW_TAG_subprogram { - {MACRO_AT_func { "main" "${srcdir}/${subdir}/${srcfile}" }} - {DW_AT_type :${int_label}} -@@ -274,7 +286,19 @@ if ![runto_main] { - } - - gdb_test "print varval" "= 8" --gdb_test "print varval2" "= 8" -+#gdb_test "print varval2" "= 8" -+set test "print varval2" -+set pass_pattern "= 8" -+set kfail_pattern "value has been optimized out" -+gdb_test_multiple $test "" { -+ -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { -+ pass $test -+ } -+ -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" { -+ kfail gdb/24515 $test -+ } -+} -+gdb_test "print varval3" "= 8" - gdb_test "print constval" "= 53" - gdb_test "print mixedval" "= 42" - gdb_test "print pointerval" "= \\(int \\*\\) $hex " diff --git a/gdb-testsuite-8.3-kfail-xfail-unsupported.patch b/gdb-testsuite-8.3-kfail-xfail-unsupported.patch deleted file mode 100644 index dd82e3a..0000000 --- a/gdb-testsuite-8.3-kfail-xfail-unsupported.patch +++ /dev/null @@ -1,948 +0,0 @@ -- [gdb/testsuite] Add -early pattern flag for gdb_test_multiple -- [gdb/testsuite] Mark watchthreads-reorder.exp FAIL as KFAIL -- [gdb/testsuite] Allow some tests in gdb.base/restore.exp to be unsupported -- [gdb/testsuite] Allow some tests in gdb.base/store.exp to be unsupported -- [gdb/testsuite] Require gnatmake 8 for gdb.ada/rename_subscript_param.exp -- [gdb/tdep] Handle mxcsr kernel bug on Intel Skylake CPUs -- [gdb/testsuite] Add KFAIL for missing support of reverse-debugging of vmovd -- [gdb/testsuite] Fix incomplete regexps in step-precsave.exp -- [gdb/testsuite] Add KFAIL for missing support of reverse-debugging xsave ------------------------------------------------------------- -[gdb/testsuite] Add -early pattern flag for gdb_test_multiple - -[ https://sourceware.org/ml/gdb-patches/2019-09/msg00600.html ] - -Proc gdb_test_multiple builds up and executes a gdb_expect expression with -pattern/action clauses. The clauses are either implicit (added by -gdb_test_multiple) or explicit (passed via the gdb_test_multiple parameter -user_code). - -However, there are a few implicit clauses which are inserted before the -explicit ones, making sure those take precedence. - -Add an -early pattern flag for a gdb_test_multiple user_code clause to specify -that the clause needs to be inserted before any implicit clause. - -Tested on x86_64-linux. - -gdb/testsuite/ChangeLog: - -2019-09-12 Tom de Vries - - * lib/gdb.exp (gdb_test_multiple): Handle -early pattern flag. - ------------------------------------------------------------- -[gdb/testsuite] Mark watchthreads-reorder.exp FAIL as KFAIL - -[ https://sourceware.org/ml/gdb-patches/2019-09/msg00221.html ] - -When running gdb.threads/watchthreads-reorder.exp in parallel with: -... -$ n=$(grep -c processor /proc/cpuinfo); n=$((($n + 1) / 2)); stress -c $n -... -there's a reasonable change to trigger an internal gdb error: -... -$ for n in $(seq 1 10); do ./test.sh; done 2>&1 \ - | grep "expected passes" \ - | sort \ - | uniq -c - 1 # of expected passes 14 - 2 # of expected passes 15 - 1 # of expected passes 16 - 6 # of expected passes 17 -... -which look like this in gdb.sum: -... -FAIL: gdb.threads/watchthreads-reorder.exp: reorder1: continue to breakpoint: \ - break-at-exit (GDB internal error) -... - -This FAIL is filed as PR gdb/24995 and fixed on master by commit c29705b71a -"Fix internal error and improve 'set debug infrun 1'/target wait kind trace". - -Mark this as KFAIL for the 8.3 branch. - -It's trivial to do this by adding a setup_kfail: -... -+ setup_kfail gdb/24995 "*-*-*" - gdb_continue_to_breakpoint "break-at-exit" ".*break-at-exit.*" -... -but we'll get a fair amount of KPASSES: -... -KPASS: gdb.threads/watchthreads-reorder.exp: reorder0: \ - continue to breakpoint: break-at-exit (PRMS gdb/24995) -KPASS: gdb.threads/watchthreads-reorder.exp: reorder1: \ - continue to breakpoint: break-at-exit (PRMS gdb/24995) -... - -Instead, do this more precise by only KFAILing in case the internal error is -detected. - -Tested on x86_64-linux. - -gdb/testsuite/ChangeLog: - -2019-09-12 Tom de Vries - - * gdb.threads/watchthreads-reorder.exp: Add PR gdb/24995 KFAIL. - ------------------------------------------------------------- -[gdb/testsuite] Allow some tests in gdb.base/restore.exp to be unsupported - -[ Backport of master commit 77d036789aa. ] - -We currently run into: -... -248 n = callee1 (n + l5); -(gdb) PASS: gdb.base/restore.exp: caller5 calls callee1; return callee now -print l1 -$51 = -(gdb) FAIL: gdb.base/restore.exp: caller5 calls callee1; return restored l1 \ - to 32492 -... - -The problem is that we try to access the value of l1 in function caller5, but -variable l1 has no DW_AT_location attribute. Since l1 is declared using the -register keyword, it's valid for gcc to emit no DW_AT_location at -O0. - -Change the FAIL into an UNSUPPORTED. - -Tested on x86_64-linux. - -gdb/testsuite/ChangeLog: - -2019-09-22 Tom de Vries - - * gdb.base/restore.exp: Allow register variables to be optimized out at - -O0. - ------------------------------------------------------------- -[gdb/testsuite] Allow some tests in gdb.base/store.exp to be unsupported - -[ Backport of master commit 25e5c20918a. ] - -The test-case gdb.base/store.exp fails with gcc 7.4.0: -... -nr of unexpected failures 27 -... - -The first FAIL: -... -110 l = add_float (l, r); -(gdb) PASS: gdb.base/store.exp: continue to wack_float -print l -$21 = -FAIL: gdb.base/store.exp: var float l; print old l, expecting -1 -... -relates to this bit in the test-case (compiled at -O0): -... - 106 float - 107 wack_float (register float u, register float v) - 108 { - 109 register float l = u, r = v; - 110 l = add_float (l, r); - 111 return l + r; - 112 } -... -and it expects to be able to read and modify variable l before executing line -110, but it already fails to read the value, because l has no DW_AT_location -attribute in the debug info. - -Variable l is declared with the register keyword, and GCC implements the -register keyword at -O0 like so: -... -the compiler allocates distinct stack memory for all variables that do not -have the register storage-class specifier; if register is specified, the -variable may have a shorter lifespan than the code would indicate and may -never be placed in memory. -... - -The fact that l has no DW_AT_location attribute, matches with the documented -"variable may have a shorter lifespan that code would indicate", (though it -is the most extreme case of it) so the gcc behaviour is valid. We can of -course improve gcc to generate better debuginfo (filed gcc PR91611), but -this not a wrong-debug problem. - -[ The test-case passes with gcc 4.2.1, but for the failing test discussed -above, it passes simply because it doesn't store l in a register. ] - -With the debug info missing for l, reading and setting l is unsupported, so -fix the FAIL by marking the test UNSUPPORTED instead. - -Tested on x86_64-linux. - -gdb/testsuite/ChangeLog: - -2019-09-12 Tom de Vries - - * gdb.base/store.exp: Allow register variables to be optimized out at - -O0. - ------------------------------------------------------------- -[gdb/testsuite] Require gnatmake 8 for gdb.ada/rename_subscript_param.exp - -[ Backport of master commit d1b70248bde. ] - -When running gdb.ada/rename_subscript_param.exp with gnatmake 7.4.1, we get: -... -FAIL: gdb.ada/rename_subscript_param.exp: print rename_subscript_param_b \ - before changing its value -FAIL: gdb.ada/rename_subscript_param.exp: print rename_subscript_param_b \ - after changing its value -... - -The commit last touching the test-case (afcfda091e) states: -... - The test still fails with old compilers that do not properly - generate debug info for this renaming: -... - -Fix this by requiring at least gnatmake 8 for the test-case. - -Tested on x86_64-linux. - -gdb/testsuite/ChangeLog: - -2019-09-14 Tom de Vries - - PR teststuite/24599 - * gdb.ada/rename_subscript_param.exp: Require gnatmake 8. - * lib/ada.exp (gnatmake_version_at_least): New proc. - ------------------------------------------------------------- -[gdb/tdep] Handle mxcsr kernel bug on Intel Skylake CPUs - -[ Backport of master commit 3d4352200e3. ] - -On my openSUSE Leap 15.1 x86_64 Skylake system with the default (4.12) kernel, -I run into: -... -FAIL: gdb.base/gcore.exp: corefile restored all registers -... - -The problem is that there's a difference in the mxcsr register value before -and after the gcore command: -... -- mxcsr 0x0 [ ] -+ mxcsr 0x400440 [ DAZ OM ] -... - -This can be traced back to amd64_linux_nat_target::fetch_registers, where -xstateregs is partially initialized by the ptrace call: -... - char xstateregs[X86_XSTATE_MAX_SIZE]; - struct iovec iov; - - amd64_collect_xsave (regcache, -1, xstateregs, 0); - iov.iov_base = xstateregs; - iov.iov_len = sizeof (xstateregs); - if (ptrace (PTRACE_GETREGSET, tid, - (unsigned int) NT_X86_XSTATE, (long) &iov) < 0) - perror_with_name (_("Couldn't get extended state status")); - - amd64_supply_xsave (regcache, -1, xstateregs); -... -after which amd64_supply_xsave is called. - -The amd64_supply_xsave call is supposed to only use initialized parts of -xstateregs, but due to a kernel bug on intel skylake (fixed from 4.14 onwards -by commit 0852b374173b "x86/fpu: Add FPU state copying quirk to handle XRSTOR -failure on Intel Skylake CPUs") it can happen that the mxcsr part of -xstateregs is not initialized, while amd64_supply_xsave expects it to be -initialized, which explains the FAIL mentioned above. - -Fix the undetermined behaviour by initializing xstateregs before calling -ptrace, which makes sure we get a 0x0 for mxcsr when this kernel bug occurs, -and which also happens to fix the FAIL. - -Furthermore, add an xfail for this FAIL which triggers the same kernel bug: -... -FAIL: gdb.arch/amd64-init-x87-values.exp: check_setting_mxcsr_before_enable: \ - check new value of MXCSR is still in place -... - -Both FAILs pass when using a 5.3 kernel instead on the system mentioned above. - -Tested on x86_64-linux. - -gdb/ChangeLog: - -2019-09-24 Tom de Vries - - PR gdb/23815 - * amd64-linux-nat.c (amd64_linux_nat_target::fetch_registers): - Initialize xstateregs before ptrace PTRACE_GETREGSET call. - -gdb/testsuite/ChangeLog: - -2019-09-24 Tom de Vries - - PR gdb/24598 - * gdb.arch/amd64-init-x87-values.exp: Add xfail. - ------------------------------------------------------------- -[gdb/testsuite] Add KFAIL for missing support of reverse-debugging of vmovd - -[ Backport of master commit 68f7d34dd50. ] - -On my openSUSE Leap 15.1 system I run into: -... -(gdb) PASS: gdb.reverse/step-precsave.exp: turn on process record -break 76^M -Breakpoint 2 at 0x400654: file step-reverse.c, line 76.^M -(gdb) PASS: gdb.reverse/step-precsave.exp: breakpoint at end of main -continue^M -Continuing.^M -Process record does not support instruction 0xc5 at address 0x7ffff783fc70.^M -Process record: failed to record execution log.^M -^M -Program stopped.^M -0x00007ffff783fc70 in __memset_avx2_unaligned_erms () from /lib64/libc.so.6^M -(gdb) FAIL: gdb.reverse/step-precsave.exp: run to end of main -... - -The problem is that the vmovd instruction is not supported in -reverse-debugging (PR record/23188). - -Add a KFAIL for this PR. - -Tested on x86_64-linux. - -gdb/testsuite/ChangeLog: - -2019-09-27 Tom de Vries - - PR record/23188 - * gdb.reverse/step-precsave.exp: Add kfail for PR record/23188. - ------------------------------------------------------------- -[gdb/testsuite] Fix incomplete regexps in step-precsave.exp - -[ Backport of master commit 060b3ab4eda. ] - -The commit 68f7d34dd50 "[gdb/testsuite] Add KFAIL for missing support of -reverse-debugging of vmovd" rewrites a gdb_test into a gdb_test_multiple but -forgets to add the $gdb_prompt part in the regexp. - -Add the missing parts of the regexps. - -Tested on x86_64-linux. - -gdb/testsuite/ChangeLog: - -2019-09-27 Tom de Vries - - * gdb.reverse/step-precsave.exp: Add missing $gdb_prompt in regexps. - ------------------------------------------------------------- -[gdb/testsuite] Add KFAIL for missing support of reverse-debugging xsave - -[ https://sourceware.org/ml/gdb-patches/2019-09/msg00557.html ] - -Normally the gdb.reverse/*.exp test-cases pass on my system (apart from the -record/23188 KFAIL for gdb.reverse/step-precsave.exp). But when specifying -GLIBC_TUNABLES=glibc.tune.hwcaps=-XSAVEC_Usable to force glibc to use -_dl_runtime_resolve_xsave instead of _dl_runtime_resolve_xsavec, we run into -1054 FAILs like this: -... -(gdb) PASS: gdb.reverse/sigall-reverse.exp: b gen_HUP -continue^M -Continuing.^M -Process record does not support instruction 0xfae64 at address \ - 0x7ffff7ded958.^M -Process record: failed to record execution log.^M -^M -Program stopped.^M -0x00007ffff7ded958 in _dl_runtime_resolve_xsave () from \ - /lib64/ld-linux-x86-64.so.2^M -(gdb) FAIL: gdb.reverse/sigall-reverse.exp: get signal ABRT -... - -The problem is that the xsave instruction is not supported in -reverse-debugging (PR record/25038). - -Add KFAILs for this PR. - -Tested on x86_64-linux. - -gdb/testsuite/ChangeLog: - -2019-09-27 Tom de Vries - - PR record/25038 - * gdb.reverse/sigall-precsave.exp: Add PR record/25038 KFAIL. - * gdb.reverse/sigall-reverse.exp: Same. - * gdb.reverse/solib-precsave.exp: Same. - * gdb.reverse/solib-reverse.exp: Same. - * gdb.reverse/step-precsave.exp: Same. - * gdb.reverse/until-precsave.exp: Same. - * gdb.reverse/until-reverse.exp: Same. - * lib/gdb.exp (gdb_continue_to_breakpoint): Same. - ------------------------------------------------------------- -diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index 3d5f8726f7f..5f1bc4d84b7 100644 ---- a/gdb/testsuite/lib/gdb.exp -+++ b/gdb/testsuite/lib/gdb.exp -@@ -798,37 +798,44 @@ proc gdb_test_multiple { command message user_code } { - set subst_code [uplevel list $subst_code] - - set processed_code "" -+ set early_processed_code "" -+ set current_list processed_code - set patterns "" - set expecting_action 0 - set expecting_arg 0 - foreach item $user_code subst_item $subst_code { - if { $item == "-n" || $item == "-notransfer" || $item == "-nocase" } { -- lappend processed_code $item -+ lappend $current_list $item - continue - } - if { $item == "-indices" || $item == "-re" || $item == "-ex" } { -- lappend processed_code $item -+ lappend $current_list $item -+ continue -+ } -+ if { $item == "-early" } { -+ set current_list early_processed_code - continue - } - if { $item == "-timeout" || $item == "-i" } { - set expecting_arg 1 -- lappend processed_code $item -+ lappend $current_list $item - continue - } - if { $expecting_arg } { - set expecting_arg 0 -- lappend processed_code $subst_item -+ lappend $current_list $subst_item - continue - } - if { $expecting_action } { -- lappend processed_code "uplevel [list $item]" -+ lappend $current_list "uplevel [list $item]" - set expecting_action 0 - # Cosmetic, no effect on the list. -- append processed_code "\n" -+ append $current_list "\n" -+ set current_list processed_code - continue - } - set expecting_action 1 -- lappend processed_code $subst_item -+ lappend $current_list $subst_item - if {$patterns != ""} { - append patterns "; " - } -@@ -891,7 +898,8 @@ proc gdb_test_multiple { command message user_code } { - } - } - -- set code { -+ set code $early_processed_code -+ append code { - -re ".*A problem internal to GDB has been detected" { - fail "$message (GDB internal error)" - gdb_internal_error_resync -diff --git a/gdb/testsuite/gdb.threads/watchthreads-reorder.exp b/gdb/testsuite/gdb.threads/watchthreads-reorder.exp -index 9bbbb6f2b8b..2e90870087d 100644 ---- a/gdb/testsuite/gdb.threads/watchthreads-reorder.exp -+++ b/gdb/testsuite/gdb.threads/watchthreads-reorder.exp -@@ -90,5 +90,19 @@ foreach reorder {0 1} { with_test_prefix "reorder$reorder" { - # found in the DEBUG_INFRUN code path. - gdb_test "set debug infrun 1" - -- gdb_continue_to_breakpoint "break-at-exit" ".*break-at-exit.*" -+ # Do: -+ # gdb_continue_to_breakpoint "break-at-exit" ".*break-at-exit.*" -+ # with setup_kfail. -+ set msg "continue to breakpoint: break-at-exit" -+ set pass_pattern "(?:Breakpoint|Temporary breakpoint) .* (at|in) .*break-at-exit.*" -+ set kfail_pattern "internal-error: inferior\\* find_inferior_pid\\(int\\): Assertion .pid != 0. failed\\." -+ gdb_test_multiple "continue" $msg { -+ -early -re "$kfail_pattern" { -+ setup_kfail gdb/24995 "*-*-*" -+ exp_continue -+ } -+ -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { -+ pass $msg -+ } -+ } - }} -diff --git a/gdb/testsuite/gdb.base/restore.exp b/gdb/testsuite/gdb.base/restore.exp -index 947fe58be47..56c2f5e3dce 100644 ---- a/gdb/testsuite/gdb.base/restore.exp -+++ b/gdb/testsuite/gdb.base/restore.exp -@@ -73,8 +73,17 @@ proc restore_tests { } { - # they should be. - for {set var 1} {$var <= $c} {incr var} { - set expected [expr 0x7eeb + $var] -- gdb_test "print l$var" " = $expected" \ -- "caller$c calls callee$e; return restored l$var to $expected" -+ set test "caller$c calls callee$e; return restored l$var to $expected" -+ set pass_pattern " = $expected" -+ set unsupported_pattern " = " -+ gdb_test_multiple "print l$var" $test { -+ -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { -+ pass $test -+ } -+ -re "\[\r\n\]*(?:$unsupported_pattern)\[\r\n\]+$gdb_prompt $" { -+ unsupported $test -+ } -+ } - } - } - } -diff --git a/gdb/testsuite/gdb.base/store.exp b/gdb/testsuite/gdb.base/store.exp -index c5a7584101a..9c19ce15a7b 100644 ---- a/gdb/testsuite/gdb.base/store.exp -+++ b/gdb/testsuite/gdb.base/store.exp -@@ -55,18 +55,29 @@ proc check_set { t l r new add } { - } - } - -- gdb_test "print l" " = ${l}" \ -- "${prefix}; print old l, expecting ${l}" -- gdb_test "print r" " = ${r}" \ -- "${prefix}; print old r, expecting ${r}" -- gdb_test_no_output "set variable l = 4" \ -- "${prefix}; setting l to 4" -- gdb_test "print l" " = ${new}" \ -- "${prefix}; print new l, expecting ${new}" -- gdb_test "next" "return l \\+ r;" \ -- "${prefix}; next over add call" -- gdb_test "print l" " = ${add}" \ -- "${prefix}; print incremented l, expecting ${add}" -+ set supported 1 -+ set test "${prefix}; print old l, expecting ${l}" -+ gdb_test_multiple "print l" "$test" { -+ -re " = \r\n$gdb_prompt $" { -+ unsupported $test -+ set supported 0 -+ } -+ -re " = ${l}\r\n$gdb_prompt $" { -+ pass $test -+ } -+ } -+ if { $supported } { -+ gdb_test "print r" " = ${r}" \ -+ "${prefix}; print old r, expecting ${r}" -+ gdb_test_no_output "set variable l = 4" \ -+ "${prefix}; setting l to 4" -+ gdb_test "print l" " = ${new}" \ -+ "${prefix}; print new l, expecting ${new}" -+ gdb_test "next" "return l \\+ r;" \ -+ "${prefix}; next over add call" -+ gdb_test "print l" " = ${add}" \ -+ "${prefix}; print incremented l, expecting ${add}" -+ } - } - - check_set "charest" "-1 .*" "-2 .*" "4 ..004." "2 ..002." -@@ -81,20 +92,34 @@ check_set "doublest" "-1" "-2" "4" "2" - # - - proc up_set { t l r new } { -+ global gdb_prompt -+ - set prefix "upvar ${t} l" - gdb_test "tbreak add_${t}" - gdb_test "continue" "return u . v;" \ - "continue to add_${t}" - gdb_test "up" "l = add_${t} .l, r.;" \ - "${prefix}; up" -- gdb_test "print l" " = ${l}" \ -- "${prefix}; print old l, expecting ${l}" -- gdb_test "print r" " = ${r}" \ -- "${prefix}; print old r, expecting ${r}" -- gdb_test_no_output "set variable l = 4" \ -- "${prefix}; set l to 4" -- gdb_test "print l" " = ${new}" \ -- "${prefix}; print new l, expecting ${new}" -+ -+ set supported 1 -+ set test "${prefix}; print old l, expecting ${l}" -+ gdb_test_multiple "print l" "$test" { -+ -re " = \r\n$gdb_prompt $" { -+ unsupported $test -+ set supported 0 -+ } -+ -re " = ${l}\r\n$gdb_prompt $" { -+ pass $test -+ } -+ } -+ if { $supported } { -+ gdb_test "print r" " = ${r}" \ -+ "${prefix}; print old r, expecting ${r}" -+ gdb_test_no_output "set variable l = 4" \ -+ "${prefix}; set l to 4" -+ gdb_test "print l" " = ${new}" \ -+ "${prefix}; print new l, expecting ${new}" -+ } - } - - up_set "charest" "-1 .*" "-2 .*" "4 ..004." -diff --git a/gdb/testsuite/gdb.ada/rename_subscript_param.exp b/gdb/testsuite/gdb.ada/rename_subscript_param.exp -index ffcfa50df33..fd8208825a0 100644 ---- a/gdb/testsuite/gdb.ada/rename_subscript_param.exp -+++ b/gdb/testsuite/gdb.ada/rename_subscript_param.exp -@@ -15,6 +15,10 @@ - - load_lib "ada.exp" - -+if { ![gnatmake_version_at_least 8] } { -+ return -1 -+} -+ - standard_ada_testfile pb30_012 - - if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } { -diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp -index ee9ade16ae5..b10558811fb 100644 ---- a/gdb/testsuite/lib/ada.exp -+++ b/gdb/testsuite/lib/ada.exp -@@ -78,3 +78,23 @@ proc standard_ada_testfile {base_file {dir ""}} { - set srcfile $srcdir/$subdir/$testdir/$testfile.adb - set binfile [standard_output_file $testfile] - } -+ -+# Return 1 if gnatmake is at least version $MAJOR.x.x -+ -+proc gnatmake_version_at_least { major } { -+ set gnatmake [gdb_find_gnatmake] -+ set gnatmake [lindex [split $gnatmake] 0] -+ set output [exec $gnatmake --version] -+ if { [regexp {GNATMAKE ([^ .]+).([^ .]+).([^ .]+)} $output \ -+ match gnatmake_major gnatmake_minor gnatmake_micro] } { -+ if { $gnatmake_major >= $major } { -+ return 1 -+ } else { -+ return 0 -+ } -+ } -+ -+ # Unknown, return 1 -+ return 1 -+} -+ -diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c -index 8d0e8eb35cd..b56917c2bc6 100644 ---- a/gdb/amd64-linux-nat.c -+++ b/gdb/amd64-linux-nat.c -@@ -238,6 +238,12 @@ amd64_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum) - char xstateregs[X86_XSTATE_MAX_SIZE]; - struct iovec iov; - -+ /* Pre-4.14 kernels have a bug (fixed by commit 0852b374173b -+ "x86/fpu: Add FPU state copying quirk to handle XRSTOR failure on -+ Intel Skylake CPUs") that sometimes causes the mxcsr location in -+ xstateregs not to be copied by PTRACE_GETREGSET. Make sure that -+ the location is at least initialized with a defined value. */ -+ memset (xstateregs, 0, sizeof (xstateregs)); - iov.iov_base = xstateregs; - iov.iov_len = sizeof (xstateregs); - if (ptrace (PTRACE_GETREGSET, tid, -diff --git a/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp b/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp -index cdf92dcd377..5fd18dbb794 100644 ---- a/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp -+++ b/gdb/testsuite/gdb.arch/amd64-init-x87-values.exp -@@ -116,7 +116,7 @@ proc_with_prefix check_x87_regs_around_init {} { - # nop that does not enable any FP features). Finally check that the - # mxcsr register still has the value we set. - proc_with_prefix check_setting_mxcsr_before_enable {} { -- global binfile -+ global binfile gdb_prompt - - clean_restart ${binfile} - -@@ -127,7 +127,22 @@ proc_with_prefix check_setting_mxcsr_before_enable {} { - - gdb_test_no_output "set \$mxcsr=0x9f80" "set a new value for MXCSR" - gdb_test "stepi" "fwait" "step forward one instruction for mxcsr test" -- gdb_test "p/x \$mxcsr" " = 0x9f80" "check new value of MXCSR is still in place" -+ -+ set test "check new value of MXCSR is still in place" -+ set pass_pattern " = 0x9f80" -+ # Pre-4.14 kernels have a bug (fixed by commit 0852b374173b "x86/fpu: -+ # Add FPU state copying quirk to handle XRSTOR failure on Intel Skylake -+ # CPUs") that causes mxcsr not to be copied, in which case we get 0 instead of -+ # the just saved value. -+ set xfail_pattern " = 0x0" -+ gdb_test_multiple "p/x \$mxcsr" $test { -+ -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { -+ pass $test -+ } -+ -re "\[\r\n\]*(?:$xfail_pattern)\[\r\n\]+$gdb_prompt $" { -+ xfail $test -+ } -+ } - } - - # Start the test file, all FP features will be disabled. Set new -diff --git a/gdb/testsuite/gdb.reverse/step-precsave.exp b/gdb/testsuite/gdb.reverse/step-precsave.exp -index 7443995c007..f5e15510e1f 100644 ---- a/gdb/testsuite/gdb.reverse/step-precsave.exp -+++ b/gdb/testsuite/gdb.reverse/step-precsave.exp -@@ -46,7 +46,15 @@ gdb_test "break $end_of_main" \ - - # This can take awhile. - with_timeout_factor 20 { -- gdb_test "continue" "Breakpoint .* end of main .*" "run to end of main" -+ set test "run to end of main" -+ gdb_test_multiple "continue" $test { -+ -re "Breakpoint .* end of main .*" { -+ pass $test -+ } -+ -re "Process record does not support instruction 0xc5 at.*$gdb_prompt $" { -+ kfail "record/23188" $test -+ } -+ } - } - - # So can this, against gdbserver, for example. -diff --git a/gdb/testsuite/gdb.reverse/step-precsave.exp b/gdb/testsuite/gdb.reverse/step-precsave.exp -index f5e15510e1f..2073b8a1542 100644 ---- a/gdb/testsuite/gdb.reverse/step-precsave.exp -+++ b/gdb/testsuite/gdb.reverse/step-precsave.exp -@@ -47,11 +47,13 @@ gdb_test "break $end_of_main" \ - # This can take awhile. - with_timeout_factor 20 { - set test "run to end of main" -+ set pass_pattern "Breakpoint .* end of main .*" -+ set kfail_pattern "Process record does not support instruction 0xc5 at.*" - gdb_test_multiple "continue" $test { -- -re "Breakpoint .* end of main .*" { -+ -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { - pass $test - } -- -re "Process record does not support instruction 0xc5 at.*$gdb_prompt $" { -+ -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" { - kfail "record/23188" $test - } - } -diff --git a/gdb/testsuite/gdb.reverse/sigall-precsave.exp b/gdb/testsuite/gdb.reverse/sigall-precsave.exp -index 79a1e7282b6..ccdfde407fc 100644 ---- a/gdb/testsuite/gdb.reverse/sigall-precsave.exp -+++ b/gdb/testsuite/gdb.reverse/sigall-precsave.exp -@@ -258,14 +258,20 @@ foreach sig $signals { - } - } - --gdb_test_multiple "continue" "continue" { -+set kfail_pattern "Process record does not support instruction 0xfae64 at.*" -+set test "run to end of main" -+gdb_test_multiple "continue" $test { - -re "Breakpoint .* end of main .*$gdb_prompt $" { -- pass "run to end of main" -+ pass $test - } - -re "Breakpoint .* handle_.*$gdb_prompt $" { - send_gdb "continue\n" - exp_continue - } -+ -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" { -+ kfail "gdb/25038" $test -+ return -1 -+ } - } - - delete_breakpoints -@@ -289,8 +295,12 @@ set sig_supported 1 - set thissig "ABRT" - - # test signal handling -+set record_instruction_kfail 0 - foreach sig [lrange $signals 1 end] { - test_one_sig $sig -+ if { $record_instruction_kfail } { -+ return -1 -+ } - } - - # The last signal (SIGTERM) gets handled slightly differently because -diff --git a/gdb/testsuite/gdb.reverse/sigall-reverse.exp b/gdb/testsuite/gdb.reverse/sigall-reverse.exp -index c734fe8e17a..884a00c5dcf 100644 ---- a/gdb/testsuite/gdb.reverse/sigall-reverse.exp -+++ b/gdb/testsuite/gdb.reverse/sigall-reverse.exp -@@ -37,6 +37,7 @@ proc test_one_sig {nextsig} { - global sig_supported - global gdb_prompt - global thissig -+ global record_instruction_kfail - - set this_sig_supported $sig_supported - gdb_test "handle SIG$thissig stop print" \ -@@ -51,6 +52,7 @@ proc test_one_sig {nextsig} { - setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu" - } - set testmsg "get signal $thissig" -+ set kfail_pattern "Process record does not support instruction 0xfae64 at.*" - gdb_test_multiple "continue" $testmsg { - -re "Program received signal SIG$thissig.*handle_$thissig.*$gdb_prompt $" { - fail "$testmsg (wrong location)" -@@ -62,6 +64,11 @@ proc test_one_sig {nextsig} { - xfail $testmsg - set need_another_continue 0 - } -+ -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" { -+ kfail "gdb/25038" "$testmsg" -+ set record_instruction_kfail 1 -+ return -+ } - } - } - -@@ -237,8 +244,12 @@ set sig_supported 1 - set thissig "ABRT" - - # test signal handling -+set record_instruction_kfail 0 - foreach sig [lrange $signals 1 end] { - test_one_sig $sig -+ if { $record_instruction_kfail } { -+ return -1 -+ } - } - - # The last signal (SIGTERM) gets handled slightly differently because -diff --git a/gdb/testsuite/gdb.reverse/solib-precsave.exp b/gdb/testsuite/gdb.reverse/solib-precsave.exp -index 574d79816db..a3f874c09b7 100644 ---- a/gdb/testsuite/gdb.reverse/solib-precsave.exp -+++ b/gdb/testsuite/gdb.reverse/solib-precsave.exp -@@ -91,7 +91,18 @@ gdb_test "break $end_of_main" \ - "Breakpoint $decimal at .*$srcfile, line $end_of_main\." \ - "breakpoint at end of main" - --gdb_test "continue" "Breakpoint .* end of main .*" "run to end of main" -+set test "run to end of main" -+set pass_pattern "Breakpoint .* end of main .*" -+set kfail_pattern "Process record does not support instruction 0xfae64 at.*" -+gdb_test_multiple "continue" $test { -+ -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { -+ pass $test -+ } -+ -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" { -+ kfail "gdb/25038" $test -+ return -1 -+ } -+} - - gdb_test "record save $precsave" \ - "Saved core file $precsave with execution log\." \ -diff --git a/gdb/testsuite/gdb.reverse/solib-reverse.exp b/gdb/testsuite/gdb.reverse/solib-reverse.exp -index 77c321388b4..53b35239f81 100644 ---- a/gdb/testsuite/gdb.reverse/solib-reverse.exp -+++ b/gdb/testsuite/gdb.reverse/solib-reverse.exp -@@ -86,7 +86,18 @@ if [supports_process_record] { - - set end_part_one [gdb_get_line_number " end part one" "$srcfile"] - set end_part_two [gdb_get_line_number " end part two" "$srcfile"] --gdb_test "until $end_part_one" " end part one.*" "run until end part one" -+set test "run until end part one" -+set pass_pattern " end part one.*" -+set kfail_pattern "Process record does not support instruction 0xfae64 at.*" -+gdb_test_multiple "until $end_part_one" $test { -+ -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { -+ pass $test -+ } -+ -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" { -+ kfail "gdb/25038" $test -+ return -1 -+ } -+} - - gdb_test "reverse-step" " shr1 three .*" "reverse-step third shr1" - gdb_test "reverse-step" " shr1 two .*" "reverse-step second shr1" -diff --git a/gdb/testsuite/gdb.reverse/step-precsave.exp b/gdb/testsuite/gdb.reverse/step-precsave.exp -index 2073b8a1542..72ee279f806 100644 ---- a/gdb/testsuite/gdb.reverse/step-precsave.exp -+++ b/gdb/testsuite/gdb.reverse/step-precsave.exp -@@ -49,6 +49,7 @@ with_timeout_factor 20 { - set test "run to end of main" - set pass_pattern "Breakpoint .* end of main .*" - set kfail_pattern "Process record does not support instruction 0xc5 at.*" -+ set kfail2_pattern "Process record does not support instruction 0xfae64 at.*" - gdb_test_multiple "continue" $test { - -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { - pass $test -@@ -56,6 +57,9 @@ with_timeout_factor 20 { - -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" { - kfail "record/23188" $test - } -+ -re "\[\r\n\]*(?:$kfail2_pattern)\[\r\n\]+$gdb_prompt $" { -+ kfail "record/25038" $test -+ } - } - } - -diff --git a/gdb/testsuite/gdb.reverse/until-precsave.exp b/gdb/testsuite/gdb.reverse/until-precsave.exp -index baf21ab7ad2..1f09df193fd 100644 ---- a/gdb/testsuite/gdb.reverse/until-precsave.exp -+++ b/gdb/testsuite/gdb.reverse/until-precsave.exp -@@ -50,7 +50,18 @@ gdb_test "break $end_of_main" \ - - # This can take awhile. - with_timeout_factor 20 { -- gdb_test "continue" "Breakpoint .* set breakpoint 10a here .*" "run to end of main" -+ set test "run to end of main" -+ set pass_pattern "Breakpoint .* set breakpoint 10a here .*" -+ set kfail_pattern "Process record does not support instruction 0xfae64 at.*" -+ gdb_test_multiple "continue" $test { -+ -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { -+ pass $test -+ } -+ -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" { -+ kfail "gdb/25038" $test -+ return -1 -+ } -+ } - } - - # So can this, against gdbserver, for example. -diff --git a/gdb/testsuite/gdb.reverse/until-reverse.exp b/gdb/testsuite/gdb.reverse/until-reverse.exp -index 2e26de3ce7b..804e07f46ca 100644 ---- a/gdb/testsuite/gdb.reverse/until-reverse.exp -+++ b/gdb/testsuite/gdb.reverse/until-reverse.exp -@@ -49,9 +49,18 @@ gdb_test "until $bp_location1" \ - - # Advance up to factorial, outer invocation - # --gdb_test "advance factorial" \ -- "factorial .value=6..*$srcfile:$bp_location7.*" \ -- "advance to factorial" -+set test "advance to factorial" -+set pass_pattern "factorial .value=6..*$srcfile:$bp_location7.*" -+set kfail_pattern "Process record does not support instruction 0xfae64 at.*" -+gdb_test_multiple "advance factorial" $test { -+ -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { -+ pass "$test" -+ } -+ -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" { -+ kfail "gdb/25038" $test -+ return -1 -+ } -+} - - # At this point, 'until' should continue the inferior up to when all the - # inner invocations of factorial() are completed and we are back at this -diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index 5f1bc4d84b7..0d5447dd10c 100644 ---- a/gdb/testsuite/lib/gdb.exp -+++ b/gdb/testsuite/lib/gdb.exp -@@ -633,10 +633,14 @@ proc gdb_continue_to_breakpoint {name {location_pattern .*}} { - global gdb_prompt - set full_name "continue to breakpoint: $name" - -+ set kfail_pattern "Process record does not support instruction 0xfae64 at.*" - gdb_test_multiple "continue" $full_name { - -re "(?:Breakpoint|Temporary breakpoint) .* (at|in) $location_pattern\r\n$gdb_prompt $" { - pass $full_name - } -+ -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" { -+ kfail "gdb/25038" $full_name -+ } - } - } - diff --git a/gdb-testsuite-add-missing-initial-prompt-read-in-multidictionary.exp.patch b/gdb-testsuite-add-missing-initial-prompt-read-in-multidictionary.exp.patch deleted file mode 100644 index 7c5c319..0000000 --- a/gdb-testsuite-add-missing-initial-prompt-read-in-multidictionary.exp.patch +++ /dev/null @@ -1,59 +0,0 @@ -[gdb/testsuite] Add missing initial prompt read in multidictionary.exp - -When running multidictionary.exp in conjunction with: -... -$ stress -c $(($(cat /proc/cpuinfo | grep -c "^processor") + 1)) -... -we get: -... -Running gdb/testsuite/gdb.dwarf2/multidictionary.exp ... -ERROR: Couldn't load multidictionary into gdb. - - === gdb Summary === - -nr of unresolved testcases 1 -... - -The multidictionary test-case needs -readnow, and achieves this using: -... -gdb_spawn_with_cmdline_opts "-readnow" -gdb_load -... -but the initial gdb prompt is not read. Usually, the following gdb_load -command accidentally consumes that initial prompt (at the gdb_expect for the -kill command in gdb_file_cmd). But under high load, that doesn't happen and -we run into the error. - -Fix this by consuming the initial gdb prompt after spawning gdb. - -Tested on x86_64-linux. - -gdb/testsuite/ChangeLog: - -2019-07-23 Tom de Vries - - PR testsuite/24842 - * gdb.dwarf2/multidictionary.exp: Consume initial prompt after - gdb_spawn_with_cmdline_opts. - ---- - gdb/testsuite/gdb.dwarf2/multidictionary.exp | 6 ++++++ - 2 files changed, 12 insertions(+) - -diff --git a/gdb/testsuite/gdb.dwarf2/multidictionary.exp b/gdb/testsuite/gdb.dwarf2/multidictionary.exp -index 5588ef2144..c307ed8adc 100644 ---- a/gdb/testsuite/gdb.dwarf2/multidictionary.exp -+++ b/gdb/testsuite/gdb.dwarf2/multidictionary.exp -@@ -148,6 +148,12 @@ if {[build_executable $testfile.exp $testfile [list $asm_file $srcfile] {}] \ - - # We force the DIEs above to be read in via "-readnow". - gdb_spawn_with_cmdline_opts "-readnow" -+set test "initial prompt" -+gdb_test_multiple "" $test { -+ -re ".*$gdb_prompt $" { -+ pass "$test" -+ } -+} - gdb_load $binfile - - # All we need to do is check whether GDB is alive. Without diff --git a/gdb-testsuite-i386-pkru-exp.patch b/gdb-testsuite-i386-pkru-exp.patch deleted file mode 100644 index ddf720f..0000000 --- a/gdb-testsuite-i386-pkru-exp.patch +++ /dev/null @@ -1,47 +0,0 @@ -commit 1512d3b7b9de3a1943623f2e1f373459d5d80a98 -Author: Tom de Vries -Date: Fri Jul 26 21:49:45 2019 +0200 - - [gdb/testsuite] Fix unterminated string in i386-pkru.exp - - I ran into this error: - ... - ERROR: tcl error sourcing gdb/testsuite/gdb.arch/i386-pkru.exp. - ERROR: missing " - while executing - "untested "" - invoked from within - "if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ - [list debug additional_flags=${comp_flags}]] } { - untested "failed to c..." - (file "gdb/testsuite/gdb.arch/i386-pkru.exp" line 25) - invoked from within - ... - caused by: - ... - untested "failed to compile x86 PKEYS test. - ... - - Fix the unterminated string. - - Tested on x86_64-linux. - - gdb/testsuite/ChangeLog: - - 2019-07-26 Tom de Vries - - * gdb.arch/i386-pkru.exp: Fix unterminated string. - -diff --git a/gdb/testsuite/gdb.arch/i386-pkru.exp b/gdb/testsuite/gdb.arch/i386-pkru.exp -index 7a2c65799e..db271522f0 100644 ---- a/gdb/testsuite/gdb.arch/i386-pkru.exp -+++ b/gdb/testsuite/gdb.arch/i386-pkru.exp -@@ -24,7 +24,7 @@ set comp_flags "-I${srcdir}/../nat/" - - if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ - [list debug additional_flags=${comp_flags}]] } { -- untested "failed to compile x86 PKEYS test. -+ untested "failed to compile x86 PKEYS test." - return -1 - } - diff --git a/gdb-testsuite-pie-no-pie.patch b/gdb-testsuite-pie-no-pie.patch deleted file mode 100644 index ddb6e09..0000000 --- a/gdb-testsuite-pie-no-pie.patch +++ /dev/null @@ -1,397 +0,0 @@ -- Testsuite: Remove pie from trace tests -- [gdb/testsuite] Fail in gdb_compile if nopie results in PIE executable -- [gdb/testsuite] Fail in gdb_compile if pie results in non-PIE executable - ---------------------------------------------------------- - -[gdb/testsuite] Fail in gdb_compile if pie results in non-PIE executable - -When running gdb.base/break-idempotent.exp with ---target_board=unix/-fno-PIE/-no-pie, we get: -... -nr of expected passes 140 -... - -The test-case is compiled once with nopie and once with pie, but in both cases -we end up with a non-PIE executable. The "-fno-PIE -no-pie" options specified -using the target_board are interpreted by dejagnu as multilib_flags, and end up -overriding the pie flags. - -Fix this by checking in gdb_compile if the resulting exec is non-PIE despite of -a pie setting, and if so return an error: -... -Running gdb/testsuite/gdb.base/break-idempotent.exp ... -gdb compile failed, pie failed to generate PIE executable - - === gdb Summary === - -nr of expected passes 70 -nr of untested testcases 1 -... - -Tested on x86_64-linux. - -gdb/testsuite/ChangeLog: - -2019-08-05 Tom de Vries - - * lib/gdb.exp (version_at_least): Factor out of ... - (tcl_version_at_least): ... here. - (gdb_compile): Fail if pie results in non-PIE executable. - (readelf_version, readelf_prints_pie): New proc. - (exec_is_pie): Return -1 if unknown. - ---------------------------------------------------------- - -[gdb/testsuite] Fail in gdb_compile if nopie results in PIE executable - -When running gdb.base/dump.exp with --target_board=unix/-fPIE/-pie, we get: -... -Running gdb/testsuite/gdb.base/dump.exp ... -FAIL: gdb.base/dump.exp: dump array as value, intel hex -... - -The FAIL happens because although the test specifies nopie, the exec is -in fact compiled as PIE. The "-fPIE -pie" options specified using the -target_board are interpreted by dejagnu as multilib_flags, and end up -overriding the nopie flags. - -Fix this by checking in gdb_compile if the resulting exec is PIE despite of -a nopie setting, and if so return an error: -... -Running gdb/testsuite/gdb.base/dump.exp ... -gdb compile failed, nopie failed to prevent PIE executable - - === gdb Summary === - -nr of untested testcases 1 -... - -Tested on x86_64-linux. - -gdb/testsuite/ChangeLog: - -2019-07-30 Tom de Vries - - PR testsuite/24834 - * lib/gdb.exp (gdb_compile): Fail if nopie results in PIE executable. - (exec_is_pie): New proc. - ---------------------------------------------------------- - -Testsuite: Remove pie from trace tests - -Ubuntu/Debian defaults PIE to enabled. This causes the trace tests -to fall over due to variables being returned as "unavailable". The -tests were never designed to work with pie. - -Simply ensure the nopie flag is always used for the failing tests. - -This removes 100+ failures when running native-gdbserver on Ubuntu 18.04. - -gdb/testsuite/ChangeLog: - - * gdb.trace/backtrace.exp: Use nopie flag. - * gdb.trace/circ.exp: Likewise. - * gdb.trace/collection.exp: Likewise. - * gdb.trace/ftrace.exp: Likewise. - * gdb.trace/mi-trace-unavailable.exp: Likewise. - * gdb.trace/mi-traceframe-changed.exp: Likewise. - * gdb.trace/qtro.exp: Likewise. - * gdb.trace/read-memory.exp: Likewise. - * gdb.trace/report.exp: Likewise. - * gdb.trace/tfile.exp: Likewise. - * gdb.trace/tfind.exp: Likewise. - * gdb.trace/unavailable.exp: Likewise. - ---------------------------------------------------------- - -diff --git a/gdb/testsuite/gdb.trace/backtrace.exp b/gdb/testsuite/gdb.trace/backtrace.exp -index 0f60153cb5..24e097135f 100644 ---- a/gdb/testsuite/gdb.trace/backtrace.exp -+++ b/gdb/testsuite/gdb.trace/backtrace.exp -@@ -27,7 +27,7 @@ if ![gdb_trace_common_supports_arch] { - } - - if [prepare_for_testing "failed to prepare" $executable $srcfile \ -- [list debug nowarnings]] { -+ [list debug nowarnings nopie]] { - return -1 - } - -diff --git a/gdb/testsuite/gdb.trace/circ.exp b/gdb/testsuite/gdb.trace/circ.exp -index d48eca5deb..30ec9b47fc 100644 ---- a/gdb/testsuite/gdb.trace/circ.exp -+++ b/gdb/testsuite/gdb.trace/circ.exp -@@ -17,7 +17,7 @@ load_lib "trace-support.exp" - - standard_testfile - --if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nowarnings}]} { -+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nowarnings nopie}]} { - return -1 - } - -diff --git a/gdb/testsuite/gdb.trace/collection.exp b/gdb/testsuite/gdb.trace/collection.exp -index 8c064385ba..44eccbe865 100644 ---- a/gdb/testsuite/gdb.trace/collection.exp -+++ b/gdb/testsuite/gdb.trace/collection.exp -@@ -19,7 +19,7 @@ load_lib "trace-support.exp" - standard_testfile - set executable $testfile - --if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nowarnings}]} { -+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nowarnings nopie}]} { - return -1 - } - -diff --git a/gdb/testsuite/gdb.trace/ftrace.exp b/gdb/testsuite/gdb.trace/ftrace.exp -index f97c2c6193..702efe76bb 100644 ---- a/gdb/testsuite/gdb.trace/ftrace.exp -+++ b/gdb/testsuite/gdb.trace/ftrace.exp -@@ -53,7 +53,7 @@ set remote_libipa [gdb_load_shlib $libipa] - # file unused because linking not done" when building the object. - - if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ -- executable [list debug $additional_flags shlib=$libipa] ] != "" } { -+ executable [list debug nopie $additional_flags shlib=$libipa] ] != "" } { - untested "failed to compile" - return -1 - } -diff --git a/gdb/testsuite/gdb.trace/mi-trace-unavailable.exp b/gdb/testsuite/gdb.trace/mi-trace-unavailable.exp -index 5ec4bbc152..f0b3c52728 100644 ---- a/gdb/testsuite/gdb.trace/mi-trace-unavailable.exp -+++ b/gdb/testsuite/gdb.trace/mi-trace-unavailable.exp -@@ -17,7 +17,7 @@ load_lib trace-support.exp - - standard_testfile trace-unavailable.c - --if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}] } { -+if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug nopie}] } { - return -1 - } - -diff --git a/gdb/testsuite/gdb.trace/mi-traceframe-changed.exp b/gdb/testsuite/gdb.trace/mi-traceframe-changed.exp -index 781d3646cb..1244b5b273 100644 ---- a/gdb/testsuite/gdb.trace/mi-traceframe-changed.exp -+++ b/gdb/testsuite/gdb.trace/mi-traceframe-changed.exp -@@ -32,7 +32,7 @@ if {![is_remote host] && ![is_remote target]} { - - if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ - executable \ -- [list debug nowarnings \ -+ [list debug nowarnings nopie\ - "additional_flags=-DTFILE_DIR=\"$tfile_dir\""]] \ - != "" } { - untested "failed to compile" -diff --git a/gdb/testsuite/gdb.trace/qtro.exp b/gdb/testsuite/gdb.trace/qtro.exp -index 9eabfeb51e..d5d912b5b9 100644 ---- a/gdb/testsuite/gdb.trace/qtro.exp -+++ b/gdb/testsuite/gdb.trace/qtro.exp -@@ -22,7 +22,7 @@ load_lib trace-support.exp - - standard_testfile - --if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { -+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nopie}]} { - return -1 - } - clean_restart $testfile -diff --git a/gdb/testsuite/gdb.trace/read-memory.exp b/gdb/testsuite/gdb.trace/read-memory.exp -index 61fc137916..4d19f0074d 100644 ---- a/gdb/testsuite/gdb.trace/read-memory.exp -+++ b/gdb/testsuite/gdb.trace/read-memory.exp -@@ -17,7 +17,7 @@ load_lib "trace-support.exp" - - standard_testfile - --if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { -+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nopie}]} { - return -1 - } - -diff --git a/gdb/testsuite/gdb.trace/report.exp b/gdb/testsuite/gdb.trace/report.exp -index f43fbb7c62..c847ab0c5b 100644 ---- a/gdb/testsuite/gdb.trace/report.exp -+++ b/gdb/testsuite/gdb.trace/report.exp -@@ -27,7 +27,7 @@ if ![gdb_trace_common_supports_arch] { - return -1 - } - if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ -- executable {debug nowarnings}] != "" } { -+ executable {debug nowarnings nopie}] != "" } { - untested "failed to compile" - return -1 - } -diff --git a/gdb/testsuite/gdb.trace/tfile.exp b/gdb/testsuite/gdb.trace/tfile.exp -index 04f3e98e99..23f4fc58d0 100644 ---- a/gdb/testsuite/gdb.trace/tfile.exp -+++ b/gdb/testsuite/gdb.trace/tfile.exp -@@ -37,7 +37,7 @@ if {![is_remote host] && ![is_remote target]} { - standard_testfile - if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ - executable \ -- [list debug \ -+ [list debug nopie\ - "additional_flags=-DTFILE_DIR=\"$tfile_dir\""]] \ - != "" } { - untested "failed to compile" -diff --git a/gdb/testsuite/gdb.trace/tfind.exp b/gdb/testsuite/gdb.trace/tfind.exp -index 2c9996b040..fb58f80196 100644 ---- a/gdb/testsuite/gdb.trace/tfind.exp -+++ b/gdb/testsuite/gdb.trace/tfind.exp -@@ -29,7 +29,7 @@ if ![gdb_trace_common_supports_arch] { - } - - if { [gdb_compile "$srcdir/$subdir/$srcfile" "$binfile" \ -- executable {debug nowarnings}] != "" } { -+ executable {debug nowarnings nopie}] != "" } { - untested "failed to compile" - return -1 - } -diff --git a/gdb/testsuite/gdb.trace/unavailable.exp b/gdb/testsuite/gdb.trace/unavailable.exp -index 23d593e7d3..f3bb54db34 100644 ---- a/gdb/testsuite/gdb.trace/unavailable.exp -+++ b/gdb/testsuite/gdb.trace/unavailable.exp -@@ -19,7 +19,7 @@ standard_testfile unavailable.cc - set executable $testfile - - if {[prepare_for_testing "failed to prepare" $testfile $srcfile \ -- {debug nowarnings c++}]} { -+ {debug nowarnings c++ nopie}]} { - return -1 - } - -diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index 3d5f8726f7..cf7739aee3 100644 ---- a/gdb/testsuite/lib/gdb.exp -+++ b/gdb/testsuite/lib/gdb.exp -@@ -3722,6 +3722,12 @@ proc gdb_compile {source dest type options} { - regsub "\[\r\n\]*$" "$result" "" result - regsub "^\[\r\n\]*" "$result" "" result - -+ if { $type == "executable" && $result == "" && $nopie != -1 } { -+ if { [exec_is_pie "$dest"] } { -+ set result "nopie failed to prevent PIE executable" -+ } -+ } -+ - if {[lsearch $options quiet] < 0} { - # We shall update this on a per language basis, to avoid - # changing the entire testsuite in one go. -@@ -5083,6 +5089,18 @@ proc rerun_to_main {} { - } - } - -+# Return true if EXECUTABLE is a Position Independent Executable. -+ -+proc exec_is_pie { executable } { -+ set readelf_program [gdb_find_readelf] -+ set res [catch {exec $readelf_program -d $executable \ -+ | grep -E "(FLAGS_1).*Flags:.* PIE($| )" }] -+ if { $res == 0 } { -+ return 1 -+ } -+ return 0 -+} -+ - # Return true if a test should be skipped due to lack of floating - # point support or GDB can't fetch the contents from floating point - # registers. -diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index cf7739aee3..896e0f1b40 100644 ---- a/gdb/testsuite/lib/gdb.exp -+++ b/gdb/testsuite/lib/gdb.exp -@@ -1097,6 +1097,18 @@ proc gdb_test { args } { - }] - } - -+# Return 1 if version MAJOR.MINOR is at least AT_LEAST_MAJOR.AT_LEAST_MINOR. -+proc version_at_least { major minor at_least_major at_least_minor} { -+ if { $major > $at_least_major } { -+ return 1 -+ } elseif { $major == $at_least_major \ -+ && $minor >= $at_least_minor } { -+ return 1 -+ } else { -+ return 0 -+ } -+} -+ - # gdb_test_no_output COMMAND MESSAGE - # Send a command to GDB and verify that this command generated no output. - # -@@ -3722,9 +3734,13 @@ proc gdb_compile {source dest type options} { - regsub "\[\r\n\]*$" "$result" "" result - regsub "^\[\r\n\]*" "$result" "" result - -- if { $type == "executable" && $result == "" && $nopie != -1 } { -- if { [exec_is_pie "$dest"] } { -+ if { $type == "executable" && $result == "" \ -+ && ($nopie != -1 || $pie != -1) } { -+ set is_pie [exec_is_pie "$dest"] -+ if { $nopie != -1 && $is_pie == 1 } { - set result "nopie failed to prevent PIE executable" -+ } elseif { $pie != -1 && $is_pie == 0 } { -+ set result "pie failed to generate PIE executable" - } - } - -@@ -5089,13 +5105,53 @@ proc rerun_to_main {} { - } - } - --# Return true if EXECUTABLE is a Position Independent Executable. -+# Return list with major and minor version of readelf, or an empty list. -+gdb_caching_proc readelf_version { -+ set readelf_program [gdb_find_readelf] -+ set res [catch {exec $readelf_program --version} output] -+ if { $res != 0 } { -+ return [list] -+ } -+ set lines [split $output \n] -+ set line [lindex $lines 0] -+ set res [regexp {[ \t]+([0-9]+)[.]([0-9]+)[^ \t]*$} \ -+ $line dummy major minor] -+ if { $res != 1 } { -+ return [list] -+ } -+ return [list $major $minor] -+} -+ -+# Return 1 if readelf prints the PIE flag, 0 if is doesn't, and -1 if unknown. -+proc readelf_prints_pie { } { -+ set version [readelf_version] -+ if { [llength $version] == 0 } { -+ return -1 -+ } -+ set major [lindex $version 0] -+ set minor [lindex $version 1] -+ # It would be better to construct a PIE executable and test if the PIE -+ # flag is printed by readelf, but we cannot reliably construct a PIE -+ # executable if the multilib_flags dictate otherwise -+ # (--target_board=unix/-no-pie/-fno-PIE). -+ return [version_at_least $major $minor 2 26] -+} -+ -+# Return 1 if EXECUTABLE is a Position Independent Executable, 0 if it is not, -+# and -1 if unknown. - - proc exec_is_pie { executable } { -+ set res [readelf_prints_pie] -+ if { $res != 1 } { -+ return -1 -+ } - set readelf_program [gdb_find_readelf] -- set res [catch {exec $readelf_program -d $executable \ -- | grep -E "(FLAGS_1).*Flags:.* PIE($| )" }] -- if { $res == 0 } { -+ set res [catch {exec $readelf_program -d $executable} output] -+ if { $res != 0 } { -+ return -1 -+ } -+ set res [regexp -line {\(FLAGS_1\).*Flags:.* PIE($| )} $output] -+ if { $res == 1 } { - return 1 - } - return 0 diff --git a/gdb-testsuite-read1-fixes.patch b/gdb-testsuite-read1-fixes.patch deleted file mode 100644 index f6d11ff..0000000 --- a/gdb-testsuite-read1-fixes.patch +++ /dev/null @@ -1,312 +0,0 @@ -- Fix test_gdb_complete_tab_multiple race -- [gdb/testsuite] Don't expect gdb_prompt in mi_skip_python_test -- [gdb/testsuite] Fix gdb.base/maint.exp with check-read1 -- [gdb/testsuite] Fix mi-catch-cpp-exceptions.exp and mi-nonstop.exp with check-read1 -- [gdb/testsuite] Fix python.exp with check-read1 -- [gdb/testsuite, 1/2] Fix gdb.linespec/explicit.exp with check-read1 -- [gdb/testsuite, 2/2] Fix gdb.linespec/explicit.exp with check-read1 -- [gdb/testsuite] Test skip_libstdcxx_probe_tests in mi-catch-cpp-exceptions.exp - -diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp -index 38e9a1ec4b..810c7c9b8c 100644 ---- a/gdb/testsuite/gdb.base/maint.exp -+++ b/gdb/testsuite/gdb.base/maint.exp -@@ -69,15 +69,15 @@ set saw_registers 0 - set saw_headers 0 - set test "maint print registers" - gdb_test_multiple $test $test { -- -re "\[^\r\n\]+Name\[^\r\n\]+Nr\[^\r\n\]+Rel\[^\r\n\]+Offset\[^\r\n\]+Size\[^\r\n\]+Type\[^\r\n\]+\[\r\n\]+" { -+ -re "\[^\r\n\]+Name\[^\r\n\]+Nr\[^\r\n\]+Rel\[^\r\n\]+Offset\[^\r\n\]+Size\[^\r\n\]+Type\[^\r\n\]+\r\n" { - set saw_headers 1 - exp_continue - } -- -re "^\[^\r\n\]+\[0-9\]+\[^\r\n\]+\[0-9\]+\[^\r\n\]+\[0-9\]+\[^\r\n\]+\[0-9\]+\[^\r\n\]+\[\r\n\]+" { -+ -re "^\[^\r\n\]+\[0-9\]+\[^\r\n\]+\[0-9\]+\[^\r\n\]+\[0-9\]+\[^\r\n\]+\[0-9\]+\[^\r\n\]+\r\n" { - set saw_registers 1 - exp_continue - } -- -re "^\\*\[0-9\]+\[^\r\n\]+\[\r\n\]+" { -+ -re "^\\*\[0-9\]+\[^\r\n\]+\r\n" { - exp_continue - } - -re "$gdb_prompt $" { -diff --git a/gdb/testsuite/gdb.linespec/explicit.exp b/gdb/testsuite/gdb.linespec/explicit.exp -index 11656ca5c5..e50e503343 100644 ---- a/gdb/testsuite/gdb.linespec/explicit.exp -+++ b/gdb/testsuite/gdb.linespec/explicit.exp -@@ -241,20 +241,7 @@ namespace eval $testfile { - -re "break -source exp\\\x07licit" { - send_gdb "\t\t" - gdb_test_multiple "" $tst { -- -re "\\\x07\r\nexplicit.c\[ \t\]+explicit2.c\[ \t\]+\r\n$gdb_prompt" { -- send_gdb "\n" -- gdb_test "" \ -- {Source filename requires function, label, or line offset.} \ -- $tst -- } -- } -- } -- -- -re "break -source exp\\\x07l" { -- # This pattern may occur when glibc debuginfo is installed. -- send_gdb "\t\t" -- gdb_test_multiple "" $tst { -- -re "\\\x07\r\nexplicit.c\[ \t\]+explicit2.c\[ \t\]+expl.*\r\n$gdb_prompt" { -+ -re "\\\x07\r\nexplicit.c\[ \t\]+explicit2.c\[ \t\]+\(expl.*\)?\r\n$gdb_prompt" { - send_gdb "\n" - gdb_test "" \ - {Source filename requires function, label, or line offset.} \ -@@ -486,7 +473,7 @@ namespace eval $testfile { - send_gdb "break \t" - gdb_test_multiple "" $tst { - "break \\\x07" { -- send_gdb "\t\t" -+ send_gdb "\t" - gdb_test_multiple "" $tst { - "Display all" { - send_gdb "y" -diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp -index b62572ceb8..f5c1d1b261 100644 ---- a/gdb/testsuite/gdb.python/python.exp -+++ b/gdb/testsuite/gdb.python/python.exp -@@ -450,7 +450,7 @@ gdb_py_test_multiple "prompt substitution readline" \ - "end" "" - - gdb_test_multiple "python gdb.prompt_hook = error_prompt" "set the hook" { -- -re "Python Exception (exceptions.RuntimeError|<(type 'exceptions.|class ')RuntimeError'>) Python exception called.*" { -+ -re "Python Exception (exceptions.RuntimeError|<(type 'exceptions.|class ')RuntimeError'>) Python exception called.*$gdb_prompt $" { - pass "set hook" - } - } -@@ -462,7 +462,7 @@ gdb_py_test_silent_cmd "set python print-stack full" \ - "set print-stack full for prompt error test" 1 - - gdb_test_multiple "python gdb.prompt_hook = error_prompt" "set the hook" { -- -re "Traceback.*File.*line.*RuntimeError.*Python exception called.*" { -+ -re "Traceback.*File.*line.*RuntimeError.*Python exception called.*$gdb_prompt $" { - pass "set hook" - } - } -diff --git a/gdb/testsuite/lib/completion-support.exp b/gdb/testsuite/lib/completion-support.exp -index 3e498d3c63..8a75b0d785 100644 ---- a/gdb/testsuite/lib/completion-support.exp -+++ b/gdb/testsuite/lib/completion-support.exp -@@ -144,8 +144,12 @@ proc test_gdb_complete_tab_multiple { input_line add_completed_line \ - set maybe_bell "" - } - gdb_test_multiple "" "$test (second tab)" { -- -re "^${maybe_bell}\r\n$expected_re\r\n$gdb_prompt $input_line_re$add_completed_line_re$" { -- pass "$test" -+ -re "^${maybe_bell}\r\n$expected_re\r\n$gdb_prompt " { -+ gdb_test_multiple "" "$test (second tab)" { -+ -re "^$input_line_re$add_completed_line_re$" { -+ pass "$test" -+ } -+ } - } - } - } -diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index 896e0f1b40..2eb00d58b9 100644 ---- a/gdb/testsuite/lib/gdb.exp -+++ b/gdb/testsuite/lib/gdb.exp -@@ -695,7 +695,7 @@ proc gdb_internal_error_resync {} { - } - - --# gdb_test_multiple COMMAND MESSAGE EXPECT_ARGUMENTS -+# gdb_test_multiple COMMAND MESSAGE EXPECT_ARGUMENTS PROMPT_REGEXP - # Send a command to gdb; test the result. - # - # COMMAND is the command to execute, send to GDB with send_gdb. If -@@ -707,6 +707,8 @@ proc gdb_internal_error_resync {} { - # context; action elements will be executed in the caller's context. - # Unlike patterns for gdb_test, these patterns should generally include - # the final newline and prompt. -+# PROMPT_REGEXP is a regexp matching the expected prompt after the command -+# output. If empty, defaults to "$gdb_prompt $" - # - # Returns: - # 1 if the test failed, according to a built-in failure pattern -@@ -744,7 +746,7 @@ proc gdb_internal_error_resync {} { - # expected from $gdb_spawn_id. IOW, callers do not need to worry - # about resetting "-i" back to $gdb_spawn_id explicitly. - # --proc gdb_test_multiple { command message user_code } { -+proc gdb_test_multiple { command message user_code { prompt_regexp "" } } { - global verbose use_gdb_stub - global gdb_prompt pagination_prompt - global GDB -@@ -754,6 +756,10 @@ proc gdb_test_multiple { command message user_code } { - upvar expect_out expect_out - global any_spawn_id - -+ if { "$prompt_regexp" == "" } { -+ set prompt_regexp "$gdb_prompt $" -+ } -+ - if { $message == "" } { - set message $command - } -@@ -913,7 +919,7 @@ proc gdb_test_multiple { command message user_code } { - } - - append code { -- -re "Ending remote debugging.*$gdb_prompt $" { -+ -re "Ending remote debugging.*$prompt_regexp" { - if ![isnative] then { - warning "Can`t communicate to remote target." - } -@@ -921,17 +927,17 @@ proc gdb_test_multiple { command message user_code } { - gdb_start - set result -1 - } -- -re "Undefined\[a-z\]* command:.*$gdb_prompt $" { -+ -re "Undefined\[a-z\]* command:.*$prompt_regexp" { - perror "Undefined command \"$command\"." - fail "$message" - set result 1 - } -- -re "Ambiguous command.*$gdb_prompt $" { -+ -re "Ambiguous command.*$prompt_regexp" { - perror "\"$command\" is not a unique command name." - fail "$message" - set result 1 - } -- -re "$inferior_exited_re with code \[0-9\]+.*$gdb_prompt $" { -+ -re "$inferior_exited_re with code \[0-9\]+.*$prompt_regexp" { - if ![string match "" $message] then { - set errmsg "$message (the program exited)" - } else { -@@ -940,7 +946,7 @@ proc gdb_test_multiple { command message user_code } { - fail "$errmsg" - set result -1 - } -- -re "$inferior_exited_re normally.*$gdb_prompt $" { -+ -re "$inferior_exited_re normally.*$prompt_regexp" { - if ![string match "" $message] then { - set errmsg "$message (the program exited)" - } else { -@@ -949,7 +955,7 @@ proc gdb_test_multiple { command message user_code } { - fail "$errmsg" - set result -1 - } -- -re "The program is not being run.*$gdb_prompt $" { -+ -re "The program is not being run.*$prompt_regexp" { - if ![string match "" $message] then { - set errmsg "$message (the program is no longer running)" - } else { -@@ -958,7 +964,7 @@ proc gdb_test_multiple { command message user_code } { - fail "$errmsg" - set result -1 - } -- -re "\r\n$gdb_prompt $" { -+ -re "\r\n$prompt_regexp" { - if ![string match "" $message] then { - fail "$message" - } -@@ -972,13 +978,13 @@ proc gdb_test_multiple { command message user_code } { - } - -re "\\((y or n|y or \\\[n\\\]|\\\[y\\\] or n)\\) " { - send_gdb "n\n" -- gdb_expect -re "$gdb_prompt $" -+ gdb_expect -re "$prompt_regexp" - fail "$message (got interactive prompt)" - set result -1 - } - -re "\\\[0\\\] cancel\r\n\\\[1\\\] all.*\r\n> $" { - send_gdb "0\n" -- gdb_expect -re "$gdb_prompt $" -+ gdb_expect -re "$prompt_regexp" - fail "$message (got breakpoint menu)" - set result -1 - } -@@ -1842,7 +1848,7 @@ proc skip_python_tests_prompt { prompt_regexp } { - return 1 - } - -re "$prompt_regexp" {} -- } -+ } "$prompt_regexp" - - set gdb_py_is_py24 0 - gdb_test_multiple "python print (sys.version_info\[0\])" "check if python 3" { -@@ -1852,7 +1858,7 @@ proc skip_python_tests_prompt { prompt_regexp } { - -re ".*$prompt_regexp" { - set gdb_py_is_py3k 0 - } -- } -+ } "$prompt_regexp" - if { $gdb_py_is_py3k == 0 } { - gdb_test_multiple "python print (sys.version_info\[1\])" "check if python 2.4" { - -re "\[45\].*$prompt_regexp" { -@@ -1861,7 +1867,7 @@ proc skip_python_tests_prompt { prompt_regexp } { - -re ".*$prompt_regexp" { - set gdb_py_is_py24 0 - } -- } -+ } "$prompt_regexp" - } - - return 0 -@@ -3079,22 +3085,27 @@ proc skip_unwinder_tests {} { - - # Return 0 if we should skip tests that require the libstdc++ stap - # probes. This must be invoked while gdb is running, after shared --# libraries have been loaded. -- --proc skip_libstdcxx_probe_tests {} { -- global gdb_prompt -+# libraries have been loaded. PROMPT_REGEXP is the expected prompt. - -+proc skip_libstdcxx_probe_tests_prompt { prompt_regexp } { - set ok 0 - gdb_test_multiple "info probe" "check for stap probe in libstdc++" { -- -re ".*libstdcxx.*catch.*\r\n$gdb_prompt $" { -+ -re ".*libstdcxx.*catch.*\r\n$prompt_regexp" { - set ok 1 - } -- -re "\r\n$gdb_prompt $" { -+ -re "\r\n$prompt_regexp" { - } -- } -+ } "$prompt_regexp" - return $ok - } - -+# As skip_libstdcxx_probe_tests_prompt, with gdb_prompt. -+ -+proc skip_libstdcxx_probe_tests {} { -+ global gdb_prompt -+ return [skip_libstdcxx_probe_tests_prompt "$gdb_prompt $"] -+} -+ - # Return 1 if we should skip tests of the "compile" feature. - # This must be invoked after the inferior has been started. - -@@ -3131,7 +3142,7 @@ proc gdb_is_target_1 { target_name target_stack_regexp prompt_regexp } { - -re "$prompt_regexp" { - pass $test - } -- } -+ } "$prompt_regexp" - return 0 - } - -diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp -index a58c4f6e11..d0ee5ca744 100644 ---- a/gdb/testsuite/lib/mi-support.exp -+++ b/gdb/testsuite/lib/mi-support.exp -@@ -2596,6 +2596,13 @@ proc mi_skip_python_tests {} { - return [skip_python_tests_prompt "$mi_gdb_prompt$"] - } - -+# As skip_libstdcxx_probe_tests_prompt, with mi_gdb_prompt. -+ -+proc mi_skip_libstdcxx_probe_tests {} { -+ global mi_gdb_prompt -+ return [skip_libstdcxx_probe_tests_prompt "$mi_gdb_prompt$"] -+} -+ - # Check whether we're testing with the remote or extended-remote - # targets. - diff --git a/gdb-testsuite-readline63-sigint.patch b/gdb-testsuite-readline63-sigint.patch deleted file mode 100644 index 6a7e93a..0000000 --- a/gdb-testsuite-readline63-sigint.patch +++ /dev/null @@ -1,46 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-testsuite-readline63-sigint.patch - -;; [testsuite] Fix false selftest.exp FAIL from system readline-6.3+ (Patrick Palka). -;;=fedoratest - -gdb/users/ppalka/readline-7.0-update -commit 379059215e823555a37a8dc7e02cef8fd86566e4 -https://sourceware.org/ml/gdb-patches/2015-07/msg00422.html -Message-Id: <1436927724-4059-1-git-send-email-patrick@parcs.ath.cx> -https://bugzilla.redhat.com/show_bug.cgi?id=1301175 - -diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp ---- a/gdb/testsuite/gdb.gdb/selftest.exp -+++ b/gdb/testsuite/gdb.gdb/selftest.exp -@@ -113,9 +113,25 @@ proc test_with_self { } { - } - - set description "send SIGINT signal to child process" -- gdb_test "signal SIGINT" \ -- "Continuing with signal SIGINT.*" \ -- "$description" -+ gdb_test_multiple "signal SIGINT" "$description" { -+ -re "^signal SIGINT\r\nContinuing with signal SIGINT.\r\nQuit\r\n" { -+ pass "$description" -+ } -+ } -+ -+ set description "send ^C to child process again" -+ send_gdb "\003" -+ gdb_expect { -+ -re "(Thread .*|Program) received signal SIGINT.*$gdb_prompt $" { -+ pass "$description" -+ } -+ -re ".*$gdb_prompt $" { -+ fail "$description" -+ } -+ timeout { -+ fail "$description (timeout)" -+ } -+ } - - # Switch back to the GDB thread if Guile support is linked in. - # "signal SIGINT" could also switch the current thread. diff --git a/gdb-threads-fix-hang-in-stop_all_threads-after-killing-inferior.patch b/gdb-threads-fix-hang-in-stop_all_threads-after-killing-inferior.patch index 09c406b..fc5924d 100644 --- a/gdb-threads-fix-hang-in-stop_all_threads-after-killing-inferior.patch +++ b/gdb-threads-fix-hang-in-stop_all_threads-after-killing-inferior.patch @@ -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 - -...... - -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 - - 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 @@ index 9d20036fcf..16e9e136c0 100644 } } -@@ -4359,7 +4364,15 @@ stop_all_threads (void) +@@ -4376,10 +4381,18 @@ stop_all_threads (void) + target_pid_to_str (event_ptid).c_str ()); + } - event_ptid = wait_one (&ws); - -- 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 @@ index 9d20036fcf..16e9e136c0 100644 + 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. */ diff --git a/gdb-vla-intel-fix-print-char-array.patch b/gdb-vla-intel-fix-print-char-array.patch index 3644f45..e06197a 100644 --- a/gdb-vla-intel-fix-print-char-array.patch +++ b/gdb-vla-intel-fix-print-char-array.patch @@ -22,7 +22,7 @@ And adjust its testcase. 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 diff --git a/gdb-vla-intel-fortran-strides.patch b/gdb-vla-intel-fortran-strides.patch index 2213ee1..c385d6f 100644 --- a/gdb-vla-intel-fortran-strides.patch +++ b/gdb-vla-intel-fortran-strides.patch @@ -34,162 +34,10 @@ dbfd7140bf4c0500d1f5d192be781f83f78f7922 gdb/value.h | 2 + 23 files changed, 1242 insertions(+), 183 deletions(-) -diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -2429,11 +2429,14 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton, - /* See dwarf2loc.h. */ - - int --dwarf2_evaluate_property (const struct dynamic_prop *prop, -+dwarf2_evaluate_property_signed (const struct dynamic_prop *prop, - struct frame_info *frame, - struct property_addr_info *addr_stack, -- CORE_ADDR *value) -+ CORE_ADDR *value, -+ int is_signed) - { -+ int rc = 0; -+ - if (prop == NULL) - return 0; - -@@ -2457,7 +2460,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, - - *value = value_as_address (val); - } -- return 1; -+ rc = 1; - } - } - break; -@@ -2479,7 +2482,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, - if (!value_optimized_out (val)) - { - *value = value_as_address (val); -- return 1; -+ rc = 1; - } - } - } -@@ -2487,8 +2490,8 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, - - case PROP_CONST: - *value = prop->data.const_val; -- return 1; -- -+ rc = 1; -+ break; - case PROP_ADDR_OFFSET: - { - struct dwarf2_property_baton *baton -@@ -2509,11 +2512,38 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, - val = value_at (baton->offset_info.type, - pinfo->addr + baton->offset_info.offset); - *value = value_as_address (val); -- return 1; -+ rc = 1; - } -+ break; - } - -- return 0; -+ if (rc == 1 && is_signed == 1) -+ { -+ /* If we have a valid return candidate and it's value is signed, -+ we have to sign-extend the value because CORE_ADDR on 64bit machine has -+ 8 bytes but address size of an 32bit application is 4 bytes. */ -+ struct gdbarch * gdbarch = target_gdbarch (); -+ const int addr_bit = gdbarch_addr_bit (gdbarch); -+ const CORE_ADDR neg_mask = ((~0) << (addr_bit - 1)); -+ -+ /* Check if signed bit is set and sign-extend values. */ -+ if (*value & (neg_mask)) -+ *value |= (neg_mask ); -+ } -+ return rc; -+} -+ -+int -+dwarf2_evaluate_property (const struct dynamic_prop *prop, -+ struct frame_info *frame, -+ struct property_addr_info *addr_stack, -+ CORE_ADDR *value) -+{ -+ return dwarf2_evaluate_property_signed (prop, -+ frame, -+ addr_stack, -+ value, -+ 0); - } - - /* See dwarf2loc.h. */ -diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h ---- a/gdb/dwarf2loc.h -+++ b/gdb/dwarf2loc.h -@@ -143,6 +143,12 @@ int dwarf2_evaluate_property (const struct dynamic_prop *prop, - struct property_addr_info *addr_stack, - CORE_ADDR *value); - -+int dwarf2_evaluate_property_signed (const struct dynamic_prop *prop, -+ struct frame_info *frame, -+ struct property_addr_info *addr_stack, -+ CORE_ADDR *value, -+ int is_signed); -+ - /* A helper for the compiler interface that compiles a single dynamic - property to C code. - -diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c ---- a/gdb/dwarf2read.c -+++ b/gdb/dwarf2read.c -@@ -17773,7 +17773,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) - struct type *base_type, *orig_base_type; - struct type *range_type; - struct attribute *attr; -- struct dynamic_prop low, high; -+ struct dynamic_prop low, high, stride; - int low_default_is_valid; - int high_bound_is_count = 0; - const char *name; -@@ -17793,7 +17793,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) - - low.kind = PROP_CONST; - high.kind = PROP_CONST; -+ stride.kind = PROP_CONST; - high.data.const_val = 0; -+ stride.data.const_val = 0; - - /* Set LOW_DEFAULT_IS_VALID if current language and DWARF version allow - omitting DW_AT_lower_bound. */ -@@ -17826,6 +17828,14 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) - break; - } - -+ attr = dwarf2_attr (die, DW_AT_byte_stride, cu); -+ if (attr) -+ if (!attr_to_dynamic_prop (attr, die, cu, &stride)) -+ complaint (_("Missing DW_AT_byte_stride " -+ "- DIE at 0x%s [in module %s]"), -+ sect_offset_str (die->sect_off), -+ objfile_name (cu->per_cu->dwarf2_per_objfile->objfile)); -+ - attr = dwarf2_attr (die, DW_AT_lower_bound, cu); - if (attr) - attr_to_dynamic_prop (attr, die, cu, &low); -@@ -17918,7 +17928,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) - && !TYPE_UNSIGNED (base_type) && (high.data.const_val & negative_mask)) - high.data.const_val |= negative_mask; - -- range_type = create_range_type (NULL, orig_base_type, &low, &high); -+ range_type = create_range_type (NULL, orig_base_type, &low, &high, &stride); - - if (high_bound_is_count) - TYPE_RANGE_DATA (range_type)->flag_upper_bound_is_count = 1; diff --git a/gdb/eval.c b/gdb/eval.c --- a/gdb/eval.c +++ b/gdb/eval.c -@@ -377,29 +377,324 @@ init_array_element (struct value *array, struct value *element, +@@ -372,29 +372,324 @@ init_array_element (struct value *array, struct value *element, return index; } @@ -533,7 +381,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c } -@@ -1242,19 +1537,6 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos, +@@ -1235,19 +1530,6 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos, return eval_call (exp, noside, nargs, argvec, var_func_name, expect_type); } @@ -553,7 +401,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c struct value * evaluate_subexp_standard (struct type *expect_type, struct expression *exp, int *pos, -@@ -1949,33 +2231,8 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1942,33 +2224,8 @@ evaluate_subexp_standard (struct type *expect_type, switch (code) { case TYPE_CODE_ARRAY: @@ -588,7 +436,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c case TYPE_CODE_PTR: case TYPE_CODE_FUNC: -@@ -2372,49 +2629,6 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2388,49 +2645,6 @@ evaluate_subexp_standard (struct type *expect_type, } return (arg1); @@ -638,7 +486,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c case BINOP_LOGICAL_AND: arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); if (noside == EVAL_SKIP) -@@ -3334,6 +3548,9 @@ calc_f77_array_dims (struct type *array_type) +@@ -3350,6 +3564,9 @@ calc_f77_array_dims (struct type *array_type) int ndimen = 1; struct type *tmp_type; @@ -651,7 +499,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c diff --git a/gdb/expprint.c b/gdb/expprint.c --- a/gdb/expprint.c +++ b/gdb/expprint.c -@@ -578,17 +578,14 @@ print_subexp_standard (struct expression *exp, int *pos, +@@ -580,17 +580,14 @@ print_subexp_standard (struct expression *exp, int *pos, longest_to_int (exp->elts[pc + 1].longconst); *pos += 2; @@ -673,7 +521,7 @@ diff --git a/gdb/expprint.c b/gdb/expprint.c print_subexp (exp, pos, stream, PREC_ABOVE_COMMA); fputs_filtered (")", stream); return; -@@ -1105,22 +1102,24 @@ dump_subexp_body_standard (struct expression *exp, +@@ -1107,22 +1104,24 @@ dump_subexp_body_standard (struct expression *exp, switch (range_type) { @@ -706,7 +554,7 @@ diff --git a/gdb/expprint.c b/gdb/expprint.c fputs_filtered ("ExclusiveRange 'EXP..EXP'", stream); break; default: -@@ -1128,11 +1127,9 @@ dump_subexp_body_standard (struct expression *exp, +@@ -1130,11 +1129,9 @@ dump_subexp_body_standard (struct expression *exp, break; } @@ -723,7 +571,7 @@ diff --git a/gdb/expprint.c b/gdb/expprint.c diff --git a/gdb/expression.h b/gdb/expression.h --- a/gdb/expression.h +++ b/gdb/expression.h -@@ -150,28 +150,27 @@ extern void dump_raw_expression (struct expression *, +@@ -167,28 +167,27 @@ extern void dump_raw_expression (struct expression *, struct ui_file *, const char *); extern void dump_prefix_expression (struct expression *, struct ui_file *); @@ -775,12 +623,12 @@ diff --git a/gdb/expression.h b/gdb/expression.h diff --git a/gdb/f-exp.y b/gdb/f-exp.y --- a/gdb/f-exp.y +++ b/gdb/f-exp.y -@@ -257,31 +257,63 @@ arglist : subrange +@@ -282,31 +282,63 @@ arglist : subrange arglist : arglist ',' exp %prec ABOVE_COMMA - { arglist_len++; } + { pstate->arglist_len++; } + | arglist ',' subrange %prec ABOVE_COMMA -+ { arglist_len++; } ++ { pstate->arglist_len++; } ; /* There are four sorts of subrange types in F90. */ @@ -847,148 +695,52 @@ diff --git a/gdb/f-exp.y b/gdb/f-exp.y diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c -@@ -119,8 +119,14 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, - - if (nss != ndimensions) - { -- size_t dim_size = TYPE_LENGTH (TYPE_TARGET_TYPE (type)); -+ size_t dim_size; +@@ -129,6 +129,11 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, + byte_stride = dim_size; size_t offs = 0; -+ LONGEST byte_stride = abs (TYPE_BYTE_STRIDE (range_type)); -+ + + if (byte_stride) + dim_size = byte_stride; + else + dim_size = TYPE_LENGTH (TYPE_TARGET_TYPE (type)); - ++ for (i = lowerbound; (i < upperbound + 1 && (*elts) < options->print_max); + i++) diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c -@@ -911,7 +911,8 @@ operator== (const range_bounds &l, const range_bounds &r) - struct type * - create_range_type (struct type *result_type, struct type *index_type, - const struct dynamic_prop *low_bound, -- const struct dynamic_prop *high_bound) -+ const struct dynamic_prop *high_bound, -+ const struct dynamic_prop *stride) - { - if (result_type == NULL) - result_type = alloc_type_copy (index_type); -@@ -926,6 +927,7 @@ create_range_type (struct type *result_type, struct type *index_type, - TYPE_ZALLOC (result_type, sizeof (struct range_bounds)); - TYPE_RANGE_DATA (result_type)->low = *low_bound; +@@ -936,7 +936,7 @@ create_range_type (struct type *result_type, struct type *index_type, TYPE_RANGE_DATA (result_type)->high = *high_bound; -+ TYPE_RANGE_DATA (result_type)->stride = *stride; + TYPE_RANGE_DATA (result_type)->bias = bias; - if (low_bound->kind == PROP_CONST && low_bound->data.const_val >= 0) - TYPE_UNSIGNED (result_type) = 1; -@@ -954,7 +956,7 @@ struct type * - create_static_range_type (struct type *result_type, struct type *index_type, - LONGEST low_bound, LONGEST high_bound) - { -- struct dynamic_prop low, high; -+ struct dynamic_prop low, high, stride; +- /* Initialize the stride to be a constant, the value will already be zero ++ /* bias the stride to be a constant, the value will already be zero + thanks to the use of TYPE_ZALLOC above. */ + TYPE_RANGE_DATA (result_type)->stride.kind = PROP_CONST; - low.kind = PROP_CONST; - low.data.const_val = low_bound; -@@ -962,7 +964,11 @@ create_static_range_type (struct type *result_type, struct type *index_type, +@@ -1001,7 +1001,8 @@ create_static_range_type (struct type *result_type, struct type *index_type, high.kind = PROP_CONST; high.data.const_val = high_bound; -- result_type = create_range_type (result_type, index_type, &low, &high); -+ stride.kind = PROP_CONST; -+ stride.data.const_val = 0; -+ +- result_type = create_range_type (result_type, index_type, &low, &high, 0); + result_type = create_range_type (result_type, index_type, -+ &low, &high, &stride); ++ &low, &high, 0); return result_type; } -@@ -1180,16 +1186,20 @@ create_array_type_with_stride (struct type *result_type, - && (!type_not_associated (result_type) - && !type_not_allocated (result_type))) - { -- LONGEST low_bound, high_bound; -+ LONGEST low_bound, high_bound, byte_stride; - +@@ -1236,6 +1237,7 @@ create_array_type_with_stride (struct type *result_type, if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) low_bound = high_bound = 0; element_type = check_typedef (element_type); -+ byte_stride = abs (TYPE_BYTE_STRIDE (range_type)); + /* Be careful when setting the array length. Ada arrays can be empty arrays with the high_bound being smaller than the low_bound. In such cases, the array length should be zero. */ - if (high_bound < low_bound) - TYPE_LENGTH (result_type) = 0; -+ else if (byte_stride > 0) -+ TYPE_LENGTH (result_type) = byte_stride * (high_bound - low_bound + 1); - else if (bit_stride > 0) - TYPE_LENGTH (result_type) = - (bit_stride * (high_bound - low_bound + 1) + 7) / 8; -@@ -1990,12 +2000,12 @@ resolve_dynamic_range (struct type *dyn_range_type, - CORE_ADDR value; - struct type *static_range_type, *static_target_type; - const struct dynamic_prop *prop; -- struct dynamic_prop low_bound, high_bound; -+ struct dynamic_prop low_bound, high_bound, stride; - - gdb_assert (TYPE_CODE (dyn_range_type) == TYPE_CODE_RANGE); - - prop = &TYPE_RANGE_DATA (dyn_range_type)->low; -- if (dwarf2_evaluate_property (prop, NULL, addr_stack, &value)) -+ if (dwarf2_evaluate_property_signed (prop, NULL, addr_stack, &value, 1)) - { - low_bound.kind = PROP_CONST; - low_bound.data.const_val = value; -@@ -2007,7 +2017,7 @@ resolve_dynamic_range (struct type *dyn_range_type, - } - - prop = &TYPE_RANGE_DATA (dyn_range_type)->high; -- if (dwarf2_evaluate_property (prop, NULL, addr_stack, &value)) -+ if (dwarf2_evaluate_property_signed (prop, NULL, addr_stack, &value, 1)) - { - high_bound.kind = PROP_CONST; - high_bound.data.const_val = value; -@@ -2022,12 +2032,20 @@ resolve_dynamic_range (struct type *dyn_range_type, - high_bound.data.const_val = 0; - } - -+ prop = &TYPE_RANGE_DATA (dyn_range_type)->stride; -+ if (dwarf2_evaluate_property_signed (prop, NULL, addr_stack, &value, 1)) -+ { -+ stride.kind = PROP_CONST; -+ stride.data.const_val = value; -+ } -+ - static_target_type - = resolve_dynamic_type_internal (TYPE_TARGET_TYPE (dyn_range_type), - addr_stack, 0); - static_range_type = create_range_type (copy_type (dyn_range_type), - static_target_type, -- &low_bound, &high_bound); -+ &low_bound, &high_bound, &stride); -+ - TYPE_RANGE_DATA (static_range_type)->flag_bound_evaluated = 1; - return static_range_type; - } diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h -@@ -614,6 +614,10 @@ struct range_bounds - - struct dynamic_prop high; - -+ /* * Stride of range. */ -+ -+ struct dynamic_prop stride; -+ - /* True if HIGH range bound contains the number of elements in the - subrange. This affects how the final hight bound is computed. */ - -@@ -778,7 +782,6 @@ struct main_type +@@ -803,7 +803,6 @@ struct main_type /* * Union member used for range types. */ struct range_bounds *bounds; @@ -996,10 +748,10 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h } flds_bnds; /* * Slot to point to additional language-specific fields of this -@@ -1327,6 +1330,15 @@ extern bool set_type_align (struct type *, ULONGEST); - TYPE_RANGE_DATA(range_type)->high.kind - #define TYPE_LOW_BOUND_KIND(range_type) \ - TYPE_RANGE_DATA(range_type)->low.kind +@@ -1365,6 +1364,15 @@ extern bool set_type_align (struct type *, ULONGEST); + #define TYPE_BIT_STRIDE(range_type) \ + (TYPE_RANGE_DATA(range_type)->stride.data.const_val \ + * (TYPE_RANGE_DATA(range_type)->flag_is_byte_stride ? 8 : 1)) +#define TYPE_BYTE_STRIDE(range_type) \ + TYPE_RANGE_DATA(range_type)->stride.data.const_val +#define TYPE_BYTE_STRIDE_BLOCK(range_type) \ @@ -1012,7 +764,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h /* Property accessors for the type data location. */ #define TYPE_DATA_LOCATION(thistype) \ -@@ -1361,6 +1373,9 @@ extern bool set_type_align (struct type *, ULONGEST); +@@ -1400,6 +1408,9 @@ extern bool set_type_align (struct type *, ULONGEST); TYPE_HIGH_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype)) #define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \ TYPE_LOW_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype)) @@ -1022,18 +774,10 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h #define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \ (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype)))) -@@ -1896,6 +1911,7 @@ extern struct type *create_array_type_with_stride - struct dynamic_prop *, unsigned int); - - extern struct type *create_range_type (struct type *, struct type *, -+ const struct dynamic_prop *, - const struct dynamic_prop *, - const struct dynamic_prop *); - diff --git a/gdb/parse.c b/gdb/parse.c --- a/gdb/parse.c +++ b/gdb/parse.c -@@ -989,24 +989,20 @@ operator_length_standard (const struct expression *expr, int endpos, +@@ -919,24 +919,20 @@ operator_length_standard (const struct expression *expr, int endpos, case OP_RANGE: oplen = 3; @@ -1072,7 +816,7 @@ diff --git a/gdb/parse.c b/gdb/parse.c diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y --- a/gdb/rust-exp.y +++ b/gdb/rust-exp.y -@@ -2475,24 +2475,28 @@ rust_parser::convert_ast_to_expression (const struct rust_op *operation, +@@ -2492,24 +2492,28 @@ rust_parser::convert_ast_to_expression (const struct rust_op *operation, case OP_RANGE: { @@ -1112,7 +856,7 @@ diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c -@@ -1193,13 +1193,11 @@ rust_range (struct expression *exp, int *pos, enum noside noside) +@@ -1224,13 +1224,11 @@ rust_range (struct expression *exp, int *pos, enum noside noside) kind = (enum range_type) longest_to_int (exp->elts[*pos + 1].longconst); *pos += 3; @@ -1129,7 +873,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c if (noside == EVAL_SKIP) return value_from_longest (builtin_type (exp->gdbarch)->builtin_int, 1); -@@ -1288,7 +1286,7 @@ rust_compute_range (struct type *type, struct value *range, +@@ -1319,7 +1317,7 @@ rust_compute_range (struct type *type, struct value *range, *low = 0; *high = 0; @@ -1138,7 +882,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c if (TYPE_NFIELDS (type) == 0) return; -@@ -1296,15 +1294,14 @@ rust_compute_range (struct type *type, struct value *range, +@@ -1327,15 +1325,14 @@ rust_compute_range (struct type *type, struct value *range, i = 0; if (strcmp (TYPE_FIELD_NAME (type, 0), "start") == 0) { @@ -1156,7 +900,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c *high = value_as_long (value_field (range, i)); if (rust_inclusive_range_type_p (type)) -@@ -1322,7 +1319,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, +@@ -1353,7 +1350,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, struct type *rhstype; LONGEST low, high_bound; /* Initialized to appease the compiler. */ @@ -1165,7 +909,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c LONGEST high = 0; int want_slice = 0; -@@ -1420,7 +1417,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, +@@ -1451,7 +1448,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, error (_("Cannot subscript non-array type")); if (want_slice @@ -1174,7 +918,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c low = low_bound; if (low < 0) error (_("Index less than zero")); -@@ -1438,7 +1435,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, +@@ -1469,7 +1466,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, CORE_ADDR addr; struct value *addrval, *tem; @@ -1669,33 +1413,53 @@ new file mode 100644 +program testprog + call sub +end -diff --git a/gdb/testsuite/gdb.fortran/vla-ptype.exp b/gdb/testsuite/gdb.fortran/vla-ptype.exp ---- a/gdb/testsuite/gdb.fortran/vla-ptype.exp -+++ b/gdb/testsuite/gdb.fortran/vla-ptype.exp -@@ -98,3 +98,7 @@ gdb_test "ptype vla2" "type = " "ptype vla2 not allocated" - gdb_test "ptype vla2(5, 45, 20)" \ - "no such vector element \\\(vector not allocated\\\)" \ - "ptype vla2(5, 45, 20) not allocated" -+ -+gdb_breakpoint [gdb_get_line_number "vla1-neg-bounds"] -+gdb_continue_to_breakpoint "vla1-neg-bounds" -+gdb_test "ptype vla1" "type = $real \\(-2:1,-5:4,-3:-1\\)" "ptype vla1 negative bounds" diff --git a/gdb/testsuite/gdb.fortran/vla-sizeof.exp b/gdb/testsuite/gdb.fortran/vla-sizeof.exp --- a/gdb/testsuite/gdb.fortran/vla-sizeof.exp +++ b/gdb/testsuite/gdb.fortran/vla-sizeof.exp -@@ -44,3 +44,7 @@ gdb_test "print sizeof(pvla)" " = 0" "print sizeof non-associated pvla" - gdb_breakpoint [gdb_get_line_number "pvla-associated"] - gdb_continue_to_breakpoint "pvla-associated" +@@ -32,7 +32,8 @@ gdb_test "print sizeof(vla1)" " = 0" "print sizeof non-allocated vla1" + gdb_test "print sizeof(vla1(3,2,1))" \ + "no such vector element \\(vector not allocated\\)" \ + "print sizeof non-allocated indexed vla1" +-gdb_test "print sizeof(vla1(3:4,2,1))" "array not allocated" \ ++gdb_test "print sizeof(vla1(3:4,2,1))" \ ++ "provided bound\\(s\\) outside array bound\\(s\\)" \ + "print sizeof non-allocated sliced vla1" + + # Try to access value in allocated VLA +@@ -41,7 +42,7 @@ gdb_continue_to_breakpoint "vla1-allocated" + gdb_test "print sizeof(vla1)" " = 4000" "print sizeof allocated vla1" + gdb_test "print sizeof(vla1(3,2,1))" "4" \ + "print sizeof element from allocated vla1" +-gdb_test "print sizeof(vla1(3:4,2,1))" "800" \ ++gdb_test "print sizeof(vla1(3:4,2,1))" "8" \ + "print sizeof sliced vla1" + + # Try to access values in undefined pointer to VLA (dangling) +@@ -49,7 +50,8 @@ gdb_test "print sizeof(pvla)" " = 0" "print sizeof non-associated pvla" + gdb_test "print sizeof(pvla(3,2,1))" \ + "no such vector element \\(vector not associated\\)" \ + "print sizeof non-associated indexed pvla" +-gdb_test "print sizeof(pvla(3:4,2,1))" "array not associated" \ ++gdb_test "print sizeof(pvla(3:4,2,1))" \ ++ "provided bound\\(s\\) outside array bound\\(s\\)" \ + "print sizeof non-associated sliced pvla" + + # Try to access values in pointer to VLA and compare them +@@ -58,7 +60,8 @@ gdb_continue_to_breakpoint "pvla-associated" gdb_test "print sizeof(pvla)" " = 4000" "print sizeof associated pvla" + gdb_test "print sizeof(pvla(3,2,1))" "4" \ + "print sizeof element from associated pvla" +-gdb_test "print sizeof(pvla(3:4,2,1))" "800" "print sizeof sliced pvla" + -+gdb_breakpoint [gdb_get_line_number "vla1-neg-bounds"] -+gdb_continue_to_breakpoint "vla1-neg-bounds" -+gdb_test "print sizeof(vla1)" " = 480" "print sizeof vla1 negative bounds" ++gdb_test "print sizeof(pvla(3:4,2,1))" "8" "print sizeof sliced pvla" + + gdb_breakpoint [gdb_get_line_number "vla1-neg-bounds-v1"] + gdb_continue_to_breakpoint "vla1-neg-bounds-v1" diff --git a/gdb/testsuite/gdb.fortran/vla-stride.exp b/gdb/testsuite/gdb.fortran/vla-stride.exp new file mode 100644 --- /dev/null +++ b/gdb/testsuite/gdb.fortran/vla-stride.exp -@@ -0,0 +1,44 @@ +@@ -0,0 +1,47 @@ +# Copyright 2016 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -1723,6 +1487,9 @@ new file mode 100644 + continue +} + ++gdb_test_no_output "set max-value-size unlimited" \ ++ "set max-value-size to unlimited" ++ +gdb_breakpoint [gdb_get_line_number "re-reverse-elements"] +gdb_continue_to_breakpoint "re-reverse-elements" +gdb_test "print pvla" " = \\\(1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\\)" \ @@ -1774,51 +1541,10 @@ new file mode 100644 + + pvla => null() ! single-element +end program vla_stride -diff --git a/gdb/testsuite/gdb.fortran/vla.f90 b/gdb/testsuite/gdb.fortran/vla.f90 ---- a/gdb/testsuite/gdb.fortran/vla.f90 -+++ b/gdb/testsuite/gdb.fortran/vla.f90 -@@ -54,4 +54,14 @@ program vla - - allocate (vla3 (2,2)) ! vla2-deallocated - vla3(:,:) = 13 -+ -+ allocate (vla1 (-2:1, -5:4, -3:-1)) -+ l = allocated(vla1) -+ -+ vla1(:, :, :) = 1 -+ vla1(-2, -3, -1) = -231 -+ -+ deallocate (vla1) ! vla1-neg-bounds -+ l = allocated(vla1) -+ - end program vla -diff --git a/gdb/valarith.c b/gdb/valarith.c ---- a/gdb/valarith.c -+++ b/gdb/valarith.c -@@ -187,11 +187,17 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) - struct type *array_type = check_typedef (value_type (array)); - struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type)); - ULONGEST elt_size = type_length_units (elt_type); -- ULONGEST elt_offs = elt_size * (index - lowerbound); -+ LONGEST elt_offs = index - lowerbound; -+ LONGEST elt_stride = TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (array_type)); -+ -+ if (elt_stride != 0) -+ elt_offs *= elt_stride; -+ else -+ elt_offs *= elt_size; - - if (index < lowerbound - || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type) -- && elt_offs >= type_length_units (array_type)) -+ && abs (elt_offs) >= type_length_units (array_type)) - || (VALUE_LVAL (array) != lval_memory - && TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type))) - { diff --git a/gdb/valops.c b/gdb/valops.c --- a/gdb/valops.c +++ b/gdb/valops.c -@@ -3792,56 +3792,195 @@ value_of_this_silent (const struct language_defn *lang) +@@ -3797,13 +3797,42 @@ value_of_this_silent (const struct language_defn *lang) struct value * value_slice (struct value *array, int lowbound, int length) @@ -1865,6 +1591,9 @@ diff --git a/gdb/valops.c b/gdb/valops.c if (TYPE_CODE (array_type) != TYPE_CODE_ARRAY && TYPE_CODE (array_type) != TYPE_CODE_STRING) error (_("cannot take slice of non-array")); +@@ -3813,45 +3842,155 @@ value_slice (struct value *array, int lowbound, int length) + if (type_not_associated (array_type)) + error (_("array not associated")); - range_type = TYPE_INDEX_TYPE (array_type); - if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0) @@ -1932,7 +1661,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c /* FIXME-type-allocation: need a way to free this type when we are - done with it. */ -- slice_range_type = create_static_range_type ((struct type *) NULL, +- slice_range_type = create_static_range_type (NULL, - TYPE_TARGET_TYPE (range_type), - lowbound, - lowbound + length - 1); @@ -1954,7 +1683,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c + + slice_type = create_array_type (NULL, element_type, slice_range_type); -- slice_type = create_array_type ((struct type *) NULL, +- slice_type = create_array_type (NULL, - element_type, - slice_range_type); - TYPE_CODE (slice_type) = TYPE_CODE (array_type); @@ -2047,7 +1776,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c diff --git a/gdb/value.h b/gdb/value.h --- a/gdb/value.h +++ b/gdb/value.h -@@ -1139,6 +1139,8 @@ extern struct value *varying_to_slice (struct value *); +@@ -1145,6 +1145,8 @@ extern struct value *varying_to_slice (struct value *); extern struct value *value_slice (struct value *, int, int); diff --git a/gdb-vla-intel-fortran-vla-strings.patch b/gdb-vla-intel-fortran-vla-strings.patch index dd37f09..2173af0 100644 --- a/gdb-vla-intel-fortran-vla-strings.patch +++ b/gdb-vla-intel-fortran-vla-strings.patch @@ -33,7 +33,7 @@ git diff --stat -p gdb/master...gdb/users/bheckel/fortran-vla-strings diff --git a/gdb/NEWS b/gdb/NEWS --- a/gdb/NEWS +++ b/gdb/NEWS -@@ -336,6 +336,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd* +@@ -805,6 +805,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd* *** Changes in GDB 8.1 @@ -45,7 +45,7 @@ diff --git a/gdb/NEWS b/gdb/NEWS diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c -@@ -653,6 +653,28 @@ c_value_print (struct value *val, struct ui_file *stream, +@@ -649,6 +649,28 @@ c_value_print (struct value *val, struct ui_file *stream, else { /* normal case */ @@ -77,50 +77,68 @@ diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -1833,7 +1833,8 @@ static void read_signatured_type (struct signatured_type *); +@@ -1827,7 +1827,10 @@ static void read_signatured_type (struct signatured_type *); static int attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, struct dwarf2_cu *cu, -- struct dynamic_prop *prop); -+ struct dynamic_prop *prop, const gdb_byte *additional_data, +- struct dynamic_prop *prop, struct type *type); ++ struct dynamic_prop *prop, ++ struct type *default_type, ++ const gdb_byte *additional_data, + int additional_data_size); /* memory allocation interface */ -@@ -13757,7 +13758,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) - { +@@ -13799,7 +13802,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) newobj->static_link = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop); -- attr_to_dynamic_prop (attr, die, cu, newobj->static_link); -+ attr_to_dynamic_prop (attr, die, cu, newobj->static_link, NULL, 0); + attr_to_dynamic_prop (attr, die, cu, newobj->static_link, +- dwarf2_per_cu_addr_type (cu->per_cu)); ++ dwarf2_per_cu_addr_type (cu->per_cu), NULL, 0); } cu->list_in_scope = cu->get_builder ()->get_local_symbols (); -@@ -16516,7 +16517,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) - +@@ -16565,7 +16568,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) byte_stride_prop = (struct dynamic_prop *) alloca (sizeof (struct dynamic_prop)); -- stride_ok = attr_to_dynamic_prop (attr, die, cu, byte_stride_prop); -+ stride_ok = attr_to_dynamic_prop (attr, die, cu, byte_stride_prop, -+ NULL, 0); + stride_ok = attr_to_dynamic_prop (attr, die, cu, byte_stride_prop, +- prop_type); ++ prop_type, NULL, 0); if (!stride_ok) { complaint (_("unable to read array DW_AT_byte_stride " -@@ -17277,29 +17279,90 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) - struct gdbarch *gdbarch = get_objfile_arch (objfile); - struct type *type, *range_type, *index_type, *char_type; +@@ -17325,7 +17328,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) struct attribute *attr; -- unsigned int length; -+ unsigned int length = UINT_MAX; -+ + struct dynamic_prop prop; + bool length_is_constant = true; +- LONGEST length; ++ ULONGEST length = UINT_MAX; + + /* There are a couple of places where bit sizes might be made use of + when parsing a DW_TAG_string_type, however, no producer that we know +@@ -17346,6 +17349,10 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) + } + } + + index_type = objfile_type (objfile)->builtin_int; + range_type = create_static_range_type (NULL, index_type, 1, length); - ++ + /* If DW_AT_string_length is defined, the length is stored in memory. */ attr = dwarf2_attr (die, DW_AT_string_length, cu); - if (attr) + if (attr != nullptr && !attr_form_is_constant (attr)) + { +@@ -17372,13 +17379,71 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) + } + + /* Convert the attribute into a dynamic property. */ +- if (!attr_to_dynamic_prop (attr, die, cu, &prop, prop_type)) ++ if (!attr_to_dynamic_prop (attr, die, cu, &prop, prop_type, NULL, 0)) + length = 1; + else + length_is_constant = false; + } + else if (attr != nullptr) { -- length = DW_UNSND (attr); + if (attr_form_is_block (attr)) + { + struct attribute *byte_size, *bit_size; @@ -152,8 +170,8 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c + /* Operand for DW_OP_deref_size. */ + (gdb_byte) DW_UNSND(byte_size) }; + -+ if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops, -+ ARRAY_SIZE(append_ops))) ++ if (!attr_to_dynamic_prop (attr, die, cu, &high, index_type, ++ append_ops, ARRAY_SIZE(append_ops))) + complaint (_("Could not parse DW_AT_byte_size")); + } + else if (bit_size != NULL) @@ -166,8 +184,8 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c + const gdb_byte append_ops[] = + { DW_OP_deref }; + -+ if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops, -+ ARRAY_SIZE(append_ops))) ++ if (!attr_to_dynamic_prop (attr, die, cu, &high, index_type, ++ append_ops, ARRAY_SIZE(append_ops))) + complaint (_("Could not parse DW_AT_string_length")); + } + @@ -178,56 +196,53 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c + TYPE_HIGH_BOUND (range_type) = DW_UNSND(attr); + TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST; + } ++ + /* This DW_AT_string_length just contains the length with no + indirection. There's no need to create a dynamic property in this + case. Pass 0 for the default value as we know it will not be +@@ -17392,6 +17457,20 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) } else { -- /* Check for the DW_AT_byte_size attribute. */ + /* Check for the DW_AT_byte_size attribute, which represents the length + in this case. */ - attr = dwarf2_attr (die, DW_AT_byte_size, cu); - if (attr) -- { -- length = DW_UNSND (attr); -- } ++ attr = dwarf2_attr (die, DW_AT_byte_size, cu); ++ if (attr) + { + TYPE_HIGH_BOUND (range_type) = DW_UNSND(attr); + TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST; + } - else -- { -- length = 1; -- } ++ else + { + TYPE_HIGH_BOUND (range_type) = 1; + TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST; + } ++ + /* Use 1 as a fallback length if we have nothing else. */ + length = 1; } - -- index_type = objfile_type (objfile)->builtin_int; -- range_type = create_static_range_type (NULL, index_type, 1, length); +@@ -17407,6 +17486,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) + low_bound.data.const_val = 1; + range_type = create_range_type (NULL, index_type, &low_bound, &prop, 0); + } ++ char_type = language_string_char_type (cu->language_defn, gdbarch); type = create_string_type (NULL, char_type, range_type); -@@ -17667,7 +17730,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) - +@@ -17858,7 +17938,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) static int attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, -- struct dwarf2_cu *cu, struct dynamic_prop *prop) -+ struct dwarf2_cu *cu, struct dynamic_prop *prop, + struct dwarf2_cu *cu, struct dynamic_prop *prop, +- struct type *default_type) ++ struct type *default_type, + const gdb_byte *additional_data, int additional_data_size) { struct dwarf2_property_baton *baton; struct obstack *obstack -@@ -17678,14 +17742,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, - - if (attr_form_is_block (attr)) - { -- baton = XOBNEW (obstack, struct dwarf2_property_baton); -+ baton = XOBNEW(obstack, struct dwarf2_property_baton); - baton->referenced_type = NULL; - baton->locexpr.per_cu = cu->per_cu; -- baton->locexpr.size = DW_BLOCK (attr)->size; -- baton->locexpr.data = DW_BLOCK (attr)->data; +@@ -17885,9 +17966,30 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, + baton->locexpr.is_reference = false; + break; + } + + if (additional_data != NULL && additional_data_size > 0) + { @@ -256,12 +271,13 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c } else if (attr_form_is_ref (attr)) { -@@ -17718,8 +17801,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, +@@ -17920,9 +18022,29 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, baton = XOBNEW (obstack, struct dwarf2_property_baton); - baton->referenced_type = die_type (target_die, target_cu); + baton->property_type = die_type (target_die, target_cu); baton->locexpr.per_cu = cu->per_cu; - baton->locexpr.size = DW_BLOCK (target_attr)->size; - baton->locexpr.data = DW_BLOCK (target_attr)->data; + baton->locexpr.is_reference = true; + + if (additional_data != NULL && additional_data_size > 0) + { @@ -287,124 +303,91 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c prop->data.baton = baton; prop->kind = PROP_LOCEXPR; gdb_assert (prop->data.baton != NULL); -@@ -17830,7 +17933,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) - - attr = dwarf2_attr (die, DW_AT_byte_stride, cu); - if (attr) -- if (!attr_to_dynamic_prop (attr, die, cu, &stride)) -+ if (!attr_to_dynamic_prop (attr, die, cu, &stride, NULL, 0)) - complaint (_("Missing DW_AT_byte_stride " - "- DIE at 0x%s [in module %s]"), - sect_offset_str (die->sect_off), -@@ -17838,7 +17941,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -18099,8 +18221,8 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) + } attr = dwarf2_attr (die, DW_AT_lower_bound, cu); - if (attr) -- attr_to_dynamic_prop (attr, die, cu, &low); -+ attr_to_dynamic_prop (attr, die, cu, &low, NULL, 0); +- if (attr != nullptr) +- attr_to_dynamic_prop (attr, die, cu, &low, base_type); ++ if (attr) ++ attr_to_dynamic_prop (attr, die, cu, &low, base_type, NULL, 0); else if (!low_default_is_valid) complaint (_("Missing DW_AT_lower_bound " "- DIE at %s [in module %s]"), -@@ -17847,10 +17950,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -18109,10 +18231,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct attribute *attr_ub, *attr_count; attr = attr_ub = dwarf2_attr (die, DW_AT_upper_bound, cu); -- if (!attr_to_dynamic_prop (attr, die, cu, &high)) -+ if (!attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0)) +- if (!attr_to_dynamic_prop (attr, die, cu, &high, base_type)) ++ if (!attr_to_dynamic_prop (attr, die, cu, &high, base_type, NULL, 0)) { attr = attr_count = dwarf2_attr (die, DW_AT_count, cu); -- if (attr_to_dynamic_prop (attr, die, cu, &high)) -+ if (attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0)) +- if (attr_to_dynamic_prop (attr, die, cu, &high, base_type)) ++ if (attr_to_dynamic_prop (attr, die, cu, &high, base_type, NULL, 0)) { /* If bounds are constant do the final calculation here. */ if (low.kind == PROP_CONST && high.kind == PROP_CONST) -@@ -25417,7 +25520,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) - attr = dwarf2_attr (die, DW_AT_allocated, cu); - if (attr_form_is_block (attr)) +@@ -18164,7 +18286,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) + struct type *prop_type + = dwarf2_per_cu_addr_sized_int_type (cu->per_cu, false); + attr_to_dynamic_prop (attr_byte_stride, die, cu, &byte_stride_prop, +- prop_type); ++ prop_type, NULL, 0); + } + + struct dynamic_prop bit_stride_prop; +@@ -18185,7 +18307,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) + struct type *prop_type + = dwarf2_per_cu_addr_sized_int_type (cu->per_cu, false); + attr_to_dynamic_prop (attr_bit_stride, die, cu, &bit_stride_prop, +- prop_type); ++ prop_type, NULL, 0); + } + } + +@@ -25879,7 +26001,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) { -- if (attr_to_dynamic_prop (attr, die, cu, &prop)) -+ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0)) + struct type *prop_type + = dwarf2_per_cu_addr_sized_int_type (cu->per_cu, false); +- if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type)) ++ if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type, NULL, 0)) add_dyn_prop (DYN_PROP_ALLOCATED, prop, type); } else if (attr != NULL) -@@ -25431,7 +25534,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) - attr = dwarf2_attr (die, DW_AT_associated, cu); - if (attr_form_is_block (attr)) +@@ -25895,7 +26017,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) { -- if (attr_to_dynamic_prop (attr, die, cu, &prop)) -+ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0)) + struct type *prop_type + = dwarf2_per_cu_addr_sized_int_type (cu->per_cu, false); +- if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type)) ++ if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type, NULL, 0)) add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type); } else if (attr != NULL) -@@ -25443,7 +25546,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) - +@@ -25908,7 +26030,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) /* Read DW_AT_data_location and set in type. */ attr = dwarf2_attr (die, DW_AT_data_location, cu); -- if (attr_to_dynamic_prop (attr, die, cu, &prop)) -+ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0)) + if (attr_to_dynamic_prop (attr, die, cu, &prop, +- dwarf2_per_cu_addr_type (cu->per_cu))) ++ dwarf2_per_cu_addr_type (cu->per_cu), NULL, 0)) add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type); if (dwarf2_per_objfile->die_type_hash == NULL) diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c --- a/gdb/f-typeprint.c +++ b/gdb/f-typeprint.c -@@ -37,7 +37,7 @@ static void f_type_print_args (struct type *, struct ui_file *); - #endif - - static void f_type_print_varspec_suffix (struct type *, struct ui_file *, int, -- int, int, int); -+ int, int, int, int); - - void f_type_print_varspec_prefix (struct type *, struct ui_file *, - int, int); -@@ -53,18 +53,6 @@ f_print_type (struct type *type, const char *varstring, struct ui_file *stream, - { - enum type_code code; - -- if (type_not_associated (type)) -- { -- val_print_not_associated (stream); -- return; -- } -- -- if (type_not_allocated (type)) -- { -- val_print_not_allocated (stream); -- return; -- } -- - f_type_print_base (type, stream, show, level); - code = TYPE_CODE (type); - if ((varstring != NULL && *varstring != '\0') -@@ -89,7 +77,7 @@ f_print_type (struct type *type, const char *varstring, struct ui_file *stream, - - demangled_args = (*varstring != '\0' - && varstring[strlen (varstring) - 1] == ')'); -- f_type_print_varspec_suffix (type, stream, show, 0, demangled_args, 0); -+ f_type_print_varspec_suffix (type, stream, show, 0, demangled_args, 0, 0); - } - } - -@@ -159,7 +147,7 @@ f_type_print_varspec_prefix (struct type *type, struct ui_file *stream, - static void - f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, - int show, int passed_a_ptr, int demangled_args, -- int arrayprint_recurse_level) -+ int arrayprint_recurse_level, int print_rank_only) - { - int upper_bound, lower_bound; - -@@ -183,34 +171,50 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, - fprintf_filtered (stream, "("); - - if (type_not_associated (type)) -- val_print_not_associated (stream); -+ print_rank_only = 1; - else if (type_not_allocated (type)) -- val_print_not_allocated (stream); -+ print_rank_only = 1; -+ else if ((TYPE_ASSOCIATED_PROP (type) -+ && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ASSOCIATED_PROP (type))) +@@ -197,15 +197,14 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, + print_rank_only = true; + else if ((TYPE_ASSOCIATED_PROP (type) + && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ASSOCIATED_PROP (type))) +- || (TYPE_ALLOCATED_PROP (type) +- && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ALLOCATED_PROP (type))) +- || (TYPE_DATA_LOCATION (type) +- && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_DATA_LOCATION (type)))) +- { +- /* This case exist when we ptype a typename which has the dynamic +- properties but cannot be resolved as there is no object. */ +- print_rank_only = true; +- } + || (TYPE_ALLOCATED_PROP (type) + && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ALLOCATED_PROP (type))) + || (TYPE_DATA_LOCATION (type) @@ -412,95 +395,43 @@ diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c + /* This case exist when we ptype a typename which has the + dynamic properties but cannot be resolved as there is + no object. */ -+ print_rank_only = 1; -+ -+ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY) -+ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, -+ 0, 0, arrayprint_recurse_level, -+ print_rank_only); -+ -+ if (print_rank_only == 1) -+ fprintf_filtered (stream, ":"); ++ print_rank_only = true; + + if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY) + f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, +@@ -217,8 +216,9 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, else -- { -- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY) -- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, -- 0, 0, arrayprint_recurse_level); -- -- lower_bound = f77_get_lowerbound (type); -- if (lower_bound != 1) /* Not the default. */ -- fprintf_filtered (stream, "%d:", lower_bound); -- -- /* Make sure that, if we have an assumed size array, we -- print out a warning and print the upperbound as '*'. */ -- -- if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) -- fprintf_filtered (stream, "*"); -- else -- { -- upper_bound = f77_get_upperbound (type); -- fprintf_filtered (stream, "%d", upper_bound); -- } -- -- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY) -- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, -- 0, 0, arrayprint_recurse_level); -- } -+ { -+ lower_bound = f77_get_lowerbound (type); -+ if (lower_bound != 1) /* Not the default. */ -+ fprintf_filtered (stream, "%d:", lower_bound); + { + LONGEST lower_bound = f77_get_lowerbound (type); + -+ /* Make sure that, if we have an assumed size array, we -+ print out a warning and print the upperbound as '*'. */ -+ -+ if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) -+ fprintf_filtered (stream, "*"); -+ else -+ { -+ upper_bound = f77_get_upperbound (type); -+ fprintf_filtered (stream, "%d", upper_bound); -+ } -+ } -+ -+ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY) -+ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, -+ 0, 0, arrayprint_recurse_level, -+ print_rank_only); -+ - if (arrayprint_recurse_level == 1) - fprintf_filtered (stream, ")"); - else -@@ -221,13 +225,14 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, - case TYPE_CODE_PTR: + if (lower_bound != 1) /* Not the default. */ +- fprintf_filtered (stream, "%s:", plongest (lower_bound)); ++ fprintf_filtered (stream, "%s:", plongest (lower_bound)); + + /* Make sure that, if we have an assumed size array, we + print out a warning and print the upperbound as '*'. */ +@@ -229,7 +229,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, + { + LONGEST upper_bound = f77_get_upperbound (type); + +- fputs_filtered (plongest (upper_bound), stream); ++ fprintf_filtered (stream, "%s", plongest (upper_bound)); + } + } + +@@ -249,7 +249,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, case TYPE_CODE_REF: f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0, -- arrayprint_recurse_level); -+ arrayprint_recurse_level, 0); - fprintf_filtered (stream, ")"); + arrayprint_recurse_level, false); +- fprintf_filtered (stream, " )"); ++ fprintf_filtered (stream, ")"); break; case TYPE_CODE_FUNC: - f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, -- passed_a_ptr, 0, arrayprint_recurse_level); -+ passed_a_ptr, 0, arrayprint_recurse_level, -+ 0); - if (passed_a_ptr) - fprintf_filtered (stream, ")"); - -@@ -388,7 +393,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show, - fputs_filtered (" :: ", stream); - fputs_filtered (TYPE_FIELD_NAME (type, index), stream); - f_type_print_varspec_suffix (TYPE_FIELD_TYPE (type, index), -- stream, show - 1, 0, 0, 0); -+ stream, show - 1, 0, 0, 0, 0); - fputs_filtered ("\n", stream); - } - fprintfi_filtered (level, stream, "End Type "); diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c -@@ -1913,7 +1913,8 @@ is_dynamic_type_internal (struct type *type, int top_level) +@@ -1939,7 +1939,8 @@ is_dynamic_type_internal (struct type *type, int top_level) type = check_typedef (type); /* We only want to recognize references at the outermost level. */ @@ -510,32 +441,26 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c type = check_typedef (TYPE_TARGET_TYPE (type)); /* Types that have a dynamic TYPE_DATA_LOCATION are considered -@@ -1947,6 +1948,7 @@ is_dynamic_type_internal (struct type *type, int top_level) +@@ -1972,10 +1973,10 @@ is_dynamic_type_internal (struct type *type, int top_level) + || is_dynamic_type_internal (TYPE_TARGET_TYPE (type), 0)); } +- case TYPE_CODE_STRING: + /* Strings are very much like an array of characters, and can be + treated as one here. */ case TYPE_CODE_ARRAY: + case TYPE_CODE_STRING: { gdb_assert (TYPE_NFIELDS (type) == 1); -@@ -2065,7 +2067,8 @@ resolve_dynamic_array (struct type *type, - struct dynamic_prop *prop; - unsigned int bit_stride = 0; - -- gdb_assert (TYPE_CODE (type) == TYPE_CODE_ARRAY); -+ gdb_assert (TYPE_CODE (type) == TYPE_CODE_ARRAY -+ || TYPE_CODE (type) == TYPE_CODE_STRING); - - type = copy_type (type); - -@@ -2090,11 +2093,15 @@ resolve_dynamic_array (struct type *type, +@@ -2139,11 +2140,15 @@ resolve_dynamic_array_or_string (struct type *type, ary_dim = check_typedef (TYPE_TARGET_TYPE (elt_type)); - if (ary_dim != NULL && TYPE_CODE (ary_dim) == TYPE_CODE_ARRAY) + if (ary_dim != NULL && (TYPE_CODE (ary_dim) == TYPE_CODE_ARRAY + || TYPE_CODE (ary_dim) == TYPE_CODE_STRING)) - elt_type = resolve_dynamic_array (ary_dim, addr_stack); + elt_type = resolve_dynamic_array_or_string (ary_dim, addr_stack); else elt_type = TYPE_TARGET_TYPE (type); @@ -545,7 +470,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c prop = get_dyn_prop (DYN_PROP_BYTE_STRIDE, type); if (prop != NULL) { -@@ -2249,6 +2256,28 @@ resolve_dynamic_struct (struct type *type, +@@ -2295,6 +2300,28 @@ resolve_dynamic_struct (struct type *type, return resolved_type; } @@ -574,19 +499,16 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c /* Worker for resolved_dynamic_type. */ static struct type * -@@ -2297,7 +2326,12 @@ resolve_dynamic_type_internal (struct type *type, - break; - } - +@@ -2349,6 +2376,9 @@ resolve_dynamic_type_internal (struct type *type, + case TYPE_CODE_ARRAY: + resolved_type = resolve_dynamic_array_or_string (type, addr_stack); + break; + case TYPE_CODE_PTR: + resolved_type = resolve_dynamic_pointer (type, addr_stack); + break; -+ - case TYPE_CODE_ARRAY: -+ case TYPE_CODE_STRING: - resolved_type = resolve_dynamic_array (type, addr_stack); - break; + case TYPE_CODE_RANGE: + resolved_type = resolve_dynamic_range (type, addr_stack); diff --git a/gdb/testsuite/gdb.cp/vla-cxx.cc b/gdb/testsuite/gdb.cp/vla-cxx.cc --- a/gdb/testsuite/gdb.cp/vla-cxx.cc +++ b/gdb/testsuite/gdb.cp/vla-cxx.cc @@ -683,15 +605,15 @@ new file mode 100644 + +gdb_breakpoint [gdb_get_line_number "Before pointer assignment"] +gdb_continue_to_breakpoint "Before pointer assignment" -+gdb_test "print logp" "= \\(PTR TO -> \\( $logical \\)\\) 0x0" "print logp, not associated" ++gdb_test "print logp" "= \\(PTR TO -> \\( $logical\\)\\) 0x0" "print logp, not associated" +gdb_test "print *logp" "Cannot access memory at address 0x0" "print *logp, not associated" -+gdb_test "print comp" "= \\(PTR TO -> \\( $complex \\)\\) 0x0" "print comp, not associated" ++gdb_test "print comp" "= \\(PTR TO -> \\( $complex\\)\\) 0x0" "print comp, not associated" +gdb_test "print *comp" "Cannot access memory at address 0x0" "print *comp, not associated" -+gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1 \\)\\) 0x0" "print charp, not associated" ++gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1\\)\\) 0x0" "print charp, not associated" +gdb_test "print *charp" "Cannot access memory at address 0x0" "print *charp, not associated" -+gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3 \\)\\) 0x0" "print charap, not associated" ++gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3\\)\\) 0x0" "print charap, not associated" +gdb_test "print *charap" "Cannot access memory at address 0x0" "print *charap, not associated" -+gdb_test "print intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0" "print intp, not associated" ++gdb_test "print intp" "= \\(PTR TO -> \\( $int\\)\\) 0x0" "print intp, not associated" +gdb_test "print *intp" "Cannot access memory at address 0x0" "print *intp, not associated" +set test "print intap, not associated" +gdb_test_multiple "print intap" $test { @@ -702,9 +624,9 @@ new file mode 100644 + pass $test + } +} -+gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) 0x0" "print realp, not associated" ++gdb_test "print realp" "= \\(PTR TO -> \\( $real\\)\\) 0x0" "print realp, not associated" +gdb_test "print *realp" "Cannot access memory at address 0x0" "print *realp, not associated" -+gdb_test "print \$my_var = intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0" ++gdb_test "print \$my_var = intp" "= \\(PTR TO -> \\( $int\\)\\) 0x0" +set test "print cyclicp1, not associated" +gdb_test_multiple "print cyclicp1" $test { + -re "= \\( i = -?\\d+, p = 0x0 \\)\r\n$gdb_prompt $" { @@ -716,10 +638,10 @@ new file mode 100644 +} +set test "print cyclicp1%p, not associated" +gdb_test_multiple "print cyclicp1%p" $test { -+ -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) 0x0\r\n$gdb_prompt $" { ++ -re "= \\(PTR TO -> \\( Type typewithpointer\\)\\) 0x0\r\n$gdb_prompt $" { + pass $test + } -+ -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) \r\n$gdb_prompt $" { ++ -re "= \\(PTR TO -> \\( Type typewithpointer\\)\\) \r\n$gdb_prompt $" { + pass $test + } +} @@ -732,15 +654,15 @@ new file mode 100644 + +gdb_breakpoint [gdb_get_line_number "After value assignment"] +gdb_continue_to_breakpoint "After value assignment" -+gdb_test "print logp" "= \\(PTR TO -> \\( $logical \\)\\) $hex\( <.*>\)?" ++gdb_test "print logp" "= \\(PTR TO -> \\( $logical\\)\\) $hex\( <.*>\)?" +gdb_test "print *logp" "= \\.TRUE\\." -+gdb_test "print comp" "= \\(PTR TO -> \\( $complex \\)\\) $hex\( <.*>\)?" ++gdb_test "print comp" "= \\(PTR TO -> \\( $complex\\)\\) $hex\( <.*>\)?" +gdb_test "print *comp" "= \\(1,2\\)" -+gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1 \\)\\) $hex\( <.*>\)?" ++gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1\\)\\) $hex\( <.*>\)?" +gdb_test "print *charp" "= 'a'" -+gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3 \\)\\) $hex\( <.*>\)?" ++gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3\\)\\) $hex\( <.*>\)?" +gdb_test "print *charap" "= 'abc'" -+gdb_test "print intp" "= \\(PTR TO -> \\( $int \\)\\) $hex\( <.*>\)?" ++gdb_test "print intp" "= \\(PTR TO -> \\( $int\\)\\) $hex\( <.*>\)?" +gdb_test "print *intp" "= 10" +set test_name "print intap, associated" +gdb_test_multiple "print intap" $test_name { @@ -762,16 +684,16 @@ new file mode 100644 + pass $test_name + } +} -+gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) $hex\( <.*>\)?" ++gdb_test "print realp" "= \\(PTR TO -> \\( $real\\)\\) $hex\( <.*>\)?" +gdb_test "print *realp" "= 3\\.14000\\d+" -+gdb_test "print arrayOfPtr(2)%p" "= \\(PTR TO -> \\( Type two \\)\\) $hex\( <.*>\)?" ++gdb_test "print arrayOfPtr(2)%p" "= \\(PTR TO -> \\( Type two\\)\\) $hex\( <.*>\)?" +gdb_test "print *(arrayOfPtr(2)%p)" "= \\( ivla1 = \\(11, 12, 13\\), ivla2 = \\(\\( 211, 221\\) \\( 212, 222\\) \\) \\)" +set test_name "print arrayOfPtr(3)%p" +gdb_test_multiple $test_name $test_name { -+ -re "= \\(PTR TO -> \\( Type two \\)\\) \r\n$gdb_prompt $" { ++ -re "= \\(PTR TO -> \\( Type two\\)\\) \r\n$gdb_prompt $" { + pass $test_name + } -+ -re "= \\(PTR TO -> \\( Type two \\)\\) 0x0\r\n$gdb_prompt $" { ++ -re "= \\(PTR TO -> \\( Type two\\)\\) 0x0\r\n$gdb_prompt $" { + pass $test_name + } +} @@ -785,37 +707,17 @@ new file mode 100644 + } +} +gdb_test "print cyclicp1" "= \\( i = 1, p = $hex\( <.*>\)? \\)" -+gdb_test "print cyclicp1%p" "= \\(PTR TO -> \\( Type typewithpointer \\)\\) $hex\( <.*>\)?" ++gdb_test "print cyclicp1%p" "= \\(PTR TO -> \\( Type typewithpointer\\)\\) $hex\( <.*>\)?" +gdb_test "print *((integer*) &inta + 2)" "= 3" "print temporary pointer, array" +gdb_test "print *((integer*) &intvla + 3)" "= 4" "print temporary pointer, allocated vla" -+gdb_test "print \$pc" "= \\(PTR TO -> \\( void \\(\\)\\(\\)\\)\\) $hex " "Print program counter" ++gdb_test "print \$pc" "= \\(PTR TO -> \\( void \\(\\) \\(\\)\\)\\) $hex " "Print program counter" diff --git a/gdb/testsuite/gdb.fortran/pointers.f90 b/gdb/testsuite/gdb.fortran/pointers.f90 -new file mode 100644 ---- /dev/null +--- a/gdb/testsuite/gdb.fortran/pointers.f90 +++ b/gdb/testsuite/gdb.fortran/pointers.f90 -@@ -0,0 +1,109 @@ -+! Copyright 2016 Free Software Foundation, Inc. -+! -+! This program is free software; you can redistribute it and/or modify -+! it under the terms of the GNU General Public License as published by -+! the Free Software Foundation; either version 3 of the License, or -+! (at your option) any later version. -+! -+! This program is distributed in the hope that it will be useful, -+! but WITHOUT ANY WARRANTY; without even the implied warranty of -+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+! GNU General Public License for more details. -+! -+! You should have received a copy of the GNU General Public License -+! along with this program. If not, see . -+ -+program pointers -+ -+ type :: two -+ integer, allocatable :: ivla1 (:) -+ integer, allocatable :: ivla2 (:, :) -+ end type two -+ +@@ -20,21 +20,34 @@ program pointers + integer, allocatable :: ivla2 (:, :) + end type two + + type :: typeWithPointer + integer i + type(typeWithPointer), pointer:: p @@ -825,229 +727,125 @@ new file mode 100644 + type (two), pointer :: p + end type twoPtr + -+ logical, target :: logv -+ complex, target :: comv -+ character, target :: charv -+ character (len=3), target :: chara -+ integer, target :: intv -+ integer, target, dimension (10,2) :: inta + logical, target :: logv + complex, target :: comv + character, target :: charv + character (len=3), target :: chara + integer, target :: intv + integer, target, dimension (10,2) :: inta +- real, target :: realv +- type(two), target :: twov + integer, target, allocatable, dimension (:) :: intvla + real, target :: realv + type(two), target :: twov + type(twoPtr) :: arrayOfPtr (3) + type(typeWithPointer), target:: cyclicp1,cyclicp2 -+ -+ logical, pointer :: logp -+ complex, pointer :: comp + + logical, pointer :: logp + complex, pointer :: comp +- character, pointer :: charp +- character (len=3), pointer :: charap + character, pointer:: charp + character (len=3), pointer:: charap -+ integer, pointer :: intp -+ integer, pointer, dimension (:,:) :: intap + integer, pointer :: intp + integer, pointer, dimension (:,:) :: intap + integer, pointer, dimension (:) :: intvlap -+ real, pointer :: realp -+ type(two), pointer :: twop -+ -+ nullify (logp) -+ nullify (comp) -+ nullify (charp) -+ nullify (charap) -+ nullify (intp) -+ nullify (intap) + real, pointer :: realp + type(two), pointer :: twop + +@@ -44,8 +57,14 @@ program pointers + nullify (charap) + nullify (intp) + nullify (intap) + nullify (intvlap) -+ nullify (realp) -+ nullify (twop) + nullify (realp) + nullify (twop) + nullify (arrayOfPtr(1)%p) + nullify (arrayOfPtr(2)%p) + nullify (arrayOfPtr(3)%p) + nullify (cyclicp1%p) + nullify (cyclicp2%p) -+ -+ logp => logv ! Before pointer assignment -+ comp => comv -+ charp => charv -+ charap => chara -+ intp => intv -+ intap => inta + + logp => logv ! Before pointer assignment + comp => comv +@@ -53,8 +72,14 @@ program pointers + charap => chara + intp => intv + intap => inta + intvlap => intvla -+ realp => realv -+ twop => twov + realp => realv + twop => twov + arrayOfPtr(2)%p => twov + cyclicp1%i = 1 + cyclicp1%p => cyclicp2 + cyclicp2%i = 2 + cyclicp2%p => cyclicp1 -+ -+ logv = associated(logp) ! Before value assignment -+ comv = cmplx(1,2) -+ charv = "a" -+ chara = "abc" -+ intv = 10 -+ inta(:,:) = 1 -+ inta(3,1) = 3 + + logv = associated(logp) ! Before value assignment + comv = cmplx(1,2) +@@ -63,6 +88,10 @@ program pointers + intv = 10 + inta(:,:) = 1 + inta(3,1) = 3 + allocate (intvla(10)) + intvla(:) = 2 + intvla(4) = 4 + intvlap => intvla -+ realv = 3.14 -+ -+ allocate (twov%ivla1(3)) -+ allocate (twov%ivla2(2,2)) -+ twov%ivla1(1) = 11 -+ twov%ivla1(2) = 12 -+ twov%ivla1(3) = 13 -+ twov%ivla2(1,1) = 211 -+ twov%ivla2(2,1) = 221 -+ twov%ivla2(1,2) = 212 -+ twov%ivla2(2,2) = 222 -+ -+ intv = intv + 1 ! After value assignment -+ -+end program pointers + realv = 3.14 + + allocate (twov%ivla1(3)) diff --git a/gdb/testsuite/gdb.fortran/print_type.exp b/gdb/testsuite/gdb.fortran/print_type.exp -new file mode 100644 ---- /dev/null +--- a/gdb/testsuite/gdb.fortran/print_type.exp +++ b/gdb/testsuite/gdb.fortran/print_type.exp -@@ -0,0 +1,100 @@ -+# Copyright 2016 Free Software Foundation, Inc. +@@ -1,5 +1,6 @@ + # Copyright 2019-2020 Free Software Foundation, Inc. + # + -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+standard_testfile "pointers.f90" -+load_lib fortran.exp -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ -+ {debug f90 quiet}] } { -+ return -1 -+} -+ -+ -+if ![runto_main] { -+ untested "could not run to main" -+ return -1 -+} -+ -+# Depending on the compiler being used, the type names can be printed differently. -+set logical [fortran_logical4] -+set real [fortran_real4] -+set int [fortran_int4] -+set complex [fortran_complex4] -+ -+gdb_breakpoint [gdb_get_line_number "Before pointer assignment"] -+gdb_continue_to_breakpoint "Before pointer assignment" -+gdb_test "ptype logp" "type = PTR TO -> \\( $logical \\)" "ptype logp, not associated" -+gdb_test "ptype comp" "type = PTR TO -> \\( $complex \\)" "ptype comp, not associated" -+gdb_test "ptype charp" "type = PTR TO -> \\( character\\*1 \\)" "ptype charp, not associated" -+gdb_test "ptype charap" "type = PTR TO -> \\( character\\*3 \\)" "ptype charap, not associated" -+gdb_test "ptype intp" "type = PTR TO -> \\( $int \\)" "ptype intp, not associated" -+set test "ptype intap, not associated" -+gdb_test_multiple "ptype intap" $test { -+ -re "type = PTR TO -> \\( $int \\(:,:\\)\\)\r\n$gdb_prompt $" { -+ pass $test -+ } -+ -re "type = $int \\(:,:\\)\r\n$gdb_prompt $" { -+ pass $test -+ } -+} -+gdb_test "ptype realp" "type = PTR TO -> \\( $real \\)" "ptype realp, not associated" -+gdb_test "ptype twop" \ -+ [multi_line "type = PTR TO -> \\( Type two" \ -+ " $int :: ivla1\\(:\\)" \ -+ " $int :: ivla2\\(:,:\\)" \ -+ "End Type two \\)"] \ -+ "ptype twop, not associated" -+gdb_test "ptype two" \ -+ [multi_line "type = Type two" \ -+ " $int :: ivla1\\(:\\)" \ -+ " $int :: ivla2\\(:,:\\)" \ -+ "End Type two"] -+ -+ -+gdb_breakpoint [gdb_get_line_number "Before value assignment"] -+gdb_continue_to_breakpoint "Before value assignment" -+gdb_test "ptype twop" \ -+ [multi_line "type = PTR TO -> \\( Type two" \ -+ " $int :: ivla1\\(:\\)" \ -+ " $int :: ivla2\\(:,:\\)" \ -+ "End Type two \\)"] -+ -+ -+gdb_breakpoint [gdb_get_line_number "After value assignment"] -+gdb_continue_to_breakpoint "After value assignment" -+gdb_test "ptype logv" "type = $logical" -+gdb_test "ptype comv" "type = $complex" -+gdb_test "ptype charv" "type = character\\*1" -+gdb_test "ptype chara" "type = character\\*3" -+gdb_test "ptype intv" "type = $int" -+gdb_test "ptype inta" "type = $int \\(10,2\\)" -+gdb_test "ptype realv" "type = $real" -+ -+ -+gdb_test "ptype logp" "type = PTR TO -> \\( $logical \\)" -+gdb_test "ptype comp" "type = PTR TO -> \\( $complex \\)" -+gdb_test "ptype charp" "type = PTR TO -> \\( character\\*1 \\)" -+gdb_test "ptype charap" "type = PTR TO -> \\( character\\*3 \\)" -+gdb_test "ptype intp" "type = PTR TO -> \\( $int \\)" -+set test "ptype intap" -+gdb_test_multiple $test $test { -+ -re "type = $int \\(10,2\\)\r\n$gdb_prompt $" { -+ pass $test -+ } -+ -re "type = PTR TO -> \\( $int \\(10,2\\)\\)\r\n$gdb_prompt $" { -+ pass $test -+ } -+} -+gdb_test "ptype realp" "type = PTR TO -> \\( $real \\)" -diff --git a/gdb/testsuite/gdb.fortran/vla-ptype.exp b/gdb/testsuite/gdb.fortran/vla-ptype.exp ---- a/gdb/testsuite/gdb.fortran/vla-ptype.exp -+++ b/gdb/testsuite/gdb.fortran/vla-ptype.exp -@@ -32,9 +32,9 @@ set real [fortran_real4] - # Check the ptype of various VLA states and pointer to VLA's. - gdb_breakpoint [gdb_get_line_number "vla1-init"] - gdb_continue_to_breakpoint "vla1-init" --gdb_test "ptype vla1" "type = " "ptype vla1 not initialized" --gdb_test "ptype vla2" "type = " "ptype vla2 not initialized" --gdb_test "ptype pvla" "type = " "ptype pvla not initialized" -+gdb_test "ptype vla1" "type = $real \\(:,:,:\\)" "ptype vla1 not initialized" -+gdb_test "ptype vla2" "type = $real \\(:,:,:\\)" "ptype vla2 not initialized" -+gdb_test "ptype pvla" "type = $real \\(:,:,:\\)" "ptype pvla not initialized" - gdb_test "ptype vla1(3, 6, 9)" "no such vector element \\\(vector not allocated\\\)" \ - "ptype vla1(3, 6, 9) not initialized" - gdb_test "ptype vla2(5, 45, 20)" \ -@@ -81,20 +81,20 @@ gdb_test "ptype vla2(5, 45, 20)" "type = $real" \ + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 3 of the License, or +@@ -40,7 +41,7 @@ set complex [fortran_complex4] + # matches the string TYPE. + proc check_pointer_type { var_name type } { + gdb_test "ptype ${var_name}" \ +- "type = PTR TO -> \\( ${type} \\)" ++ "type = PTR TO -> \\( ${type}\\)" + } - gdb_breakpoint [gdb_get_line_number "pvla-deassociated"] - gdb_continue_to_breakpoint "pvla-deassociated" --gdb_test "ptype pvla" "type = " "ptype pvla deassociated" -+gdb_test "ptype pvla" "type = $real \\(:,:,:\\)" "ptype pvla deassociated" - gdb_test "ptype pvla(5, 45, 20)" \ - "no such vector element \\\(vector not associated\\\)" \ - "ptype pvla(5, 45, 20) not associated" + gdb_breakpoint [gdb_get_line_number "Before pointer assignment"] +@@ -85,7 +86,8 @@ gdb_test "ptype twop" \ + [multi_line "type = PTR TO -> \\( Type two" \ + " $int, allocatable :: ivla1\\(:\\)" \ + " $int, allocatable :: ivla2\\(:,:\\)" \ +- "End Type two \\)"] ++ "End Type two\\)"] ++ - gdb_breakpoint [gdb_get_line_number "vla1-deallocated"] - gdb_continue_to_breakpoint "vla1-deallocated" --gdb_test "ptype vla1" "type = " "ptype vla1 not allocated" -+gdb_test "ptype vla1" "type = $real \\(:,:,:\\)" "ptype vla1 not allocated" - gdb_test "ptype vla1(3, 6, 9)" "no such vector element \\\(vector not allocated\\\)" \ - "ptype vla1(3, 6, 9) not allocated" + gdb_breakpoint [gdb_get_line_number "After value assignment"] + gdb_continue_to_breakpoint "After value assignment" +@@ -97,11 +99,11 @@ gdb_test "ptype intv" "type = $int" + gdb_test "ptype inta" "type = $int \\(10,2\\)" + gdb_test "ptype realv" "type = $real" - gdb_breakpoint [gdb_get_line_number "vla2-deallocated"] - gdb_continue_to_breakpoint "vla2-deallocated" --gdb_test "ptype vla2" "type = " "ptype vla2 not allocated" -+gdb_test "ptype vla2" "type = $real \\(:,:,:\\)" "ptype vla2 not allocated" - gdb_test "ptype vla2(5, 45, 20)" \ - "no such vector element \\\(vector not allocated\\\)" \ - "ptype vla2(5, 45, 20) not allocated" +-gdb_test "ptype logp" "type = PTR TO -> \\( $logical \\)" +-gdb_test "ptype comp" "type = PTR TO -> \\( $complex \\)" +-gdb_test "ptype charp" "type = PTR TO -> \\( character\\*1 \\)" +-gdb_test "ptype charap" "type = PTR TO -> \\( character\\*3 \\)" +-gdb_test "ptype intp" "type = PTR TO -> \\( $int \\)" ++gdb_test "ptype logp" "type = PTR TO -> \\( $logical\\)" ++gdb_test "ptype comp" "type = PTR TO -> \\( $complex\\)" ++gdb_test "ptype charp" "type = PTR TO -> \\( character\\*1\\)" ++gdb_test "ptype charap" "type = PTR TO -> \\( character\\*3\\)" ++gdb_test "ptype intp" "type = PTR TO -> \\( $int\\)" + set test "ptype intap" + gdb_test_multiple $test $test { + -re "type = $int \\(10,2\\)\r\n$gdb_prompt $" { +@@ -111,4 +113,4 @@ gdb_test_multiple $test $test { + pass $test + } + } +-gdb_test "ptype realp" "type = PTR TO -> \\( $real \\)" ++gdb_test "ptype realp" "type = PTR TO -> \\( $real\\)" diff --git a/gdb/testsuite/gdb.fortran/vla-strings.exp b/gdb/testsuite/gdb.fortran/vla-strings.exp new file mode 100644 --- /dev/null @@ -1087,7 +885,7 @@ new file mode 100644 +gdb_continue_to_breakpoint "var_char-allocated-1" +set test "whatis var_char first time" +gdb_test_multiple "whatis var_char" $test { -+ -re "type = PTR TO -> \\( character\\*10 \\)\r\n$gdb_prompt $" { ++ -re "type = PTR TO -> \\( character\\*10\\)\r\n$gdb_prompt $" { + pass $test + } + -re "type = character\\*10\r\n$gdb_prompt $" { @@ -1096,7 +894,7 @@ new file mode 100644 +} +set test "ptype var_char first time" +gdb_test_multiple "ptype var_char" $test { -+ -re "type = PTR TO -> \\( character\\*10 \\)\r\n$gdb_prompt $" { ++ -re "type = PTR TO -> \\( character\\*10\\)\r\n$gdb_prompt $" { + pass $test + } + -re "type = character\\*10\r\n$gdb_prompt $" { @@ -1114,7 +912,7 @@ new file mode 100644 +gdb_continue_to_breakpoint "var_char-filled-1" +set test "print var_char, var_char-filled-1" +gdb_test_multiple "print var_char" $test { -+ -re "= \\(PTR TO -> \\( character\\*3 \\)\\) $hex\r\n$gdb_prompt $" { ++ -re "= \\(PTR TO -> \\( character\\*3\\)\\) $hex\r\n$gdb_prompt $" { + gdb_test "print *var_char" "= 'foo'" "print *var_char, var_char-filled-1" + pass $test + } @@ -1124,7 +922,7 @@ new file mode 100644 +} +set test "ptype var_char, var_char-filled-1" +gdb_test_multiple "ptype var_char" $test { -+ -re "type = PTR TO -> \\( character\\*3 \\)\r\n$gdb_prompt $" { ++ -re "type = PTR TO -> \\( character\\*3\\)\r\n$gdb_prompt $" { + pass $test + } + -re "type = character\\*3\r\n$gdb_prompt $" { @@ -1139,7 +937,7 @@ new file mode 100644 +gdb_continue_to_breakpoint "var_char-filled-2" +set test "print var_char, var_char-filled-2" +gdb_test_multiple "print var_char" $test { -+ -re "= \\(PTR TO -> \\( character\\*6 \\)\\) $hex\r\n$gdb_prompt $" { ++ -re "= \\(PTR TO -> \\( character\\*6\\)\\) $hex\r\n$gdb_prompt $" { + gdb_test "print *var_char" "= 'foobar'" "print *var_char, var_char-filled-2" + pass $test + } @@ -1149,7 +947,7 @@ new file mode 100644 +} +set test "ptype var_char, var_char-filled-2" +gdb_test_multiple "ptype var_char" $test { -+ -re "type = PTR TO -> \\( character\\*6 \\)\r\n$gdb_prompt $" { ++ -re "type = PTR TO -> \\( character\\*6\\)\r\n$gdb_prompt $" { + pass $test + } + -re "type = character\\*6\r\n$gdb_prompt $" { @@ -1200,30 +998,6 @@ new file mode 100644 + var_char_p => null() + l = associated(var_char_p) ! var_char_p-not-associated +end program vla_strings -diff --git a/gdb/testsuite/gdb.fortran/vla-type.exp b/gdb/testsuite/gdb.fortran/vla-type.exp ---- a/gdb/testsuite/gdb.fortran/vla-type.exp -+++ b/gdb/testsuite/gdb.fortran/vla-type.exp -@@ -132,7 +132,10 @@ gdb_test "ptype fivearr(2)%tone" \ - "End Type one" ] - - # Check allocation status of dynamic array and it's dynamic members --gdb_test "ptype fivedynarr" "type = " -+gdb_test "ptype fivedynarr" \ -+ [multi_line "type = Type five" \ -+ " Type one :: tone" \ -+ "End Type five \\(:\\)" ] - gdb_test "next" "" - gdb_test "ptype fivedynarr(2)" \ - [multi_line "type = Type five" \ -@@ -141,7 +144,7 @@ gdb_test "ptype fivedynarr(2)" \ - "ptype fivedynarr(2), tone is not allocated" - gdb_test "ptype fivedynarr(2)%tone" \ - [multi_line "type = Type one" \ -- " $int :: ivla\\(\\)" \ -+ " $int :: ivla\\(:,:,:\\)" \ - "End Type one" ] \ - "ptype fivedynarr(2)%tone, not allocated" - diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran/vla-value.exp --- a/gdb/testsuite/gdb.fortran/vla-value.exp +++ b/gdb/testsuite/gdb.fortran/vla-value.exp @@ -1231,53 +1005,42 @@ diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran gdb_continue_to_breakpoint "vla1-init" gdb_test "print vla1" " = " "print non-allocated vla1" gdb_test "print &vla1" \ -- " = \\\(PTR TO -> \\\( $real \\\(\\\)\\\)\\\) $hex" \ -+ " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\)\\\)\\\) $hex" \ +- " = \\\(PTR TO -> \\\( $real, allocatable \\\(:,:,:\\\) \\\)\\\) $hex" \ ++ " = \\\(PTR TO -> \\\( $real, allocatable \\\(:,:,:\\\)\\\)\\\) $hex" \ "print non-allocated &vla1" gdb_test "print vla1(1,1,1)" "no such vector element \\\(vector not allocated\\\)" \ "print member in non-allocated vla1 (1)" +@@ -56,7 +56,7 @@ with_timeout_factor 15 { + "step over value assignment of vla1" + } + gdb_test "print &vla1" \ +- " = \\\(PTR TO -> \\\( $real, allocatable \\\(10,10,10\\\) \\\)\\\) $hex" \ ++ " = \\\(PTR TO -> \\\( $real, allocatable \\\(10,10,10\\\)\\\)\\\) $hex" \ + "print allocated &vla1" + gdb_test "print vla1(3, 6, 9)" " = 1311" "print allocated vla1(3,6,9)" + gdb_test "print vla1(1, 3, 8)" " = 1311" "print allocated vla1(1,3,8)" @@ -76,7 +76,7 @@ gdb_test "print vla1(9, 9, 9)" " = 999" \ # Try to access values in undefined pointer to VLA (dangling) gdb_test "print pvla" " = " "print undefined pvla" gdb_test "print &pvla" \ -- " = \\\(PTR TO -> \\\( $real \\\(\\\)\\\)\\\) $hex" \ +- " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\) \\\)\\\) $hex" \ + " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\)\\\)\\\) $hex" \ "print non-associated &pvla" gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated\\\)" \ "print undefined pvla(1,3,8)" -diff --git a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp ---- a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp -+++ b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp -@@ -51,10 +51,10 @@ mi_expect_stop "breakpoint-hit" "vla" "" ".*vla.f90" "$bp_lineno" \ - mi_gdb_test "500-data-evaluate-expression vla1" \ - "500\\^done,value=\"\"" "evaluate not allocated vla, before allocation" - --mi_create_varobj_checked vla1_not_allocated vla1 "" \ -+mi_create_varobj_checked vla1_not_allocated vla1 "$real \\(:\\)" \ - "create local variable vla1_not_allocated" - mi_gdb_test "501-var-info-type vla1_not_allocated" \ -- "501\\^done,type=\"\"" \ -+ "501\\^done,type=\"$real \\(:\\)\"" \ - "info type variable vla1_not_allocated" - mi_gdb_test "502-var-show-format vla1_not_allocated" \ - "502\\^done,format=\"natural\"" \ -@@ -146,10 +146,10 @@ gdb_expect { - -re "580\\^done,value=\"\".*${mi_gdb_prompt}$" { - pass $test - -- mi_create_varobj_checked pvla2_not_associated pvla2 "" \ -+ mi_create_varobj_checked pvla2_not_associated pvla2 "$real \\(:,:\\)" \ - "create local variable pvla2_not_associated" - mi_gdb_test "581-var-info-type pvla2_not_associated" \ -- "581\\^done,type=\"\"" \ -+ "581\\^done,type=\"$real \\(:,:\\)\"" \ - "info type variable pvla2_not_associated" - mi_gdb_test "582-var-show-format pvla2_not_associated" \ - "582\\^done,format=\"natural\"" \ +@@ -85,7 +85,7 @@ gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated + gdb_breakpoint [gdb_get_line_number "pvla-associated"] + gdb_continue_to_breakpoint "pvla-associated" + gdb_test "print &pvla" \ +- " = \\\(PTR TO -> \\\( $real \\\(10,10,10\\\) \\\)\\\) $hex" \ ++ " = \\\(PTR TO -> \\\( $real \\\(10,10,10\\\)\\\)\\\) $hex" \ + "print associated &pvla" + gdb_test "print pvla(3, 6, 9)" " = 42" "print associated pvla(3,6,9)" + gdb_test "print pvla(1, 3, 8)" " = 1001" "print associated pvla(1,3,8)" diff --git a/gdb/typeprint.c b/gdb/typeprint.c --- a/gdb/typeprint.c +++ b/gdb/typeprint.c -@@ -589,6 +589,25 @@ whatis_exp (const char *exp, int show) +@@ -574,6 +574,25 @@ whatis_exp (const char *exp, int show) printf_filtered (" */\n"); } @@ -1339,7 +1102,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c diff --git a/gdb/valprint.c b/gdb/valprint.c --- a/gdb/valprint.c +++ b/gdb/valprint.c -@@ -1108,12 +1108,6 @@ value_check_printable (struct value *val, struct ui_file *stream, +@@ -1149,12 +1149,6 @@ value_check_printable (struct value *val, struct ui_file *stream, return 0; } diff --git a/gdb-vla-intel-stringbt-fix.patch b/gdb-vla-intel-stringbt-fix.patch index 61e709e..7395def 100644 --- a/gdb-vla-intel-stringbt-fix.patch +++ b/gdb-vla-intel-stringbt-fix.patch @@ -30,15 +30,7 @@ Jan diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c -@@ -42,6 +42,7 @@ - #include - #include - #include -+#include - #include "common/underlying.h" - #include "common/byte-vector.h" - -@@ -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; diff --git a/gdb-vla-intel-tests.patch b/gdb-vla-intel-tests.patch index adadcb5..0f1e067 100644 --- a/gdb-vla-intel-tests.patch +++ b/gdb-vla-intel-tests.patch @@ -5,6 +5,25 @@ Subject: gdb-vla-intel-tests.patch ;;=fedoratest +diff --git a/gdb/testsuite/gdb.fortran/ptr-indentation.exp b/gdb/testsuite/gdb.fortran/ptr-indentation.exp +--- a/gdb/testsuite/gdb.fortran/ptr-indentation.exp ++++ b/gdb/testsuite/gdb.fortran/ptr-indentation.exp +@@ -37,5 +37,5 @@ gdb_continue_to_breakpoint "BP1" + gdb_test "ptype tinsta" \ + [multi_line "type = Type tuserdef" \ + " $int :: i" \ +- " PTR TO -> \\( $real :: ptr \\)" \ ++ " PTR TO -> \\( $real :: ptr\\)" \ + "End Type tuserdef"] +diff --git a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp +--- a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp ++++ b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp +@@ -42,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 @@ new file mode 100644 +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 @@ new file mode 100644 +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 @@ new file mode 100644 + + ret = .TRUE. ! func2-returned +end program vla_func +diff --git a/gdb/testsuite/gdb.fortran/vla-ptr-info.exp b/gdb/testsuite/gdb.fortran/vla-ptr-info.exp +--- a/gdb/testsuite/gdb.fortran/vla-ptr-info.exp ++++ b/gdb/testsuite/gdb.fortran/vla-ptr-info.exp +@@ -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 @@ new file mode 100644 +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 @@ new file mode 100644 +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 @@ new file mode 100644 +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 @@ new file mode 100644 + var_char_p => null() + l = associated(var_char_p) ! var_char_p-not-associated +end program vla_strings +diff --git a/gdb/testsuite/gdb.fortran/whatis_type.exp b/gdb/testsuite/gdb.fortran/whatis_type.exp +--- a/gdb/testsuite/gdb.fortran/whatis_type.exp ++++ b/gdb/testsuite/gdb.fortran/whatis_type.exp +@@ -44,7 +44,7 @@ gdb_test "whatis t2" "type = Type t2" + gdb_test "whatis t2v" "type = Type t2" + gdb_test "whatis t3" "type = Type t3" + gdb_test "whatis t3v" "type = Type t3" +-gdb_test "whatis t3p" "type = PTR TO -> \\( Type t3 \\)" ++gdb_test "whatis t3p" "type = PTR TO -> \\( Type t3\\)" + + gdb_test "ptype t1" \ + [multi_line "type = Type t1" \ +@@ -73,4 +73,4 @@ gdb_test "ptype t3p" \ + [multi_line "type = PTR TO -> \\( Type t3" \ + " $int :: t3_i" \ + " Type t2 :: t2_n" \ +- "End Type t3 \\)"] ++ "End Type t3\\)"] diff --git a/gdb.changes b/gdb.changes index 65d1881..8982797 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,104 @@ +------------------------------------------------------------------- +Tue Jul 14 14:33:12 UTC 2020 - Tom de Vries + +- Fix SLE-11 build. Gdb 9.1 requires make 3.82, but SLE-11 has + make 3.81: + * gdbserver-fix-build-with-make-3.81.patch + +------------------------------------------------------------------- +Tue Jul 14 08:31:27 UTC 2020 - Tom de Vries + +- Fix patch context: + * gdb-fix-the-thread-pool.c-compilation.patch + +------------------------------------------------------------------- +Mon Jul 13 22:13:07 UTC 2020 - Tom de Vries + +- Fix build error due to missing DIAGNOSTIC_IGNORE_UNUSED_FUNCTION. + * gdb-fix-the-thread-pool.c-compilation.patch + +------------------------------------------------------------------- +Mon Jul 13 15:36:16 UTC 2020 - Tom de Vries + +- Drop ChangeLog part of patch: + * gdb-fix-unused-function-error.patch + +------------------------------------------------------------------- +Mon Jul 13 15:24:53 UTC 2020 - Tom de Vries + +- Fix Werror=unused-function with gcc 4.8 (for Leap 42.3). + * gdb-fix-unused-function-error.patch + +------------------------------------------------------------------- +Mon Jul 13 13:56:50 UTC 2020 - Tom de Vries + +- Require %{suse_version} >= 1500 for --with-system-readline. + +------------------------------------------------------------------- +Mon Jul 13 12:21:04 UTC 2020 - Tom de Vries + +- Rebase to 9.1 release (as in fedora 32 @ 1735910). + * Breakpoints on nested functions and subroutines in Fortran. + * Multithreaded symbol loading, disabled by default. Enable + using 'maint set worker-threads unlimited'. + * Multi-target debugging support. + * New command pipe. + * New command set logging debugredirect [on|off]. + * New fortran commands info modules, info module functions, + info module variables. +- Fedora-specific patches dropped: + * gdb-libexec-add-index.patch + * gdb-6.3-rh-testversion-20041202.patch + * gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch +- Obsoleted fedora patches dropped: + * gdb-6.5-bz216711-clone-is-outermost.patch + * gdb-6.6-scheduler_locking-step-is-default.patch + * gdb-6.8-bz436037-reg-no-longer-active.patch + * gdb-bz541866-rwatch-before-run.patch + * gdb-bz568248-oom-is-error.patch + * gdb-follow-child-stale-parent.patch + * gdb-readline62-ask-more-rh.patch + * gdb-rhbz1371380-gcore-elf-headers.patch + * gdb-rhbz1553086-binutils-warning-loadable-section-outside-elf.patch + * gdb-rhbz1704406-disable-style-log-output-1of3.patch + * gdb-rhbz1704406-disable-style-log-output-2of3.patch + * gdb-rhbz1704406-disable-style-log-output-3of3.patch + * gdb-rhbz1708192-parse_macro_definition-crash.patch + * gdb-rhbz1723564-gdb-crash-PYTHONMALLOC-debug.patch + * gdb-rhbz795424-bitpos-20of25.patch + * gdb-rhbz795424-bitpos-21of25.patch + * gdb-rhbz795424-bitpos-22of25.patch + * gdb-rhbz795424-bitpos-23of25.patch + * gdb-rhbz795424-bitpos-25of25-test.patch + * gdb-rhbz795424-bitpos-25of25.patch + * gdb-rhbz795424-bitpos-arrayview.patch + * gdb-rhbz795424-bitpos-lazyvalue.patch + * gdb-testsuite-readline63-sigint.patch +- Fedora patches added: + * gdb-rhbz1818011-bfd-gcc10-error.patch +- Obsoleted patched dropped: + * gdb-fix-s390-build.diff + * gdb-fix-riscv-tdep.patch + * gdb-testsuite-add-missing-initial-prompt-read-in-multidictionary.exp.patch + * gdb-testsuite-pie-no-pie.patch + * gdb-testsuite-read1-fixes.patch + * gdb-testsuite-i386-pkru-exp.patch + * gdb-s390-handle-arch13.diff + * gdb-fix-heap-use-after-free-in-typename-concat.patch + * gdb-dwarf-reader-reject-sections-with-invalid-sizes.patch + * gdb-0001-remove-alloca-0-calls.patch + * gdb-arch13-1.diff + * gdb-arch13-2.diff + * gdb-arch13-3.diff + * bfd-change-num_group-to-unsigned-int.patch + * gdb-fix-incorrect-use-of-is-operator-for-comparison-in-python-lib-gdb-command-prompt.py.patch + * gdb-symtab-prefer-var-def-over-decl.patch + * gdb-only-force-interp_console-ui_out-for-breakpoint-commands-in-mi-mode.patch + * gdb-testsuite-8.3-kfail-xfail-unsupported.patch +- Backport from master: + * gdb-fix-debug-agent-odr-bool-int.patch + * gdb-fix-python3.9-related-runtime-problems.patch + ------------------------------------------------------------------- Wed May 6 03:46:31 UTC 2020 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index bef0ae1..c3beb1e 100644 --- a/gdb.spec +++ b/gdb.spec @@ -29,7 +29,7 @@ License: GPL-3.0-or-later AND GPL-3.0-with-GCC-exception AND LGPL-2.1-or- Group: Development/Tools/Debuggers Name: gdb -Version: 8.3.1 +Version: 9.1 Release: 0 # The release always contains a leading reserved number, start it at 1. @@ -98,7 +98,6 @@ Source12: baselibs.conf Source13: gdb-rpmlintrc #Fedora Packages begin -Patch1: gdb-6.3-rh-testversion-20041202.patch Patch2: gdb-vla-intel-fortran-strides.patch Patch3: gdb-vla-intel-fortran-vla-strings.patch Patch4: gdb-vla-intel-stringbt-fix.patch @@ -115,112 +114,93 @@ Patch14: gdb-6.5-sharedlibrary-path.patch Patch15: gdb-6.5-BEA-testsuite.patch Patch16: gdb-6.5-last-address-space-byte-test.patch Patch17: gdb-6.5-readline-long-line-crash-test.patch -Patch18: gdb-6.5-bz216711-clone-is-outermost.patch -Patch19: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch -Patch20: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch -Patch21: gdb-6.5-bz109921-DW_AT_decl_file-test.patch -Patch22: gdb-6.3-bz140532-ppc-unwinding-test.patch -Patch23: gdb-6.3-bz202689-exec-from-pthread-test.patch -Patch24: gdb-6.6-bz230000-power6-disassembly-test.patch -Patch25: gdb-6.6-bz229517-gcore-without-terminal.patch -Patch26: gdb-6.6-testsuite-timeouts.patch -Patch27: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch -Patch28: gdb-6.6-scheduler_locking-step-is-default.patch -Patch29: gdb-6.3-attach-see-vdso-test.patch -Patch30: gdb-6.5-bz243845-stale-testing-zombie-test.patch -Patch31: gdb-6.6-buildid-locate.patch -Patch32: gdb-6.6-buildid-locate-solib-missing-ids.patch -Patch33: gdb-6.6-buildid-locate-rpm.patch -Patch34: gdb-6.7-charsign-test.patch -Patch35: gdb-6.7-ppc-clobbered-registers-O2-test.patch -Patch36: gdb-6.7-testsuite-stable-results.patch -Patch37: gdb-6.5-ia64-libunwind-leak-test.patch -Patch38: gdb-6.5-missed-trap-on-step-test.patch -Patch39: gdb-6.5-gcore-buffer-limit-test.patch -Patch40: gdb-6.3-mapping-zero-inode-test.patch -Patch41: gdb-6.3-focus-cmd-prev-test.patch -Patch42: gdb-6.8-bz442765-threaded-exec-test.patch -Patch43: gdb-6.5-section-num-fixup-test.patch -Patch44: gdb-6.8-bz436037-reg-no-longer-active.patch -Patch45: gdb-6.8-bz466901-backtrace-full-prelinked.patch -Patch46: gdb-simultaneous-step-resume-breakpoint-test.patch -Patch47: gdb-core-open-vdso-warning.patch -Patch49: gdb-bz533176-fortran-omp-step.patch -Patch50: gdb-follow-child-stale-parent.patch -Patch51: gdb-ccache-workaround.patch -Patch52: gdb-archer-pie-addons.patch -Patch53: gdb-archer-pie-addons-keep-disabled.patch -Patch54: gdb-lineno-makeup-test.patch -Patch55: gdb-ppc-power7-test.patch -Patch56: gdb-bz541866-rwatch-before-run.patch -Patch57: gdb-moribund-utrace-workaround.patch -Patch58: gdb-archer-next-over-throw-cxx-exec.patch -Patch59: gdb-bz601887-dwarf4-rh-test.patch -Patch60: gdb-6.6-buildid-locate-core-as-arg.patch -Patch61: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch -Patch62: gdb-test-bt-cfi-without-die.patch -Patch63: gdb-bz568248-oom-is-error.patch -Patch64: gdb-bz634108-solib_address.patch -Patch65: gdb-test-pid0-core.patch -Patch66: gdb-test-dw2-aranges.patch -Patch67: gdb-test-expr-cumulative-archer.patch -Patch68: gdb-physname-pr11734-test.patch -Patch69: gdb-physname-pr12273-test.patch -Patch70: gdb-test-ivy-bridge.patch -Patch71: gdb-runtest-pie-override.patch -Patch72: gdb-attach-fail-reasons-5of5.patch -Patch73: gdb-glibc-strstr-workaround.patch -Patch74: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch -Patch75: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch76: gdb-rhbz795424-bitpos-20of25.patch -Patch77: gdb-rhbz795424-bitpos-21of25.patch -Patch78: gdb-rhbz795424-bitpos-22of25.patch -Patch79: gdb-rhbz795424-bitpos-23of25.patch -Patch80: gdb-rhbz795424-bitpos-25of25.patch -Patch81: gdb-rhbz795424-bitpos-25of25-test.patch -Patch82: gdb-rhbz795424-bitpos-lazyvalue.patch -Patch83: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch -Patch84: gdb-gnat-dwarf-crash-3of3.patch -Patch85: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch -Patch86: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch -Patch87: gdb-archer-vla-tests.patch -Patch88: gdb-vla-intel-tests.patch -Patch89: gdb-btrobust.patch -Patch90: gdb-fortran-frame-string.patch -Patch91: gdb-rhbz1156192-recursive-dlopen-test.patch -Patch92: gdb-jit-reader-multilib.patch -Patch93: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -Patch94: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch -Patch95: gdb-rhbz1350436-type-printers-error.patch -Patch96: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -Patch97: gdb-bz1219747-attach-kills.patch -Patch98: gdb-fedora-libncursesw.patch -Patch99: gdb-opcodes-clflushopt-test.patch -Patch100: gdb-dts-rhel6-python-compat.patch -Patch101: gdb-6.6-buildid-locate-rpm-scl.patch -Patch102: gdb-readline62-ask-more-rh.patch -Patch103: gdb-6.8-quit-never-aborts.patch -Patch104: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch105: gdb-container-rh-pkg.patch -Patch106: gdb-rhbz1325795-framefilters-test.patch -Patch107: gdb-linux_perf-bundle.patch -Patch108: gdb-libexec-add-index.patch -Patch109: gdb-rhbz1398387-tab-crash-test.patch -Patch110: gdb-testsuite-readline63-sigint.patch -Patch111: gdb-archer.patch -Patch112: gdb-vla-intel-fix-print-char-array.patch -Patch113: gdb-rhbz1553104-s390x-arch12-test.patch -Patch114: gdb-rhbz795424-bitpos-arrayview.patch -Patch115: gdb-rhbz1371380-gcore-elf-headers.patch -Patch116: gdb-rhbz1708192-parse_macro_definition-crash.patch -Patch117: gdb-rhbz1704406-disable-style-log-output-1of3.patch -Patch118: gdb-rhbz1704406-disable-style-log-output-2of3.patch -Patch119: gdb-rhbz1704406-disable-style-log-output-3of3.patch -Patch120: gdb-rhbz1723564-gdb-crash-PYTHONMALLOC-debug.patch -Patch121: gdb-rhbz1553086-binutils-warning-loadable-section-outside-elf.patch +Patch18: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch +Patch19: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch +Patch20: gdb-6.5-bz109921-DW_AT_decl_file-test.patch +Patch21: gdb-6.3-bz140532-ppc-unwinding-test.patch +Patch22: gdb-6.3-bz202689-exec-from-pthread-test.patch +Patch23: gdb-6.6-bz230000-power6-disassembly-test.patch +Patch24: gdb-6.6-bz229517-gcore-without-terminal.patch +Patch25: gdb-6.6-testsuite-timeouts.patch +Patch26: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch +Patch27: gdb-6.3-attach-see-vdso-test.patch +Patch28: gdb-6.5-bz243845-stale-testing-zombie-test.patch +Patch29: gdb-6.6-buildid-locate.patch +Patch30: gdb-6.6-buildid-locate-solib-missing-ids.patch +Patch31: gdb-6.6-buildid-locate-rpm.patch +Patch32: gdb-6.7-charsign-test.patch +Patch33: gdb-6.7-ppc-clobbered-registers-O2-test.patch +Patch34: gdb-6.7-testsuite-stable-results.patch +Patch35: gdb-6.5-ia64-libunwind-leak-test.patch +Patch36: gdb-6.5-missed-trap-on-step-test.patch +Patch37: gdb-6.5-gcore-buffer-limit-test.patch +Patch38: gdb-6.3-mapping-zero-inode-test.patch +Patch39: gdb-6.3-focus-cmd-prev-test.patch +Patch40: gdb-6.8-bz442765-threaded-exec-test.patch +Patch41: gdb-6.5-section-num-fixup-test.patch +Patch42: gdb-6.8-bz466901-backtrace-full-prelinked.patch +Patch43: gdb-simultaneous-step-resume-breakpoint-test.patch +Patch44: gdb-core-open-vdso-warning.patch +Patch45: gdb-bz533176-fortran-omp-step.patch +Patch46: gdb-ccache-workaround.patch +Patch47: gdb-archer-pie-addons.patch +Patch48: gdb-archer-pie-addons-keep-disabled.patch +Patch49: gdb-lineno-makeup-test.patch +Patch50: gdb-ppc-power7-test.patch +Patch51: gdb-moribund-utrace-workaround.patch +Patch52: gdb-archer-next-over-throw-cxx-exec.patch +Patch53: gdb-bz601887-dwarf4-rh-test.patch +Patch54: gdb-6.6-buildid-locate-core-as-arg.patch +Patch55: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +Patch56: gdb-test-bt-cfi-without-die.patch +Patch57: gdb-bz634108-solib_address.patch +Patch58: gdb-test-pid0-core.patch +Patch59: gdb-test-dw2-aranges.patch +Patch60: gdb-test-expr-cumulative-archer.patch +Patch61: gdb-physname-pr11734-test.patch +Patch62: gdb-physname-pr12273-test.patch +Patch63: gdb-test-ivy-bridge.patch +Patch64: gdb-runtest-pie-override.patch +Patch65: gdb-attach-fail-reasons-5of5.patch +Patch66: gdb-glibc-strstr-workaround.patch +Patch67: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch +Patch68: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch69: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +Patch70: gdb-gnat-dwarf-crash-3of3.patch +Patch71: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +Patch73: gdb-archer-vla-tests.patch +Patch74: gdb-vla-intel-tests.patch +Patch75: gdb-btrobust.patch +Patch76: gdb-fortran-frame-string.patch +Patch77: gdb-rhbz1156192-recursive-dlopen-test.patch +Patch78: gdb-jit-reader-multilib.patch +Patch79: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch80: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch +Patch81: gdb-rhbz1350436-type-printers-error.patch +Patch82: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch83: gdb-bz1219747-attach-kills.patch +Patch84: gdb-fedora-libncursesw.patch +Patch85: gdb-opcodes-clflushopt-test.patch +Patch86: gdb-dts-rhel6-python-compat.patch +Patch87: gdb-6.6-buildid-locate-rpm-scl.patch +Patch88: gdb-6.8-quit-never-aborts.patch +Patch89: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch90: gdb-container-rh-pkg.patch +Patch91: gdb-rhbz1325795-framefilters-test.patch +Patch92: gdb-linux_perf-bundle.patch +Patch94: gdb-rhbz1398387-tab-crash-test.patch +Patch95: gdb-archer.patch +Patch96: gdb-vla-intel-fix-print-char-array.patch +Patch97: gdb-rhbz1553104-s390x-arch12-test.patch +Patch98: gdb-rhbz1818011-bfd-gcc10-error.patch #Fedora Packages end -#Fedora patches fixup +# Fedora Packages not copied: +# - gdb-libexec-add-index.patch +# - gdb-6.3-rh-testversion-20041202.patch +# - gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch + +# Fedora patches fixup Patch500: gdb-testsuite-avoid-pagination-in-attach-32.exp.patch Patch501: gdb-testsuite-fix-perror-in-gdb.opt-fortran-string.exp.patch @@ -232,41 +212,23 @@ Patch1002: gdb-6.6-buildid-locate-rpm-suse.patch Patch1003: gdb-testsuite-ada-pie.patch # Patches to upstream - -# Fixed upstream Sat, Jun 22 2019, 47e3f47487 "[gdb] Fix s390x -m31 build". -# We should be able to drop this in 8.4. -Patch1007: gdb-fix-s390-build.diff +Patch1500: gdb-fix-debug-agent-odr-bool-int.patch +Patch1501: gdbserver-fix-build-with-make-3.81.patch # Backports from master -Patch2001: gdb-fix-riscv-tdep.patch -Patch2004: gdb-testsuite-add-missing-initial-prompt-read-in-multidictionary.exp.patch -Patch2005: gdb-testsuite-pie-no-pie.patch -Patch2007: gdb-testsuite-read1-fixes.patch -Patch2008: gdb-testsuite-i386-pkru-exp.patch -Patch2009: gdb-s390-handle-arch13.diff -Patch2010: gdb-fix-heap-use-after-free-in-typename-concat.patch -Patch2011: gdb-dwarf-reader-reject-sections-with-invalid-sizes.patch -Patch2012: gdb-0001-remove-alloca-0-calls.patch -Patch2013: gdb-arch13-1.diff -Patch2014: gdb-arch13-2.diff -Patch2015: gdb-arch13-3.diff -Patch2016: bfd-change-num_group-to-unsigned-int.patch -Patch2017: gdb-fix-incorrect-use-of-is-operator-for-comparison-in-python-lib-gdb-command-prompt.py.patch Patch2018: gdb-fix-toplevel-types-with-fdebug-types-section.patch Patch2019: gdb-fix-range-loop-index-in-find_method.patch - -# Proposed patch for PR symtab/24971 -Patch2500: gdb-symtab-prefer-var-def-over-decl.patch - -# Proposed patch for PR gdb/24956 -Patch2501: gdb-only-force-interp_console-ui_out-for-breakpoint-commands-in-mi-mode.patch +Patch2020: gdb-fix-python3.9-related-runtime-problems.patch +Patch2021: gdb-fix-unused-function-error.patch +Patch2022: gdb-fix-the-thread-pool.c-compilation.patch # Proposed patch for PR threads/25478 Patch2502: gdb-threads-fix-hang-in-stop_all_threads-after-killing-inferior.patch # Testsuite patches -Patch2600: gdb-testsuite-8.3-kfail-xfail-unsupported.patch + +# - # libipt support Patch3000: v1.5-libipt-static.patch @@ -471,7 +433,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c gdb/go-exp.c find -name "*.info*"|xargs rm -f #Fedora patching start -%patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 @@ -518,6 +479,7 @@ find -name "*.info*"|xargs rm -f %patch45 -p1 %patch46 -p1 %patch47 -p1 +%patch48 -p1 %patch49 -p1 %patch50 -p1 %patch51 -p1 @@ -541,7 +503,6 @@ find -name "*.info*"|xargs rm -f %patch69 -p1 %patch70 -p1 %patch71 -p1 -%patch72 -p1 %patch73 -p1 %patch74 -p1 %patch75 -p1 @@ -562,35 +523,11 @@ find -name "*.info*"|xargs rm -f %patch90 -p1 %patch91 -p1 %patch92 -p1 -%patch93 -p1 %patch94 -p1 %patch95 -p1 %patch96 -p1 %patch97 -p1 %patch98 -p1 -%patch99 -p1 -%patch100 -p1 -%patch101 -p1 -%patch102 -p1 -%patch103 -p1 -%patch104 -p1 -%patch105 -p1 -%patch106 -p1 -%patch107 -p1 -%patch108 -p1 -%patch109 -p1 -%patch110 -p1 -%patch111 -p1 -%patch112 -p1 -%patch113 -p1 -%patch114 -p1 -%patch115 -p1 -%patch116 -p1 -%patch117 -p1 -%patch118 -p1 -%patch119 -p1 -%patch120 -p1 -%patch121 -p1 #Fedora patching end %patch500 -p1 @@ -600,31 +537,17 @@ find -name "*.info*"|xargs rm -f %patch1002 -p1 %patch1003 -p1 -%patch1007 -p1 +%patch1500 -p1 +%patch1501 -p1 -%patch2001 -p1 -%patch2004 -p1 -%patch2005 -p1 -%patch2007 -p1 -%patch2008 -p1 -%patch2009 -p1 -%patch2010 -p1 -%patch2011 -p1 -%patch2012 -p1 -%patch2013 -p1 -%patch2014 -p1 -%patch2015 -p1 -%patch2016 -p1 -%patch2017 -p1 %patch2018 -p1 %patch2019 -p1 +%patch2020 -p1 +%patch2021 -p1 +%patch2022 -p1 -%patch2500 -p1 -%patch2501 -p1 %patch2502 -p1 -%patch2600 -p1 - #unpack libipt %if 0%{have_libipt} tar xzf %{SOURCE7} @@ -751,7 +674,7 @@ EXTRA_TARGETS= --disable-sim \ --disable-rpath \ --with-system-zlib \ -%if %{suse_version} > 1110 +%if %{suse_version} >= 1500 --with-system-readline \ %else --without-system-readline \ diff --git a/gdbserver-fix-build-with-make-3.81.patch b/gdbserver-fix-build-with-make-3.81.patch new file mode 100644 index 0000000..f9cf223 --- /dev/null +++ b/gdbserver-fix-build-with-make-3.81.patch @@ -0,0 +1,33 @@ +[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. +