From a2f8e1d8c66c52fee92c90ffc73b2bc7a575fadc904832c79259a885293bbcca Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Wed, 15 Feb 2017 16:05:56 +0000 Subject: [PATCH] - Update to gdb 7.12.1 * negative repeat count for x examines backwards * fortran: support structs/arrays with dynamically types fields * support MPX bound checking * support for the Rust language * 'catch syscall' now can catch groups of related syscalls * New (sub)commands: - skip {-file,-gfile,-function,-rfunction}: generic skip mechanism - maint {selftest,info line-table} - new-ui: create new user interface for GUI clients * (fast) tracepoints on s390x and ppc64le added to gdbserver * New target Andes NDS32 - Remove patch gdb-aarch64-v81-hwbreakpoints.diff (upstream) - Add patches from Fedora package: gdb-6.7-testsuite-stable-results.patch gdb-add-index-chmod.patch gdb-bison-old.patch gdb-container-rh-pkg.patch gdb-libexec-add-index.patch gdb-linux_perf-bundle.patch gdb-physname-pr11734-test.patch gdb-physname-pr12273-test.patch gdb-rhbz1007614-memleak-infpy_read_memory-test.patch gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch gdb-rhbz1149205-catch-syscall-after-fork-test.patch gdb-rhbz1156192-recursive-dlopen-test.patch gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch gdb-rhbz1350436-type-printers-error.patch gdb-test-ivy-bridge.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=151 --- gdb-6.3-mapping-zero-inode-test.patch | 3 +- gdb-6.6-buildid-locate-rpm-suse.patch | 20 +- gdb-6.6-buildid-locate-rpm.patch | 167 +- ...6.6-buildid-locate-solib-missing-ids.patch | 163 ++ gdb-6.6-buildid-locate.patch | 136 +- ...6.6-bz230000-power6-disassembly-test.patch | 2 +- ....6-scheduler_locking-step-is-default.patch | 47 +- gdb-6.7-ppc-clobbered-registers-O2-test.patch | 2 +- gdb-6.7-testsuite-stable-results.patch | 101 + gdb-6.8-attach-signalled-detach-stopped.patch | 57 +- gdb-6.8-quit-never-aborts.patch | 47 +- gdb-7.11.1.tar.bz2 | 3 - gdb-7.12.1.tar.bz2 | 3 + gdb-aarch64-v81-hwbreakpoints.diff | 65 - gdb-add-index-chmod.patch | 69 + gdb-archer-pie-addons-keep-disabled.patch | 24 +- gdb-archer-vla-tests.patch | 1123 ++++++++- gdb-archer.patch | 69 +- gdb-attach-fail-reasons-5of5.patch | 100 +- gdb-bison-old.patch | 44 + gdb-bz541866-rwatch-before-run.patch | 49 +- gdb-container-rh-pkg.patch | 21 + gdb-dts-rhel6-python-compat.patch | 24 +- gdb-glibc-vdso-workaround.patch | 10 +- gdb-libexec-add-index.patch | 16 + ...libstdc++-v3-python-6.3.1-20170212.tar.bz2 | 3 + gdb-libstdc++-v3-python-r225521.tar.bz2 | 3 - gdb-linux_perf-bundle.patch | 232 ++ gdb-physname-pr11734-test.patch | 226 ++ gdb-physname-pr12273-test.patch | 95 + gdb-ppc-power7-test.patch | 2 +- gdb-python-gil.patch | 76 +- gdb-readline62-ask-more-rh.patch | 15 +- ...07614-memleak-infpy_read_memory-test.patch | 162 ++ ...-s390x-wrong-prologue-skip-O2-g-3of3.patch | 226 ++ ...149205-catch-syscall-after-fork-test.patch | 114 + gdb-rhbz1156192-recursive-dlopen-test.patch | 341 +++ ...l-error-unqualified-name-re-set-test.patch | 125 + gdb-rhbz1325795-framefilters-test.patch | 104 +- gdb-rhbz1350436-type-printers-error.patch | 73 + gdb-rhbz795424-bitpos-20of25.patch | 2158 +++++------------ gdb-rhbz795424-bitpos-23of25.patch | 340 ++- gdb-rhbz795424-bitpos-25of25.patch | 64 +- gdb-rhbz795424-bitpos-lazyvalue.patch | 34 +- gdb-test-ivy-bridge.patch | 461 ++++ gdb-testsuite-casts.patch | 80 + gdb-testsuite-m-static.patch | 79 + gdb-testsuite-morestack-gold.patch | 83 + gdb-tls-1of2.patch | 47 + gdb-tls-2of2.patch | 159 ++ gdb-upstream.patch | 722 ++++++ gdb-vla-intel-fortran-strides.patch | 1977 +++++++++++++++ gdb-vla-intel-fortran-vla-strings.patch | 1488 ++++++++++++ gdb-vla-intel-stringbt-fix.patch | 48 +- gdb-vla-intel-tests.patch | 293 +++ gdb.changes | 43 + gdb.spec | 275 ++- 57 files changed, 9888 insertions(+), 2625 deletions(-) create mode 100644 gdb-6.7-testsuite-stable-results.patch delete mode 100644 gdb-7.11.1.tar.bz2 create mode 100644 gdb-7.12.1.tar.bz2 delete mode 100644 gdb-aarch64-v81-hwbreakpoints.diff create mode 100644 gdb-add-index-chmod.patch create mode 100644 gdb-bison-old.patch create mode 100644 gdb-container-rh-pkg.patch create mode 100644 gdb-libexec-add-index.patch create mode 100644 gdb-libstdc++-v3-python-6.3.1-20170212.tar.bz2 delete mode 100644 gdb-libstdc++-v3-python-r225521.tar.bz2 create mode 100644 gdb-linux_perf-bundle.patch create mode 100644 gdb-physname-pr11734-test.patch create mode 100644 gdb-physname-pr12273-test.patch create mode 100644 gdb-rhbz1007614-memleak-infpy_read_memory-test.patch create mode 100644 gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch create mode 100644 gdb-rhbz1149205-catch-syscall-after-fork-test.patch create mode 100644 gdb-rhbz1156192-recursive-dlopen-test.patch create mode 100644 gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch create mode 100644 gdb-rhbz1350436-type-printers-error.patch create mode 100644 gdb-test-ivy-bridge.patch create mode 100644 gdb-testsuite-casts.patch create mode 100644 gdb-testsuite-m-static.patch create mode 100644 gdb-testsuite-morestack-gold.patch create mode 100644 gdb-tls-1of2.patch create mode 100644 gdb-tls-2of2.patch create mode 100644 gdb-upstream.patch create mode 100644 gdb-vla-intel-fortran-strides.patch create mode 100644 gdb-vla-intel-fortran-vla-strings.patch create mode 100644 gdb-vla-intel-tests.patch diff --git a/gdb-6.3-mapping-zero-inode-test.patch b/gdb-6.3-mapping-zero-inode-test.patch index f274f06..22fdf62 100644 --- a/gdb-6.3-mapping-zero-inode-test.patch +++ b/gdb-6.3-mapping-zero-inode-test.patch @@ -108,7 +108,7 @@ Index: gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/gcore-shmid0.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/gcore-shmid0.c 2013-08-02 22:22:17.573599496 +0200 -@@ -0,0 +1,127 @@ +@@ -0,0 +1,128 @@ +/* Copyright 2007, 2009 Free Software Foundation, Inc. + + This file is part of GDB. @@ -139,6 +139,7 @@ Index: gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.base/gcore-shmid0.c +#include +#include +#include ++#include + +/* The same test running in a parallel testsuite may steal us the zero SID, + even if we never get any EEXIST. Just try a while. */ diff --git a/gdb-6.6-buildid-locate-rpm-suse.patch b/gdb-6.6-buildid-locate-rpm-suse.patch index 7e2eb72..0644e5c 100644 --- a/gdb-6.6-buildid-locate-rpm-suse.patch +++ b/gdb-6.6-buildid-locate-rpm-suse.patch @@ -1,8 +1,8 @@ -Index: gdb-7.10.1/gdb/build-id.c +Index: gdb-7.12.1/gdb/build-id.c =================================================================== ---- gdb-7.10.1.orig/gdb/build-id.c 2016-01-14 16:19:02.000000000 +0100 -+++ gdb-7.10.1/gdb/build-id.c 2016-01-14 16:21:43.000000000 +0100 -@@ -830,9 +830,9 @@ missing_rpm_enlist (const char *filename +--- 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 if (h == NULL) break; @@ -15,7 +15,7 @@ Index: gdb-7.10.1/gdb/build-id.c &err); if (!debuginfo) { -@@ -840,60 +840,19 @@ missing_rpm_enlist (const char *filename +@@ -851,60 +851,19 @@ missing_rpm_enlist_1 (const char *filena err); continue; } @@ -25,12 +25,12 @@ Index: gdb-7.10.1/gdb/build-id.c - if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0) - { - /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */ -- s2 = memrchr (debuginfo, '-', s - debuginfo); +- s2 = (char *) memrchr (debuginfo, '-', s - debuginfo); - } - if (s2) - { - /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */ -- s2 = memrchr (debuginfo, '-', s2 - debuginfo); +- s2 = (char *) memrchr (debuginfo, '-', s2 - debuginfo); - } - if (!s2) - { @@ -54,7 +54,7 @@ Index: gdb-7.10.1/gdb/build-id.c + /* Verify the debuginfo file is not already installed. */ /* RPMDBI_PACKAGES requires keylen == sizeof (int). */ /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */ - mi_debuginfo = rpmtsInitIterator_p (ts, RPMDBI_LABEL, debuginfo, 0); + mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0); - xfree (debuginfo); if (mi_debuginfo) { @@ -78,7 +78,7 @@ Index: gdb-7.10.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 -@@ -978,10 +937,7 @@ missing_rpm_list_print (void) +@@ -1035,10 +994,7 @@ missing_rpm_list_print (void) (int (*) (const void *, const void *)) missing_rpm_list_compar); printf_unfiltered (_("Missing separate debuginfos, use: %s"), @@ -90,7 +90,7 @@ Index: gdb-7.10.1/gdb/build-id.c for (array_iter = array; array_iter < array + missing_rpm_list_entries; array_iter++) { -@@ -1194,13 +1150,12 @@ debug_print_missing (const char *binary, +@@ -1251,13 +1207,12 @@ debug_print_missing (const char *binary, fprintf_unfiltered (gdb_stdlog, _("Missing separate debuginfo for %s\n"), binary); if (debug != NULL) diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch index 21023a4..d42c893 100644 --- a/gdb-6.6-buildid-locate-rpm.patch +++ b/gdb-6.6-buildid-locate-rpm.patch @@ -1,25 +1,16 @@ -Index: gdb-7.10.50.20160106/gdb/event-top.c +Index: gdb-7.11.50.20160630/gdb/event-top.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/event-top.c -+++ gdb-7.10.50.20160106/gdb/event-top.c -@@ -37,6 +37,7 @@ - #include "gdbcmd.h" /* for dont_repeat() */ - #include "annotate.h" - #include "maint.h" +--- gdb-7.11.50.20160630.orig/gdb/event-top.c 2016-07-02 23:43:24.085214144 +0200 ++++ gdb-7.11.50.20160630/gdb/event-top.c 2016-07-03 14:37:12.572130734 +0200 +@@ -40,6 +40,7 @@ + #include "buffer.h" + #include "ser-event.h" + #include "gdb_select.h" +#include "symfile.h" /* readline include files. */ #include "readline/readline.h" -@@ -180,6 +181,8 @@ rl_callback_read_char_wrapper (gdb_clien - void - cli_command_loop (void *data) - { -+ debug_flush_missing (); -+ - display_gdb_prompt (0); - - /* Now it's time to start the event loop. */ -@@ -298,6 +301,8 @@ display_gdb_prompt (const char *new_prom +@@ -347,6 +348,8 @@ /* Reset the nesting depth used when trace-commands is set. */ reset_command_nest_depth (); @@ -28,11 +19,23 @@ Index: gdb-7.10.50.20160106/gdb/event-top.c old_chain = make_cleanup (free_current_contents, &actual_gdb_prompt); /* Do not call the python hook on an explicit prompt change as -Index: gdb-7.10.50.20160106/gdb/symfile.h +@@ -794,7 +797,10 @@ + command_handler (cmd); + + if (ui->prompt_state != PROMPTED) +- display_gdb_prompt (0); ++ { ++ debug_flush_missing (); ++ display_gdb_prompt (0); ++ } + } + } + +Index: gdb-7.11.50.20160630/gdb/symfile.h =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/symfile.h -+++ gdb-7.10.50.20160106/gdb/symfile.h -@@ -587,6 +587,8 @@ void map_symbol_filenames (symbol_filena +--- gdb-7.11.50.20160630.orig/gdb/symfile.h 2016-07-03 14:34:32.032753668 +0200 ++++ gdb-7.11.50.20160630/gdb/symfile.h 2016-07-03 14:37:12.573130742 +0200 +@@ -592,6 +592,8 @@ /* 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); @@ -41,48 +44,10 @@ Index: gdb-7.10.50.20160106/gdb/symfile.h /* From dwarf2read.c */ -Index: gdb-7.10.50.20160106/gdb/testsuite/lib/gdb.exp +Index: gdb-7.11.50.20160630/gdb/aclocal.m4 =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/testsuite/lib/gdb.exp -+++ gdb-7.10.50.20160106/gdb/testsuite/lib/gdb.exp -@@ -1642,7 +1642,7 @@ proc default_gdb_start { } { - warning "Couldn't set the width to 0." - } - } -- # Turn off the missing warnings as the testsuite does not expect it. -+ # Turn off the missing RPMs warnings as the testsuite does not expect it. - send_gdb "set build-id-verbose 0\n" - gdb_expect 10 { - -re "$gdb_prompt $" { -Index: gdb-7.10.50.20160106/gdb/testsuite/lib/mi-support.exp -=================================================================== ---- gdb-7.10.50.20160106.orig/gdb/testsuite/lib/mi-support.exp -+++ gdb-7.10.50.20160106/gdb/testsuite/lib/mi-support.exp -@@ -204,7 +204,7 @@ proc default_mi_gdb_start { args } { - warning "Couldn't set the width to 0." - } - } -- # Turn off the missing warnings as the testsuite does not expect it. -+ # Turn off the missing RPMs warnings as the testsuite does not expect it. - send_gdb "190-gdb-set build-id-verbose 0\n" - gdb_expect 10 { - -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" { -Index: gdb-7.10.50.20160106/gdb/tui/tui-interp.c -=================================================================== ---- gdb-7.10.50.20160106.orig/gdb/tui/tui-interp.c -+++ gdb-7.10.50.20160106/gdb/tui/tui-interp.c -@@ -31,6 +31,7 @@ - #include "tui/tui-io.h" - #include "infrun.h" - #include "observer.h" -+#include "symfile.h" - - static struct ui_out *tui_ui_out (struct interp *self); - -Index: gdb-7.10.50.20160106/gdb/aclocal.m4 -=================================================================== ---- gdb-7.10.50.20160106.orig/gdb/aclocal.m4 -+++ gdb-7.10.50.20160106/gdb/aclocal.m4 +--- gdb-7.11.50.20160630.orig/gdb/aclocal.m4 2016-07-02 23:43:24.085214144 +0200 ++++ gdb-7.11.50.20160630/gdb/aclocal.m4 2016-07-03 14:37:12.576130768 +0200 @@ -11,6 +11,221 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @@ -305,10 +270,10 @@ Index: gdb-7.10.50.20160106/gdb/aclocal.m4 # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -Index: gdb-7.10.50.20160106/gdb/config.in +Index: gdb-7.11.50.20160630/gdb/config.in =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/config.in -+++ gdb-7.10.50.20160106/gdb/config.in +--- gdb-7.11.50.20160630.orig/gdb/config.in 2016-07-02 23:43:24.085214144 +0200 ++++ gdb-7.11.50.20160630/gdb/config.in 2016-07-03 14:37:12.576130768 +0200 @@ -33,6 +33,9 @@ /* Define to BFD's default target vector. */ #undef DEFAULT_BFD_VEC @@ -319,7 +284,7 @@ Index: gdb-7.10.50.20160106/gdb/config.in /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS -@@ -258,6 +261,9 @@ +@@ -261,6 +264,9 @@ /* Define if Python 2.7 is being used. */ #undef HAVE_LIBPYTHON2_7 @@ -329,11 +294,11 @@ Index: gdb-7.10.50.20160106/gdb/config.in /* Define to 1 if you have the header file. */ #undef HAVE_LIBUNWIND_IA64_H -Index: gdb-7.10.50.20160106/gdb/configure +Index: gdb-7.11.50.20160630/gdb/configure =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/configure -+++ gdb-7.10.50.20160106/gdb/configure -@@ -705,6 +705,11 @@ PKGVERSION +--- gdb-7.11.50.20160630.orig/gdb/configure 2016-07-02 23:43:24.085214144 +0200 ++++ gdb-7.11.50.20160630/gdb/configure 2016-07-03 14:37:12.581130811 +0200 +@@ -705,6 +705,11 @@ HAVE_NATIVE_GCORE_TARGET TARGET_OBS subdirs @@ -345,7 +310,7 @@ Index: gdb-7.10.50.20160106/gdb/configure GDB_DATADIR DEBUGDIR MAKEINFO_EXTRA_FLAGS -@@ -813,6 +818,7 @@ with_gdb_datadir +@@ -814,6 +819,7 @@ with_relocated_sources with_auto_load_dir with_auto_load_safe_path @@ -353,7 +318,7 @@ Index: gdb-7.10.50.20160106/gdb/configure enable_targets enable_64_bit_bfd enable_gdbcli -@@ -869,6 +875,11 @@ CCC +@@ -870,6 +876,11 @@ CPP MAKEINFO MAKEINFOFLAGS @@ -365,7 +330,7 @@ Index: gdb-7.10.50.20160106/gdb/configure YACC YFLAGS XMKMF' -@@ -1540,6 +1551,8 @@ Optional Packages: +@@ -1541,6 +1552,8 @@ [--with-auto-load-dir] --without-auto-load-safe-path do not restrict auto-loaded files locations @@ -374,7 +339,7 @@ Index: gdb-7.10.50.20160106/gdb/configure --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets --with-curses use the curses library instead of the termcap library -@@ -1595,6 +1608,13 @@ Some influential environment variables: +@@ -1595,6 +1608,13 @@ MAKEINFO Parent configure detects if it is of sufficient version. MAKEINFOFLAGS Parameters for MAKEINFO. @@ -388,7 +353,7 @@ Index: gdb-7.10.50.20160106/gdb/configure YACC The `Yet Another C Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. -@@ -5655,6 +5675,494 @@ _ACEOF +@@ -5613,6 +5633,494 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5 $as_echo "$with_auto_load_safe_path" >&6; } @@ -883,11 +848,11 @@ Index: gdb-7.10.50.20160106/gdb/configure subdirs="$subdirs testsuite" -Index: gdb-7.10.50.20160106/gdb/configure.ac +Index: gdb-7.11.50.20160630/gdb/configure.ac =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/configure.ac -+++ gdb-7.10.50.20160106/gdb/configure.ac -@@ -177,6 +177,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escap +--- gdb-7.11.50.20160630.orig/gdb/configure.ac 2016-07-02 23:43:24.085214144 +0200 ++++ gdb-7.11.50.20160630/gdb/configure.ac 2016-07-03 14:37:12.582130819 +0200 +@@ -177,6 +177,199 @@ [Directories safe to hold auto-loaded files.]) AC_MSG_RESULT([$with_auto_load_safe_path]) @@ -1087,11 +1052,11 @@ Index: gdb-7.10.50.20160106/gdb/configure.ac AC_CONFIG_SUBDIRS(testsuite) # Check whether to support alternative target configurations -Index: gdb-7.10.50.20160106/gdb/corelow.c +Index: gdb-7.11.50.20160630/gdb/corelow.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/corelow.c -+++ gdb-7.10.50.20160106/gdb/corelow.c -@@ -310,7 +310,7 @@ build_id_locate_exec (int from_tty) +--- gdb-7.11.50.20160630.orig/gdb/corelow.c 2016-07-03 14:34:32.022753582 +0200 ++++ gdb-7.11.50.20160630/gdb/corelow.c 2016-07-03 14:37:12.582130819 +0200 +@@ -310,7 +310,7 @@ symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED; } else @@ -1100,10 +1065,10 @@ Index: gdb-7.10.50.20160106/gdb/corelow.c do_cleanups (back_to); -Index: gdb-7.10.50.20160106/gdb/build-id.c +Index: gdb-7.11.50.20160630/gdb/build-id.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/build-id.c -+++ gdb-7.10.50.20160106/gdb/build-id.c +--- gdb-7.11.50.20160630.orig/gdb/build-id.c 2016-07-03 14:36:50.124938187 +0200 ++++ gdb-7.11.50.20160630/gdb/build-id.c 2016-07-03 14:42:25.171812134 +0200 @@ -35,6 +35,7 @@ #include "elf/common.h" #include "elf-bfd.h" @@ -1112,7 +1077,7 @@ Index: gdb-7.10.50.20160106/gdb/build-id.c #define BUILD_ID_VERBOSE_NONE 0 #define BUILD_ID_VERBOSE_FILENAMES 1 -@@ -665,8 +666,366 @@ build_id_to_filename (const struct bfd_b +@@ -665,8 +666,366 @@ return result; } @@ -1221,13 +1186,13 @@ Index: gdb-7.10.50.20160106/gdb/build-id.c + return 0; + } + -+ if (!((headerFormat_p = dlsym (h, "headerFormat")) -+ && (rpmReadConfigFiles_p = dlsym (h, "rpmReadConfigFiles")) -+ && (rpmdbFreeIterator_p = dlsym (h, "rpmdbFreeIterator")) -+ && (rpmdbNextIterator_p = dlsym (h, "rpmdbNextIterator")) -+ && (rpmtsCreate_p = dlsym (h, "rpmtsCreate")) -+ && (rpmtsFree_p = dlsym (h, "rpmtsFree")) -+ && (rpmtsInitIterator_p = dlsym (h, "rpmtsInitIterator")))) ++ if (!((headerFormat_p = (char *(*) (Header h, const char * fmt, errmsg_t *errmsg)) dlsym (h, "headerFormat")) ++ && (rpmReadConfigFiles_p = (int (*) (const char * file, const char * target)) dlsym (h, "rpmReadConfigFiles")) ++ && (rpmdbFreeIterator_p = (rpmdbMatchIterator (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbFreeIterator")) ++ && (rpmdbNextIterator_p = (Header (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbNextIterator")) ++ && (rpmtsCreate_p = (rpmts (*) (void)) dlsym (h, "rpmtsCreate")) ++ && (rpmtsFree_p = (rpmts (*) (rpmts ts)) dlsym (h, "rpmtsFree")) ++ && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator")))) + { + warning (_("Opened library \"%s\" is incompatible (%s), " + "missing debuginfos notifications will not be displayed"), @@ -1283,12 +1248,12 @@ Index: gdb-7.10.50.20160106/gdb/build-id.c + if (s > debuginfo && memcmp (s, ".src.rpm", srcrpmlen) == 0) + { + /* s2 = `-%{release}.src.rpm-debuginfo.%{arch}' */ -+ s2 = memrchr (debuginfo, '-', s - debuginfo); ++ s2 = (char *) memrchr (debuginfo, '-', s - debuginfo); + } + if (s2) + { + /* s2 = `-%{version}-%{release}.src.rpm-debuginfo.%{arch}' */ -+ s2 = memrchr (debuginfo, '-', s2 - debuginfo); ++ s2 = (char *) memrchr (debuginfo, '-', s2 - debuginfo); + } + if (!s2) + { @@ -1311,7 +1276,7 @@ Index: gdb-7.10.50.20160106/gdb/build-id.c + + /* RPMDBI_PACKAGES requires keylen == sizeof (int). */ + /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */ -+ mi_debuginfo = rpmtsInitIterator_p (ts, RPMDBI_LABEL, debuginfo, 0); ++ mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0); + xfree (debuginfo); + if (mi_debuginfo) + { @@ -1362,7 +1327,7 @@ Index: gdb-7.10.50.20160106/gdb/build-id.c + + *slot = debuginfo; + -+ missing_rpm = xmalloc (sizeof (*missing_rpm) + strlen (debuginfo)); ++ missing_rpm = (struct missing_rpm *) xmalloc (sizeof (*missing_rpm) + strlen (debuginfo)); + strcpy (missing_rpm->rpm, debuginfo); + missing_rpm->next = missing_rpm_list; + missing_rpm_list = missing_rpm; @@ -1400,7 +1365,7 @@ Index: gdb-7.10.50.20160106/gdb/build-id.c + if (missing_rpm_list_entries == 0) + return; + -+ array = xmalloc (sizeof (*array) * missing_rpm_list_entries); ++ array = (char **) xmalloc (sizeof (*array) * missing_rpm_list_entries); + cleanups = make_cleanup (xfree, array); + + array_iter = array; @@ -1480,7 +1445,7 @@ Index: gdb-7.10.50.20160106/gdb/build-id.c avoidance. */ struct missing_filepair -@@ -720,11 +1079,17 @@ missing_filepair_change (void) +@@ -720,11 +1079,17 @@ /* All their memory came just from missing_filepair_OBSTACK. */ missing_filepair_hash = NULL; } @@ -1498,7 +1463,7 @@ Index: gdb-7.10.50.20160106/gdb/build-id.c missing_filepair_change (); } -@@ -791,14 +1156,39 @@ debug_print_missing (const char *binary, +@@ -791,14 +1156,39 @@ *slot = missing_filepair; diff --git a/gdb-6.6-buildid-locate-solib-missing-ids.patch b/gdb-6.6-buildid-locate-solib-missing-ids.patch index 96cb493..32764be 100644 --- a/gdb-6.6-buildid-locate-solib-missing-ids.patch +++ b/gdb-6.6-buildid-locate-solib-missing-ids.patch @@ -1,3 +1,6 @@ +gdb returns an incorrect back trace when applying a debuginfo +https://bugzilla.redhat.com/show_bug.cgi?id=1339862 + Index: gdb-7.9.90.20150709/gdb/solib-svr4.c =================================================================== --- gdb-7.9.90.20150709.orig/gdb/solib-svr4.c 2015-07-09 18:18:54.526417766 +0200 @@ -57,3 +60,163 @@ Index: gdb-7.9.90.20150709/gdb/solib-svr4.c xfree (build_id_filename); xfree (build_id); +--- /dev/null 2016-07-02 20:29:01.679404943 +0200 ++++ gdb-7.11.50.20160721/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp 2016-07-31 23:04:49.062753722 +0200 +@@ -0,0 +1,105 @@ ++# Copyright 2016 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++if {[skip_shlib_tests]} { ++ return 0 ++} ++ ++set testfile "gcore-buildid-exec-but-not-solib" ++set srcmainfile ${testfile}-main.c ++set srclibfile ${testfile}-lib.c ++set libfile [standard_output_file ${testfile}-lib.so] ++set objfile [standard_output_file ${testfile}-main.o] ++set executable ${testfile}-main ++set binfile [standard_output_file ${executable}] ++set gcorefile [standard_output_file ${executable}.gcore] ++set outdir [file dirname $binfile] ++ ++if { [gdb_compile_shlib ${srcdir}/${subdir}/${srclibfile} ${libfile} "debug additional_flags=-Wl,--build-id"] != "" ++ || [gdb_compile ${srcdir}/${subdir}/${srcmainfile} ${objfile} object {debug}] != "" } { ++ unsupported "-Wl,--build-id compilation failed" ++ return -1 ++} ++set opts [list debug shlib=${libfile} "additional_flags=-Wl,--build-id"] ++if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } { ++ unsupported "-Wl,--build-id compilation failed" ++ return -1 ++} ++ ++clean_restart $executable ++gdb_load_shlib $libfile ++ ++# Does this gdb support gcore? ++set test "help gcore" ++gdb_test_multiple $test $test { ++ -re "Undefined command: .gcore.*\r\n$gdb_prompt $" { ++ # gcore command not supported -- nothing to test here. ++ unsupported "gdb does not support gcore on this target" ++ return -1; ++ } ++ -re "Save a core file .*\r\n$gdb_prompt $" { ++ pass $test ++ } ++} ++ ++if { ![runto lib] } then { ++ return -1 ++} ++ ++set escapedfilename [string_to_regexp ${gcorefile}] ++ ++set test "save a corefile" ++gdb_test_multiple "gcore ${gcorefile}" $test { ++ -re "Saved corefile ${escapedfilename}\r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re "Can't create a corefile\r\n$gdb_prompt $" { ++ unsupported $test ++ return -1 ++ } ++} ++ ++# Now restart gdb and load the corefile. ++ ++clean_restart $executable ++gdb_load_shlib $libfile ++ ++set buildid [build_id_debug_filename_get $libfile] ++ ++regsub {\.debug$} $buildid {} buildid ++ ++set debugdir [standard_output_file ${testfile}-debugdir] ++file delete -force -- $debugdir ++ ++file mkdir $debugdir/[file dirname $libfile] ++file copy $libfile $debugdir/${libfile} ++ ++file mkdir $debugdir/[file dirname $buildid] ++file copy $libfile $debugdir/${buildid} ++ ++remote_exec build "ln -s /lib ${debugdir}/" ++remote_exec build "ln -s /lib64 ${debugdir}/" ++# /usr is not needed, all the libs are in /lib64: libm.so.6 libc.so.6 ld-linux-x86-64.so.2 ++ ++gdb_test "set solib-absolute-prefix $debugdir" ++ ++gdb_test_no_output "set debug-file-directory $debugdir" "set debug-file-directory" ++ ++gdb_test "core ${gcorefile}" "Core was generated by .*" "re-load generated corefile" ++ ++gdb_test "frame" "#0 \[^\r\n\]* lib .*" "library got loaded" ++ ++gdb_test "bt" ++gdb_test "info shared" +--- /dev/null 2016-07-02 20:29:01.679404943 +0200 ++++ gdb-7.11.50.20160721/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c 2016-07-28 21:06:40.977786922 +0200 +@@ -0,0 +1,25 @@ ++/* Copyright 2010 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++extern void lib (void); ++ ++int ++main (void) ++{ ++ lib (); ++ return 0; ++} +--- /dev/null 2016-07-02 20:29:01.679404943 +0200 ++++ gdb-7.11.50.20160721/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c 2016-07-28 21:06:40.977786922 +0200 +@@ -0,0 +1,21 @@ ++/* Copyright 2010 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++void ++lib (void) ++{ ++} diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index 3a68075..da4919b 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -1,7 +1,7 @@ -Index: gdb-7.10.90.20160211/gdb/corelow.c +Index: gdb-7.11.50.20160630/gdb/corelow.c =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/corelow.c 2016-02-15 23:25:00.859346221 +0100 -+++ gdb-7.10.90.20160211/gdb/corelow.c 2016-02-15 23:26:46.516096395 +0100 +--- gdb-7.11.50.20160630.orig/gdb/corelow.c 2016-07-03 14:33:28.130205528 +0200 ++++ gdb-7.11.50.20160630/gdb/corelow.c 2016-07-03 14:34:32.022753582 +0200 @@ -45,6 +45,10 @@ #include "gdb_bfd.h" #include "completer.h" @@ -94,11 +94,11 @@ Index: gdb-7.10.90.20160211/gdb/corelow.c + NULL, NULL, NULL, + &setlist, &showlist); } -Index: gdb-7.10.90.20160211/gdb/doc/gdb.texinfo +Index: gdb-7.11.50.20160630/gdb/doc/gdb.texinfo =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/doc/gdb.texinfo 2016-02-15 23:25:36.455598958 +0100 -+++ gdb-7.10.90.20160211/gdb/doc/gdb.texinfo 2016-02-15 23:26:06.362811302 +0100 -@@ -18684,6 +18684,27 @@ +--- gdb-7.11.50.20160630.orig/gdb/doc/gdb.texinfo 2016-07-03 14:33:28.130205528 +0200 ++++ gdb-7.11.50.20160630/gdb/doc/gdb.texinfo 2016-07-03 14:34:32.030753651 +0200 +@@ -18916,6 +18916,27 @@ @end table @@ -126,10 +126,10 @@ Index: gdb-7.10.90.20160211/gdb/doc/gdb.texinfo @cindex @code{.gnu_debuglink} sections @cindex debug link sections A debug link is a special section of the executable file named -Index: gdb-7.10.90.20160211/gdb/solib-svr4.c +Index: gdb-7.11.50.20160630/gdb/solib-svr4.c =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/solib-svr4.c 2016-02-15 23:25:00.859346221 +0100 -+++ gdb-7.10.90.20160211/gdb/solib-svr4.c 2016-02-15 23:26:46.613097083 +0100 +--- gdb-7.11.50.20160630.orig/gdb/solib-svr4.c 2016-07-03 14:33:28.130205528 +0200 ++++ gdb-7.11.50.20160630/gdb/solib-svr4.c 2016-07-03 14:34:32.031753659 +0200 @@ -45,6 +45,7 @@ #include "auxv.h" #include "gdb_bfd.h" @@ -194,10 +194,10 @@ Index: gdb-7.10.90.20160211/gdb/solib-svr4.c xfree (buffer); /* If this entry has no name, or its name matches the name -Index: gdb-7.10.90.20160211/gdb/elfread.c +Index: gdb-7.11.50.20160630/gdb/elfread.c =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/elfread.c 2016-02-15 23:25:00.859346221 +0100 -+++ gdb-7.10.90.20160211/gdb/elfread.c 2016-02-15 23:26:06.364811316 +0100 +--- gdb-7.11.50.20160630.orig/gdb/elfread.c 2016-07-03 14:33:28.130205528 +0200 ++++ gdb-7.11.50.20160630/gdb/elfread.c 2016-07-03 14:34:32.031753659 +0200 @@ -1259,9 +1259,10 @@ && objfile->separate_debug_objfile == NULL && objfile->separate_debug_objfile_backlink == NULL) @@ -224,11 +224,11 @@ Index: gdb-7.10.90.20160211/gdb/elfread.c } } -Index: gdb-7.10.90.20160211/gdb/symfile.h +Index: gdb-7.11.50.20160630/gdb/symfile.h =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/symfile.h 2016-02-15 23:25:00.859346221 +0100 -+++ gdb-7.10.90.20160211/gdb/symfile.h 2016-02-15 23:26:46.516096395 +0100 -@@ -584,6 +584,10 @@ +--- gdb-7.11.50.20160630.orig/gdb/symfile.h 2016-07-03 14:33:28.130205528 +0200 ++++ gdb-7.11.50.20160630/gdb/symfile.h 2016-07-03 14:34:32.032753668 +0200 +@@ -589,6 +589,10 @@ void map_symbol_filenames (symbol_filename_ftype *fun, void *data, int need_fullname); @@ -239,11 +239,11 @@ Index: gdb-7.10.90.20160211/gdb/symfile.h /* From dwarf2read.c */ /* Names for a dwarf2 debugging section. The field NORMAL is the normal -Index: gdb-7.10.90.20160211/gdb/testsuite/lib/gdb.exp +Index: gdb-7.11.50.20160630/gdb/testsuite/lib/gdb.exp =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/testsuite/lib/gdb.exp 2016-02-15 23:25:00.859346221 +0100 -+++ gdb-7.10.90.20160211/gdb/testsuite/lib/gdb.exp 2016-02-15 23:26:46.516096395 +0100 -@@ -1640,6 +1640,16 @@ +--- gdb-7.11.50.20160630.orig/gdb/testsuite/lib/gdb.exp 2016-07-03 14:33:28.130205528 +0200 ++++ gdb-7.11.50.20160630/gdb/testsuite/lib/gdb.exp 2016-07-03 14:34:32.033753676 +0200 +@@ -1641,6 +1641,16 @@ warning "Couldn't set the width to 0." } } @@ -260,11 +260,11 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/lib/gdb.exp return 0 } -Index: gdb-7.10.90.20160211/gdb/testsuite/lib/mi-support.exp +Index: gdb-7.11.50.20160630/gdb/testsuite/lib/mi-support.exp =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/testsuite/lib/mi-support.exp 2016-02-15 23:25:00.859346221 +0100 -+++ gdb-7.10.90.20160211/gdb/testsuite/lib/mi-support.exp 2016-02-15 23:26:46.516096395 +0100 -@@ -204,6 +204,16 @@ +--- gdb-7.11.50.20160630.orig/gdb/testsuite/lib/mi-support.exp 2016-07-03 14:33:28.130205528 +0200 ++++ gdb-7.11.50.20160630/gdb/testsuite/lib/mi-support.exp 2016-07-03 14:34:32.033753676 +0200 +@@ -309,6 +309,16 @@ proc default_mi_gdb_start { args } { warning "Couldn't set the width to 0." } } @@ -279,12 +279,22 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/lib/mi-support.exp + } + } - # Create the new PTY for the inferior process. if { $separate_inferior_pty } { -Index: gdb-7.10.90.20160211/gdb/objfiles.h + mi_create_inferior_pty +--- gdb-7.11.90.20160907/gdb/testsuite/gdb.base/new-ui-pending-input.exp-orig 2016-09-07 04:01:15.000000000 +0200 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.base/new-ui-pending-input.exp 2016-09-07 22:35:35.818534069 +0200 +@@ -62,6 +62,7 @@ proc test_command_line_new_ui_pending_in + set options "" + append options " -iex \"set height 0\"" + append options " -iex \"set width 0\"" ++ append options " -iex \"set build-id-verbose 0\"" + append options " -iex \"new-ui console $extra_tty_name\"" + append options " -ex \"b $bpline\"" + append options " -ex \"run\"" +Index: gdb-7.11.50.20160630/gdb/objfiles.h =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/objfiles.h 2016-02-15 23:25:00.859346221 +0100 -+++ gdb-7.10.90.20160211/gdb/objfiles.h 2016-02-15 23:26:06.366811330 +0100 +--- gdb-7.11.50.20160630.orig/gdb/objfiles.h 2016-07-03 14:33:28.130205528 +0200 ++++ gdb-7.11.50.20160630/gdb/objfiles.h 2016-07-03 14:34:32.034753685 +0200 @@ -489,6 +489,10 @@ #define OBJF_NOT_FILENAME (1 << 6) @@ -296,10 +306,10 @@ Index: gdb-7.10.90.20160211/gdb/objfiles.h /* Declarations for functions defined in objfiles.c */ extern struct objfile *allocate_objfile (bfd *, const char *name, int); -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/corefile.exp +Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/corefile.exp =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/testsuite/gdb.base/corefile.exp 2016-02-15 23:25:00.859346221 +0100 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/corefile.exp 2016-02-15 23:26:55.178157896 +0100 +--- gdb-7.11.50.20160630.orig/gdb/testsuite/gdb.base/corefile.exp 2016-07-03 14:33:28.130205528 +0200 ++++ gdb-7.11.50.20160630/gdb/testsuite/gdb.base/corefile.exp 2016-07-03 14:34:32.034753685 +0200 @@ -293,3 +293,33 @@ pass $test } @@ -334,10 +344,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/corefile.exp + gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*" + pass $wholetest +} -Index: gdb-7.10.90.20160211/gdb/build-id.c +Index: gdb-7.11.50.20160630/gdb/build-id.c =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/build-id.c 2016-02-15 23:25:00.859346221 +0100 -+++ gdb-7.10.90.20160211/gdb/build-id.c 2016-02-15 23:26:46.516096395 +0100 +--- gdb-7.11.50.20160630.orig/gdb/build-id.c 2016-07-03 14:33:28.130205528 +0200 ++++ gdb-7.11.50.20160630/gdb/build-id.c 2016-07-03 14:36:50.124938187 +0200 @@ -26,11 +26,67 @@ #include "objfiles.h" #include "filenames.h" @@ -385,10 +395,10 @@ Index: gdb-7.10.90.20160211/gdb/build-id.c + && memcmp (xnp->name, "GNU", sizeof "GNU") == 0) + { + size_t size = descsz; -+ gdb_byte *data = (void *) descdata; ++ gdb_byte *data = (gdb_byte *) descdata; + struct bfd_build_id *retval; + -+ retval = xmalloc (sizeof *retval - 1 + size); ++ retval = (struct bfd_build_id *) xmalloc (sizeof *retval - 1 + size); + retval->size = size; + memcpy (retval->data, data, size); + @@ -429,7 +439,7 @@ Index: gdb-7.10.90.20160211/gdb/build-id.c + gdb_byte *buf; + int err; + -+ buf = xmalloc (hdr->p_filesz); ++ buf = (gdb_byte *) xmalloc (hdr->p_filesz); + err = target_read_memory (loadbase + i_phdr[i].p_vaddr, buf, + hdr->p_filesz); + if (err == 0) @@ -633,8 +643,8 @@ Index: gdb-7.10.90.20160211/gdb/build-id.c + x_phdrs_size = (bfd_get_arch_size (templ) == 64 ? sizeof (Elf64_External_Phdr) + : sizeof (Elf32_External_Phdr)); + -+ i_phdrs = xmalloc (i_ehdr.e_phnum * (sizeof *i_phdrs + x_phdrs_size)); -+ x_phdrs_ptr = (void *) &i_phdrs[i_ehdr.e_phnum]; ++ i_phdrs = (Elf_Internal_Phdr *) xmalloc (i_ehdr.e_phnum * (sizeof *i_phdrs + x_phdrs_size)); ++ x_phdrs_ptr = (gdb_byte *) &i_phdrs[i_ehdr.e_phnum]; + err = target_read_memory (ehdr_vma + i_ehdr.e_phoff, (bfd_byte *) x_phdrs_ptr, + i_ehdr.e_phnum * x_phdrs_size); + if (err) @@ -700,7 +710,7 @@ Index: gdb-7.10.90.20160211/gdb/build-id.c + { + struct build_id_addr_sect *candidate; + -+ candidate = xmalloc (sizeof *candidate); ++ candidate = (struct build_id_addr_sect *) xmalloc (sizeof *candidate); + candidate->next = build_id_addr_sect; + build_id_addr_sect = candidate; + candidate->sect = sect; @@ -825,7 +835,7 @@ Index: gdb-7.10.90.20160211/gdb/build-id.c - + (sizeof "/.build-id/" - 1) + 1 - + 2 * build_id_len + (sizeof ".debug" - 1) + 1); - link = (char *) alloca (alloc_len); -+ link = xmalloc (strlen (debug_file_directory) + 2 * build_id_len + 50); ++ link = (char *) xmalloc (strlen (debug_file_directory) + 2 * build_id_len + 50); /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will cause "/.build-id/..." lookups. */ @@ -937,8 +947,8 @@ Index: gdb-7.10.90.20160211/gdb/build-id.c + { + size_t len_orig = strlen (link_all); + -+ link_all = xrealloc (link_all, -+ len_orig + 1 + strlen (link0_resolved) + 1); ++ link_all = (char *) xrealloc (link_all, ++ len_orig + 1 + strlen (link0_resolved) + 1); + + /* Use whitespace instead of DIRNAME_SEPARATOR to be compatible with + its possible use as an argument for installation command. */ @@ -1095,9 +1105,9 @@ Index: gdb-7.10.90.20160211/gdb/build-id.c + if (*slot != NULL) + return; + -+ missing_filepair = obstack_alloc (&missing_filepair_obstack, -+ sizeof (*missing_filepair) - 1 -+ + binary_len0 + debug_len0); ++ missing_filepair = (struct missing_filepair *) obstack_alloc (&missing_filepair_obstack, ++ sizeof (*missing_filepair) - 1 ++ + binary_len0 + debug_len0); + missing_filepair->binary = missing_filepair->data; + memcpy (missing_filepair->binary, binary, binary_len0); + if (debug != NULL) @@ -1166,10 +1176,10 @@ Index: gdb-7.10.90.20160211/gdb/build-id.c + + observer_attach_executable_changed (debug_print_executable_changed); +} -Index: gdb-7.10.90.20160211/gdb/build-id.h +Index: gdb-7.11.50.20160630/gdb/build-id.h =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/build-id.h 2016-02-15 23:25:00.859346221 +0100 -+++ gdb-7.10.90.20160211/gdb/build-id.h 2016-02-15 23:26:06.368811345 +0100 +--- gdb-7.11.50.20160630.orig/gdb/build-id.h 2016-07-03 14:33:28.130205528 +0200 ++++ gdb-7.11.50.20160630/gdb/build-id.h 2016-07-03 14:34:32.035753694 +0200 @@ -20,9 +20,10 @@ #ifndef BUILD_ID_H #define BUILD_ID_H @@ -1204,11 +1214,11 @@ Index: gdb-7.10.90.20160211/gdb/build-id.h + char **build_id_filename_return); #endif /* BUILD_ID_H */ -Index: gdb-7.10.90.20160211/gdb/dwarf2read.c +Index: gdb-7.11.50.20160630/gdb/dwarf2read.c =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/dwarf2read.c 2016-02-15 23:25:36.461599001 +0100 -+++ gdb-7.10.90.20160211/gdb/dwarf2read.c 2016-02-15 23:26:06.373811380 +0100 -@@ -2516,7 +2516,7 @@ +--- gdb-7.11.50.20160630.orig/gdb/dwarf2read.c 2016-07-03 14:33:28.130205528 +0200 ++++ gdb-7.11.50.20160630/gdb/dwarf2read.c 2016-07-03 14:34:32.040753736 +0200 +@@ -2535,7 +2535,7 @@ } if (dwz_bfd == NULL) @@ -1217,11 +1227,11 @@ Index: gdb-7.10.90.20160211/gdb/dwarf2read.c if (dwz_bfd == NULL) error (_("could not find '.gnu_debugaltlink' file for %s"), -Index: gdb-7.10.90.20160211/gdb/python/py-objfile.c +Index: gdb-7.11.50.20160630/gdb/python/py-objfile.c =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/python/py-objfile.c 2016-02-15 23:25:00.859346221 +0100 -+++ gdb-7.10.90.20160211/gdb/python/py-objfile.c 2016-02-15 23:26:06.373811380 +0100 -@@ -139,7 +139,7 @@ +--- gdb-7.11.50.20160630.orig/gdb/python/py-objfile.c 2016-07-03 14:33:28.130205528 +0200 ++++ gdb-7.11.50.20160630/gdb/python/py-objfile.c 2016-07-03 14:34:32.040753736 +0200 +@@ -136,7 +136,7 @@ TRY { @@ -1230,7 +1240,7 @@ Index: gdb-7.10.90.20160211/gdb/python/py-objfile.c } CATCH (except, RETURN_MASK_ALL) { -@@ -548,7 +548,7 @@ +@@ -547,7 +547,7 @@ /* Don't return separate debug files. */ if (objfile->separate_debug_objfile_backlink != NULL) continue; @@ -1239,11 +1249,11 @@ Index: gdb-7.10.90.20160211/gdb/python/py-objfile.c if (obfd_build_id == NULL) continue; if (objfpy_build_id_matches (obfd_build_id, build_id)) -Index: gdb-7.10.90.20160211/gdb/coffread.c +Index: gdb-7.11.50.20160630/gdb/coffread.c =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/coffread.c 2016-02-15 23:25:00.859346221 +0100 -+++ gdb-7.10.90.20160211/gdb/coffread.c 2016-02-15 23:26:06.374811387 +0100 -@@ -739,7 +739,7 @@ +--- gdb-7.11.50.20160630.orig/gdb/coffread.c 2016-07-03 14:33:28.130205528 +0200 ++++ gdb-7.11.50.20160630/gdb/coffread.c 2016-07-03 14:34:32.041753745 +0200 +@@ -737,7 +737,7 @@ { char *debugfile; diff --git a/gdb-6.6-bz230000-power6-disassembly-test.patch b/gdb-6.6-bz230000-power6-disassembly-test.patch index ac3a250..17f86cd 100644 --- a/gdb-6.6-bz230000-power6-disassembly-test.patch +++ b/gdb-6.6-bz230000-power6-disassembly-test.patch @@ -35,7 +35,7 @@ Index: gdb-7.5.50.20130215/gdb/testsuite/gdb.arch/powerpc-power6.exp + +set testfile "powerpc-power6" +set srcfile ${testfile}.s -+set objfile ${objdir}/${subdir}/${testfile}.o ++set objfile [standard_output_file ${testfile}.o] + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } { + untested "PowerPC prologue tests" diff --git a/gdb-6.6-scheduler_locking-step-is-default.patch b/gdb-6.6-scheduler_locking-step-is-default.patch index a8dbcce..40c06b4 100644 --- a/gdb-6.6-scheduler_locking-step-is-default.patch +++ b/gdb-6.6-scheduler_locking-step-is-default.patch @@ -1,8 +1,8 @@ -Index: gdb-7.10.50.20151022/gdb/infrun.c +Index: gdb-7.11.90.20160904/gdb/infrun.c =================================================================== ---- gdb-7.10.50.20151022.orig/gdb/infrun.c 2015-10-22 22:30:15.887224452 +0200 -+++ gdb-7.10.50.20151022/gdb/infrun.c 2015-10-22 22:30:25.742282478 +0200 -@@ -2175,7 +2175,7 @@ static const char *const scheduler_enums +--- gdb-7.11.90.20160904.orig/gdb/infrun.c 2016-09-04 17:57:12.733853848 +0200 ++++ gdb-7.11.90.20160904/gdb/infrun.c 2016-09-04 17:57:45.568145391 +0200 +@@ -2218,7 +2218,7 @@ schedlock_replay, NULL }; @@ -11,11 +11,11 @@ Index: gdb-7.10.50.20151022/gdb/infrun.c static void show_scheduler_mode (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) -Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.mi/mi-cli.exp +Index: gdb-7.11.90.20160904/gdb/testsuite/gdb.mi/mi-cli.exp =================================================================== ---- gdb-7.10.50.20151022.orig/gdb/testsuite/gdb.mi/mi-cli.exp 2015-10-22 22:29:38.352003447 +0200 -+++ gdb-7.10.50.20151022/gdb/testsuite/gdb.mi/mi-cli.exp 2015-10-22 22:30:15.888224458 +0200 -@@ -199,7 +199,7 @@ mi_expect_stop "breakpoint-hit" "main" " +--- gdb-7.11.90.20160904.orig/gdb/testsuite/gdb.mi/mi-cli.exp 2016-09-04 17:57:12.733853848 +0200 ++++ gdb-7.11.90.20160904/gdb/testsuite/gdb.mi/mi-cli.exp 2016-09-04 17:57:45.569145399 +0200 +@@ -199,7 +199,7 @@ # Test that the token is output even for CLI commands # Also test that *stopped includes frame information. mi_gdb_test "34 next" \ @@ -24,11 +24,11 @@ Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.mi/mi-cli.exp "34 next: run" # Test that the new current source line is output to the console -Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.mi/mi-logging.exp +Index: gdb-7.11.90.20160904/gdb/testsuite/gdb.mi/mi-logging.exp =================================================================== ---- gdb-7.10.50.20151022.orig/gdb/testsuite/gdb.mi/mi-logging.exp 2015-10-22 22:29:38.352003447 +0200 -+++ gdb-7.10.50.20151022/gdb/testsuite/gdb.mi/mi-logging.exp 2015-10-22 22:30:15.888224458 +0200 -@@ -53,7 +53,7 @@ close $chan +--- gdb-7.11.90.20160904.orig/gdb/testsuite/gdb.mi/mi-logging.exp 2016-09-04 17:57:12.733853848 +0200 ++++ gdb-7.11.90.20160904/gdb/testsuite/gdb.mi/mi-logging.exp 2016-09-04 17:57:45.569145399 +0200 +@@ -53,7 +53,7 @@ set mi_log_prompt "\[(\]gdb\[)\] \[\r\n\]+" @@ -37,7 +37,7 @@ Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.mi/mi-logging.exp pass "Log file contents" } else { fail "Log file contents" -@@ -76,7 +76,7 @@ set chan [open $milogfile] +@@ -76,7 +76,7 @@ set logcontent [read $chan] close $chan @@ -46,11 +46,11 @@ Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.mi/mi-logging.exp pass "Redirect log file contents" } else { fail "Redirect log file contents" -Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.mi/mi-console.exp +Index: gdb-7.11.90.20160904/gdb/testsuite/gdb.mi/mi-console.exp =================================================================== ---- gdb-7.10.50.20151022.orig/gdb/testsuite/gdb.mi/mi-console.exp 2015-10-22 22:29:38.353003453 +0200 -+++ gdb-7.10.50.20151022/gdb/testsuite/gdb.mi/mi-console.exp 2015-10-22 22:30:15.888224458 +0200 -@@ -60,6 +60,9 @@ if { [gdb_compile "${srcdir}/${subdir}/ +--- gdb-7.11.90.20160904.orig/gdb/testsuite/gdb.mi/mi-console.exp 2016-09-04 17:57:12.733853848 +0200 ++++ gdb-7.11.90.20160904/gdb/testsuite/gdb.mi/mi-console.exp 2016-09-04 17:57:45.569145399 +0200 +@@ -60,6 +60,9 @@ mi_run_to_main @@ -60,3 +60,16 @@ Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.mi/mi-console.exp # 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 +Index: gdb-7.11.90.20160904/gdb/testsuite/gdb.opt/inline-cmds.exp +=================================================================== +--- gdb-7.11.90.20160904.orig/gdb/testsuite/gdb.opt/inline-cmds.exp 2016-09-04 17:59:44.600202299 +0200 ++++ gdb-7.11.90.20160904/gdb/testsuite/gdb.opt/inline-cmds.exp 2016-09-04 18:00:04.616380027 +0200 +@@ -331,7 +331,7 @@ + + 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.7-ppc-clobbered-registers-O2-test.patch b/gdb-6.7-ppc-clobbered-registers-O2-test.patch index 3328efc..5b62cbf 100644 --- a/gdb-6.7-ppc-clobbered-registers-O2-test.patch +++ b/gdb-6.7-ppc-clobbered-registers-O2-test.patch @@ -68,7 +68,7 @@ http://sourceware.org/ml/gdb-patches/2007-09/msg00228.html + +set testfile "ppc-clobbered-registers-O2" +set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} ++set binfile [standard_output_file ${testfile}] +set compile_flags "debug additional_flags=-O2" + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ${compile_flags}] != "" } { diff --git a/gdb-6.7-testsuite-stable-results.patch b/gdb-6.7-testsuite-stable-results.patch new file mode 100644 index 0000000..6716ef6 --- /dev/null +++ b/gdb-6.7-testsuite-stable-results.patch @@ -0,0 +1,101 @@ +gdb/testsuite/gdb.base/fileio.c: +gdb/testsuite/gdb.base/fileio.exp: +2007-12-08 Jan Kratochvil + + * gdb.base/fileio.c (ROOTSUBDIR): New macro. + (main): CHDIR into ROOTSUBDIR. CHOWN ROOTSUBDIR and CHDIR into + ROOTSUBDIR if we are being run as root. + * gdb.base/fileio.exp: Change the startup and finish cleanup. + Change the test file reference to be into the `fileio.dir' directory. + + +sources/gdb/testsuite/gdb.base/dump.exp: +Found on RHEL-5.s390x. + + +gdb-6.8.50.20090209/gdb/testsuite/gdb.base/auxv.exp: +random FAIL: gdb.base/auxv.exp: matching auxv data from live and gcore + + +gdb-6.8.50.20090209/gdb/testsuite/gdb.base/annota1.exp: +frames-invalid can happen asynchronously. + +Index: gdb-7.12/gdb/testsuite/gdb.base/fileio.c +=================================================================== +--- gdb-7.12.orig/gdb/testsuite/gdb.base/fileio.c 2016-08-01 17:50:21.000000000 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.base/fileio.c 2016-10-07 22:49:20.689346914 +0200 +@@ -556,6 +556,28 @@ + int + main () + { ++ /* These tests ++ Open for write but no write permission returns EACCES ++ Unlinking a file in a directory w/o write access returns EACCES ++ fail if we are being run as root - drop the privileges here. */ ++ ++ if (geteuid () == 0) ++ { ++ uid_t uid = 99; ++ ++ if (chown (OUTDIR, uid, uid) != 0) ++ { ++ printf ("chown %d.%d %s: %s\n", (int) uid, (int) uid, ++ OUTDIR, strerror (errno)); ++ exit (1); ++ } ++ if (setuid (uid) || geteuid () == 0) ++ { ++ printf ("setuid %d: %s\n", (int) uid, strerror (errno)); ++ exit (1); ++ } ++ } ++ + /* Don't change the order of the calls. They partly depend on each other */ + test_open (); + test_write (); +Index: gdb-7.12/gdb/testsuite/gdb.base/fileio.exp +=================================================================== +--- gdb-7.12.orig/gdb/testsuite/gdb.base/fileio.exp 2016-08-01 17:50:21.000000000 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.base/fileio.exp 2016-10-07 22:54:44.680071906 +0200 +@@ -24,9 +24,9 @@ + standard_testfile + + if {[is_remote host]} { +- set outdir . ++ set outdir "fileio.dir" + } else { +- set outdir [standard_output_file {}] ++ set outdir [standard_output_file "fileio.dir"] + } + + if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ +@@ -47,7 +47,8 @@ + if {[file exists $dir2] && ![file writable $dir2]} { + system "chmod +w $dir2" + } +-system "rm -rf [standard_output_file *.fileio.test]" ++system "rm -rf [standard_output_file fileio.dir]" ++system "mkdir -m777 [standard_output_file fileio.dir]" + + set oldtimeout $timeout + set timeout [expr "$timeout + 60"] +@@ -89,7 +90,7 @@ + + gdb_test "continue" ".*" "" + +-catch "system \"chmod -f -w [standard_output_file nowrt.fileio.test]\"" ++catch "system \"chmod -f -w [standard_output_file fileio.dir/nowrt.fileio.test]\"" + + gdb_test continue \ + "Continuing\\..*open 5:.*EACCES$stop_msg" \ +@@ -276,9 +277,7 @@ + gdb_exit + + # Make dir2 writable again so rm -rf of a build tree Just Works. +-if {[file exists $dir2] && ![file writable $dir2]} { +- system "chmod +w $dir2" +-} ++system "chmod -R +w $outdir" + + set timeout $oldtimeout + return 0 diff --git a/gdb-6.8-attach-signalled-detach-stopped.patch b/gdb-6.8-attach-signalled-detach-stopped.patch index 026e420..cfaacee 100644 --- a/gdb-6.8-attach-signalled-detach-stopped.patch +++ b/gdb-6.8-attach-signalled-detach-stopped.patch @@ -1,7 +1,8 @@ -diff -dup -rup gdb-7.10.50.20160106-orig/gdb/infrun.c gdb-7.10.50.20160106/gdb/infrun.c ---- gdb-7.10.50.20160106-orig/gdb/infrun.c 2016-01-09 15:05:06.127481758 +0100 -+++ gdb-7.10.50.20160106/gdb/infrun.c 2016-01-09 15:05:24.054593048 +0100 -@@ -626,6 +626,13 @@ holding the child stopped. Try \"set de +Index: gdb-7.11.50.20160716/gdb/infrun.c +=================================================================== +--- gdb-7.11.50.20160716.orig/gdb/infrun.c 2016-07-16 14:37:09.317178150 +0200 ++++ gdb-7.11.50.20160716/gdb/infrun.c 2016-07-16 14:37:10.636188765 +0200 +@@ -620,6 +620,13 @@ target_pid_to_str (process_ptid)); } @@ -15,10 +16,11 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/infrun.c gdb-7.10.50.20160106/gdb/i target_detach (NULL, 0); } -diff -dup -rup gdb-7.10.50.20160106-orig/gdb/linux-nat.c gdb-7.10.50.20160106/gdb/linux-nat.c ---- gdb-7.10.50.20160106-orig/gdb/linux-nat.c 2016-01-09 15:05:06.225482366 +0100 -+++ gdb-7.10.50.20160106/gdb/linux-nat.c 2016-01-09 15:05:24.050593023 +0100 -@@ -194,6 +194,11 @@ enum tribool have_ptrace_getregset = TRI +Index: gdb-7.11.50.20160716/gdb/linux-nat.c +=================================================================== +--- gdb-7.11.50.20160716.orig/gdb/linux-nat.c 2016-07-16 14:37:09.320178174 +0200 ++++ gdb-7.11.50.20160716/gdb/linux-nat.c 2016-07-16 14:38:09.574663094 +0200 +@@ -194,6 +194,11 @@ static struct target_ops *linux_ops; static struct target_ops linux_ops_saved; @@ -30,7 +32,7 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/linux-nat.c gdb-7.10.50.20160106/gd /* The method to call, if any, when a new thread is attached. */ static void (*linux_nat_new_thread) (struct lwp_info *); -@@ -961,6 +966,9 @@ linux_nat_post_attach_wait (ptid_t ptid, +@@ -1047,6 +1052,9 @@ if (debug_linux_nat) fprintf_unfiltered (gdb_stdlog, "LNPAW: Attaching to a stopped process\n"); @@ -40,8 +42,8 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/linux-nat.c gdb-7.10.50.20160106/gd /* The process is definitely stopped. It is in a job control stop, unless the kernel predates the TASK_STOPPED / -@@ -1303,6 +1311,25 @@ get_pending_status (struct lwp_info *lp, - gdb_signal_to_string (signo)); +@@ -1404,6 +1412,25 @@ + return gdb_signal_to_host (signo); } +#ifdef NEED_DETACH_SIGSTOP @@ -66,18 +68,18 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/linux-nat.c gdb-7.10.50.20160106/gd return 0; } -@@ -1416,6 +1443,10 @@ linux_nat_detach (struct target_ops *ops - } - else - linux_ops->to_detach (ops, args, from_tty); -+#ifdef NEED_DETACH_SIGSTOP -+ -+ pid_was_stopped = 0; -+#endif - } +@@ -1562,6 +1589,10 @@ + detach_one_lwp (main_lwp, &signo); - /* Resume execution of the inferior process. If STEP is nonzero, -@@ -1674,6 +1705,16 @@ linux_nat_resume (struct target_ops *ops + inf_ptrace_detach_success (ops); ++ ++#ifdef NEED_DETACH_SIGSTOP ++ pid_was_stopped = 0; ++#endif + } + delete_lwp (main_lwp->ptid); + } +@@ -1823,6 +1854,16 @@ return; } @@ -94,7 +96,7 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/linux-nat.c gdb-7.10.50.20160106/gd if (resume_many) iterate_over_lwps (ptid, linux_nat_resume_callback, lp); -@@ -3618,6 +3659,10 @@ linux_nat_mourn_inferior (struct target_ +@@ -3819,6 +3860,10 @@ /* Let the arch-specific native code know this process is gone. */ linux_nat_forget_process (pid); @@ -105,10 +107,11 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/linux-nat.c gdb-7.10.50.20160106/gd } /* Convert a native/host siginfo object, into/from the siginfo in the -diff -dup -rup gdb-7.10.50.20160106-orig/gdb/testsuite/gdb.threads/attach-stopped.exp gdb-7.10.50.20160106/gdb/testsuite/gdb.threads/attach-stopped.exp ---- gdb-7.10.50.20160106-orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2016-01-06 02:48:38.000000000 +0100 -+++ gdb-7.10.50.20160106/gdb/testsuite/gdb.threads/attach-stopped.exp 2016-01-09 15:05:48.917747101 +0100 -@@ -56,7 +56,65 @@ proc corefunc { threadtype } { +Index: gdb-7.11.50.20160716/gdb/testsuite/gdb.threads/attach-stopped.exp +=================================================================== +--- gdb-7.11.50.20160716.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2016-07-16 14:37:09.321178182 +0200 ++++ gdb-7.11.50.20160716/gdb/testsuite/gdb.threads/attach-stopped.exp 2016-07-16 14:37:10.640188797 +0200 +@@ -56,7 +56,65 @@ gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} diff --git a/gdb-6.8-quit-never-aborts.patch b/gdb-6.8-quit-never-aborts.patch index e9660fd..cd58019 100644 --- a/gdb-6.8-quit-never-aborts.patch +++ b/gdb-6.8-quit-never-aborts.patch @@ -5,38 +5,42 @@ Some of the threads may not be properly PTRACE_DETACHed which hurts if they should have been detached with SIGSTOP (as they are accidentally left running on the debugger termination). -diff -dup -rup gdb-7.10.50.20160106-orig/gdb/defs.h gdb-7.10.50.20160106/gdb/defs.h ---- gdb-7.10.50.20160106-orig/gdb/defs.h 2016-01-09 15:06:57.658172875 +0100 -+++ gdb-7.10.50.20160106/gdb/defs.h 2016-01-09 15:07:12.431264378 +0100 -@@ -145,6 +145,9 @@ extern void set_quit_flag (void); +Index: gdb-7.11.50.20160630/gdb/defs.h +=================================================================== +--- gdb-7.11.50.20160630.orig/gdb/defs.h 2016-07-03 16:40:43.423078926 +0200 ++++ gdb-7.11.50.20160630/gdb/defs.h 2016-07-03 16:41:08.568271741 +0200 +@@ -175,6 +175,10 @@ /* Flag that function quit should call quit_force. */ extern volatile int sync_quit_force_run; +#ifdef NEED_DETACH_SIGSTOP +extern int quit_flag_cleanup; +#endif - extern int immediate_quit; - ++ extern void quit (void); -diff -dup -rup gdb-7.10.50.20160106-orig/gdb/extension.c gdb-7.10.50.20160106/gdb/extension.c ---- gdb-7.10.50.20160106-orig/gdb/extension.c 2016-01-06 02:48:37.000000000 +0100 -+++ gdb-7.10.50.20160106/gdb/extension.c 2016-01-09 15:07:12.434264396 +0100 -@@ -833,6 +833,11 @@ check_quit_flag (void) + + /* Helper for the QUIT macro. */ +Index: gdb-7.11.50.20160630/gdb/extension.c +=================================================================== +--- gdb-7.11.50.20160630.orig/gdb/extension.c 2016-07-03 16:40:41.723065890 +0200 ++++ gdb-7.11.50.20160630/gdb/extension.c 2016-07-03 16:41:44.896550309 +0200 +@@ -830,6 +830,11 @@ int i, result = 0; const struct extension_language_defn *extlang; +#ifdef NEED_DETACH_SIGSTOP + if (quit_flag_cleanup) + return 0; -+ +#endif ++ ALL_ENABLED_EXTENSION_LANGUAGES (i, extlang) { if (extlang->ops->check_quit_flag != NULL) -diff -dup -rup gdb-7.10.50.20160106-orig/gdb/top.c gdb-7.10.50.20160106/gdb/top.c ---- gdb-7.10.50.20160106-orig/gdb/top.c 2016-01-06 02:48:38.000000000 +0100 -+++ gdb-7.10.50.20160106/gdb/top.c 2016-01-09 15:07:12.432264384 +0100 -@@ -1557,7 +1557,13 @@ quit_force (char *args, int from_tty) +Index: gdb-7.11.50.20160630/gdb/top.c +=================================================================== +--- gdb-7.11.50.20160630.orig/gdb/top.c 2016-07-03 16:40:41.724065898 +0200 ++++ gdb-7.11.50.20160630/gdb/top.c 2016-07-03 16:40:43.424078934 +0200 +@@ -1617,7 +1617,13 @@ qt.args = args; qt.from_tty = from_tty; @@ -50,20 +54,21 @@ diff -dup -rup gdb-7.10.50.20160106-orig/gdb/top.c gdb-7.10.50.20160106/gdb/top. /* Get out of tfind mode, and kill or detach all inferiors. */ TRY -diff -dup -rup gdb-7.10.50.20160106-orig/gdb/utils.c gdb-7.10.50.20160106/gdb/utils.c ---- gdb-7.10.50.20160106-orig/gdb/utils.c 2016-01-09 15:06:57.654172850 +0100 -+++ gdb-7.10.50.20160106/gdb/utils.c 2016-01-09 15:07:12.433264390 +0100 -@@ -122,6 +122,13 @@ int job_control; +Index: gdb-7.11.50.20160630/gdb/utils.c +=================================================================== +--- gdb-7.11.50.20160630.orig/gdb/utils.c 2016-07-03 16:40:41.725065905 +0200 ++++ gdb-7.11.50.20160630/gdb/utils.c 2016-07-03 16:41:38.961504799 +0200 +@@ -109,6 +109,13 @@ - int immediate_quit; + int job_control; +#ifdef NEED_DETACH_SIGSTOP +/* Nonzero means we are already processing the quitting cleanups and we should + no longer get aborted. */ + +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 international character, and the terminal or window can cope.) */ diff --git a/gdb-7.11.1.tar.bz2 b/gdb-7.11.1.tar.bz2 deleted file mode 100644 index 6c70add..0000000 --- a/gdb-7.11.1.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:52497db17119a21d59bc62ac5f1138b8061990f97fee6138c4e8b4d7104e67e0 -size 27307242 diff --git a/gdb-7.12.1.tar.bz2 b/gdb-7.12.1.tar.bz2 new file mode 100644 index 0000000..113493f --- /dev/null +++ b/gdb-7.12.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc284fa344bd7d3440da19fd8660b4e9e524dea32abea0bddbf4e2225845140e +size 27786483 diff --git a/gdb-aarch64-v81-hwbreakpoints.diff b/gdb-aarch64-v81-hwbreakpoints.diff deleted file mode 100644 index f4d8c85..0000000 --- a/gdb-aarch64-v81-hwbreakpoints.diff +++ /dev/null @@ -1,65 +0,0 @@ -From: Andrew Pinski -Date: Sat, 23 Jul 2016 16:56:44 +0000 (-0700) -Subject: Fix ARMv8.1/v8.2 for hw watchpoint and breakpoint -X-Git-Url: https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=49ecef2a7da2ee9df4ae675f99b70518fbf1bb23 - -Fix ARMv8.1/v8.2 for hw watchpoint and breakpoint - -The problem here is ARMv8.1 (and ARMv8.2) define a -different debug version than ARMv8 (7 and 8 respectively). -This fixes hw watchpoints and breakpoints by checking -for those debug versions too. - -Committed as obvious after a test on aarch64-linux-gnu -(on a ThunderX machine which has ARMv8.1 support enabled). - -ChangeLog: - * nat/aarch64-linux-hw-point.c - (aarch64_linux_get_debug_reg_capacity): Handle - ARMv8.1 and ARMv8.2 debug versions. - * nat/aarch64-linux-hw-point.h - (AARCH64_DEBUG_ARCH_V8_1): New define. - (AARCH64_DEBUG_ARCH_V8_2): New define. - -Signed-off-by: Andrew Pinski ---- - -diff --git a/gdb/nat/aarch64-linux-hw-point.c b/gdb/nat/aarch64-linux-hw-point.c -index a06a6e6..f9e04d9 100644 ---- a/gdb/nat/aarch64-linux-hw-point.c -+++ b/gdb/nat/aarch64-linux-hw-point.c -@@ -630,7 +630,9 @@ aarch64_linux_get_debug_reg_capacity (int tid) - - /* Get hardware watchpoint register info. */ - if (ptrace (PTRACE_GETREGSET, tid, NT_ARM_HW_WATCH, &iov) == 0 -- && AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8) -+ && (AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8 -+ || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_1 -+ || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_2)) - { - aarch64_num_wp_regs = AARCH64_DEBUG_NUM_SLOTS (dreg_state.dbg_info); - if (aarch64_num_wp_regs > AARCH64_HWP_MAX_NUM) -@@ -650,7 +652,9 @@ aarch64_linux_get_debug_reg_capacity (int tid) - - /* Get hardware breakpoint register info. */ - if (ptrace (PTRACE_GETREGSET, tid, NT_ARM_HW_BREAK, &iov) == 0 -- && AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8) -+ && (AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8 -+ || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_1 -+ || AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8_2)) - { - aarch64_num_bp_regs = AARCH64_DEBUG_NUM_SLOTS (dreg_state.dbg_info); - if (aarch64_num_bp_regs > AARCH64_HBP_MAX_NUM) -diff --git a/gdb/nat/aarch64-linux-hw-point.h b/gdb/nat/aarch64-linux-hw-point.h -index acf0a49..16efb7c 100644 ---- a/gdb/nat/aarch64-linux-hw-point.h -+++ b/gdb/nat/aarch64-linux-hw-point.h -@@ -68,6 +68,8 @@ - - /* Macro for the expected version of the ARMv8-A debug architecture. */ - #define AARCH64_DEBUG_ARCH_V8 0x6 -+#define AARCH64_DEBUG_ARCH_V8_1 0x7 -+#define AARCH64_DEBUG_ARCH_V8_2 0x8 - - /* ptrace expects control registers to be formatted as follows: - diff --git a/gdb-add-index-chmod.patch b/gdb-add-index-chmod.patch new file mode 100644 index 0000000..75cd4c9 --- /dev/null +++ b/gdb-add-index-chmod.patch @@ -0,0 +1,69 @@ +http://sourceware.org/ml/gdb-patches/2017-01/msg00110.html +Subject: [patch] contrib/gdb-add-index.sh: chmod u+w + + +--AhhlLboLdkugWU4S +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline + +Hi, + +in Fedora 24 it still worked, in Fedora 25 it does not - *-debuginfo.rpm +no longer have the .gdb_index accelerating section now. + +It happens because: +objcopy: unable to copy file 'foo.debug'; reason: Permission denied + +*.debug files in Fedora were always 444 but the time gdb-add-index is run is +still before the *.debug split and in Fedora 24 the files were -rwxr-xr-x +that time while in Fedora 25 they are apparently no longer w. + +OK for check-in? + + +Jan + +--AhhlLboLdkugWU4S +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline; filename=1 + +gdb/ChangeLog +2017-01-06 Jan Kratochvil + + * contrib/gdb-add-index.sh: Use chmod u+w for $file. + +diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh +index 0cd4ce3..5a190a0 100755 +--- a/gdb/contrib/gdb-add-index.sh ++++ b/gdb/contrib/gdb-add-index.sh +@@ -38,10 +38,11 @@ fi + dir="${file%/*}" + test "$dir" = "$file" && dir="." + index="${file}.gdb-index" ++mode="${file}.mode" + +-rm -f $index ++rm -f $index $mode + # Ensure intermediate index file is removed when we exit. +-trap "rm -f $index" 0 ++trap "rm -f $index $mode" 0 + + $GDB --batch -nx -iex 'set auto-load no' \ + -ex "file $file" -ex "save gdb-index $dir" || { +@@ -58,8 +59,13 @@ $GDB --batch -nx -iex 'set auto-load no' \ + status=0 + + if test -f "$index"; then ++ touch "$mode" ++ chmod --reference="$file" "$mode" ++ # objcopy: unable to copy file 'foo.debug'; reason: Permission denied ++ chmod u+w "$file" + $OBJCOPY --add-section .gdb_index="$index" \ + --set-section-flags .gdb_index=readonly "$file" "$file" ++ chmod --reference="$mode" "$file" + status=$? + else + echo "$myname: No index was created for $file" 1>&2 + +--AhhlLboLdkugWU4S-- + diff --git a/gdb-archer-pie-addons-keep-disabled.patch b/gdb-archer-pie-addons-keep-disabled.patch index ad398c3..b453164 100644 --- a/gdb-archer-pie-addons-keep-disabled.patch +++ b/gdb-archer-pie-addons-keep-disabled.patch @@ -1,8 +1,8 @@ -Index: gdb-7.10.50.20160121/gdb/breakpoint.c +Index: gdb-7.11.90.20160829/gdb/breakpoint.c =================================================================== ---- gdb-7.10.50.20160121.orig/gdb/breakpoint.c 2016-01-21 21:52:34.243387043 +0100 -+++ gdb-7.10.50.20160121/gdb/breakpoint.c 2016-01-21 21:53:00.365542925 +0100 -@@ -16139,6 +16139,50 @@ +--- gdb-7.11.90.20160829.orig/gdb/breakpoint.c 2016-08-29 09:41:57.054875810 +0200 ++++ gdb-7.11.90.20160829/gdb/breakpoint.c 2016-08-29 09:45:04.166612376 +0200 +@@ -16176,6 +16176,50 @@ static struct cmd_list_element *enablebreaklist = NULL; void @@ -34,7 +34,7 @@ Index: gdb-7.10.50.20160121/gdb/breakpoint.c + && relocated_address < obj_section_endaddr (osect)) + { + if (bl->inserted) -+ remove_breakpoint (bl, mark_uninserted); ++ remove_breakpoint (bl); + + bl->address += delta_offset; + bl->requested_address += delta_offset; @@ -53,11 +53,11 @@ Index: gdb-7.10.50.20160121/gdb/breakpoint.c _initialize_breakpoint (void) { struct cmd_list_element *c; -Index: gdb-7.10.50.20160121/gdb/breakpoint.h +Index: gdb-7.11.90.20160829/gdb/breakpoint.h =================================================================== ---- gdb-7.10.50.20160121.orig/gdb/breakpoint.h 2016-01-21 21:52:34.244387049 +0100 -+++ gdb-7.10.50.20160121/gdb/breakpoint.h 2016-01-21 21:53:00.366542931 +0100 -@@ -1629,4 +1629,7 @@ +--- gdb-7.11.90.20160829.orig/gdb/breakpoint.h 2016-08-29 09:41:57.054875810 +0200 ++++ gdb-7.11.90.20160829/gdb/breakpoint.h 2016-08-29 09:42:24.370129320 +0200 +@@ -1644,4 +1644,7 @@ UIOUT iff debugging multiple threads. */ extern void maybe_print_thread_hit_breakpoint (struct ui_out *uiout); @@ -65,10 +65,10 @@ Index: gdb-7.10.50.20160121/gdb/breakpoint.h + struct section_offsets *delta); + #endif /* !defined (BREAKPOINT_H) */ -Index: gdb-7.10.50.20160121/gdb/objfiles.c +Index: gdb-7.11.90.20160829/gdb/objfiles.c =================================================================== ---- gdb-7.10.50.20160121.orig/gdb/objfiles.c 2016-01-21 21:52:34.245387055 +0100 -+++ gdb-7.10.50.20160121/gdb/objfiles.c 2016-01-21 21:53:00.367542937 +0100 +--- gdb-7.11.90.20160829.orig/gdb/objfiles.c 2016-08-29 09:41:57.054875810 +0200 ++++ gdb-7.11.90.20160829/gdb/objfiles.c 2016-08-29 09:42:24.370129320 +0200 @@ -916,6 +916,11 @@ obj_section_addr (s)); } diff --git a/gdb-archer-vla-tests.patch b/gdb-archer-vla-tests.patch index 05e4288..9aa5c1e 100644 --- a/gdb-archer-vla-tests.patch +++ b/gdb-archer-vla-tests.patch @@ -1,7 +1,7 @@ -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.ada/packed_array.exp +Index: gdb-7.12/gdb/testsuite/gdb.ada/packed_array.exp =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/testsuite/gdb.ada/packed_array.exp 2016-02-15 23:33:29.830959972 +0100 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.ada/packed_array.exp 2016-02-15 23:35:56.289999846 +0100 +--- gdb-7.12.orig/gdb/testsuite/gdb.ada/packed_array.exp 2016-08-01 17:50:21.000000000 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.ada/packed_array.exp 2016-10-22 09:45:15.849013467 +0200 @@ -56,5 +56,11 @@ # are. Observed with (FSF GNU Ada 4.5.3 20110124). xfail $test @@ -14,10 +14,493 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.ada/packed_array.exp + } } -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S +Index: gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S 2016-02-15 23:35:56.290999853 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S 2016-10-22 09:50:38.510393903 +0200 +@@ -0,0 +1,358 @@ ++ .file "x86_64-vla-pointer.c" ++ .text ++.Ltext0: ++ .globl foo ++ .type foo, @function ++foo: ++.LFB0: ++ .file 1 "gdb.arch/x86_64-vla-pointer.c" ++ # gdb.arch/x86_64-vla-pointer.c:22 ++ .loc 1 22 0 ++ .cfi_startproc ++# BLOCK 2 seq:0 ++# PRED: ENTRY (FALLTHRU) ++ pushq %rbp ++ .cfi_def_cfa_offset 16 ++ .cfi_offset 6, -16 ++ movq %rsp, %rbp ++ .cfi_def_cfa_register 6 ++ pushq %rbx ++ subq $56, %rsp ++ .cfi_offset 3, -24 ++ movl %edi, -52(%rbp) ++ # gdb.arch/x86_64-vla-pointer.c:22 ++ .loc 1 22 0 ++ movq %rsp, %rax ++ movq %rax, %rsi ++ # gdb.arch/x86_64-vla-pointer.c:23 ++ .loc 1 23 0 ++ movl -52(%rbp), %eax ++ movslq %eax, %rdx ++ subq $1, %rdx ++ movq %rdx, -32(%rbp) ++ movslq %eax, %rdx ++ movq %rdx, %r8 ++ movl $0, %r9d ++ # gdb.arch/x86_64-vla-pointer.c:24 ++ .loc 1 24 0 ++ movslq %eax, %rdx ++ movq %rdx, %rcx ++ movl $0, %ebx ++ cltq ++ movl $16, %edx ++ subq $1, %rdx ++ addq %rdx, %rax ++ movl $16, %ebx ++ movl $0, %edx ++ divq %rbx ++ imulq $16, %rax, %rax ++ subq %rax, %rsp ++ movq %rsp, %rax ++ addq $0, %rax ++ movq %rax, -40(%rbp) ++ # gdb.arch/x86_64-vla-pointer.c:27 ++ .loc 1 27 0 ++ movl $0, -20(%rbp) ++# SUCC: 4 [100.0%] ++ jmp .L2 ++# BLOCK 3 seq:1 ++# PRED: 4 ++.L3: ++ # gdb.arch/x86_64-vla-pointer.c:28 ++ .loc 1 28 0 discriminator 3 ++ movl -20(%rbp), %eax ++ movl %eax, %ecx ++ movq -40(%rbp), %rdx ++ movl -20(%rbp), %eax ++ cltq ++ movb %cl, (%rdx,%rax) ++# SUCC: 4 (FALLTHRU,DFS_BACK) ++ # gdb.arch/x86_64-vla-pointer.c:27 ++ .loc 1 27 0 discriminator 3 ++ addl $1, -20(%rbp) ++# BLOCK 4 seq:2 ++# PRED: 3 (FALLTHRU,DFS_BACK) 2 [100.0%] ++.L2: ++ # gdb.arch/x86_64-vla-pointer.c:27 ++ .loc 1 27 0 is_stmt 0 discriminator 1 ++ movl -20(%rbp), %eax ++ cmpl -52(%rbp), %eax ++# SUCC: 3 5 (FALLTHRU) ++ jl .L3 ++# BLOCK 5 seq:3 ++# PRED: 4 (FALLTHRU) ++ # gdb.arch/x86_64-vla-pointer.c:30 ++ .loc 1 30 0 is_stmt 1 ++ movq -40(%rbp), %rax ++ movb $0, (%rax) ++ movq %rsi, %rsp ++ # gdb.arch/x86_64-vla-pointer.c:31 ++ .loc 1 31 0 ++ nop ++ movq -8(%rbp), %rbx ++ leave ++ .cfi_def_cfa 7, 8 ++# SUCC: EXIT [100.0%] ++ ret ++ .cfi_endproc ++.LFE0: ++ .size foo, .-foo ++.Letext0: ++ .section .debug_info,"",@progbits ++.Ldebug_info0: ++ .long 0xa5 # Length of Compilation Unit Info ++ .value 0x4 # DWARF version number ++ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section ++ .byte 0x8 # Pointer Size (in bytes) ++ .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit) ++ .long .LASF3 # DW_AT_producer: "GNU C11 6.2.1 20160916 (Red Hat 6.2.1-2) -mtune=generic -march=x86-64 -g" ++ .byte 0xc # DW_AT_language ++ .long .LASF4 # DW_AT_name: "gdb.arch/x86_64-vla-pointer.c" ++ .long .LASF5 # DW_AT_comp_dir: "/home/jkratoch/redhat/fedora/gdb/master/gdb-7.12/gdb/testsuite" ++ .quad .Ltext0 # DW_AT_low_pc ++ .quad .Letext0-.Ltext0 # DW_AT_high_pc ++ .long .Ldebug_line0 # DW_AT_stmt_list ++ .uleb128 0x2 # (DIE (0x2d) DW_TAG_subprogram) ++ # DW_AT_external ++ .ascii "foo\0" # DW_AT_name ++ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c) ++ .byte 0x15 # DW_AT_decl_line ++ # DW_AT_prototyped ++ .quad .LFB0 # DW_AT_low_pc ++ .quad .LFE0-.LFB0 # DW_AT_high_pc ++ .uleb128 0x1 # DW_AT_frame_base ++ .byte 0x9c # DW_OP_call_frame_cfa ++ # DW_AT_GNU_all_call_sites ++ .long 0x80 # DW_AT_sibling ++ .uleb128 0x3 # (DIE (0x4a) DW_TAG_formal_parameter) ++ .long .LASF6 # DW_AT_name: "size" ++ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c) ++ .byte 0x15 # DW_AT_decl_line ++ .long 0x80 # DW_AT_type ++ .uleb128 0x3 # DW_AT_location ++ .byte 0x91 # DW_OP_fbreg ++ .sleb128 -68 ++ .uleb128 0x4 # (DIE (0x59) DW_TAG_typedef) ++ .long .LASF7 # DW_AT_name: "array_t" ++ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c) ++ .byte 0x17 # DW_AT_decl_line ++ .long 0x87 # DW_AT_type ++ .uleb128 0x5 # (DIE (0x64) DW_TAG_variable) ++ .long .LASF0 # DW_AT_name: "array" ++ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c) ++ .byte 0x18 # DW_AT_decl_line ++ .long 0x59 # DW_AT_type ++ .uleb128 0x3 # DW_AT_location ++ .byte 0x91 # DW_OP_fbreg ++ .sleb128 -56 ++ .byte 0x6 # DW_OP_deref ++ .uleb128 0x6 # (DIE (0x73) DW_TAG_variable) ++ .ascii "i\0" # DW_AT_name ++ .byte 0x1 # DW_AT_decl_file (gdb.arch/x86_64-vla-pointer.c) ++ .byte 0x19 # DW_AT_decl_line ++ .long 0x80 # DW_AT_type ++ .uleb128 0x2 # DW_AT_location ++ .byte 0x91 # DW_OP_fbreg ++ .sleb128 -36 ++ .byte 0 # end of children of DIE 0x2d ++ .uleb128 0x7 # (DIE (0x80) DW_TAG_base_type) ++ .byte 0x4 # DW_AT_byte_size ++ .byte 0x5 # DW_AT_encoding ++ .ascii "int\0" # DW_AT_name ++ .uleb128 0x8 # (DIE (0x87) DW_TAG_array_type) ++ .long 0xa1 # DW_AT_type ++ .long 0x9a # DW_AT_sibling ++ .uleb128 0x9 # (DIE (0x90) DW_TAG_subrange_type) ++ .long 0x9a # DW_AT_type ++ .uleb128 0x3 # DW_AT_upper_bound ++ .byte 0x91 # DW_OP_fbreg ++ .sleb128 -48 ++ .byte 0x6 # DW_OP_deref ++ .byte 0 # end of children of DIE 0x87 ++ .uleb128 0xa # (DIE (0x9a) DW_TAG_base_type) ++ .byte 0x8 # DW_AT_byte_size ++ .byte 0x7 # DW_AT_encoding ++ .long .LASF1 # DW_AT_name: "sizetype" ++ .uleb128 0xa # (DIE (0xa1) DW_TAG_base_type) ++ .byte 0x1 # DW_AT_byte_size ++ .byte 0x6 # DW_AT_encoding ++ .long .LASF2 # DW_AT_name: "char" ++ .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 0x11 # (DW_AT_low_pc) ++ .uleb128 0x1 # (DW_FORM_addr) ++ .uleb128 0x12 # (DW_AT_high_pc) ++ .uleb128 0x7 # (DW_FORM_data8) ++ .uleb128 0x10 # (DW_AT_stmt_list) ++ .uleb128 0x17 # (DW_FORM_sec_offset) ++ .byte 0 ++ .byte 0 ++ .uleb128 0x2 # (abbrev code) ++ .uleb128 0x2e # (TAG: DW_TAG_subprogram) ++ .byte 0x1 # DW_children_yes ++ .uleb128 0x3f # (DW_AT_external) ++ .uleb128 0x19 # (DW_FORM_flag_present) ++ .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 0x27 # (DW_AT_prototyped) ++ .uleb128 0x19 # (DW_FORM_flag_present) ++ .uleb128 0x11 # (DW_AT_low_pc) ++ .uleb128 0x1 # (DW_FORM_addr) ++ .uleb128 0x12 # (DW_AT_high_pc) ++ .uleb128 0x7 # (DW_FORM_data8) ++ .uleb128 0x40 # (DW_AT_frame_base) ++ .uleb128 0x18 # (DW_FORM_exprloc) ++ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites) ++ .uleb128 0x19 # (DW_FORM_flag_present) ++ .uleb128 0x1 # (DW_AT_sibling) ++ .uleb128 0x13 # (DW_FORM_ref4) ++ .byte 0 ++ .byte 0 ++ .uleb128 0x3 # (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 0x18 # (DW_FORM_exprloc) ++ .byte 0 ++ .byte 0 ++ .uleb128 0x4 # (abbrev code) ++ .uleb128 0x16 # (TAG: DW_TAG_typedef) ++ .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) ++ .byte 0 ++ .byte 0 ++ .uleb128 0x5 # (abbrev code) ++ .uleb128 0x34 # (TAG: DW_TAG_variable) ++ .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 0x18 # (DW_FORM_exprloc) ++ .byte 0 ++ .byte 0 ++ .uleb128 0x6 # (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 0x18 # (DW_FORM_exprloc) ++ .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 0x8 # (DW_FORM_string) ++ .byte 0 ++ .byte 0 ++ .uleb128 0x8 # (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 0x9 # (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 0x18 # (DW_FORM_exprloc) ++ .byte 0 ++ .byte 0 ++ .uleb128 0xa # (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 ++ .byte 0 ++ .section .debug_aranges,"",@progbits ++ .long 0x2c # Length of Address Ranges Info ++ .value 0x2 # DWARF Version ++ .long .Ldebug_info0 # Offset of Compilation Unit Info ++ .byte 0x8 # Size of Address ++ .byte 0 # Size of Segment Descriptor ++ .value 0 # Pad to 16 byte boundary ++ .value 0 ++ .quad .Ltext0 # Address ++ .quad .Letext0-.Ltext0 # Length ++ .quad 0 ++ .quad 0 ++ .section .debug_line,"",@progbits ++.Ldebug_line0: ++ .section .debug_str,"MS",@progbits,1 ++.LASF4: ++ .string "gdb.arch/x86_64-vla-pointer.c" ++.LASF7: ++ .string "array_t" ++.LASF3: ++ .string "GNU C11 6.2.1 20160916 (Red Hat 6.2.1-2) -mtune=generic -march=x86-64 -g" ++.LASF2: ++ .string "char" ++.LASF1: ++ .string "sizetype" ++.LASF5: ++ .string "/home/jkratoch/redhat/fedora/gdb/master/gdb-7.12/gdb/testsuite" ++.LASF6: ++ .string "size" ++.LASF0: ++ .string "array" ++ .ident "GCC: (GNU) 6.2.1 20160916 (Red Hat 6.2.1-2)" ++ .section .note.GNU-stack,"",@progbits +Index: gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c 2016-10-22 09:50:40.335407367 +0200 +@@ -0,0 +1,45 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2009 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++#if 0 ++ ++void ++foo (int size) ++{ ++ typedef char array_t[size]; ++ array_t array; ++ int i; ++ ++ for (i = 0; i < size; i++) ++ array[i] = i; ++ ++ array[0] = 0; /* break-here */ ++} ++ ++#else ++ ++void foo (int size); ++ ++int ++main (void) ++{ ++ foo (26); ++ foo (78); ++ return 0; ++} ++ ++#endif +Index: gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp 2016-10-22 21:10:56.210413346 +0200 +@@ -0,0 +1,65 @@ ++# Copyright 2009 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++if ![istarget "x86_64-*-*"] then { ++ verbose "Skipping over gdb.arch/x86_64-vla-pointer.exp test made only for x86_64." ++ return ++} ++ ++set testfile x86_64-vla-pointer ++set srcasmfile ${testfile}-foo.S ++set srcfile ${testfile}.c ++set binfile [standard_output_file ${testfile}] ++set binobjfile [standard_output_file ${testfile}-foo.o] ++if { [gdb_compile "${srcdir}/${subdir}/${srcasmfile}" "${binobjfile}" object {}] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${binobjfile}" "${binfile}" executable {}] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++if ![runto_main] { ++ untested x86_64-vla-pointer ++ return -1 ++} ++ ++gdb_breakpoint $srcfile:[gdb_get_line_number "break-here"] ++ ++gdb_continue_to_breakpoint "break-here" ++ ++gdb_test "whatis array" "type = array_t" "first: whatis array" ++gdb_test "whatis array_t" "type = char \\\[variable length\\\]" "first: whatis array_t" ++gdb_test "ptype array" "type = char \\\[26\\\]" "first: ptype array" ++ ++gdb_test "whatis *array" "type = char" "first: whatis *array" ++gdb_test "ptype *array" "type = char" "first: ptype *array" ++ ++gdb_test "p array\[1\]" "\\$\[0-9\] = 1 '\\\\001'" ++gdb_test "p array\[2\]" "\\$\[0-9\] = 2 '\\\\002'" ++gdb_test "p array\[3\]" "\\$\[0-9\] = 3 '\\\\003'" ++gdb_test "p array\[4\]" "\\$\[0-9\] = 4 '\\\\004'" ++ ++gdb_continue_to_breakpoint "break_here" ++ ++gdb_test "whatis array" "type = array_t" "second: whatis array" ++gdb_test "whatis array_t" "type = char \\\[variable length\\\]" "second: whatis array_t" ++gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array" +Index: gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S 2016-10-22 09:45:15.851013482 +0200 @@ -0,0 +1,455 @@ + .file "x86_64-vla-typedef.c" + .section .debug_abbrev,"",@progbits @@ -474,10 +957,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S + .string "GNU C 4.3.2 20081105 (Red Hat 4.3.2-7)" + .ident "GCC: (GNU) 4.3.2 20081105 (Red Hat 4.3.2-7)" + .section .note.GNU-stack,"",@progbits -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c +Index: gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c 2016-02-15 23:35:56.290999853 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c 2016-10-22 09:45:15.851013482 +0200 @@ -0,0 +1,45 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -524,10 +1007,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c +} + +#endif -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp +Index: gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp 2016-02-15 23:35:56.290999853 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp 2016-10-22 09:45:15.851013482 +0200 @@ -0,0 +1,64 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -593,10 +1076,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp +gdb_test "whatis array" "type = array_t" "second: whatis array" + +gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array" -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/arrayidx.c +Index: gdb-7.12/gdb/testsuite/gdb.base/arrayidx.c =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/testsuite/gdb.base/arrayidx.c 2016-02-15 23:33:29.830959972 +0100 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/arrayidx.c 2016-02-15 23:35:56.290999853 +0100 +--- gdb-7.12.orig/gdb/testsuite/gdb.base/arrayidx.c 2016-08-01 17:50:21.000000000 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.base/arrayidx.c 2016-10-22 09:45:15.851013482 +0200 @@ -17,6 +17,13 @@ int array[] = {1, 2, 3, 4}; @@ -611,10 +1094,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/arrayidx.c int main (void) { -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/arrayidx.exp +Index: gdb-7.12/gdb/testsuite/gdb.base/arrayidx.exp =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/testsuite/gdb.base/arrayidx.exp 2016-02-15 23:33:29.830959972 +0100 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/arrayidx.exp 2016-02-15 23:35:56.291999860 +0100 +--- gdb-7.12.orig/gdb/testsuite/gdb.base/arrayidx.exp 2016-08-01 17:50:21.000000000 +0200 ++++ gdb-7.12/gdb/testsuite/gdb.base/arrayidx.exp 2016-10-22 09:45:15.851013482 +0200 @@ -49,4 +49,12 @@ "\\{\\\[0\\\] = 1, \\\[1\\\] = 2, \\\[2\\\] = 3, \\\[3\\\] = 4\\}" \ "Print array with array-indexes on" @@ -629,10 +1112,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/arrayidx.exp + unsupported "$test (no GCC)" + } +} -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/internal-var-field-address.c +Index: gdb-7.12/gdb/testsuite/gdb.base/internal-var-field-address.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/internal-var-field-address.c 2016-02-15 23:35:56.291999860 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.base/internal-var-field-address.c 2016-10-22 09:45:15.852013490 +0200 @@ -0,0 +1,20 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -654,10 +1137,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/internal-var-field-address.c +struct { + int field; +} staticstruct = { 1 }; -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/internal-var-field-address.exp +Index: gdb-7.12/gdb/testsuite/gdb.base/internal-var-field-address.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/internal-var-field-address.exp 2016-02-15 23:35:56.291999860 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.base/internal-var-field-address.exp 2016-10-22 09:45:15.852013490 +0200 @@ -0,0 +1,26 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -685,10 +1168,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/internal-var-field-address.ex + +gdb_test {set $varstruct = staticstruct} +gdb_test {p $varstruct.field} " = 1" -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-frame.c +Index: gdb-7.12/gdb/testsuite/gdb.base/vla-frame.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-frame.c 2016-02-15 23:35:56.291999860 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.base/vla-frame.c 2016-10-22 09:45:15.852013490 +0200 @@ -0,0 +1,31 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -721,10 +1204,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-frame.c + f (s); + return 0; +} -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-frame.exp +Index: gdb-7.12/gdb/testsuite/gdb.base/vla-frame.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-frame.exp 2016-02-15 23:35:56.291999860 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.base/vla-frame.exp 2016-10-22 09:45:15.852013490 +0200 @@ -0,0 +1,38 @@ +# Copyright 2011 Free Software Foundation, Inc. +# @@ -764,10 +1247,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-frame.exp +} + +gdb_test "bt full" "\r\n +s = \"X\\\\000\"\r\n.*" -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-overflow.c +Index: gdb-7.12/gdb/testsuite/gdb.base/vla-overflow.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-overflow.c 2016-02-15 23:35:56.291999860 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.base/vla-overflow.c 2016-10-22 09:45:15.852013490 +0200 @@ -0,0 +1,30 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -799,10 +1282,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-overflow.c + + return 0; +} -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-overflow.exp +Index: gdb-7.12/gdb/testsuite/gdb.base/vla-overflow.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-overflow.exp 2016-02-15 23:35:56.292999867 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.base/vla-overflow.exp 2016-10-22 09:45:15.852013490 +0200 @@ -0,0 +1,109 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -913,10 +1396,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-overflow.exp +gdb_test "bt" "in \[^ \]*abort \\(.* in main \\(.*" "Backtrace after abort()" + +verbose -log "kb_found in bt after abort() = [expr [memory_v_pages_get] * $pagesize / 1024]" -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla.c +Index: gdb-7.12/gdb/testsuite/gdb.base/vla.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla.c 2016-02-15 23:35:56.292999867 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.base/vla.c 2016-10-22 09:45:15.852013490 +0200 @@ -0,0 +1,55 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -973,10 +1456,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla.c + foo (78); + return 0; +} -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla.exp +Index: gdb-7.12/gdb/testsuite/gdb.base/vla.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla.exp 2016-02-15 23:35:56.292999867 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.base/vla.exp 2016-10-22 09:45:15.853013497 +0200 @@ -0,0 +1,62 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -1040,10 +1523,382 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla.exp +gdb_test "p temp1" " = '1' " "second: print temp1" +gdb_test "p temp2" " = '2' " "second: print temp2" +gdb_test "p temp3" " = '3' " "second: print temp3" -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S +Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb9593.cc =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S 2016-02-15 23:35:56.292999867 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.cp/gdb9593.cc 2016-10-22 09:45:15.853013497 +0200 +@@ -0,0 +1,180 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2008, 2009 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++ */ ++#include ++ ++using namespace std; ++ ++class NextOverThrowDerivates ++{ ++ ++public: ++ ++ ++ // Single throw an exception in this function. ++ void function1() ++ { ++ throw 20; ++ } ++ ++ // Throw an exception in another function. ++ void function2() ++ { ++ function1(); ++ } ++ ++ // Throw an exception in another function, but handle it ++ // locally. ++ void function3 () ++ { ++ { ++ try ++ { ++ function1 (); ++ } ++ catch (...) ++ { ++ cout << "Caught and handled function1 exception" << endl; ++ } ++ } ++ } ++ ++ void rethrow () ++ { ++ try ++ { ++ function1 (); ++ } ++ catch (...) ++ { ++ throw; ++ } ++ } ++ ++ void finish () ++ { ++ // We use this to test that a "finish" here does not end up in ++ // this frame, but in the one above. ++ try ++ { ++ function1 (); ++ } ++ catch (int x) ++ { ++ } ++ function1 (); // marker for until ++ } ++ ++ void until () ++ { ++ function1 (); ++ function1 (); // until here ++ } ++ ++}; ++NextOverThrowDerivates next_cases; ++ ++ ++int main () ++{ ++ try ++ { ++ next_cases.function1 (); ++ } ++ catch (...) ++ { ++ // Discard ++ } ++ ++ try ++ { ++ next_cases.function2 (); ++ } ++ catch (...) ++ { ++ // Discard ++ } ++ ++ try ++ { ++ // This is duplicated so we can next over one but step into ++ // another. ++ next_cases.function2 (); ++ } ++ catch (...) ++ { ++ // Discard ++ } ++ ++ next_cases.function3 (); ++ ++ try ++ { ++ next_cases.rethrow (); ++ } ++ catch (...) ++ { ++ // Discard ++ } ++ ++ try ++ { ++ // Another duplicate so we can test "finish". ++ next_cases.function2 (); ++ } ++ catch (...) ++ { ++ // Discard ++ } ++ ++ // Another test for "finish". ++ try ++ { ++ next_cases.finish (); ++ } ++ catch (...) ++ { ++ } ++ ++ // Test of "until". ++ try ++ { ++ next_cases.finish (); ++ } ++ catch (...) ++ { ++ } ++ ++ // Test of "until" with an argument. ++ try ++ { ++ next_cases.until (); ++ } ++ catch (...) ++ { ++ } ++ ++ // Test of "advance". ++ try ++ { ++ next_cases.until (); ++ } ++ catch (...) ++ { ++ } ++} ++ +Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb9593.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.cp/gdb9593.exp 2016-10-22 09:45:15.853013497 +0200 +@@ -0,0 +1,182 @@ ++# Copyright 2008, 2009 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++ ++if $tracelevel then { ++ strace $tracelevel ++} ++ ++if { [skip_cplus_tests] } { continue } ++ ++set testfile "gdb9593" ++set srcfile ${testfile}.cc ++set binfile [standard_output_file $testfile] ++ ++# Create and source the file that provides information about the compiler ++# used to compile the test case. ++if [get_compiler_info "c++"] { ++ untested gdb9593.exp ++ return -1 ++} ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { ++ untested gdb9593.exp ++ return -1 ++} ++ ++# Some targets can't do function calls, so don't even bother with this ++# test. ++if [target_info exists gdb,cannot_call_functions] { ++ setup_xfail "*-*-*" 9593 ++ fail "This target can not call functions" ++ continue ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++if ![runto_main] then { ++ perror "couldn't run to main" ++ continue ++} ++ ++# See whether we have the needed unwinder hooks. ++set ok 1 ++gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook" { ++ -re "= .*_Unwind_DebugHook.*\r\n$gdb_prompt $" { ++ pass "check for unwinder hook" ++ } ++ -re "No symbol .* in current context.\r\n$gdb_prompt $" { ++ # Pass the test so we don't get bogus fails in the results. ++ pass "check for unwinder hook" ++ set ok 0 ++ } ++} ++if {!$ok} { ++ untested gdb9593.exp ++ return -1 ++} ++ ++# See http://sourceware.org/bugzilla/show_bug.cgi?id=9593 ++ ++gdb_test "next" \ ++ ".*catch (...).*" \ ++ "next over a throw 1" ++ ++gdb_test "next" \ ++ ".*next_cases.function2.*" \ ++ "next past catch 1" ++ ++gdb_test "next" \ ++ ".*catch (...).*" \ ++ "next over a throw 2" ++ ++gdb_test "next" \ ++ ".*next_cases.function2.*" \ ++ "next past catch 2" ++ ++gdb_test "step" \ ++ ".*function1().*" \ ++ "step into function2 1" ++ ++gdb_test "next" \ ++ ".*catch (...).*" \ ++ "next over a throw 3" ++ ++gdb_test "next" \ ++ ".*next_cases.function3.*" \ ++ "next past catch 3" ++ ++gdb_test "next" \ ++ ".*next_cases.rethrow.*" \ ++ "next over a throw 4" ++ ++gdb_test "next" \ ++ ".*catch (...).*" \ ++ "next over a rethrow" ++ ++gdb_test "next" \ ++ ".*next_cases.function2.*" \ ++ "next after a rethrow" ++ ++gdb_test "step" \ ++ ".*function1().*" \ ++ "step into function2 2" ++ ++gdb_test "finish" \ ++ ".*catch (...).*" \ ++ "finish 1" ++ ++gdb_test "next" \ ++ ".*next_cases.finish ().*" \ ++ "next past catch 4" ++ ++gdb_test "step" \ ++ ".*function1 ().*" \ ++ "step into finish method" ++ ++gdb_test "finish" \ ++ ".*catch (...).*" \ ++ "finish 2" ++ ++gdb_test "next" \ ++ ".*next_cases.finish ().*" \ ++ "next past catch 5" ++ ++gdb_test "step" \ ++ ".*function1 ().*" \ ++ "step into finish, for until" ++ ++gdb_test "until" \ ++ ".*function1 ().*" \ ++ "until with no argument 1" ++ ++set line [gdb_get_line_number "marker for until" $testfile.cc] ++ ++gdb_test "until $line" \ ++ ".*function1 ().*" \ ++ "next past catch 6" ++ ++gdb_test "until" \ ++ ".*catch (...).*" \ ++ "until with no argument 2" ++ ++set line [gdb_get_line_number "until here" $testfile.cc] ++ ++gdb_test "next" \ ++ ".*next_cases.until ().*" \ ++ "next past catch 6" ++ ++gdb_test "step" \ ++ ".*function1 ().*" \ ++ "step into until" ++ ++gdb_test "until $line" \ ++ ".*catch (...).*" \ ++ "until-over-throw" ++ ++gdb_test "next" \ ++ ".*next_cases.until ().*" \ ++ "next past catch 7" ++ ++gdb_test "step" \ ++ ".*function1 ().*" \ ++ "step into until, for advance" ++ ++gdb_test "advance $line" \ ++ ".*catch (...).*" \ ++ "advance-over-throw" +Index: gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S 2016-10-22 09:45:15.853013497 +0200 @@ -0,0 +1,246 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -1291,10 +2146,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S + .string "char" +.Luint_str: + .string "unsigned int" -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp +Index: gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp 2016-02-15 23:35:56.292999867 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp 2016-10-22 09:45:15.854013504 +0200 @@ -0,0 +1,66 @@ +# Copyright 2010 Free Software Foundation, Inc. + @@ -1362,10 +2217,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp + +# The register contains unpredictable value - the array size. +gdb_test "ptype reg_string" {type = char \[-?[0-9]+\]} -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-stripped.c +Index: gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-stripped.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-stripped.c 2016-02-15 23:35:56.293999874 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-stripped.c 2016-10-22 09:45:15.854013504 +0200 @@ -0,0 +1,42 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -1409,10 +2264,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-stripped.c + func1 (1, 2); + return 0; +} -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp +Index: gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp 2016-02-15 23:35:56.293999874 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp 2016-10-22 09:45:15.854013504 +0200 @@ -0,0 +1,79 @@ +# Copyright 2006 Free Software Foundation, Inc. + @@ -1445,7 +2300,7 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp + +set testfile "dw2-stripped" +set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile}.x ++set binfile [standard_output_file ${testfile}.x] + +remote_exec build "rm -f ${binfile}" + @@ -1493,10 +2348,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp +gdb_test "step" \ + "func.* \\(.*\\) at .*" \ + "step" -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S +Index: gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S 2016-02-15 23:35:56.293999874 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S 2016-10-22 09:45:15.854013504 +0200 @@ -0,0 +1,83 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -1581,10 +2436,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-loca + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp +Index: gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp 2016-02-15 23:35:56.293999874 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp 2016-10-22 09:45:15.854013504 +0200 @@ -0,0 +1,37 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -1623,10 +2478,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-loca +clean_restart $binfile + +gdb_test "ptype struct some_struct" "type = struct some_struct {\[\r\n \t\]*void field;\[\r\n \t\]*}" -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S +Index: gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S 2016-02-15 23:35:56.293999874 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S 2016-10-22 09:45:15.854013504 +0200 @@ -0,0 +1,121 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -1749,10 +2604,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S + .byte 0x0 /* Terminator */ + + .byte 0x0 /* Terminator */ -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp +Index: gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp 2016-02-15 23:35:56.293999874 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp 2016-10-22 09:45:15.855013512 +0200 @@ -0,0 +1,39 @@ +# Copyright 2012 Free Software Foundation, Inc. + @@ -1793,10 +2648,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp + +gdb_test "ptype notype_string" {type = char \[129\]} +gdb_test "p notype_string" " = 'x' " -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dwarf-stride.exp +Index: gdb-7.12/gdb/testsuite/gdb.fortran/dwarf-stride.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2016-02-15 23:35:56.294999881 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2016-10-22 09:45:15.855013512 +0200 @@ -0,0 +1,42 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -1840,10 +2695,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dwarf-stride.exp +gdb_continue_to_breakpoint "break-here" ".*break-here.*" +gdb_test "p c40pt(1)" " = '0-hello.*" +gdb_test "p c40pt(2)" " = '1-hello.*" -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dwarf-stride.f90 +Index: gdb-7.12/gdb/testsuite/gdb.fortran/dwarf-stride.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dwarf-stride.f90 2016-02-15 23:35:56.294999881 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.fortran/dwarf-stride.f90 2016-10-22 09:45:15.855013512 +0200 @@ -0,0 +1,40 @@ +! Copyright 2009 Free Software Foundation, Inc. +! @@ -1885,11 +2740,11 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dwarf-stride.f90 + print *, c40pt ! break-here + +end program repro -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dynamic.exp +Index: gdb-7.12/gdb/testsuite/gdb.fortran/dynamic.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dynamic.exp 2016-02-15 23:36:39.358305635 +0100 -@@ -0,0 +1,151 @@ ++++ gdb-7.12/gdb/testsuite/gdb.fortran/dynamic.exp 2016-10-22 09:45:15.855013512 +0200 +@@ -0,0 +1,154 @@ +# Copyright 2007 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -1934,11 +2789,13 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dynamic.exp + +gdb_breakpoint [gdb_get_line_number "varx-init"] +gdb_continue_to_breakpoint "varx-init" -+gdb_test "p varx" "\\$\[0-9\]* = " "p varx unallocated" -+gdb_test "ptype varx" "type = " "ptype varx unallocated" -+gdb_test "p varx(1,5,17)" {no such vector element \(vector not allocated\)} "p varx(1,5,17) unallocated" -+gdb_test "p varx(1,5,17)=1" {no such vector element \(vector not allocated\)} "p varx(1,5,17)=1 unallocated" -+gdb_test "ptype varx(1,5,17)" {no such vector element \(vector not allocated\)} "ptype varx(1,5,17) unallocated" ++ ++# http://www.cs.rpi.edu/~szymansk/OOF90/bugs.html#5 ++# Do not: gdb_test "p varx" "\\$\[0-9\]* = " "p varx unallocated" ++# Do not: gdb_test "ptype varx" {type = real\(kind=4\) \(:,:,:\)} "ptype varx unallocated" ++# Do not: gdb_test "p varx(1,5,17)" {no such vector element \(vector not allocated\)} "p varx(1,5,17) unallocated" ++# Do not: gdb_test "p varx(1,5,17)=1" {no such vector element \(vector not allocated\)} "p varx(1,5,17)=1 unallocated" ++# Do not: gdb_test "ptype varx(1,5,17)" {no such vector element \(vector not allocated\)} "ptype varx(1,5,17) unallocated" + +gdb_breakpoint [gdb_get_line_number "varx-allocated"] +gdb_continue_to_breakpoint "varx-allocated" @@ -1953,8 +2810,9 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dynamic.exp +gdb_test "p varx(1, 5, 17)" "\\$\[0-9\]* = 7" +gdb_test "p varx(2, 6, 18)" "\\$\[0-9\]* = 8" +gdb_test "p varx(6, 15, 28)" "\\$\[0-9\]* = 9" -+gdb_test "p varv" "\\$\[0-9\]* = " "p varv unassociated" -+gdb_test "ptype varv" "type = " "ptype varv unassociated" ++# http://www.cs.rpi.edu/~szymansk/OOF90/bugs.html#5 ++# Do not: gdb_test "p varv" "\\$\[0-9\]* = " "p varv unassociated" ++# Do not: gdb_test "ptype varv" {type = real\(kind=4\) \(:,:,:\)} "ptype varv unassociated" + +set test "output varx" +gdb_test_multiple $test $test { @@ -1982,7 +2840,7 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dynamic.exp +gdb_continue_to_breakpoint "varv-deassociated" +# The latter one is for the Intel Fortran Compiler 10.1.008 pointer type. +gdb_test "p varv" "\\$\[0-9\]* = (|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "p varv deassociated" -+gdb_test "ptype varv" "type = (|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "ptype varv deassociated" ++gdb_test "ptype varv" {type = real\(kind=4\) \(:,:,:\)} "ptype varv deassociated" +gdb_test "p l" "\\$\[0-9\]* = \\.FALSE\\." "p l if varv deassociated" +gdb_test "p varv(1,5,17)" {no such vector element \(vector not associated\)} +gdb_test "ptype varv(1,5,17)" {no such vector element \(vector not associated\)} @@ -1990,7 +2848,7 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dynamic.exp +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 = " "ptype varx deallocated" ++gdb_test "ptype varx" {type = real\(kind=4\) \(:,:,:\)} "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" @@ -2041,10 +2899,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dynamic.exp +gdb_test "p vart(3,8)" "\\$\[0-9\]* = 9" +# maps to foo::vary(1,3) +gdb_test "p vart(2,9)" "\\$\[0-9\]* = 10" -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dynamic.f90 +Index: gdb-7.12/gdb/testsuite/gdb.fortran/dynamic.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dynamic.f90 2016-02-15 23:35:56.294999881 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.fortran/dynamic.f90 2016-10-22 09:45:15.855013512 +0200 @@ -0,0 +1,98 @@ +! Copyright 2007 Free Software Foundation, Inc. +! @@ -2144,10 +3002,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dynamic.f90 + if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort + if (x (3, 1) .ne. 10) call abort +end -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/string.exp +Index: gdb-7.12/gdb/testsuite/gdb.fortran/string.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/string.exp 2016-02-15 23:36:39.359305642 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.fortran/string.exp 2016-10-22 09:45:15.855013512 +0200 @@ -0,0 +1,59 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -2208,10 +3066,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/string.exp +gdb_continue_to_breakpoint "var-finish" +gdb_test "p e" "\\$\[0-9\]* = 'e '" "p e re-set" +gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f2 ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\)" "p *f re-set" -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/string.f90 +Index: gdb-7.12/gdb/testsuite/gdb.fortran/string.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/string.f90 2016-02-15 23:35:56.295999888 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.fortran/string.f90 2016-10-22 09:45:15.856013519 +0200 @@ -0,0 +1,37 @@ +! Copyright 2008 Free Software Foundation, Inc. +! @@ -2250,10 +3108,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/string.f90 + h = 'h' + call foo (g, h) +end -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/subrange.exp +Index: gdb-7.12/gdb/testsuite/gdb.fortran/subrange.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/subrange.exp 2016-02-15 23:35:56.295999888 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.fortran/subrange.exp 2016-10-22 09:45:15.856013519 +0200 @@ -0,0 +1,72 @@ +# Copyright 2011 Free Software Foundation, Inc. + @@ -2327,10 +3185,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/subrange.exp +gdb_unload +setup_kfail "*-*-*" "vlaregression/9999" +gdb_test {p $a (3, 2:2)} { = \(23\)} -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/subrange.f90 +Index: gdb-7.12/gdb/testsuite/gdb.fortran/subrange.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/subrange.f90 2016-02-15 23:35:56.295999888 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.fortran/subrange.f90 2016-10-22 09:45:15.856013519 +0200 @@ -0,0 +1,28 @@ +! Copyright 2011 Free Software Foundation, Inc. +! @@ -2360,10 +3218,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/subrange.f90 + ptr => a + write (*,*) a ! break-static +end -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.mi/mi2-var-stale-type.c +Index: gdb-7.12/gdb/testsuite/gdb.mi/mi2-var-stale-type.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.mi/mi2-var-stale-type.c 2016-02-15 23:35:56.295999888 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.mi/mi2-var-stale-type.c 2016-10-22 09:45:15.856013519 +0200 @@ -0,0 +1,26 @@ +/* Copyright 2011 Free Software Foundation, Inc. + @@ -2391,10 +3249,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.mi/mi2-var-stale-type.c + + return 0; +} -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp +Index: gdb-7.12/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp 2016-02-15 23:35:56.295999888 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp 2016-10-22 09:45:15.856013519 +0200 @@ -0,0 +1,57 @@ +# Copyright 2011 Free Software Foundation, Inc. +# @@ -2453,10 +3311,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp +mi_create_varobj "vla" "vla" "create local variable vla" + +mi_gdb_test "-var-update *" "\\^done,changelist=.*" "-var-update *" -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.opt/array-from-register-func.c +Index: gdb-7.12/gdb/testsuite/gdb.opt/array-from-register-func.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.opt/array-from-register-func.c 2016-02-15 23:35:56.295999888 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.opt/array-from-register-func.c 2016-10-22 09:45:15.856013519 +0200 @@ -0,0 +1,22 @@ +/* This file is part of GDB, the GNU debugger. + @@ -2480,10 +3338,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.opt/array-from-register-func.c +{ + return arr[0]; +} -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.opt/array-from-register.c +Index: gdb-7.12/gdb/testsuite/gdb.opt/array-from-register.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.opt/array-from-register.c 2016-02-15 23:35:56.296999895 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.opt/array-from-register.c 2016-10-22 09:45:15.856013519 +0200 @@ -0,0 +1,28 @@ +/* This file is part of GDB, the GNU debugger. + @@ -2513,10 +3371,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.opt/array-from-register.c + + return 0; +} -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.opt/array-from-register.exp +Index: gdb-7.12/gdb/testsuite/gdb.opt/array-from-register.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.opt/array-from-register.exp 2016-02-15 23:35:56.296999895 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.opt/array-from-register.exp 2016-10-22 09:45:15.857013527 +0200 @@ -0,0 +1,33 @@ +# Copyright 2009 Free Software Foundation, Inc. +# @@ -2551,10 +3409,87 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.opt/array-from-register.exp +# Seen regression: +# Address requested for identifier "arr" which is in register $rdi +gdb_test "p arr\[0\]" "\\$\[0-9\]+ = 42" -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.pascal/arrays.exp +Index: gdb-7.12/gdb/testsuite/gdb.opt/fortran-string.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.pascal/arrays.exp 2016-02-15 23:36:39.359305642 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.opt/fortran-string.exp 2016-10-22 09:45:15.857013527 +0200 +@@ -0,0 +1,39 @@ ++# Copyright 2009 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++# This file was written by Jan Kratochvil . ++ ++# Test GDB can cope with Fortran strings having their length present in a CPU ++# register. With -O0 the string length is passed on the stack. To make this ++# test meaningful the follow assertion should pass. It is not being checked ++# here as the "_s" symbol is compiler dependent: ++# (gdb) info address _s ++# Symbol "_s" is a variable in register XX. ++ ++set test fortran-string ++set srcfile ${test}.f90 ++if { [prepare_for_testing ${test}.exp ${test} ${srcfile} {debug f90 additional_flags=-O2}] } { ++ return -1 ++} ++ ++if ![runto $srcfile:[gdb_get_line_number "s = s"]] then { ++ perror "couldn't run to breakpoint MAIN__" ++ continue ++} ++ ++gdb_test "frame" ".*s='foo'.*" ++gdb_test "ptype s" "type = character\\*3" ++gdb_test "p s" "\\$\[0-9\]* = 'foo'" +Index: gdb-7.12/gdb/testsuite/gdb.opt/fortran-string.f90 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.opt/fortran-string.f90 2016-10-22 09:45:15.857013527 +0200 +@@ -0,0 +1,28 @@ ++! Copyright 2009 Free Software Foundation, Inc. ++! ++! This program is free software; you can redistribute it and/or modify ++! it under the terms of the GNU General Public License as published by ++! the Free Software Foundation; either version 2 of the License, or ++! (at your option) any later version. ++! ++! This program is distributed in the hope that it will be useful, ++! but WITHOUT ANY WARRANTY; without even the implied warranty of ++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++! GNU General Public License for more details. ++! ++! You should have received a copy of the GNU General Public License ++! along with this program; if not, write to the Free Software ++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++! ++! Ihis file is the Fortran source file for dynamic.exp. ++! Original file written by Jakub Jelinek . ++! Modified for the GDB testcase by Jan Kratochvil . ++ ++ subroutine f(s) ++ character*(*) s ++ s = s ++ end ++ ++ program main ++ call f ('foo') ++ end +Index: gdb-7.12/gdb/testsuite/gdb.pascal/arrays.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.pascal/arrays.exp 2016-10-22 09:45:15.857013527 +0200 @@ -0,0 +1,104 @@ +# Copyright 2008, 2009 Free Software Foundation, Inc. +# @@ -2660,10 +3595,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.pascal/arrays.exp +} +gdb_test "print DynArrChar" ".* = 'abcdefghijklm'" "Print dynamic array of char" + -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.pascal/arrays.pas +Index: gdb-7.12/gdb/testsuite/gdb.pascal/arrays.pas =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.pascal/arrays.pas 2016-02-15 23:35:56.296999895 +0100 ++++ gdb-7.12/gdb/testsuite/gdb.pascal/arrays.pas 2016-10-22 09:45:15.857013527 +0200 @@ -0,0 +1,82 @@ +{ + Copyright 2008, 2009 Free Software Foundation, Inc. @@ -2747,10 +3682,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.pascal/arrays.pas + s := 'test'#0'string'; + writeln(s); { set breakpoint 2 here } +end. -Index: gdb-7.10.90.20160211/gdb/testsuite/lib/gdb.exp +Index: gdb-7.12/gdb/testsuite/lib/gdb.exp =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/testsuite/lib/gdb.exp 2016-02-15 23:35:55.326993008 +0100 -+++ gdb-7.10.90.20160211/gdb/testsuite/lib/gdb.exp 2016-02-15 23:35:56.297999903 +0100 +--- gdb-7.12.orig/gdb/testsuite/lib/gdb.exp 2016-10-22 09:45:15.106007986 +0200 ++++ gdb-7.12/gdb/testsuite/lib/gdb.exp 2016-10-22 09:45:15.858013534 +0200 @@ -173,6 +173,11 @@ send_gdb "y\n" exp_continue @@ -2763,10 +3698,10 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/lib/gdb.exp -re "Discard symbol table from .*y or n.*$" { send_gdb "y\n" exp_continue -Index: gdb-7.10.90.20160211/gdb/testsuite/lib/pascal.exp +Index: gdb-7.12/gdb/testsuite/lib/pascal.exp =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/testsuite/lib/pascal.exp 2016-02-15 23:33:29.830959972 +0100 -+++ gdb-7.10.90.20160211/gdb/testsuite/lib/pascal.exp 2016-02-15 23:35:56.298999910 +0100 +--- gdb-7.12.orig/gdb/testsuite/lib/pascal.exp 2016-08-01 17:50:21.000000000 +0200 ++++ gdb-7.12/gdb/testsuite/lib/pascal.exp 2016-10-22 09:45:15.859013541 +0200 @@ -37,6 +37,9 @@ global pascal_compiler_is_fpc global gpc_compiler diff --git a/gdb-archer.patch b/gdb-archer.patch index c0f04cb..a42d61a 100644 --- a/gdb-archer.patch +++ b/gdb-archer.patch @@ -2,7 +2,7 @@ http://sourceware.org/gdb/wiki/ProjectArcher http://sourceware.org/gdb/wiki/ArcherBranchManagement GIT snapshot: -commit f0ee78c5ccefe388a64273353ecd5c99dae62558 +commit cfee64ee869a6a6e4ab0b64af149d4cf59517d80 tromey/python @@ -16,10 +16,10 @@ index 0000000..173b8ea +This branch originally held the Python code for gdb. It still exists +because a small amount of code here has not yet been merged upstream. diff --git a/gdb/Makefile.in b/gdb/Makefile.in -index 95104ef..a9b198a 100644 +index 5af6103..9c69cb0 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -1534,6 +1534,12 @@ stamp-h: $(srcdir)/config.in config.status +@@ -1553,6 +1553,12 @@ stamp-h: $(srcdir)/config.in config.status CONFIG_LINKS= \ $(SHELL) config.status @@ -33,10 +33,10 @@ index 95104ef..a9b198a 100644 $(SHELL) config.status --recheck diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in -index 30cfd17..e977b30 100644 +index 3f23516..b5d6390 100644 --- a/gdb/data-directory/Makefile.in +++ b/gdb/data-directory/Makefile.in -@@ -65,7 +65,10 @@ PYTHON_FILE_LIST = \ +@@ -66,7 +66,10 @@ PYTHON_FILE_LIST = \ gdb/unwinder.py \ gdb/prompt.py \ gdb/xmethod.py \ @@ -47,8 +47,8 @@ index 30cfd17..e977b30 100644 gdb/command/xmethods.py \ gdb/command/frame_filters.py \ gdb/command/unwinders.py \ -@@ -76,6 +79,8 @@ PYTHON_FILE_LIST = \ - gdb/function/__init__.py \ +@@ -78,6 +81,8 @@ PYTHON_FILE_LIST = \ + gdb/function/as_string.py \ gdb/function/caller_is.py \ gdb/function/strfns.py \ + gdb/function/caller_is.py \ @@ -57,7 +57,7 @@ index 30cfd17..e977b30 100644 gdb/printer/bound_registers.py diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo -index 1665372..c4caffc 100644 +index f5dde61..1d92bd6 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -1225,6 +1225,16 @@ for remote debugging. @@ -78,7 +78,7 @@ index 1665372..c4caffc 100644 @item -tui @cindex @code{--tui} diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi -index 57ec22e..13beb05 100644 +index a17e37d..c56068b 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -88,8 +88,6 @@ containing @code{end}. For example: @@ -111,7 +111,7 @@ index 05a38b2..9801fdf 100644 set variable $gdb_init_done = 1 diff --git a/gdb/main.c b/gdb/main.c -index aecd60a..d0f7834 100644 +index 5477379..b7e413f 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -33,6 +33,7 @@ @@ -122,7 +122,7 @@ index aecd60a..d0f7834 100644 #include "source.h" #include "cli/cli-cmds.h" #include "objfiles.h" -@@ -453,6 +454,8 @@ captured_main (void *data) +@@ -459,6 +460,8 @@ captured_main (void *data) char *cdarg = NULL; char *ttyarg = NULL; @@ -190,7 +190,7 @@ index aecd60a..d0f7834 100644 { /* The remaining options are the command-line options for the inferior. The first one is the sym/exec file, and the rest -@@ -1137,7 +1171,8 @@ captured_main (void *data) +@@ -1127,7 +1161,8 @@ captured_main (void *data) /* Read in the old history after all the command files have been read. */ @@ -200,7 +200,7 @@ index aecd60a..d0f7834 100644 if (batch_flag) { -@@ -1148,13 +1183,25 @@ captured_main (void *data) +@@ -1138,13 +1173,25 @@ captured_main (void *data) /* Show time and/or space usage. */ do_cleanups (pre_stat_chain); @@ -232,7 +232,7 @@ index aecd60a..d0f7834 100644 } /* No exit -- exit is through quit_command. */ } -@@ -1188,6 +1235,12 @@ print_gdb_help (struct ui_file *stream) +@@ -1187,6 +1234,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\ @@ -245,7 +245,7 @@ index aecd60a..d0f7834 100644 gdb [options] --args executable-file [inferior-arguments ...]\n\n\ "), stream); fputs_unfiltered (_("\ -@@ -1232,6 +1285,13 @@ Output and user interface control:\n\n\ +@@ -1231,6 +1284,13 @@ Output and user interface control:\n\n\ #endif fputs_unfiltered (_("\ --dbx DBX compatibility mode.\n\ @@ -443,10 +443,10 @@ index 0000000..8742680 + +InScope () diff --git a/gdb/python/python.c b/gdb/python/python.c -index 4f88b0e..870a1ba 100644 +index 621e201..703a1a0 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c -@@ -93,6 +93,8 @@ const struct extension_language_defn extension_language_python = +@@ -95,6 +95,8 @@ const struct extension_language_defn extension_language_python = #include "linespec.h" #include "source.h" #include "version.h" @@ -455,7 +455,7 @@ index 4f88b0e..870a1ba 100644 #include "target.h" #include "gdbthread.h" #include "interps.h" -@@ -1262,6 +1264,83 @@ gdbpy_print_stack (void) +@@ -1263,6 +1265,92 @@ gdbpy_print_stack (void) /* Return the current Progspace. There always is one. */ @@ -477,7 +477,14 @@ index 4f88b0e..870a1ba 100644 + return PyErr_Format (PyExc_RuntimeError, _("Cannot invoke CLI from MI.")); + + in_cli = 1; -+ current_interp_command_loop (); ++ /* 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; @@ -500,13 +507,15 @@ index 4f88b0e..870a1ba 100644 + PySys_SetArgv (argc - 1, argv + 1); +#else + { -+ wchar_t **wargv = alloca (sizeof (*wargv) * (argc + 1)); ++ 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); -+ size_t len2; ++ /* 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) + { @@ -514,7 +523,7 @@ index 4f88b0e..870a1ba 100644 + i, argv[i]); + exit (1); + } -+ wargv[i] = alloca (sizeof (**wargv) * (len + 1)); ++ wargv[i] = (wchar_t *) alloca (sizeof (**wargv) * (len + 1)); + len2 = mbstowcs (wargv[i], argv[i], len + 1); + assert (len2 == len); + } @@ -539,7 +548,7 @@ index 4f88b0e..870a1ba 100644 static PyObject * gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2) -@@ -1982,6 +2061,8 @@ PyMethodDef python_GdbMethods[] = +@@ -1981,6 +2069,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." }, @@ -549,7 +558,7 @@ index 4f88b0e..870a1ba 100644 "Return a gdb parameter's value" }, diff --git a/gdb/python/python.h b/gdb/python/python.h -index e6bfcca..688daa3 100644 +index b810187..a3620ab 100644 --- a/gdb/python/python.h +++ b/gdb/python/python.h @@ -25,4 +25,6 @@ @@ -560,10 +569,10 @@ index e6bfcca..688daa3 100644 + #endif /* GDB_PYTHON_H */ diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp -index 9f25a48..88b0842 100644 +index 2fdd9e3..391900d 100644 --- a/gdb/testsuite/gdb.gdb/selftest.exp +++ b/gdb/testsuite/gdb.gdb/selftest.exp -@@ -92,6 +92,10 @@ proc do_steps_and_nexts {} { +@@ -87,6 +87,10 @@ proc do_steps_and_nexts {} { set description "step over cmdarg_vec initialization" set command "step" } @@ -575,7 +584,7 @@ index 9f25a48..88b0842 100644 set description "next over make_command_stats_cleanup and everything it calls" set command "next" diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp -index 33fdbe5..264d00f 100644 +index b5a4682..d5451a6 100644 --- a/gdb/testsuite/gdb.python/py-frame.exp +++ b/gdb/testsuite/gdb.python/py-frame.exp @@ -95,6 +95,8 @@ gdb_test "python print ('result = %s' % f0.read_var ('a'))" " = 1" "test Frame.r @@ -588,10 +597,10 @@ index 33fdbe5..264d00f 100644 gdb_test "python print ('result = %s' % (gdb.selected_frame ().read_register ('sp') == gdb.parse_and_eval ('\$sp')))" \ " = True" \ diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp -index baa17b7..45ad67e 100644 +index 57a9ba1..d90d85a 100644 --- a/gdb/testsuite/gdb.python/py-value.exp +++ b/gdb/testsuite/gdb.python/py-value.exp -@@ -388,6 +388,15 @@ proc test_value_after_death {} { +@@ -397,6 +397,15 @@ proc test_value_after_death {} { "print value's type" } @@ -607,7 +616,7 @@ index baa17b7..45ad67e 100644 # 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. -@@ -517,6 +526,7 @@ test_value_in_inferior +@@ -526,6 +535,7 @@ test_value_in_inferior test_inferior_function_call test_lazy_strings test_value_after_death diff --git a/gdb-attach-fail-reasons-5of5.patch b/gdb-attach-fail-reasons-5of5.patch index f9e2f6c..ec1055d 100644 --- a/gdb-attach-fail-reasons-5of5.patch +++ b/gdb-attach-fail-reasons-5of5.patch @@ -37,13 +37,13 @@ gdb/gdbserver/ (linux_create_inferior, linux_tracefork_child): Call it instead of direct ptrace. -Index: gdb-7.10.50.20160106/gdb/nat/linux-ptrace.c +Index: gdb-7.11.90.20160829/gdb/nat/linux-ptrace.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/nat/linux-ptrace.c 2016-01-08 19:15:57.580707944 +0100 -+++ gdb-7.10.50.20160106/gdb/nat/linux-ptrace.c 2016-01-08 19:16:02.654736246 +0100 -@@ -24,6 +24,10 @@ - #include "gdb_wait.h" +--- gdb-7.11.90.20160829.orig/gdb/nat/linux-ptrace.c 2016-08-29 09:35:26.798230659 +0200 ++++ gdb-7.11.90.20160829/gdb/nat/linux-ptrace.c 2016-08-29 09:35:43.162384100 +0200 +@@ -25,6 +25,10 @@ #include "gdb_ptrace.h" + #include +#ifdef HAVE_SELINUX_SELINUX_H +# include @@ -52,7 +52,7 @@ Index: gdb-7.10.50.20160106/gdb/nat/linux-ptrace.c /* Stores the ptrace options supported by the running kernel. A value of -1 means we did not check for features yet. A value of 0 means there are no supported features. */ -@@ -48,6 +52,8 @@ +@@ -49,6 +53,8 @@ buffer_xml_printf (buffer, _("process %d is a zombie " "- the process has already terminated"), (int) pid); @@ -61,7 +61,7 @@ Index: gdb-7.10.50.20160106/gdb/nat/linux-ptrace.c } /* See linux-ptrace.h. */ -@@ -594,6 +600,22 @@ +@@ -592,6 +598,22 @@ linux_ptrace_test_ret_to_nx (); } @@ -84,11 +84,11 @@ Index: gdb-7.10.50.20160106/gdb/nat/linux-ptrace.c /* Extract extended ptrace event from wait status. */ int -Index: gdb-7.10.50.20160106/gdb/nat/linux-ptrace.h +Index: gdb-7.11.90.20160829/gdb/nat/linux-ptrace.h =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/nat/linux-ptrace.h 2016-01-08 19:15:57.581707950 +0100 -+++ gdb-7.10.50.20160106/gdb/nat/linux-ptrace.h 2016-01-08 19:16:02.655736251 +0100 -@@ -164,6 +164,7 @@ +--- gdb-7.11.90.20160829.orig/gdb/nat/linux-ptrace.h 2016-08-29 09:35:26.798230659 +0200 ++++ gdb-7.11.90.20160829/gdb/nat/linux-ptrace.h 2016-08-29 09:35:43.162384100 +0200 +@@ -185,6 +185,7 @@ extern char *linux_ptrace_attach_fail_reason_string (ptid_t ptid, int err); extern void linux_ptrace_init_warnings (void); @@ -96,11 +96,11 @@ Index: gdb-7.10.50.20160106/gdb/nat/linux-ptrace.h extern void linux_check_ptrace_features (void); extern void linux_enable_event_reporting (pid_t pid, int attached); extern void linux_disable_event_reporting (pid_t pid); -Index: gdb-7.10.50.20160106/gdb/configure.ac +Index: gdb-7.11.90.20160829/gdb/configure.ac =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/configure.ac 2016-01-08 19:15:57.582707955 +0100 -+++ gdb-7.10.50.20160106/gdb/configure.ac 2016-01-08 19:16:02.656736257 +0100 -@@ -2077,6 +2077,10 @@ +--- gdb-7.11.90.20160829.orig/gdb/configure.ac 2016-08-29 09:35:26.799230668 +0200 ++++ gdb-7.11.90.20160829/gdb/configure.ac 2016-08-29 09:35:43.163384109 +0200 +@@ -2108,6 +2108,10 @@ esac AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.]) @@ -111,11 +111,11 @@ Index: gdb-7.10.50.20160106/gdb/configure.ac dnl Handle optional features that can be enabled. # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR, -Index: gdb-7.10.50.20160106/gdb/gdbserver/configure.ac +Index: gdb-7.11.90.20160829/gdb/gdbserver/configure.ac =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/gdbserver/configure.ac 2016-01-08 19:15:57.582707955 +0100 -+++ gdb-7.10.50.20160106/gdb/gdbserver/configure.ac 2016-01-08 19:16:02.656736257 +0100 -@@ -524,6 +524,10 @@ +--- gdb-7.11.90.20160829.orig/gdb/gdbserver/configure.ac 2016-08-29 09:35:26.799230668 +0200 ++++ gdb-7.11.90.20160829/gdb/gdbserver/configure.ac 2016-08-29 09:35:43.163384109 +0200 +@@ -472,6 +472,10 @@ fi fi @@ -126,11 +126,11 @@ Index: gdb-7.10.50.20160106/gdb/gdbserver/configure.ac AC_SUBST(GDBSERVER_DEPFILES) AC_SUBST(GDBSERVER_LIBS) AC_SUBST(srv_xmlbuiltin) -Index: gdb-7.10.50.20160106/gdb/gdbserver/linux-low.c +Index: gdb-7.11.90.20160829/gdb/gdbserver/linux-low.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/gdbserver/linux-low.c 2016-01-08 19:15:57.585707972 +0100 -+++ gdb-7.10.50.20160106/gdb/gdbserver/linux-low.c 2016-01-08 19:16:02.658736268 +0100 -@@ -853,6 +853,29 @@ +--- gdb-7.11.90.20160829.orig/gdb/gdbserver/linux-low.c 2016-08-29 09:35:26.801230687 +0200 ++++ gdb-7.11.90.20160829/gdb/gdbserver/linux-low.c 2016-08-29 09:35:43.165384128 +0200 +@@ -933,6 +933,29 @@ return lwp; } @@ -160,7 +160,7 @@ Index: gdb-7.10.50.20160106/gdb/gdbserver/linux-low.c /* Start an inferior process and returns its pid. ALLARGS is a vector of program-name and args. */ -@@ -876,7 +899,7 @@ +@@ -956,7 +979,7 @@ if (pid == 0) { close_most_fds (); @@ -169,10 +169,10 @@ Index: gdb-7.10.50.20160106/gdb/gdbserver/linux-low.c setpgid (0, 0); -Index: gdb-7.10.50.20160106/gdb/inf-ptrace.c +Index: gdb-7.11.90.20160829/gdb/inf-ptrace.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/inf-ptrace.c 2016-01-08 19:15:57.586707977 +0100 -+++ gdb-7.10.50.20160106/gdb/inf-ptrace.c 2016-01-08 19:16:02.659736274 +0100 +--- gdb-7.11.90.20160829.orig/gdb/inf-ptrace.c 2016-08-29 09:35:26.801230687 +0200 ++++ gdb-7.11.90.20160829/gdb/inf-ptrace.c 2016-08-29 09:35:43.165384128 +0200 @@ -79,7 +79,15 @@ inf_ptrace_me (void) { @@ -189,11 +189,11 @@ Index: gdb-7.10.50.20160106/gdb/inf-ptrace.c } /* Start a new inferior Unix child process. EXEC_FILE is the file to -Index: gdb-7.10.50.20160106/gdb/linux-nat.c +Index: gdb-7.11.90.20160829/gdb/linux-nat.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/linux-nat.c 2016-01-08 19:15:57.587707983 +0100 -+++ gdb-7.10.50.20160106/gdb/linux-nat.c 2016-01-08 19:16:02.660736279 +0100 -@@ -1016,6 +1016,7 @@ +--- gdb-7.11.90.20160829.orig/gdb/linux-nat.c 2016-08-29 09:35:26.802230697 +0200 ++++ gdb-7.11.90.20160829/gdb/linux-nat.c 2016-08-29 09:35:43.166384137 +0200 +@@ -1102,6 +1102,7 @@ { struct cleanup *restore_personality = maybe_disable_address_space_randomization (disable_randomization); @@ -201,7 +201,7 @@ Index: gdb-7.10.50.20160106/gdb/linux-nat.c /* The fork_child mechanism is synchronous and calls target_wait, so we have to mask the async mode. */ -@@ -1023,7 +1024,28 @@ +@@ -1109,7 +1110,28 @@ /* Make sure we report all signals during startup. */ linux_nat_pass_signals (ops, 0, NULL); @@ -231,11 +231,11 @@ Index: gdb-7.10.50.20160106/gdb/linux-nat.c do_cleanups (restore_personality); } -Index: gdb-7.10.50.20160106/gdb/config.in +Index: gdb-7.11.90.20160829/gdb/config.in =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/config.in 2016-01-08 19:15:57.588707989 +0100 -+++ gdb-7.10.50.20160106/gdb/config.in 2016-01-08 19:16:02.660736279 +0100 -@@ -264,6 +264,9 @@ +--- gdb-7.11.90.20160829.orig/gdb/config.in 2016-08-29 09:35:26.803230706 +0200 ++++ gdb-7.11.90.20160829/gdb/config.in 2016-08-29 09:35:43.166384137 +0200 +@@ -267,6 +267,9 @@ /* Define if librpm library is being used. */ #undef HAVE_LIBRPM @@ -245,7 +245,7 @@ Index: gdb-7.10.50.20160106/gdb/config.in /* Define to 1 if you have the header file. */ #undef HAVE_LIBUNWIND_IA64_H -@@ -396,6 +399,9 @@ +@@ -399,6 +402,9 @@ /* Define to 1 if you have the `scm_new_smob' function. */ #undef HAVE_SCM_NEW_SMOB @@ -255,11 +255,11 @@ Index: gdb-7.10.50.20160106/gdb/config.in /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE -Index: gdb-7.10.50.20160106/gdb/configure +Index: gdb-7.11.90.20160829/gdb/configure =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/configure 2016-01-08 19:15:57.593708017 +0100 -+++ gdb-7.10.50.20160106/gdb/configure 2016-01-08 19:16:02.665736307 +0100 -@@ -14653,6 +14653,64 @@ +--- gdb-7.11.90.20160829.orig/gdb/configure 2016-08-29 09:35:26.806230734 +0200 ++++ gdb-7.11.90.20160829/gdb/configure 2016-08-29 09:35:43.170384175 +0200 +@@ -14642,6 +14642,64 @@ _ACEOF @@ -324,11 +324,11 @@ Index: gdb-7.10.50.20160106/gdb/configure # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR, # except that the argument to --with-sysroot is optional. -Index: gdb-7.10.50.20160106/gdb/gdbserver/config.in +Index: gdb-7.11.90.20160829/gdb/gdbserver/config.in =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/gdbserver/config.in 2016-01-08 19:15:57.595708028 +0100 -+++ gdb-7.10.50.20160106/gdb/gdbserver/config.in 2016-01-08 19:16:02.665736307 +0100 -@@ -117,6 +117,9 @@ +--- gdb-7.11.90.20160829.orig/gdb/gdbserver/config.in 2016-08-29 09:35:26.807230743 +0200 ++++ gdb-7.11.90.20160829/gdb/gdbserver/config.in 2016-08-29 09:35:43.170384175 +0200 +@@ -120,6 +120,9 @@ /* Define to 1 if you have the `mcheck' library (-lmcheck). */ #undef HAVE_LIBMCHECK @@ -338,7 +338,7 @@ Index: gdb-7.10.50.20160106/gdb/gdbserver/config.in /* Define if the target supports branch tracing. */ #undef HAVE_LINUX_BTRACE -@@ -193,6 +196,9 @@ +@@ -196,6 +199,9 @@ /* Define to 1 if you have the `pwrite' function. */ #undef HAVE_PWRITE @@ -348,11 +348,11 @@ Index: gdb-7.10.50.20160106/gdb/gdbserver/config.in /* Define to 1 if you have the `setns' function. */ #undef HAVE_SETNS -Index: gdb-7.10.50.20160106/gdb/gdbserver/configure +Index: gdb-7.11.90.20160829/gdb/gdbserver/configure =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/gdbserver/configure 2016-01-08 19:15:57.597708039 +0100 -+++ gdb-7.10.50.20160106/gdb/gdbserver/configure 2016-01-08 19:16:02.667736318 +0100 -@@ -7311,6 +7311,64 @@ +--- gdb-7.11.90.20160829.orig/gdb/gdbserver/configure 2016-08-29 09:35:26.809230762 +0200 ++++ gdb-7.11.90.20160829/gdb/gdbserver/configure 2016-08-29 09:35:43.172384194 +0200 +@@ -7561,6 +7561,64 @@ fi fi diff --git a/gdb-bison-old.patch b/gdb-bison-old.patch new file mode 100644 index 0000000..85701b1 --- /dev/null +++ b/gdb-bison-old.patch @@ -0,0 +1,44 @@ +bison-3.0.4-4.fc24.x86_64 +vs. +bison-2.7-4.el7.x86_64 + +bison: +8d0b7cef7df7fead44b9574cee342de336008625 tags/v3.0.1~2 + parsers: rename YY_NULL as YY_NULLPTR to avoid conflicts with Flex + +ada-lex.c:113:0: error: "YY_NULL" redefined [-Werror] + #define YY_NULL 0 + +ada-exp.c:158:0: note: this is the location of the previous definition + # define YY_NULL nullptr + +*-exp.c cp-name-parser.c +vs. +ada-lex.c + +# ifndef YY_NULL +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULL nullptr +# else +# define YY_NULL 0 +# endif +# endif + +# ifndef YY_NULLPTR +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# endif + +--- gdb-clean712/gdb/Makefile.in 2016-08-29 09:16:15.505393928 +0200 ++++ gdb-clean712/gdb/Makefile.in 2016-09-07 13:32:34.744270346 +0200 +@@ -1900,6 +1945,7 @@ po/$(PACKAGE).pot: force + -e 's/\([ \t;,(]\)free\([ \t]*[&(),]\)/\1xfree\2/g' \ + -e 's/\([ \t;,(]\)free$$/\1xfree/g' \ + -e '/^#line.*y.tab.c/d' \ ++ -e 's/\/YY_NULLPTR/g' \ + < $@.tmp > $@ + rm -f $@.tmp + .l.c: diff --git a/gdb-bz541866-rwatch-before-run.patch b/gdb-bz541866-rwatch-before-run.patch index fd636c3..42ffc22 100644 --- a/gdb-bz541866-rwatch-before-run.patch +++ b/gdb-bz541866-rwatch-before-run.patch @@ -1,7 +1,7 @@ -Index: gdb-7.10.90.20160211/gdb/config/i386/linux64.mh +Index: gdb-7.11.90.20160807/gdb/config/i386/linux64.mh =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/config/i386/linux64.mh 2016-02-11 20:56:32.470674877 +0100 -+++ gdb-7.10.90.20160211/gdb/config/i386/linux64.mh 2016-02-11 20:56:51.158797712 +0100 +--- gdb-7.11.90.20160807.orig/gdb/config/i386/linux64.mh 2016-08-07 22:27:13.889285274 +0200 ++++ gdb-7.11.90.20160807/gdb/config/i386/linux64.mh 2016-08-07 22:29:20.451311124 +0200 @@ -7,7 +7,7 @@ linux-procfs.o linux-ptrace.o linux-btrace.o \ linux-waitpid.o linux-personality.o x86-linux.o \ @@ -11,10 +11,10 @@ Index: gdb-7.10.90.20160211/gdb/config/i386/linux64.mh NAT_CDEPS = $(srcdir)/proc-service.list # The dynamically loaded libthread_db needs access to symbols in the -Index: gdb-7.10.90.20160211/gdb/config/i386/linux.mh +Index: gdb-7.11.90.20160807/gdb/config/i386/linux.mh =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/config/i386/linux.mh 2016-02-11 20:56:26.925638430 +0100 -+++ gdb-7.10.90.20160211/gdb/config/i386/linux.mh 2016-02-11 20:56:32.471674884 +0100 +--- gdb-7.11.90.20160807.orig/gdb/config/i386/linux.mh 2016-08-07 22:27:13.889285274 +0200 ++++ gdb-7.11.90.20160807/gdb/config/i386/linux.mh 2016-08-07 22:29:20.451311124 +0200 @@ -1,6 +1,6 @@ # Host: Intel 386 running GNU/Linux. @@ -23,10 +23,10 @@ Index: gdb-7.10.90.20160211/gdb/config/i386/linux.mh NATDEPFILES= inf-ptrace.o fork-child.o \ x86-nat.o x86-dregs.o i386-linux-nat.o x86-linux-nat.o \ proc-service.o linux-thread-db.o \ -Index: gdb-7.10.90.20160211/gdb/config/i386/nm-linux.h +Index: gdb-7.11.90.20160807/gdb/config/i386/nm-linux.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/config/i386/nm-linux.h 2016-02-11 20:56:32.471674884 +0100 ++++ gdb-7.11.90.20160807/gdb/config/i386/nm-linux.h 2016-08-07 22:29:20.451311124 +0200 @@ -0,0 +1,28 @@ +/* Native support for GNU/Linux i386. + @@ -56,10 +56,10 @@ Index: gdb-7.10.90.20160211/gdb/config/i386/nm-linux.h +#define target_can_use_hardware_watchpoint(type, cnt, ot) 1 + +#endif /* NM_LINUX64_H */ -Index: gdb-7.10.90.20160211/gdb/config/i386/nm-linux64.h +Index: gdb-7.11.90.20160807/gdb/config/i386/nm-linux64.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/config/i386/nm-linux64.h 2016-02-11 20:56:32.471674884 +0100 ++++ gdb-7.11.90.20160807/gdb/config/i386/nm-linux64.h 2016-08-07 22:29:20.451311124 +0200 @@ -0,0 +1,28 @@ +/* Native support for GNU/Linux amd64. + @@ -89,13 +89,13 @@ Index: gdb-7.10.90.20160211/gdb/config/i386/nm-linux64.h +#define target_can_use_hardware_watchpoint(type, cnt, ot) 1 + +#endif /* NM_LINUX64_H */ -Index: gdb-7.10.90.20160211/gdb/target.h +Index: gdb-7.11.90.20160807/gdb/target.h =================================================================== ---- gdb-7.10.90.20160211.orig/gdb/target.h 2016-02-11 20:56:26.926638437 +0100 -+++ gdb-7.10.90.20160211/gdb/target.h 2016-02-11 20:56:32.472674890 +0100 -@@ -1924,9 +1924,11 @@ - CNT is the number of such watchpoints used so far, including this - one. OTHERTYPE is who knows what... */ +--- gdb-7.11.90.20160807.orig/gdb/target.h 2016-08-07 22:27:13.889285274 +0200 ++++ gdb-7.11.90.20160807/gdb/target.h 2016-08-07 22:29:20.452311132 +0200 +@@ -1939,9 +1939,11 @@ + 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) \ @@ -105,10 +105,10 @@ Index: gdb-7.10.90.20160211/gdb/target.h /* Returns the number of debug registers needed to watch the given memory region, or zero if not supported. */ -Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp +Index: gdb-7.11.90.20160807/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2016-02-11 20:56:32.472674890 +0100 ++++ gdb-7.11.90.20160807/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2016-08-07 22:29:20.452311132 +0200 @@ -0,0 +1,40 @@ +# Copyright 2009, 2010 Free Software Foundation, Inc. + @@ -150,3 +150,16 @@ Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp +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.*" +Index: gdb-7.11.90.20160807/gdb/breakpoint.c +=================================================================== +--- gdb-7.11.90.20160807.orig/gdb/breakpoint.c 2016-08-07 22:33:38.835405458 +0200 ++++ gdb-7.11.90.20160807/gdb/breakpoint.c 2016-08-07 22:34:45.023941950 +0200 +@@ -14953,7 +14953,7 @@ + + 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-container-rh-pkg.patch b/gdb-container-rh-pkg.patch new file mode 100644 index 0000000..fbcd136 --- /dev/null +++ b/gdb-container-rh-pkg.patch @@ -0,0 +1,21 @@ +--- gdb-7.11/gdb/remote.c-orig 2016-04-06 17:46:52.428921496 +0200 ++++ gdb-7.11/gdb/remote.c 2016-04-06 18:28:26.781923516 +0200 +@@ -13002,7 +13002,17 @@ remote_pid_to_exec_file (struct target_o + char *annex = NULL; + + if (packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE) +- return NULL; ++ { ++ warning (_("Remote gdbserver does not support determining executable " ++ "automatically.\n" ++"RHEL <=6.8 and <=7.2 versions of gdbserver do not support such automatic executable detection.\n" ++"The following versions of gdbserver support it:\n" ++"- Upstream version of gdbserver (unsupported) 7.10 or later\n" ++"- Red Hat Developer Toolset (DTS) version of gdbserver from DTS 4.0 or later (only on x86_64)\n" ++"- RHEL-7.3 versions of gdbserver (on any architecture)" ++)); ++ return NULL; ++ } + + if (filename != NULL) + xfree (filename); diff --git a/gdb-dts-rhel6-python-compat.patch b/gdb-dts-rhel6-python-compat.patch index e4d3ac7..d0a466b 100644 --- a/gdb-dts-rhel6-python-compat.patch +++ b/gdb-dts-rhel6-python-compat.patch @@ -1,10 +1,10 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1020004 -Index: gdb-7.9.50.20150520/gdb/data-directory/Makefile.in +Index: gdb-7.11.50.20160630/gdb/data-directory/Makefile.in =================================================================== ---- gdb-7.9.50.20150520.orig/gdb/data-directory/Makefile.in 2015-05-31 18:05:43.046746351 +0200 -+++ gdb-7.9.50.20150520/gdb/data-directory/Makefile.in 2015-05-31 18:05:58.483841655 +0200 -@@ -60,6 +60,8 @@ PYTHON_FILE_LIST = \ +--- gdb-7.11.50.20160630.orig/gdb/data-directory/Makefile.in 2016-07-03 16:32:13.788164041 +0200 ++++ gdb-7.11.50.20160630/gdb/data-directory/Makefile.in 2016-07-03 16:32:17.868198850 +0200 +@@ -61,6 +61,8 @@ gdb/frames.py \ gdb/FrameIterator.py \ gdb/FrameDecorator.py \ @@ -13,18 +13,18 @@ Index: gdb-7.9.50.20150520/gdb/data-directory/Makefile.in gdb/types.py \ gdb/printing.py \ gdb/unwinder.py \ -@@ -76,6 +78,7 @@ PYTHON_FILE_LIST = \ +@@ -77,6 +79,7 @@ gdb/command/pretty_printers.py \ gdb/command/prompt.py \ gdb/command/explore.py \ + gdb/command/backtrace.py \ gdb/function/__init__.py \ + gdb/function/as_string.py \ gdb/function/caller_is.py \ - gdb/function/strfns.py \ -Index: gdb-7.9.50.20150520/gdb/python/lib/gdb/FrameWrapper.py +Index: gdb-7.11.50.20160630/gdb/python/lib/gdb/FrameWrapper.py =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/python/lib/gdb/FrameWrapper.py 2015-05-31 18:05:58.484841661 +0200 ++++ gdb-7.11.50.20160630/gdb/python/lib/gdb/FrameWrapper.py 2016-07-03 16:32:17.869198859 +0200 @@ -0,0 +1,122 @@ +# Wrapper API for frames. + @@ -148,10 +148,10 @@ Index: gdb-7.9.50.20150520/gdb/python/lib/gdb/FrameWrapper.py + + def __getattr__ (self, name): + return getattr (self.frame, name) -Index: gdb-7.9.50.20150520/gdb/python/lib/gdb/backtrace.py +Index: gdb-7.11.50.20160630/gdb/python/lib/gdb/backtrace.py =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/python/lib/gdb/backtrace.py 2015-05-31 18:05:58.484841661 +0200 ++++ gdb-7.11.50.20160630/gdb/python/lib/gdb/backtrace.py 2016-07-03 16:32:17.869198859 +0200 @@ -0,0 +1,42 @@ +# Filtering backtrace. + @@ -195,10 +195,10 @@ Index: gdb-7.9.50.20150520/gdb/python/lib/gdb/backtrace.py + return iter + return old_frame_filter (iter) + -Index: gdb-7.9.50.20150520/gdb/python/lib/gdb/command/backtrace.py +Index: gdb-7.11.50.20160630/gdb/python/lib/gdb/command/backtrace.py =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/python/lib/gdb/command/backtrace.py 2015-05-31 18:05:58.484841661 +0200 ++++ gdb-7.11.50.20160630/gdb/python/lib/gdb/command/backtrace.py 2016-07-03 16:32:17.869198859 +0200 @@ -0,0 +1,106 @@ +# New backtrace command. + diff --git a/gdb-glibc-vdso-workaround.patch b/gdb-glibc-vdso-workaround.patch index 3d1407f..c503d63 100644 --- a/gdb-glibc-vdso-workaround.patch +++ b/gdb-glibc-vdso-workaround.patch @@ -11,11 +11,11 @@ gdb/ Work around PR libc/13097. * solib.c (update_solib_list): Ignore "linux-vdso.so.1". -Index: gdb-7.11.1/gdb/solib.c +Index: gdb-7.9.50.20150520/gdb/solib.c =================================================================== ---- gdb-7.11.1.orig/gdb/solib.c 2016-02-10 04:19:39.000000000 +0100 -+++ gdb-7.11.1/gdb/solib.c 2016-08-08 17:34:35.000000000 +0200 -@@ -891,8 +891,13 @@ update_solib_list (int from_tty, struct +--- gdb-7.9.50.20150520.orig/gdb/solib.c 2015-05-31 17:04:16.870802493 +0200 ++++ gdb-7.9.50.20150520/gdb/solib.c 2015-05-31 17:04:38.824941054 +0200 +@@ -893,8 +893,11 @@ update_solib_list (int from_tty, struct TRY { @@ -25,8 +25,6 @@ Index: gdb-7.11.1/gdb/solib.c + Work around PR libc/13097. */ + if (!solib_map_sections (i) + && strcmp (i->so_original_name, "linux-vdso.so.1") != 0 -+ && strcmp (i->so_original_name, "linux-vdso32.so.1") != 0 -+ && strcmp (i->so_original_name, "linux-vdso64.so.1") != 0 + && strcmp (i->so_original_name, "linux-gate.so.1") != 0) { not_found++; diff --git a/gdb-libexec-add-index.patch b/gdb-libexec-add-index.patch new file mode 100644 index 0000000..31b2d92 --- /dev/null +++ b/gdb-libexec-add-index.patch @@ -0,0 +1,16 @@ +diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh +index cca7153..73181ec 100755 +--- 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##*/}" + + if test $# != 1; then diff --git a/gdb-libstdc++-v3-python-6.3.1-20170212.tar.bz2 b/gdb-libstdc++-v3-python-6.3.1-20170212.tar.bz2 new file mode 100644 index 0000000..e18f0e7 --- /dev/null +++ b/gdb-libstdc++-v3-python-6.3.1-20170212.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae85ba0279cbf1f3d7d263b5136613c2dd707b80907b3f991db43b3b23432cc1 +size 19356 diff --git a/gdb-libstdc++-v3-python-r225521.tar.bz2 b/gdb-libstdc++-v3-python-r225521.tar.bz2 deleted file mode 100644 index 12c82e0..0000000 --- a/gdb-libstdc++-v3-python-r225521.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c620865e7c00c9c2e644fa693a11170bbf2fec83c078c597e61606c38d2e2562 -size 19254 diff --git a/gdb-linux_perf-bundle.patch b/gdb-linux_perf-bundle.patch new file mode 100644 index 0000000..3fd6f29 --- /dev/null +++ b/gdb-linux_perf-bundle.patch @@ -0,0 +1,232 @@ +Index: gdb-7.11.90.20160904/gdb/nat/linux-btrace.h +=================================================================== +--- gdb-7.11.90.20160904.orig/gdb/nat/linux-btrace.h 2016-09-04 04:02:13.000000000 +0200 ++++ gdb-7.11.90.20160904/gdb/nat/linux-btrace.h 2016-09-04 20:11:47.375275492 +0200 +@@ -28,6 +28,177 @@ + # include + #endif + ++#ifdef PERF_ATTR_SIZE_VER5_BUNDLE ++#ifndef HAVE_LINUX_PERF_EVENT_H ++# error "PERF_ATTR_SIZE_VER5_BUNDLE && !HAVE_LINUX_PERF_EVENT_H" ++#endif ++#ifndef PERF_ATTR_SIZE_VER5 ++#define PERF_ATTR_SIZE_VER5 ++#define perf_event_mmap_page perf_event_mmap_page_bundle ++// kernel-headers-3.10.0-493.el7.x86_64/usr/include/linux/perf_event.h ++/* ++ * Structure of the page that can be mapped via mmap ++ */ ++struct perf_event_mmap_page { ++ __u32 version; /* version number of this structure */ ++ __u32 compat_version; /* lowest version this is compat with */ ++ ++ /* ++ * Bits needed to read the hw events in user-space. ++ * ++ * u32 seq, time_mult, time_shift, index, width; ++ * u64 count, enabled, running; ++ * u64 cyc, time_offset; ++ * s64 pmc = 0; ++ * ++ * do { ++ * seq = pc->lock; ++ * barrier() ++ * ++ * enabled = pc->time_enabled; ++ * running = pc->time_running; ++ * ++ * if (pc->cap_usr_time && enabled != running) { ++ * cyc = rdtsc(); ++ * time_offset = pc->time_offset; ++ * time_mult = pc->time_mult; ++ * time_shift = pc->time_shift; ++ * } ++ * ++ * index = pc->index; ++ * count = pc->offset; ++ * if (pc->cap_user_rdpmc && index) { ++ * width = pc->pmc_width; ++ * pmc = rdpmc(index - 1); ++ * } ++ * ++ * barrier(); ++ * } while (pc->lock != seq); ++ * ++ * NOTE: for obvious reason this only works on self-monitoring ++ * processes. ++ */ ++ __u32 lock; /* seqlock for synchronization */ ++ __u32 index; /* hardware event identifier */ ++ __s64 offset; /* add to hardware event value */ ++ __u64 time_enabled; /* time event active */ ++ __u64 time_running; /* time event on cpu */ ++ union { ++ __u64 capabilities; ++ struct { ++ __u64 cap_bit0 : 1, /* Always 0, deprecated, see commit 860f085b74e9 */ ++ cap_bit0_is_deprecated : 1, /* Always 1, signals that bit 0 is zero */ ++ ++ cap_user_rdpmc : 1, /* The RDPMC instruction can be used to read counts */ ++ cap_user_time : 1, /* The time_* fields are used */ ++ cap_user_time_zero : 1, /* The time_zero field is used */ ++ cap_____res : 59; ++ }; ++ }; ++ ++ /* ++ * If cap_user_rdpmc this field provides the bit-width of the value ++ * read using the rdpmc() or equivalent instruction. This can be used ++ * to sign extend the result like: ++ * ++ * pmc <<= 64 - width; ++ * pmc >>= 64 - width; // signed shift right ++ * count += pmc; ++ */ ++ __u16 pmc_width; ++ ++ /* ++ * If cap_usr_time the below fields can be used to compute the time ++ * delta since time_enabled (in ns) using rdtsc or similar. ++ * ++ * u64 quot, rem; ++ * u64 delta; ++ * ++ * quot = (cyc >> time_shift); ++ * rem = cyc & (((u64)1 << time_shift) - 1); ++ * delta = time_offset + quot * time_mult + ++ * ((rem * time_mult) >> time_shift); ++ * ++ * Where time_offset,time_mult,time_shift and cyc are read in the ++ * seqcount loop described above. This delta can then be added to ++ * enabled and possible running (if index), improving the scaling: ++ * ++ * enabled += delta; ++ * if (index) ++ * running += delta; ++ * ++ * quot = count / running; ++ * rem = count % running; ++ * count = quot * enabled + (rem * enabled) / running; ++ */ ++ __u16 time_shift; ++ __u32 time_mult; ++ __u64 time_offset; ++ /* ++ * If cap_usr_time_zero, the hardware clock (e.g. TSC) can be calculated ++ * from sample timestamps. ++ * ++ * time = timestamp - time_zero; ++ * quot = time / time_mult; ++ * rem = time % time_mult; ++ * cyc = (quot << time_shift) + (rem << time_shift) / time_mult; ++ * ++ * And vice versa: ++ * ++ * quot = cyc >> time_shift; ++ * rem = cyc & (((u64)1 << time_shift) - 1); ++ * timestamp = time_zero + quot * time_mult + ++ * ((rem * time_mult) >> time_shift); ++ */ ++ __u64 time_zero; ++ __u32 size; /* Header size up to __reserved[] fields. */ ++ ++ /* ++ * Hole for extension of the self monitor capabilities ++ */ ++ ++ __u8 __reserved[118*8+4]; /* align to 1k. */ ++ ++ /* ++ * Control data for the mmap() data buffer. ++ * ++ * User-space reading the @data_head value should issue an smp_rmb(), ++ * after reading this value. ++ * ++ * When the mapping is PROT_WRITE the @data_tail value should be ++ * written by userspace to reflect the last read data, after issueing ++ * an smp_mb() to separate the data read from the ->data_tail store. ++ * In this case the kernel will not over-write unread data. ++ * ++ * See perf_output_put_handle() for the data ordering. ++ * ++ * data_{offset,size} indicate the location and size of the perf record ++ * buffer within the mmapped area. ++ */ ++ __u64 data_head; /* head in the data section */ ++ __u64 data_tail; /* user-space written tail */ ++ __u64 data_offset; /* where the buffer starts */ ++ __u64 data_size; /* data buffer size */ ++ ++ /* ++ * AUX area is defined by aux_{offset,size} fields that should be set ++ * by the userspace, so that ++ * ++ * aux_offset >= data_offset + data_size ++ * ++ * prior to mmap()ing it. Size of the mmap()ed area should be aux_size. ++ * ++ * Ring buffer pointers aux_{head,tail} have the same semantics as ++ * data_{head,tail} and same ordering rules apply. ++ */ ++ __u64 aux_head; ++ __u64 aux_tail; ++ __u64 aux_offset; ++ __u64 aux_size; ++}; ++#endif // PERF_ATTR_SIZE_VER5 ++#endif // PERF_ATTR_SIZE_VER5_BUNDLE ++ + struct target_ops; + + #if HAVE_LINUX_PERF_EVENT_H +Index: gdb-7.11.90.20160904/gdb/configure +=================================================================== +--- gdb-7.11.90.20160904.orig/gdb/configure 2016-09-04 20:11:47.238274285 +0200 ++++ gdb-7.11.90.20160904/gdb/configure 2016-09-04 20:11:47.378275519 +0200 +@@ -10601,7 +10601,7 @@ + + #include + #ifndef PERF_ATTR_SIZE_VER5 +-# error ++// error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL + #endif + + _ACEOF +Index: gdb-7.11.90.20160904/gdb/configure.ac +=================================================================== +--- gdb-7.11.90.20160904.orig/gdb/configure.ac 2016-09-04 20:11:47.238274285 +0200 ++++ gdb-7.11.90.20160904/gdb/configure.ac 2016-09-04 20:11:47.379275528 +0200 +@@ -1461,7 +1461,7 @@ + AC_PREPROC_IFELSE(AC_LANG_SOURCE([[ + #include + #ifndef PERF_ATTR_SIZE_VER5 +-# error ++// error // PERF_ATTR_SIZE_VER5_BUNDLE is not available here - Fedora+RHEL + #endif + ]]), [perf_event=yes], [perf_event=no]) + if test "$perf_event" != yes; then +Index: gdb-7.11.90.20160904/gdb/gdb.c +=================================================================== +--- gdb-7.11.90.20160904.orig/gdb/gdb.c 2016-09-04 04:02:13.000000000 +0200 ++++ gdb-7.11.90.20160904/gdb/gdb.c 2016-09-04 20:12:28.018633552 +0200 +@@ -20,11 +20,19 @@ + #include "main.h" + #include "interps.h" + ++#ifdef PERF_ATTR_SIZE_VER5_BUNDLE ++extern "C" void __libipt_init(void); ++#endif ++ + int + main (int argc, char **argv) + { + struct captured_main_args args; + ++#ifdef PERF_ATTR_SIZE_VER5_BUNDLE ++ __libipt_init(); ++#endif ++ + memset (&args, 0, sizeof args); + args.argc = argc; + args.argv = argv; diff --git a/gdb-physname-pr11734-test.patch b/gdb-physname-pr11734-test.patch new file mode 100644 index 0000000..60d5281 --- /dev/null +++ b/gdb-physname-pr11734-test.patch @@ -0,0 +1,226 @@ +http://sourceware.org/ml/gdb-patches/2010-12/msg00263.html + +Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-1.cc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734-1.cc 2011-02-03 22:28:01.000000000 +0100 +@@ -0,0 +1,30 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2010 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@gnu.org */ ++ ++#include "pr11734.h" ++ ++int ++main () ++{ ++ pr11734 *p = new pr11734; ++ p->foo (); ++ return 0; ++} ++ +Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-2.cc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734-2.cc 2011-02-03 22:28:01.000000000 +0100 +@@ -0,0 +1,27 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2010 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@gnu.org */ ++ ++#include "pr11734.h" ++ ++void ++pr11734::foo(void) ++{ ++} ++ +Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-3.cc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734-3.cc 2011-02-03 22:28:01.000000000 +0100 +@@ -0,0 +1,27 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2010 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@gnu.org */ ++ ++#include "pr11734.h" ++ ++void ++pr11734::foo (int a) ++{ ++} ++ +Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734-4.cc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734-4.cc 2011-02-03 22:28:01.000000000 +0100 +@@ -0,0 +1,27 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2010 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@gnu.org */ ++ ++#include "pr11734.h" ++ ++void ++pr11734::foo (char *a) ++{ ++} ++ +Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734.exp 2011-02-03 22:28:01.000000000 +0100 +@@ -0,0 +1,55 @@ ++# Copyright 2010 Free Software Foundation, Inc. ++# ++# Contributed by Red Hat, originally written by Keith Seitz. ++# ++# 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. ++ ++if { [skip_cplus_tests] } { continue } ++ ++set testfile "pr11734" ++set class $testfile ++ ++set srcfiles {} ++for {set i 1} {$i < 5} {incr i} { ++ lappend srcfiles $testfile-$i.cc ++} ++ ++prepare_for_testing pr11734 $testfile $srcfiles {c++ debug} ++ ++if {![runto_main]} { ++ perror "couldn't run to breakpoint" ++ continue ++} ++ ++# An array holding the overload types for the method pr11734::foo. The ++# first element is the overloaded method parameter. The second element ++# is the expected source file number, e.g. "pr11734-?.cc". ++array set tests { ++ "char*" 4 ++ "int" 3 ++ "" 2 ++} ++ ++# Test each overload instance twice: once quoted, once unquoted ++foreach ovld [array names tests] { ++ set method "${class}::foo\($ovld\)" ++ set result "Breakpoint (\[0-9\]).*file .*/$class-$tests($ovld).*" ++ gdb_test "break $method" $result ++ gdb_test "break '$method'" $result ++} ++ ++gdb_exit ++return 0 +Index: gdb-7.2/gdb/testsuite/gdb.cp/pr11734.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.2/gdb/testsuite/gdb.cp/pr11734.h 2011-02-03 22:28:01.000000000 +0100 +@@ -0,0 +1,28 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2010 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@gnu.org */ ++ ++class pr11734 ++{ ++ public: ++ void foo (); ++ void foo (int); ++ void foo (char *); ++}; ++ diff --git a/gdb-physname-pr12273-test.patch b/gdb-physname-pr12273-test.patch new file mode 100644 index 0000000..d301194 --- /dev/null +++ b/gdb-physname-pr12273-test.patch @@ -0,0 +1,95 @@ +http://sourceware.org/ml/gdb-patches/2010-12/msg00264.html + +Index: gdb-7.2/gdb/testsuite/gdb.cp/pr12273.cc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.2/gdb/testsuite/gdb.cp/pr12273.cc 2011-02-03 22:31:01.000000000 +0100 +@@ -0,0 +1,37 @@ ++/* This test case is part of GDB, the GNU debugger. ++ ++ Copyright 2010 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++template ++class GDB ++{ ++ public: ++ static int simple (void) { return 0; } ++ static int harder (T a) { return 1; } ++ template ++ static X even_harder (T a) { return static_cast (a); } ++ int operator == (GDB const& other) ++ { return 1; } ++}; ++ ++int main(int argc, char **argv) ++{ ++ GDB a, b; ++ if (a == b) ++ return GDB::harder('a') + GDB::harder(3) ++ + GDB::even_harder ('a'); ++ return GDB::simple (); ++} +Index: gdb-7.2/gdb/testsuite/gdb.cp/pr12273.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.2/gdb/testsuite/gdb.cp/pr12273.exp 2011-02-03 22:31:01.000000000 +0100 +@@ -0,0 +1,46 @@ ++# Copyright 2010 Free Software Foundation, Inc. ++# ++# Contributed by Red Hat, originally written by Keith Seitz. ++# ++# 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. ++ ++if {[skip_cplus_tests]} { continue } ++ ++set testfile "pr12273" ++# Do NOT compile with debug flag. ++prepare_for_testing pr12273 $testfile $testfile.cc {c++} ++ ++gdb_test_no_output "set language c++" ++ ++# A list of minimal symbol names to check. ++# Note that GDB::even_harder(char) is quoted and includes ++# the return type. This is necessary because this is the demangled name ++# of the minimal symbol. ++set min_syms [list \ ++ "GDB::operator ==" \ ++ "GDB::operator==(GDB const&)" \ ++ "GDB::harder(char)" \ ++ "GDB::harder(int)" \ ++ {"int GDB::even_harder(char)"} \ ++ "GDB::simple()"] ++ ++foreach sym $min_syms { ++ if {[gdb_breakpoint $sym]} { ++ pass "setting breakpoint at $sym" ++ } ++} ++ ++gdb_exit diff --git a/gdb-ppc-power7-test.patch b/gdb-ppc-power7-test.patch index cbd7642..449dfce 100644 --- a/gdb-ppc-power7-test.patch +++ b/gdb-ppc-power7-test.patch @@ -26,7 +26,7 @@ + +set testfile "powerpc-power7" +set srcfile ${testfile}.s -+set objfile ${objdir}/${subdir}/${testfile}.o ++set objfile [standard_output_file ${testfile}.o] + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } { + untested "PowerPC Power7 instructions disassembly" diff --git a/gdb-python-gil.patch b/gdb-python-gil.patch index 6d8dcf5..a276c6c 100644 --- a/gdb-python-gil.patch +++ b/gdb-python-gil.patch @@ -1,8 +1,8 @@ -Index: gdb-7.9.50.20150520/gdb/doc/python.texi +Index: gdb-7.11.50.20160630/gdb/doc/python.texi =================================================================== ---- gdb-7.9.50.20150520.orig/gdb/doc/python.texi 2015-05-31 17:57:12.431593983 +0200 -+++ gdb-7.9.50.20150520/gdb/doc/python.texi 2015-05-31 17:57:14.654607708 +0200 -@@ -229,6 +229,14 @@ returned as a string. The default is @c +--- gdb-7.11.50.20160630.orig/gdb/doc/python.texi 2016-07-03 16:30:37.009338358 +0200 ++++ gdb-7.11.50.20160630/gdb/doc/python.texi 2016-07-03 16:30:42.812387867 +0200 +@@ -229,6 +229,14 @@ return value is @code{None}. If @var{to_string} is @code{True}, the @value{GDBN} virtual terminal will be temporarily set to unlimited width and height, and its pagination will be disabled; @pxref{Screen Size}. @@ -17,11 +17,11 @@ Index: gdb-7.9.50.20150520/gdb/doc/python.texi @end defun @findex gdb.breakpoints -Index: gdb-7.9.50.20150520/gdb/python/python-internal.h +Index: gdb-7.11.50.20160630/gdb/python/python-internal.h =================================================================== ---- gdb-7.9.50.20150520.orig/gdb/python/python-internal.h 2015-05-31 17:57:12.432593989 +0200 -+++ gdb-7.9.50.20150520/gdb/python/python-internal.h 2015-05-31 17:57:14.654607708 +0200 -@@ -142,6 +142,8 @@ typedef int Py_ssize_t; +--- gdb-7.11.50.20160630.orig/gdb/python/python-internal.h 2016-07-03 16:30:37.010338366 +0200 ++++ gdb-7.11.50.20160630/gdb/python/python-internal.h 2016-07-03 16:30:42.812387867 +0200 +@@ -140,6 +140,8 @@ #define PyGILState_Release(ARG) ((void)(ARG)) #define PyEval_InitThreads() #define PyThreadState_Swap(ARG) ((void)(ARG)) @@ -30,11 +30,11 @@ Index: gdb-7.9.50.20150520/gdb/python/python-internal.h #define PyEval_ReleaseLock() #endif -Index: gdb-7.9.50.20150520/gdb/python/python.c +Index: gdb-7.11.50.20160630/gdb/python/python.c =================================================================== ---- gdb-7.9.50.20150520.orig/gdb/python/python.c 2015-05-31 17:57:14.656607720 +0200 -+++ gdb-7.9.50.20150520/gdb/python/python.c 2015-05-31 18:02:08.891424227 +0200 -@@ -627,13 +627,18 @@ execute_gdb_command (PyObject *self, PyO +--- gdb-7.11.50.20160630.orig/gdb/python/python.c 2016-07-03 16:30:37.011338375 +0200 ++++ gdb-7.11.50.20160630/gdb/python/python.c 2016-07-03 16:31:16.324673783 +0200 +@@ -619,13 +619,18 @@ { const char *arg; PyObject *from_tty_obj = NULL, *to_string_obj = NULL; @@ -57,7 +57,7 @@ Index: gdb-7.9.50.20150520/gdb/python/python.c return NULL; from_tty = 0; -@@ -654,12 +659,28 @@ execute_gdb_command (PyObject *self, PyO +@@ -646,6 +651,15 @@ to_string = cmp; } @@ -73,8 +73,9 @@ Index: gdb-7.9.50.20150520/gdb/python/python.c TRY { /* Copy the argument text in case the command modifies it. */ - char *copy = xstrdup (arg); +@@ -653,6 +667,13 @@ struct cleanup *cleanup = make_cleanup (xfree, copy); + struct interp *interp; + /* In the case of long running GDB commands, allow the user to + release the Python GIL acquired by Python. Restore the GIL @@ -83,10 +84,10 @@ Index: gdb-7.9.50.20150520/gdb/python/python.c + if (release_gil) + state = PyEval_SaveThread(); + - make_cleanup_restore_integer (&interpreter_async); - interpreter_async = 0; + make_cleanup_restore_integer (¤t_ui->async); + current_ui->async = 0; -@@ -672,11 +693,23 @@ execute_gdb_command (PyObject *self, PyO +@@ -671,11 +692,23 @@ execute_command (copy, from_tty); } @@ -111,12 +112,11 @@ Index: gdb-7.9.50.20150520/gdb/python/python.c } END_CATCH -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.python/py-gil-mthread.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.python/py-gil-mthread.c 2015-05-31 17:57:14.656607720 +0200 -@@ -0,0 +1,12 @@ +--- /dev/null 2016-09-12 21:37:05.332693927 +0200 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.python/py-gil-mthread.c 2016-09-12 21:51:53.750317187 +0200 +@@ -0,0 +1,13 @@ +#include ++#include + +int +main (void) @@ -128,10 +128,8 @@ Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.python/py-gil-mthread.c + printf ("Sleeping %d\n", i); + } +} -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.python/py-gil-mthread.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.python/py-gil-mthread.exp 2015-05-31 17:57:14.657607726 +0200 +--- /dev/null 2016-09-12 21:37:05.332693927 +0200 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.python/py-gil-mthread.exp 2016-09-12 21:52:38.605750360 +0200 @@ -0,0 +1,69 @@ +# Copyright (C) 2014 Free Software Foundation, Inc. + @@ -170,7 +168,7 @@ Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.python/py-gil-mthread.exp +set sleeping_last -1 +set hello_last 0 +set minimal 5 -+gdb_test_multiple "python execfile('$srcdir/$subdir/$srcfile2')" $test { ++gdb_test_multiple "python exec (open ('$srcdir/$subdir/$srcfile2').read ())" $test { + -re "Error: unable to start thread\r\n" { + fail $test + # Not $gdb_prompt-synced! @@ -202,12 +200,13 @@ Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.python/py-gil-mthread.exp + } + } +} -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.python/py-gil-mthread.py -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.python/py-gil-mthread.py 2015-05-31 17:57:14.657607726 +0200 -@@ -0,0 +1,22 @@ -+import thread +--- /dev/null 2016-09-12 21:37:05.332693927 +0200 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.python/py-gil-mthread.py 2016-09-12 21:59:02.668459286 +0200 +@@ -0,0 +1,28 @@ ++try: ++ import thread ++except: ++ import _thread +import time +import gdb + @@ -217,15 +216,18 @@ Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.python/py-gil-mthread.py + while count < 10: + time.sleep(1) + count += 1 -+ print "Hello (", count, ")" ++ print ("Hello (", count, ")") + +# Create a threads a continue +try: -+ thread.start_new_thread( print_thread_hello, ()) ++ thread.start_new_thread (print_thread_hello, ()) + gdb.execute ("continue", release_gil=True) -+ +except: -+ print "Error: unable to start thread" ++ try: ++ _thread.start_new_thread (print_thread_hello, ()) ++ gdb.execute ("continue", release_gil=True) ++ except: ++ print ("Error: unable to start thread") + +while 1: + pass diff --git a/gdb-readline62-ask-more-rh.patch b/gdb-readline62-ask-more-rh.patch index 99b125f..a7372f8 100644 --- a/gdb-readline62-ask-more-rh.patch +++ b/gdb-readline62-ask-more-rh.patch @@ -1,17 +1,18 @@ -diff -dup -rup gdb-7.10.50.20160106-orig/gdb/event-top.c gdb-7.10.50.20160106/gdb/event-top.c ---- gdb-7.10.50.20160106-orig/gdb/event-top.c 2016-01-09 14:51:02.324243506 +0100 -+++ gdb-7.10.50.20160106/gdb/event-top.c 2016-01-09 14:51:33.029434121 +0100 -@@ -1033,6 +1033,13 @@ set_async_editing_command (char *args, i - void - gdb_setup_readline (void) +Index: gdb-7.11.50.20160630/gdb/event-top.c +=================================================================== +--- gdb-7.11.50.20160630.orig/gdb/event-top.c 2016-07-03 16:32:36.108342159 +0200 ++++ gdb-7.11.50.20160630/gdb/event-top.c 2016-07-03 16:32:59.787523733 +0200 +@@ -1252,6 +1252,13 @@ { + 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-rhbz1007614-memleak-infpy_read_memory-test.patch b/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch new file mode 100644 index 0000000..3f4b281 --- /dev/null +++ b/gdb-rhbz1007614-memleak-infpy_read_memory-test.patch @@ -0,0 +1,162 @@ +Original message by Tom Tromey: + + + Message-ID: <871uoc1va3.fsf@fleche.redhat.com> + +Comment from Sergio Durigan Junior: + + In order to correctly test this patch, I wrote a testcase based on Jan + Kratochvil's . The + testcase, which can be seen below, tests GDB in order to see if the + amount of memory being leaked is minimal, as requested in the bugzilla. + It is hard to define what "minimum" is, so I ran the testcase on all + supported RHEL architectures and came up with an average. + +commit cc0265cdda9dc7e8665e8bfcf5b4477489daf27c +Author: Tom Tromey +Date: Wed Mar 28 17:38:08 2012 +0000 + + * python/py-inferior.c (infpy_read_memory): Remove cleanups and + explicitly free 'buffer' on exit paths. Decref 'membuf_object' + before returning. + +Index: gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c +=================================================================== +--- /dev/null ++++ gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.c +@@ -0,0 +1,27 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2014 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++static struct x ++ { ++ char unsigned u[4096]; ++ } x, *px = &x; ++ ++int ++main (int argc, char *argv[]) ++{ ++ return 0; ++} +Index: gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp +=================================================================== +--- /dev/null ++++ gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.exp +@@ -0,0 +1,68 @@ ++# Copyright 2014 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++set testfile py-gdb-rhbz1007614-memleak-infpy_read_memory ++set srcfile ${testfile}.c ++set binfile ${objdir}/${subdir}/${testfile} ++ ++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { ++ return -1 ++} ++ ++if { [skip_python_tests] } { continue } ++ ++set pid_of_gdb [exp_pid -i [board_info host fileid]] ++ ++proc memory_v_pages_get {} { ++ global pid_of_gdb ++ set fd [open "/proc/$pid_of_gdb/statm"] ++ gets $fd line ++ close $fd ++ # number of pages of virtual memory ++ scan $line "%d" drs ++ return $drs ++} ++ ++if { ![runto_main] } { ++ untested $testfile.exp ++ return -1 ++} ++ ++set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py] ++ ++gdb_test "source ${remote_python_file}" "" ++ ++gdb_test "hello-world" "" ++ ++set kbytes_before [memory_v_pages_get] ++verbose -log "kbytes_before = $kbytes_before" ++ ++gdb_test "hello-world" "" ++ ++set kbytes_after [memory_v_pages_get] ++verbose -log "kbytes_after = $kbytes_after" ++ ++set kbytes_diff [expr $kbytes_after - $kbytes_before] ++verbose -log "kbytes_diff = $kbytes_diff" ++ ++# The value "1000" was calculated by running a few GDB sessions with this ++# testcase, and seeing how much (in average) the memory consumption ++# increased after the "hello-world" command issued above. The average ++# was around 500 bytes, so I chose 1000 as a high estimate. ++if { $kbytes_diff > 1000 } { ++ fail "there is a memory leak on GDB (RHBZ 1007614)" ++} else { ++ pass "there is not a memory leak on GDB (RHBZ 1007614)" ++} +Index: gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py +=================================================================== +--- /dev/null ++++ gdb-7.2/gdb/testsuite/gdb.python/py-gdb-rhbz1007614-memleak-infpy_read_memory.py +@@ -0,0 +1,30 @@ ++# Copyright (C) 2014 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++class HelloWorld (gdb.Command): ++ """Greet the whole world.""" ++ ++ def __init__ (self): ++ super (HelloWorld, self).__init__ ("hello-world", ++ gdb.COMMAND_OBSCURE) ++ ++ def invoke (self, arg, from_tty): ++ px = gdb.parse_and_eval("px") ++ core = gdb.inferiors()[0] ++ for i in range(256 * 1024): ++ chunk = core.read_memory(px, 4096) ++ print "Hello, World!" ++ ++HelloWorld () diff --git a/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch b/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch new file mode 100644 index 0000000..108434f --- /dev/null +++ b/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch @@ -0,0 +1,226 @@ +These testcases have been created by compiling glibc-2.17-78 on +RHEL-7.1 s390x/ppc64 boxes, and then taking the "select.o" file +present at $builddir/misc/select.o. + +Index: gdb-7.6.1/gdb/testsuite/gdb.arch/s390x-prologue-skip.exp +=================================================================== +--- /dev/null ++++ gdb-7.6.1/gdb/testsuite/gdb.arch/s390x-prologue-skip.exp +@@ -0,0 +1,34 @@ ++# Copyright 2015 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++if { ![istarget s390x-*linux-*] || ![is_lp64_target] } { ++ verbose "Skipping s390x-prologue-skip.exp" ++ return ++} ++ ++set testfile "s390x-prologue-skip" ++set uufile "${srcdir}/${subdir}/${testfile}.o.uu" ++set ofile "${srcdir}/${subdir}/${testfile}.o" ++ ++if { [catch "system \"uudecode -o ${ofile} ${uufile}\"" ] != 0 } { ++ untested "failed uudecode" ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_load $ofile ++ ++gdb_test "break select" "Breakpoint $decimal at 0x48: file ../sysdeps/unix/syscall-template.S, line 81." "breakpoint on select" +Index: gdb-7.6.1/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu +=================================================================== +--- /dev/null ++++ gdb-7.6.1/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu +@@ -0,0 +1,64 @@ ++begin 644 s390x-prologue-skip.o.uu ++M?T5,1@("`0`````````````!`!8````!```````````````````````````` ++M``+```````!```````!``!(`#^LE\!``).O?\&@`)+D$`.^G^_]@X^#P```D ++MP.4`````N00``NLE\+``!`J.N00`TKD$`"#`Y0````"Y!``MZ]_Q"``$I_0` ++M"L`0`````+\/$`"G=/_7"HZG2?`!N2$`),"T``````?^````5@`"````.0$! ++M^PX-``$!`0$````!```!+BXO7-C86QL+71E;7!L ++M871E+E,``0`````)`@```````````]```0)F$P("``$!````CP`"``````@! ++M```````````````````````````N+B]S>7-D97!S+W5N:7@OE(``7@. ++M`1L,#Z`!````````&````!P`````````1`!,CP6.!HT'2`[``@```!`````X ++M`````````"```````"YS>6UT86(`+G-T``````````&````!`````&``````````@````````` ++M&````%<````!``````````````````````````````$"`````````),````` ++M```````````````!``````````````!2````!``````````````````````` ++M```````)^`````````!@````$`````@`````````"``````````8````8P`` ++M``$``````````````````````````````94`````````%``````````````` ++M``````$``````````````'8````!``````````````````````````````&P ++M`````````#`````````````````````0``````````````!Q````!``````` ++M```````````````````````*6``````````P````$`````L`````````"``` ++M```````8````B@````$``````````@```````````````````>`````````` ++M2`````````````````````@``````````````(4````$```````````````` ++M``````````````J(`````````#`````0````#0`````````(`````````!@` ++M```1`````P`````````````````````````````"*`````````"4```````` ++M`````````````0```````````````0````(````````````````````````` ++M````!T`````````!L````!$````*``````````@`````````&`````D````# ++M``````````````````````````````CP`````````(X````````````````` ++M```!`````````````````````````````````````````````````P```0`` ++M`````````````````````````P```P```````````````````````````P`` ++M!````````````````````````````P``"``````````````````````````` ++M`P``"@```````````````````````````P``!@`````````````````````` ++M`````P``"P```````````````````````````P``#0`````````````````` ++M`````````P``!0`````````````````````````!$``````````````````` ++M```````````;$``````````````````````````````V$@```0````````!( ++M`````````"`````_$`````````````````````````````!7$@```0`````` ++M``!6`````````!````!I$`````````````````````````````!Y(@```0`` ++M``````!(`````````"````"'(@```0````````!(`````````"``7U]L:6)C ++M7V5N86)L95]A. ++ ++if { ![istarget powerpc64-*linux-*] || ![is_lp64_target] } { ++ verbose "Skipping ppc64-prologue-skip.exp" ++ return ++} ++ ++set testfile "ppc64-prologue-skip" ++set uufile "${srcdir}/${subdir}/${testfile}.o.uu" ++set ofile "${srcdir}/${subdir}/${testfile}.o" ++ ++if { [catch "system \"uudecode -o ${ofile} ${uufile}\"" ] != 0 } { ++ untested "failed uudecode" ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_load $ofile ++ ++gdb_test "break ___newselect_nocancel" "Breakpoint $decimal at 0xc: file ../sysdeps/unix/syscall-template.S, line 81." "breakpoint on ___newselect_nocancel" +Index: gdb-7.6.1/gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu +=================================================================== +--- /dev/null ++++ gdb-7.6.1/gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu +@@ -0,0 +1,70 @@ ++begin 644 ppc64-skip-prologue.o.uu ++M?T5,1@("`0`````````````!`!4````!```````````````````````````` ++M``-(``````!```````!``!0`$8%-B-`L"@``0,(`-#@``(Y$```"3.,`('P( ++M`J;X`0`0^"'_D4@```%@````Z`$`@#@A`'!\"`.F3H``(/@A_X%]*`*F^2$` ++MD/CA`-#XP0#(^*$`P/B!`+CX80"P2````6````#X80!PZ.$`T.C!`,CHH0#` ++MZ($`N.AA`+`X``".1````GP``";X80!X^`$`B.AA`'!(```!8````.DA`)#H ++M`0"(Z&$`>'TH`Z9\#_$@."$`@$SC`"!+__]@```````,($``````````O``( ++M7U]S96QE8W0```````````````````````````!6``(````Y!`'[#@T``0$! ++M`0````$```$N+B]S>7-D97!S+W5N:7@``'-Y"]S>7-C86QL+71E;7!L871E ++M+E,`+W)O;W0O9VQI8F,O9VQI8F,M,BXQ-RTW."YE;#$$!&PP!```` ++M`#`````8`````````+P`20YP$4%^1`X`009!0@Z``4(107Y2$49_20X`!D$& ++M1@``````+G-Y;71A8@`N`````````!(````$@````$`````````"``````````8```` ++M)@````$``````````P```````````````````1@````````````````````` ++M``````````$``````````````"P````(``````````,````````````````` ++M``$8```````````````````````````````!```````````````V`````0`` ++M```````#```````````````````!&``````````0```````````````````` ++M"```````````````,0````0`````````````````````````````"L`````` ++M````,````!(````%``````````@`````````&````#L````!```````````` ++M``````````````````$H```````````````````````````````!```````` ++M``````!0`````0`````````````````````````````!*`````````!:```` ++M`````````````````0``````````````2P````0````````````````````` ++M````````"O``````````&````!(````(``````````@`````````&````&$` ++M```!``````````````````````````````&"`````````),````````````` ++M```````!``````````````!<````!``````````````````````````````+ ++M"`````````!@````$@````H`````````"``````````8````;0````$````` ++M`````````````````````````A4`````````%`````````````````````$` ++M`````````````(`````!``````````````````````````````(P```````` ++M`#`````````````````````0``````````````![````!``````````````` ++M```````````````+:``````````P````$@````T`````````"``````````8 ++M````E`````$``````````@```````````````````F``````````2``````` ++M``````````````@``````````````(\````$```````````````````````` ++M``````N8`````````!@````2````#P`````````(`````````!@````1```` ++M`P`````````````````````````````"J`````````">```````````````` ++M`````0```````````````0````(`````````````````````````````"$@` ++M```````!L````!,````+``````````@`````````&`````D````#```````` ++M``````````````````````GX`````````'H````````````````````!```` ++M`````````````````````````````````````````````P```0`````````` ++M`````````````````P```P```````````````````````````P``!``````` ++M`````````````````````P``!0```````````````````````````P``"@`` ++M`````````````````````````P``#````````````````````````````P`` ++M"````````````````````````````P``#0`````````````````````````` ++M`P``#P```````````````````````````P``!P`````````````````````` ++M```!$@``!0```````````````````-@````*$@```0`````````,```````` ++M`#`````@$``````````````````````````````P$``````````````````` ++M``````````!*$`````````````````````````````!E(@``!0`````````` ++M`````````-@```!S(@``!0```````````````````-@`7U]S96QE8W0`7U]? ++M;F5W6YC8V%N8V5L`%]?;&EB8U]D:7-A8FQE7V%S>6YC8V%N8V5L`%]? ++M;&EB8U]S96QE8W0` +Message-ID: <1368136582.30058.7.camel@soleil> + + From: Philippe Waroquiers + To: gdb-patches at sourceware dot org + Subject: RFA: fix gdb_assert caused by 'catch signal ...' and fork + Date: Thu, 09 May 2013 23:56:22 +0200 + + The attached patch fixes a gdb_assert caused by the combination of catch + signal and fork: + break-catch-sig.c:152: internal-error: signal_catchpoint_remove_location: Assertion `signal_catch_counts[iter] > 0' failed. + + The problem is that the signal_catch_counts is decremented by detach_breakpoints. + The fix consists in not detaching breakpoint locations of type bp_loc_other. + The patch introduces a new test. + +Comments by Sergio Durigan Junior: + + I addded a specific testcase for this patch, which tests exactly the + issue that the customer is facing. This patch does not solve the + whole problem of catching a syscall and forking (for more details, + see , + specifically comment #3), but it solves the issue reported by the + customer. + + I also removed the original testcase of this patch, because it + relied on "catch signal", which is a command that is not implemented + in this version of GDB. + +commit bd9673a4ded96ea5c108601501c8e59003ea1be6 +Author: Philippe Waroquiers +Date: Tue May 21 18:47:05 2013 +0000 + + Fix internal error caused by interaction between catch signal and fork + +Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.c 2016-10-20 21:03:09.584272695 +0200 +@@ -0,0 +1,11 @@ ++#include ++#include ++ ++int ++main (int argc, char **argv) ++{ ++ if (fork () == 0) ++ sleep (1); ++ chdir ("."); ++ return 0; ++} +Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1149205-catch-syscall-fork.exp 2016-10-20 21:04:13.337771174 +0200 +@@ -0,0 +1,58 @@ ++# Copyright 2015 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++if { [is_remote target] || ![isnative] } then { ++ continue ++} ++ ++set testfile "gdb-rhbz1149205-catch-syscall-fork" ++set srcfile ${testfile}.c ++set binfile [standard_output_file ${testfile}] ++ ++# Until "catch syscall" is implemented on other targets... ++if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then { ++ continue ++} ++ ++# This shall be updated whenever 'catch syscall' is implemented ++# on some architecture. ++#if { ![istarget "i\[34567\]86-*-linux*"] ++if { ![istarget "x86_64-*-linux*"] && ![istarget "i\[34567\]86-*-linux*"] ++ && ![istarget "powerpc-*-linux*"] && ![istarget "powerpc64-*-linux*"] ++ && ![istarget "sparc-*-linux*"] && ![istarget "sparc64-*-linux*"] } { ++ continue ++} ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { ++ untested ${testfile}.exp ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load $binfile ++ ++if { ![runto_main] } { ++ return -1 ++} ++ ++gdb_test "catch syscall chdir" \ ++ "Catchpoint $decimal \\\(syscall (.)?chdir(.)? \\\[$decimal\\\]\\\)" \ ++ "catch syscall chdir" ++ ++gdb_test "continue" \ ++ "Continuing\.\r\n.*\r\nCatchpoint $decimal \\\(call to syscall .?chdir.?.*" \ ++ "continue from catch syscall after fork" diff --git a/gdb-rhbz1156192-recursive-dlopen-test.patch b/gdb-rhbz1156192-recursive-dlopen-test.patch new file mode 100644 index 0000000..d55849a --- /dev/null +++ b/gdb-rhbz1156192-recursive-dlopen-test.patch @@ -0,0 +1,341 @@ +Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libbar.c 2016-10-22 22:10:13.262634144 +0200 +@@ -0,0 +1,30 @@ ++/* Testcase for recursive dlopen calls. ++ ++ Copyright (C) 2014 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 . */ ++ ++/* This test was copied from glibc's testcase called ++ and related files. */ ++ ++#include ++#include ++ ++void ++bar (void) ++{ ++ printf ("Called bar.\n"); ++} +Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen-libfoo.c 2016-10-22 22:10:13.262634144 +0200 +@@ -0,0 +1,30 @@ ++/* Testcase for recursive dlopen calls. ++ ++ Copyright (C) 2014 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 . */ ++ ++/* This test was copied from glibc's testcase called ++ and related files. */ ++ ++#include ++#include ++ ++void ++foo (void) ++{ ++ printf ("Called foo.\n"); ++} +Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c 2016-10-22 22:10:13.262634144 +0200 +@@ -0,0 +1,124 @@ ++/* Testcase for recursive dlopen calls. ++ ++ Copyright (C) 2014 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 . */ ++ ++/* This test was copied from glibc's testcase called ++ and related files. */ ++ ++#include ++#include ++#include ++#include ++ ++#define DSO "gdb-rhbz1156192-recursive-dlopen-libfoo.so" ++#define FUNC "foo" ++ ++#define DSO1 "gdb-rhbz1156192-recursive-dlopen-libbar.so" ++#define FUNC1 "bar" ++ ++/* Prototype for my hook. */ ++void *custom_malloc_hook (size_t, const void *); ++ ++/* Pointer to old malloc hooks. */ ++void *(*old_malloc_hook) (size_t, const void *); ++ ++/* Call function func_name in DSO dso_name via dlopen. */ ++void ++call_func (const char *dso_name, const char *func_name) ++{ ++ int ret; ++ void *dso; ++ void (*func) (void); ++ char *err; ++ ++ /* Open the DSO. */ ++ dso = dlopen (dso_name, RTLD_NOW|RTLD_GLOBAL); ++ if (dso == NULL) ++ { ++ err = dlerror (); ++ fprintf (stderr, "%s\n", err); ++ exit (1); ++ } ++ /* Clear any errors. */ ++ dlerror (); ++ ++ /* Lookup func. */ ++ *(void **) (&func) = dlsym (dso, func_name); ++ if (func == NULL) ++ { ++ err = dlerror (); ++ if (err != NULL) ++ { ++ fprintf (stderr, "%s\n", err); ++ exit (1); ++ } ++ } ++ /* Call func twice. */ ++ (*func) (); ++ ++ /* Close the library and look for errors too. */ ++ ret = dlclose (dso); ++ if (ret != 0) ++ { ++ err = dlerror (); ++ fprintf (stderr, "%s\n", err); ++ exit (1); ++ } ++ ++} ++ ++/* Empty hook that does nothing. */ ++void * ++custom_malloc_hook (size_t size, const void *caller) ++{ ++ void *result; ++ /* Restore old hooks. */ ++ __malloc_hook = old_malloc_hook; ++ /* First call a function in another library via dlopen. */ ++ call_func (DSO1, FUNC1); ++ /* Called recursively. */ ++ result = malloc (size); ++ /* Restore new hooks. */ ++ __malloc_hook = custom_malloc_hook; ++ return result; ++} ++ ++int ++main (void) ++{ ++ ++ /* Save old hook. */ ++ old_malloc_hook = __malloc_hook; ++ /* Install new hook. */ ++ __malloc_hook = custom_malloc_hook; ++ ++ /* Attempt to dlopen a shared library. This dlopen will ++ trigger an access to the ld.so.cache, and that in turn ++ will require a malloc to duplicate data in the cache. ++ The malloc will call our malloc hook which calls dlopen ++ recursively, and upon return of this dlopen the non-ref ++ counted ld.so.cache mapping will be unmapped. We will ++ return to the original dlopen and crash trying to access ++ dlopened data. */ ++ call_func (DSO, FUNC); ++ ++ /* Restore old hook. */ ++ __malloc_hook = old_malloc_hook; ++ ++ return 0; ++} +Index: gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp 2016-10-24 23:21:58.043064177 +0200 +@@ -0,0 +1,137 @@ ++# Copyright 2014 Free Software Foundation, Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++if { [skip_shlib_tests] } { ++ return 0 ++} ++ ++# Library foo ++set libname1 "gdb-rhbz1156192-recursive-dlopen-libfoo" ++set srcfile_lib1 ${srcdir}/${subdir}/${libname1}.c ++set binfile_lib1 [standard_output_file ${libname1}.so] ++# Library bar ++set libname2 "gdb-rhbz1156192-recursive-dlopen-libbar" ++set srcfile_lib2 ${srcdir}/${subdir}/${libname2}.c ++set binfile_lib2 [standard_output_file ${libname2}.so] ++ ++set testfile "gdb-rhbz1156192-recursive-dlopen" ++set srcfile ${testfile}.c ++set executable ${testfile} ++set binfile [standard_output_file ${executable}] ++ ++if { [gdb_compile_shlib ${srcfile_lib1} ${binfile_lib1} \ ++ { debug "additional_flags=-fPIC" }] != "" } { ++ untested "Could not compile ${binfile_lib1}" ++ return -1 ++} ++ ++if { [gdb_compile_shlib ${srcfile_lib2} ${binfile_lib2} \ ++ { debug "additional_flags=-fPIC" }] != "" } { ++ untested "Could not compile ${binfile_lib2}" ++ return -1 ++} ++ ++if { [prepare_for_testing ${testfile}.exp ${executable} ${srcfile} \ ++ [ list debug shlib_load "additional_flags=-Wno-deprecated-declarations" ]] } { ++ untested "Could not compile ${executable}" ++ return -1 ++} ++ ++proc do_test { has_libfoo has_libbar } { ++ global hex binfile_lib2 binfile_lib1 gdb_prompt ++ set libbar_match "[string_to_regexp $binfile_lib2]" ++ set libfoo_match "[string_to_regexp $binfile_lib1]" ++ ++ gdb_test_multiple "info shared" "info shared" { ++ -re ".*$libfoo_match\r\n.*$libbar_match\(\r\n.*Shared library is missing\)?.*\r\n${gdb_prompt} $" { ++ if { $has_libfoo && $has_libbar } { ++ pass "matched libfoo and libbar" ++ } else { ++ fail "matched libfoo and libbar (has_libfoo = $has_libfoo, has_libbar = $has_libbar)" ++ } ++ } ++ -re ".*$libfoo_match\(\r\n.*Shared library is missing\)?.*\r\n${gdb_prompt} $" { ++ if { $has_libfoo && !$has_libbar } { ++ pass "matched libfoo" ++ } else { ++ fail "matched libfoo (has_libfoo = $has_libfoo, has_libbar = $has_libbar)" ++ } ++ } ++ -re ".*$libbar_match\(\r\n.*Shared library is missing\)?.*\r\n${gdb_prompt} $" { ++ if { $has_libbar && !$has_libfoo } { ++ pass "matched libbar" ++ } else { ++ fail "matched libbar (has_libfoo = $has_libfoo, has_libbar = $has_libbar)" ++ } ++ } ++ "\r\n${gdb_prompt} $" { ++ if { !$has_libfoo && !$has_libbar } { ++ pass "did not match libfoo nor libbar" ++ } else { ++ fail "did not match libfoo nor libbar (has_libfoo = $has_libfoo, has_libbar = $has_libbar)" ++ } ++ } ++ } ++} ++ ++proc test_stop_on_solib_events { } { ++ set pass 0 ++ # This variable holds the information about whether libfoo and ++ # libbar (respectively) are expected in the "info shared" output. ++ set solib_event_order { { 0 0 } { 0 0 } { 0 0 } { 0 1 } \ ++ { 0 1 } { 0 0 } { 0 0 } { 0 1 } \ ++ { 0 1 } { 0 0 } { 0 0 } { 0 1 } \ ++ { 0 1 } { 0 0 } { 0 0 1 } { 1 1 } \ ++ { 1 1 } { 1 0 } { 1 0 } { 1 1 } \ ++ { 1 1 } { 1 0 1 } { 1 0 } { 1 0 } } ++ ++ with_test_prefix "stop-on-solib-events" { ++ gdb_test_no_output "set stop-on-solib-events 1" "setting stop-on-solib-events" ++ ++ gdb_run_cmd ++ foreach l $solib_event_order { ++ incr pass ++ with_test_prefix "pass #$pass" { ++ set should_be_corrupted [expr 0+0[lindex $l 2]] ++ do_test [lindex $l 0] [lindex $l 1] ++ set test "continue" ++ global gdb_prompt ++ gdb_test_multiple $test $test { ++ -re "\r\nwarning: Corrupted shared library list:.*\r\nStopped due to shared library event.*\r\n$gdb_prompt $" { ++ set corrupted 1 ++ pass $test ++ } ++ -re "\r\nStopped due to shared library event.*\r\n$gdb_prompt $" { ++ set corrupted 0 ++ pass $test ++ } ++ } ++ set test "corrupted=$corrupted but should_be_corrupted=$should_be_corrupted" ++ if {$corrupted == $should_be_corrupted} { ++ pass $test ++ } else { ++ fail $test ++ } ++ } ++ } ++ # In the last pass we do not expect to see libfoo or libbar. ++ incr pass ++ with_test_prefix "pass #$pass" { ++ do_test 0 0 ++ } ++ } ++} ++ ++test_stop_on_solib_events diff --git a/gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch b/gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch new file mode 100644 index 0000000..e34fea0 --- /dev/null +++ b/gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch @@ -0,0 +1,125 @@ +Comments from Sergio Durigan Junior: + + The "proper" fix for this whole problem would be to backport the + "ambiguous linespec" patch series. However, it is really not + recommended to do that for RHEL GDB, because the patch series is too + big and could introduce unwanted regressions. Instead, what we + chose to do was to replace the gdb_assert call by a warning (which + allows the user to continue the debugging session), and tell the + user that, although more than one location was found for his/her + breakpoint, only one will be used. + +Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc 2016-10-20 21:06:31.849854180 +0200 +@@ -0,0 +1,22 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2015 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++int ++main (int argc, char *argv[]) ++{ ++ return 0; ++} +Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc 2016-10-20 21:06:31.850854188 +0200 +@@ -0,0 +1,26 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2015 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++class C ++ { ++ public: ++ C () {} ++ C (int x) {} ++ }; ++ ++C a; ++C b (1); +Index: gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp 2016-10-20 21:09:33.408270526 +0200 +@@ -0,0 +1,51 @@ ++# Copyright 2015 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++if { [skip_cplus_tests] } { continue } ++if { [skip_shlib_tests] } { continue } ++if { [is_remote target] } { continue } ++if { [target_info exists use_gdb_stub] } { continue } ++ ++set testfile gdb-rhbz1186476-internal-error-unqualified-name-re-set-main ++set srcfile $testfile.cc ++set executable $testfile ++set binfile [standard_output_file $executable] ++ ++set libtestfile gdb-rhbz1186476-internal-error-unqualified-name-re-set ++set libsrcfile $libtestfile.cc ++set sofile [standard_output_file lib$libtestfile.so] ++ ++# Create and source the file that provides information about the compiler ++# used to compile the test case. ++if [get_compiler_info "c++"] { ++ return -1 ++} ++ ++if { [gdb_compile_shlib $srcdir/$subdir/$libsrcfile $sofile {debug c++ "additional_flags=-fPIC"}] != "" ++ || [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list additional_flags=-Wl,-rpath,[file dirname ${sofile}] "c++" shlib=${sofile} ]] != ""} { ++ untested $libtestfile.exp ++ return -1 ++} ++ ++clean_restart $executable ++ ++gdb_test_no_output "set breakpoint pending on" ++# gdb_breakpoint would print a failure because of some warning messages ++gdb_test "break C::C" "Breakpoint $decimal \\(C::C\\) pending." ++ ++#gdb_test "run" "warning: Found more than one location for breakpoint #$decimal; only the first location will be used.(\r\n)+Breakpoint $decimal, C::C.*" ++gdb_test "run" ++ ++gdb_test "info break" " in C::C\\(\\) at .* in C::C\\(int\\) at .*" diff --git a/gdb-rhbz1325795-framefilters-test.patch b/gdb-rhbz1325795-framefilters-test.patch index b750bb6..8cf95a1 100644 --- a/gdb-rhbz1325795-framefilters-test.patch +++ b/gdb-rhbz1325795-framefilters-test.patch @@ -1,5 +1,47 @@ ---- /dev/null 2016-04-19 22:52:19.405224269 +0200 -+++ gdb-7.6.1/gdb/testsuite/gdb.python/py-framefilter-thread.exp 2016-04-19 23:22:10.655271756 +0200 +--- /dev/null 2016-09-12 21:37:05.332693927 +0200 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.python/py-framefilter-thread.c 2016-09-12 21:43:56.448695513 +0200 +@@ -0,0 +1,39 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2016 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++#include ++#include ++ ++static void * ++start (void *arg) ++{ ++ return arg; /* Backtrace end breakpoint */ ++} ++ ++int ++main (void) ++{ ++ pthread_t thread1; ++ int i; ++ ++ i = pthread_create (&thread1, NULL, start, NULL); ++ assert (i == 0); ++ i = pthread_join (thread1, NULL); ++ assert (i == 0); ++ ++ return 0; ++} +--- /dev/null 2016-09-12 21:37:05.332693927 +0200 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.python/py-framefilter-thread.exp 2016-09-12 21:46:54.623428493 +0200 @@ -0,0 +1,54 @@ +# Copyright (C) 2016 Free Software Foundation, Inc. + @@ -35,7 +77,7 @@ + +# Load global frame-filters +set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py] -+gdb_test_no_output "python execfile ('${remote_python_file}')" \ ++gdb_test_no_output "python exec (open ('${remote_python_file}').read ())" \ + "Load python file" + +gdb_breakpoint [gdb_get_line_number "Backtrace end breakpoint"] @@ -55,51 +97,9 @@ +# block = self.frame.block() +# RuntimeError: Cannot locate object file for block. +gdb_test "bt" " in \[0-9\]+ \[^\r\n\]*" "bt with filters" ---- /dev/null 2016-04-19 22:52:19.405224269 +0200 -+++ gdb-7.6.1/gdb/testsuite/gdb.python/py-framefilter-thread.c 2016-04-18 22:44:07.096613437 +0200 -@@ -0,0 +1,39 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2016 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+#include -+#include -+ -+static void * -+start (void *arg) -+{ -+ return; /* Backtrace end breakpoint */ -+} -+ -+int -+main (void) -+{ -+ pthread_t thread1; -+ int i; -+ -+ i = pthread_create (&thread1, NULL, start, NULL); -+ assert (i == 0); -+ i = pthread_join (thread1, NULL); -+ assert (i == 0); -+ -+ return 0; -+} ---- /dev/null 2016-04-19 22:52:19.405224269 +0200 -+++ gdb-7.6.1/gdb/testsuite/gdb.python/py-framefilter-thread.py 2016-04-19 23:14:03.273994063 +0200 -@@ -0,0 +1,56 @@ +--- /dev/null 2016-09-12 21:37:05.332693927 +0200 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.python/py-framefilter-thread.py 2016-09-12 21:49:16.150795235 +0200 +@@ -0,0 +1,60 @@ +# Copyright (C) 2016 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -151,8 +151,12 @@ + gdb.frame_filters [self.name] = self + + def filter (self, frame_iter): -+ frame_iter = itertools.imap (Reverse_Function, -+ frame_iter) ++ # Python 3.x moved the itertools.imap functionality to map(), ++ # so check if it is available. ++ if hasattr(itertools, "imap"): ++ frame_iter = itertools.imap (Reverse_Function, frame_iter) ++ else: ++ frame_iter = map (Reverse_Function, frame_iter) + return frame_iter + +FrameFilter() diff --git a/gdb-rhbz1350436-type-printers-error.patch b/gdb-rhbz1350436-type-printers-error.patch new file mode 100644 index 0000000..3c640ee --- /dev/null +++ b/gdb-rhbz1350436-type-printers-error.patch @@ -0,0 +1,73 @@ +Typo in Python support breaks info type-printers command +https://bugzilla.redhat.com/show_bug.cgi?id=1350436 + +[testsuite patch] PR python/17136: 'info type-printers' causes an exception when there are per-objfile printers +https://sourceware.org/ml/gdb-patches/2016-06/msg00455.html + +diff -dup -rup gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.cc gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.cc +--- gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.cc 2013-01-01 07:41:26.000000000 +0100 ++++ gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.cc 2016-06-27 22:57:58.168642470 +0200 +@@ -31,6 +31,12 @@ templ s; + + basic_string bs; + ++class Other ++{ ++}; ++ ++Other ovar; ++ + int main() + { + return 0; +diff -dup -rup gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.exp gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.exp +--- gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.exp 2013-01-01 07:41:26.000000000 +0100 ++++ gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.exp 2016-06-27 22:58:13.846785208 +0200 +@@ -51,3 +51,7 @@ gdb_test_no_output "enable type-printer + gdb_test "whatis bs" "string" "whatis with enabled printer" + + gdb_test "whatis s" "templ" ++ ++gdb_test "info type-printers" "Type printers for \[^\r\n\]*/py-typeprint:\r\n *other\r\n.*" \ ++ "info type-printers for other" ++gdb_test "whatis ovar" "type = Another" +diff -dup -rup gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.py gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.py +--- gdb-7.6.1/gdb/testsuite/gdb.python-orig/py-typeprint.py 2013-01-01 07:41:26.000000000 +0100 ++++ gdb-7.6.1/gdb/testsuite/gdb.python/py-typeprint.py 2016-06-27 22:57:58.169642479 +0200 +@@ -15,7 +15,7 @@ + + import gdb + +-class Recognizer(object): ++class StringRecognizer(object): + def __init__(self): + self.enabled = True + +@@ -30,6 +30,26 @@ class StringTypePrinter(object): + self.enabled = True + + def instantiate(self): +- return Recognizer() ++ return StringRecognizer() + + gdb.type_printers.append(StringTypePrinter()) ++ ++class OtherRecognizer(object): ++ def __init__(self): ++ self.enabled = True ++ ++ def recognize(self, type_obj): ++ if type_obj.tag == 'Other': ++ return 'Another' ++ return None ++ ++class OtherTypePrinter(object): ++ def __init__(self): ++ self.name = 'other' ++ self.enabled = True ++ ++ def instantiate(self): ++ return OtherRecognizer() ++ ++import gdb.types ++gdb.types.register_type_printer(gdb.objfiles()[0], OtherTypePrinter()) diff --git a/gdb-rhbz795424-bitpos-20of25.patch b/gdb-rhbz795424-bitpos-20of25.patch index aba82da..9f72ea0 100644 --- a/gdb-rhbz795424-bitpos-20of25.patch +++ b/gdb-rhbz795424-bitpos-20of25.patch @@ -463,11 +463,11 @@ Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-main.patch -Index: gdb-7.10.50.20151027/gdb/ada-lang.c +Index: gdb-7.11.50.20160716/gdb/ada-lang.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/ada-lang.c 2015-11-02 21:23:11.175351410 +0100 -+++ gdb-7.10.50.20151027/gdb/ada-lang.c 2015-11-02 21:23:13.197364714 +0100 -@@ -75,7 +75,7 @@ static struct type *desc_bounds_type (st +--- gdb-7.11.50.20160716.orig/gdb/ada-lang.c 2016-07-16 14:33:42.053510117 +0200 ++++ gdb-7.11.50.20160716/gdb/ada-lang.c 2016-07-16 14:33:44.527530028 +0200 +@@ -75,7 +75,7 @@ static struct value *desc_bounds (struct value *); @@ -476,7 +476,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c static int fat_pntr_bounds_bitsize (struct type *); -@@ -83,13 +83,13 @@ static struct type *desc_data_target_typ +@@ -83,13 +83,13 @@ static struct value *desc_data (struct value *); @@ -492,7 +492,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c static int desc_bound_bitsize (struct type *, int, int); -@@ -172,7 +172,7 @@ static struct type *static_unwrap_type ( +@@ -172,7 +172,7 @@ static struct value *unwrap_value (struct value *); @@ -501,7 +501,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c static struct type *decode_constrained_packed_array_type (struct type *); -@@ -187,7 +187,8 @@ static int ada_is_unconstrained_packed_a +@@ -187,7 +187,8 @@ static struct value *value_subscript_packed (struct value *, int, struct value **); @@ -511,7 +511,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c static struct value *coerce_unspec_val_to_type (struct value *, struct type *); -@@ -215,14 +216,14 @@ static struct value *value_val_atr (stru +@@ -215,14 +216,14 @@ static struct symbol *standard_lookup (const char *, const struct block *, domain_enum); @@ -530,7 +530,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR, struct value *); -@@ -236,7 +237,7 @@ static int ada_is_direct_array_type (str +@@ -236,7 +237,7 @@ static void ada_language_arch_info (struct gdbarch *, struct language_arch_info *); @@ -539,7 +539,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c struct type *); static struct value *assign_aggregate (struct value *, struct value *, -@@ -700,7 +701,7 @@ coerce_unspec_val_to_type (struct value +@@ -700,7 +701,7 @@ } static const gdb_byte * @@ -548,7 +548,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c { if (valaddr == NULL) return NULL; -@@ -709,7 +710,7 @@ cond_offset_host (const gdb_byte *valadd +@@ -709,7 +710,7 @@ } static CORE_ADDR @@ -557,7 +557,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c { if (address == 0) return 0; -@@ -1717,7 +1718,7 @@ desc_bounds (struct value *arr) +@@ -1756,7 +1757,7 @@ /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the bounds data. */ @@ -566,7 +566,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c fat_pntr_bounds_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 1); -@@ -1783,7 +1784,7 @@ desc_data (struct value *arr) +@@ -1822,7 +1823,7 @@ /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the data. */ @@ -575,7 +575,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c fat_pntr_data_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 0); -@@ -1818,7 +1819,7 @@ desc_one_bound (struct value *bounds, in +@@ -1857,7 +1858,7 @@ 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. */ @@ -584,7 +584,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c desc_bound_bitpos (struct type *type, int i, int which) { return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2); -@@ -2008,7 +2009,7 @@ ada_type_of_array (struct value *arr, in +@@ -2047,7 +2048,7 @@ zero, and does not need to be recomputed. */ if (lo < hi) { @@ -593,7 +593,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0); TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8; -@@ -2168,7 +2169,7 @@ decode_packed_array_bitsize (struct type +@@ -2207,7 +2208,7 @@ the length is arbitrary. */ static struct type * @@ -602,7 +602,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c { struct type *new_elt_type; struct type *new_type; -@@ -2222,7 +2223,7 @@ decode_constrained_packed_array_type (st +@@ -2261,7 +2262,7 @@ char *name; const char *tail; struct type *shadow_type; @@ -611,7 +611,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c if (!raw_name) raw_name = ada_type_name (desc_base_type (type)); -@@ -2293,7 +2294,8 @@ decode_constrained_packed_array (struct +@@ -2332,7 +2333,8 @@ 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. */ @@ -621,7 +621,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c ULONGEST mod; mod = ada_modulus (value_type (arr)) - 1; -@@ -2521,7 +2523,7 @@ ada_unpack_from_contents (const gdb_byte +@@ -2560,7 +2562,7 @@ struct value * ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, @@ -630,7 +630,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c struct type *type) { struct value *v; -@@ -2594,7 +2596,7 @@ ada_value_primitive_packed_val (struct v +@@ -2633,7 +2635,7 @@ if (obj != NULL) { @@ -639,7 +639,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c set_value_component_location (v, obj); set_value_bitpos (v, bit_offset + value_bitpos (obj)); -@@ -2642,7 +2644,7 @@ ada_value_primitive_packed_val (struct v +@@ -2681,7 +2683,7 @@ not overlap. */ static void move_bits (gdb_byte *target, int targ_offset, const gdb_byte *source, @@ -648,7 +648,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c { unsigned int accum, mask; int accum_bits, chunk_size; -@@ -2732,7 +2734,7 @@ ada_value_assign (struct value *toval, s +@@ -2771,7 +2773,7 @@ { int len = (value_bitpos (toval) + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT; @@ -657,7 +657,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c gdb_byte *buffer = (gdb_byte *) alloca (len); struct value *val; CORE_ADDR to_addr = value_address (toval); -@@ -2783,7 +2785,7 @@ value_assign_to_component (struct value +@@ -2822,7 +2824,7 @@ (LONGEST) (value_address (component) - value_address (container)); int bit_offset_in_container = value_bitpos (component) - value_bitpos (container); @@ -666,7 +666,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c val = value_cast (value_type (component), val); -@@ -4392,7 +4394,7 @@ ensure_lval (struct value *val) +@@ -4480,7 +4482,7 @@ if (VALUE_LVAL (val) == not_lval || VALUE_LVAL (val) == lval_internalvar) { @@ -675,7 +675,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c const CORE_ADDR addr = value_as_long (value_allocate_space_in_inferior (len)); -@@ -4476,7 +4478,7 @@ static CORE_ADDR +@@ -4564,7 +4566,7 @@ value_pointer (struct value *value, struct type *type) { struct gdbarch *gdbarch = get_type_arch (type); @@ -684,7 +684,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c gdb_byte *buf = (gdb_byte *) alloca (len); CORE_ADDR addr; -@@ -6711,7 +6713,7 @@ value_tag_from_contents_and_address (str +@@ -6799,7 +6801,7 @@ const gdb_byte *valaddr, CORE_ADDR address) { @@ -693,7 +693,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c struct type *tag_type; if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset, -@@ -7181,7 +7183,7 @@ ada_in_variant (LONGEST val, struct type +@@ -7280,7 +7282,7 @@ only in that it can handle packed values of arbitrary type. */ static struct value * @@ -702,7 +702,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c struct type *arg_type) { struct type *type; -@@ -7193,7 +7195,7 @@ ada_value_primitive_field (struct value +@@ -7292,7 +7294,7 @@ if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0) { @@ -711,7 +711,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno); return ada_value_primitive_packed_val (arg1, value_contents (arg1), -@@ -7220,9 +7222,9 @@ ada_value_primitive_field (struct value +@@ -7319,9 +7321,9 @@ Returns 1 if found, 0 otherwise. */ static int @@ -723,7 +723,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c int *index_p) { int i; -@@ -7240,8 +7242,8 @@ find_struct_field (const char *name, str +@@ -7339,8 +7341,8 @@ for (i = 0; i < TYPE_NFIELDS (type); i += 1) { @@ -734,7 +734,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c const char *t_field_name = TYPE_FIELD_NAME (type, i); if (t_field_name == NULL) -@@ -7311,7 +7313,7 @@ num_visible_fields (struct type *type) +@@ -7410,7 +7412,7 @@ Searches recursively through wrapper fields (e.g., '_parent'). */ static struct value * @@ -743,7 +743,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c struct type *type) { int i; -@@ -7344,7 +7346,7 @@ ada_search_struct_field (const char *nam +@@ -7443,7 +7445,7 @@ int j; struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type, i)); @@ -752,7 +752,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c for (j = 0; j < TYPE_NFIELDS (field_type); j += 1) { -@@ -7362,8 +7364,8 @@ ada_search_struct_field (const char *nam +@@ -7461,8 +7463,8 @@ return NULL; } @@ -763,7 +763,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c /* Return field #INDEX in ARG, where the index is that returned by -@@ -7372,7 +7374,7 @@ static struct value *ada_index_struct_fi +@@ -7471,7 +7473,7 @@ * If found, return value, else return NULL. */ static struct value * @@ -772,7 +772,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c struct type *type) { return ada_index_struct_field_1 (&index, arg, offset, type); -@@ -7384,7 +7386,7 @@ ada_index_struct_field (int index, struc +@@ -7483,7 +7485,7 @@ * *INDEX_P. */ static struct value * @@ -781,7 +781,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c struct type *type) { int i; -@@ -7474,7 +7476,8 @@ ada_value_struct_elt (struct value *arg, +@@ -7573,7 +7575,8 @@ v = ada_search_struct_field (name, arg, 0, t); else { @@ -791,7 +791,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c struct type *field_type; CORE_ADDR address; -@@ -7791,8 +7794,8 @@ ada_coerce_ref (struct value *val0) +@@ -7904,8 +7907,8 @@ /* Return OFF rounded upward if necessary to a multiple of ALIGNMENT (a power of 2). */ @@ -802,7 +802,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c { return (off + alignment - 1) & ~(alignment - 1); } -@@ -8186,10 +8189,9 @@ ada_template_to_fixed_record_type_1 (str +@@ -8299,10 +8302,9 @@ struct value *mark = value_mark (); struct value *dval; struct type *rtype; @@ -815,7 +815,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c int f; /* Compute the number of fields in this record type that are going -@@ -8267,7 +8269,7 @@ ada_template_to_fixed_record_type_1 (str +@@ -8380,7 +8382,7 @@ that follow this one. */ if (ada_is_aligner_type (field_type)) { @@ -824,7 +824,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c field_valaddr = cond_offset_host (field_valaddr, field_offset); field_address = cond_offset_target (field_address, field_offset); -@@ -8403,11 +8405,11 @@ ada_template_to_fixed_record_type_1 (str +@@ -8516,11 +8518,11 @@ if (TYPE_LENGTH (type) <= 0) { if (TYPE_NAME (rtype)) @@ -840,7 +840,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c } else { -@@ -8874,7 +8876,8 @@ to_fixed_array_type (struct type *type0, +@@ -8987,7 +8989,8 @@ 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. */ @@ -850,11 +850,11 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.c int elt_bitsize = TYPE_FIELD_BITSIZE (type0, 0); TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0); -Index: gdb-7.10.50.20151027/gdb/ada-lang.h +Index: gdb-7.11.50.20160716/gdb/ada-lang.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/ada-lang.h 2015-11-02 21:23:11.177351423 +0100 -+++ gdb-7.10.50.20151027/gdb/ada-lang.h 2015-11-02 21:23:13.198364721 +0100 -@@ -168,7 +168,7 @@ extern void ada_print_type (struct type +--- gdb-7.11.50.20160716.orig/gdb/ada-lang.h 2016-07-16 14:33:42.054510125 +0200 ++++ gdb-7.11.50.20160716/gdb/ada-lang.h 2016-07-16 14:33:44.528530036 +0200 +@@ -168,7 +168,7 @@ extern void ada_print_typedef (struct type *type, struct symbol *new_symbol, struct ui_file *stream); @@ -863,7 +863,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.h struct ui_file *, int, const struct value *, const struct value_print_options *); -@@ -183,7 +183,7 @@ extern void ada_emit_char (int, struct t +@@ -183,7 +183,7 @@ extern void ada_printchar (int, struct type *, struct ui_file *); extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *, @@ -872,7 +872,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.h const struct value_print_options *); struct value *ada_convert_actual (struct value *actual, -@@ -255,7 +255,7 @@ extern int ada_is_constrained_packed_arr +@@ -255,7 +255,7 @@ extern struct value *ada_value_primitive_packed_val (struct value *, const gdb_byte *, @@ -881,11 +881,11 @@ Index: gdb-7.10.50.20151027/gdb/ada-lang.h struct type *); extern struct type *ada_coerce_to_simple_array_type (struct type *); -Index: gdb-7.10.50.20151027/gdb/ada-typeprint.c +Index: gdb-7.11.50.20160716/gdb/ada-typeprint.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/ada-typeprint.c 2015-11-02 21:23:11.177351423 +0100 -+++ gdb-7.10.50.20151027/gdb/ada-typeprint.c 2015-11-02 21:23:13.198364721 +0100 -@@ -891,8 +891,8 @@ ada_print_type (struct type *type0, cons +--- gdb-7.11.50.20160716.orig/gdb/ada-typeprint.c 2016-07-16 14:33:42.055510133 +0200 ++++ gdb-7.11.50.20160716/gdb/ada-typeprint.c 2016-07-16 14:33:44.528530036 +0200 +@@ -891,8 +891,8 @@ const char *name = ada_type_name (type); if (!ada_is_range_type_name (name)) @@ -896,7 +896,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-typeprint.c else { fprintf_filtered (stream, "range "); -@@ -913,7 +913,8 @@ ada_print_type (struct type *type0, cons +@@ -913,7 +913,8 @@ } break; case TYPE_CODE_FLT: @@ -906,10 +906,10 @@ Index: gdb-7.10.50.20151027/gdb/ada-typeprint.c break; case TYPE_CODE_ENUM: if (show < 0) -Index: gdb-7.10.50.20151027/gdb/ada-valprint.c +Index: gdb-7.11.50.20160716/gdb/ada-valprint.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/ada-valprint.c 2015-11-02 21:23:11.179351436 +0100 -+++ gdb-7.10.50.20151027/gdb/ada-valprint.c 2015-11-02 21:23:13.199364728 +0100 +--- gdb-7.11.50.20160716.orig/gdb/ada-valprint.c 2016-07-16 14:33:42.056510141 +0200 ++++ gdb-7.11.50.20160716/gdb/ada-valprint.c 2016-07-16 14:33:44.528530036 +0200 @@ -33,11 +33,11 @@ #include "objfiles.h" @@ -924,7 +924,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-valprint.c const struct language_defn *); -@@ -279,7 +279,7 @@ ada_emit_char (int c, struct type *type, +@@ -279,7 +279,7 @@ of a character. */ static int @@ -933,7 +933,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-valprint.c enum bfd_endian byte_order) { if (type_len == 1) -@@ -441,11 +441,11 @@ ada_print_scalar (struct type *type, LON +@@ -441,11 +441,11 @@ static void printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, @@ -947,7 +947,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-valprint.c unsigned int things_printed = 0; int in_quotes = 0; int need_comma = 0; -@@ -460,9 +460,9 @@ printstr (struct ui_file *stream, struct +@@ -460,9 +460,9 @@ { /* Position of the character we are examining to see whether it is repeated. */ @@ -959,7 +959,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-valprint.c QUIT; -@@ -493,7 +493,8 @@ printstr (struct ui_file *stream, struct +@@ -493,7 +493,8 @@ ada_emit_char (char_at (string, i, type_len, byte_order), elttype, stream, '\'', type_len); fputs_filtered ("'", stream); @@ -969,7 +969,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-valprint.c i = rep1 - 1; things_printed += options->repeat_count_threshold; need_comma = 1; -@@ -521,7 +522,7 @@ printstr (struct ui_file *stream, struct +@@ -521,7 +522,7 @@ void ada_printstr (struct ui_file *stream, struct type *type, @@ -978,7 +978,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-valprint.c const char *encoding, int force_ellipses, const struct value_print_options *options) { -@@ -531,12 +532,12 @@ ada_printstr (struct ui_file *stream, st +@@ -531,12 +532,12 @@ static int print_variant_part (struct type *type, int field_num, @@ -993,7 +993,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-valprint.c const struct language_defn *language) { struct type *var_type = TYPE_FIELD_TYPE (type, field_num); -@@ -572,11 +573,11 @@ print_variant_part (struct type *type, i +@@ -572,11 +573,11 @@ static int print_field_values (struct type *type, const gdb_byte *valaddr, @@ -1007,7 +1007,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-valprint.c const struct language_defn *language) { int i, len; -@@ -643,7 +644,7 @@ print_field_values (struct type *type, c +@@ -643,7 +644,7 @@ } else { @@ -1016,7 +1016,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-valprint.c int bit_size = TYPE_FIELD_BITSIZE (type, i); struct value_print_options opts; -@@ -689,8 +690,8 @@ ada_val_print_string (struct type *type, +@@ -689,8 +690,8 @@ { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); struct type *elttype = TYPE_TARGET_TYPE (type); @@ -1027,7 +1027,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-valprint.c /* We know that ELTTYPE cannot possibly be null, because we assume that we're called only when TYPE is a string-like type. -@@ -709,7 +710,7 @@ ada_val_print_string (struct type *type, +@@ -709,7 +710,7 @@ elements up to it. */ if (options->stop_print_at_null) { @@ -1036,7 +1036,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-valprint.c /* Look for a NULL char. */ for (temp_len = 0; -@@ -1074,7 +1075,7 @@ ada_val_print_ref (struct type *type, co +@@ -1074,7 +1075,7 @@ static void ada_val_print_1 (struct type *type, const gdb_byte *valaddr, @@ -1045,7 +1045,7 @@ Index: gdb-7.10.50.20151027/gdb/ada-valprint.c struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options, -@@ -1157,7 +1158,7 @@ ada_val_print_1 (struct type *type, cons +@@ -1157,7 +1158,7 @@ void ada_val_print (struct type *type, const gdb_byte *valaddr, @@ -1054,11 +1054,11 @@ Index: gdb-7.10.50.20151027/gdb/ada-valprint.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) -Index: gdb-7.10.50.20151027/gdb/annotate.c +Index: gdb-7.11.50.20160716/gdb/annotate.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/annotate.c 2015-11-02 21:23:11.179351436 +0100 -+++ gdb-7.10.50.20151027/gdb/annotate.c 2015-11-02 21:23:13.199364728 +0100 -@@ -542,21 +542,21 @@ annotate_frame_end (void) +--- gdb-7.11.50.20160716.orig/gdb/annotate.c 2016-07-16 14:33:42.057510149 +0200 ++++ gdb-7.11.50.20160716/gdb/annotate.c 2016-07-16 14:33:44.528530036 +0200 +@@ -533,21 +533,21 @@ } void @@ -1084,11 +1084,11 @@ Index: gdb-7.10.50.20151027/gdb/annotate.c } void -Index: gdb-7.10.50.20151027/gdb/annotate.h +Index: gdb-7.11.50.20160716/gdb/annotate.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/annotate.h 2015-11-02 21:23:11.179351436 +0100 -+++ gdb-7.10.50.20151027/gdb/annotate.h 2015-11-02 21:23:13.199364728 +0100 -@@ -92,8 +92,8 @@ extern void annotate_frame_source_end (v +--- gdb-7.11.50.20160716.orig/gdb/annotate.h 2016-07-16 14:33:42.057510149 +0200 ++++ gdb-7.11.50.20160716/gdb/annotate.h 2016-07-16 14:33:44.528530036 +0200 +@@ -92,8 +92,8 @@ extern void annotate_frame_where (void); extern void annotate_frame_end (void); @@ -1099,11 +1099,11 @@ Index: gdb-7.10.50.20151027/gdb/annotate.h extern void annotate_elt_rep_end (void); extern void annotate_elt (void); extern void annotate_array_section_end (void); -Index: gdb-7.10.50.20151027/gdb/arm-linux-nat.c +Index: gdb-7.11.50.20160716/gdb/arm-linux-nat.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/arm-linux-nat.c 2015-11-02 21:23:11.180351443 +0100 -+++ gdb-7.10.50.20151027/gdb/arm-linux-nat.c 2015-11-02 21:23:13.200364734 +0100 -@@ -1099,7 +1099,7 @@ arm_linux_remove_hw_breakpoint (struct t +--- gdb-7.11.50.20160716.orig/gdb/arm-linux-nat.c 2016-07-16 14:33:42.057510149 +0200 ++++ gdb-7.11.50.20160716/gdb/arm-linux-nat.c 2016-07-16 14:33:44.529530044 +0200 +@@ -1063,7 +1063,7 @@ ADDR? */ static int arm_linux_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -1112,11 +1112,11 @@ Index: gdb-7.10.50.20151027/gdb/arm-linux-nat.c { const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap (); CORE_ADDR max_wp_length, aligned_addr; -Index: gdb-7.10.50.20151027/gdb/ax-gdb.c +Index: gdb-7.11.50.20160716/gdb/ax-gdb.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/ax-gdb.c 2015-11-02 21:23:11.182351456 +0100 -+++ gdb-7.10.50.20151027/gdb/ax-gdb.c 2015-11-02 21:23:13.201364741 +0100 -@@ -83,12 +83,12 @@ static void gen_traced_pop (struct gdbar +--- gdb-7.11.50.20160716.orig/gdb/ax-gdb.c 2016-07-16 14:33:42.060510173 +0200 ++++ gdb-7.11.50.20160716/gdb/ax-gdb.c 2016-07-16 14:33:44.529530044 +0200 +@@ -83,12 +83,12 @@ 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 *); @@ -1131,7 +1131,7 @@ Index: gdb-7.10.50.20151027/gdb/ax-gdb.c static void gen_sym_offset (struct agent_expr *, struct symbol *); static void gen_var_ref (struct gdbarch *, struct agent_expr *ax, struct axs_value *value, struct symbol *var); -@@ -136,15 +136,16 @@ static void gen_deref (struct agent_expr +@@ -136,15 +136,16 @@ static void gen_address_of (struct agent_expr *, struct axs_value *); static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, @@ -1151,7 +1151,7 @@ Index: gdb-7.10.50.20151027/gdb/ax-gdb.c struct type *type); static void gen_struct_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, -@@ -539,7 +540,7 @@ gen_fetch (struct agent_expr *ax, struct +@@ -538,7 +539,7 @@ right shift it by -DISTANCE bits if DISTANCE < 0. This generates unsigned (logical) right shifts. */ static void @@ -1160,7 +1160,7 @@ Index: gdb-7.10.50.20151027/gdb/ax-gdb.c { if (distance > 0) { -@@ -593,7 +594,7 @@ gen_frame_locals_address (struct gdbarch +@@ -592,7 +593,7 @@ programming in ML, it would be clearer why these are the same thing. */ static void @@ -1169,7 +1169,7 @@ Index: gdb-7.10.50.20151027/gdb/ax-gdb.c { /* It would suffice to simply push the offset and add it, but this makes it easier to read positive and negative offsets in the -@@ -1249,7 +1250,7 @@ gen_address_of (struct agent_expr *ax, s +@@ -1248,7 +1249,7 @@ static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, struct type *type, @@ -1178,7 +1178,7 @@ Index: gdb-7.10.50.20151027/gdb/ax-gdb.c { /* Note that ops[i] fetches 8 << i bits. */ static enum agent_op ops[] -@@ -1284,13 +1285,13 @@ gen_bitfield_ref (struct expression *exp +@@ -1283,13 +1284,13 @@ /* The first and one-after-last bits in the field, but rounded down and up to byte boundaries. */ @@ -1197,7 +1197,7 @@ Index: gdb-7.10.50.20151027/gdb/ax-gdb.c /* The index in ops of the opcode we're considering. */ int op; -@@ -1409,7 +1410,7 @@ gen_bitfield_ref (struct expression *exp +@@ -1408,7 +1409,7 @@ static void gen_primitive_field (struct expression *exp, struct agent_expr *ax, struct axs_value *value, @@ -1206,7 +1206,7 @@ Index: gdb-7.10.50.20151027/gdb/ax-gdb.c { /* Is this a bitfield? */ if (TYPE_FIELD_PACKED (type, fieldno)) -@@ -1434,7 +1435,7 @@ gen_primitive_field (struct expression * +@@ -1433,7 +1434,7 @@ static int gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax, struct axs_value *value, @@ -1215,11 +1215,11 @@ Index: gdb-7.10.50.20151027/gdb/ax-gdb.c { int i, rslt; int nbases = TYPE_N_BASECLASSES (type); -Index: gdb-7.10.50.20151027/gdb/ax-general.c +Index: gdb-7.11.50.20160716/gdb/ax-general.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/ax-general.c 2015-11-02 21:23:11.182351456 +0100 -+++ gdb-7.10.50.20151027/gdb/ax-general.c 2015-11-02 21:23:13.201364741 +0100 -@@ -192,7 +192,7 @@ ax_zero_ext (struct agent_expr *x, int n +--- gdb-7.11.50.20160716.orig/gdb/ax-general.c 2016-07-16 14:33:42.060510173 +0200 ++++ gdb-7.11.50.20160716/gdb/ax-general.c 2016-07-16 14:33:44.529530044 +0200 +@@ -199,7 +199,7 @@ /* Append a trace_quick instruction to EXPR, to record N bytes. */ void @@ -1228,11 +1228,11 @@ Index: gdb-7.10.50.20151027/gdb/ax-general.c { /* N must fit in a byte. */ if (n < 0 || n > 255) -Index: gdb-7.10.50.20151027/gdb/ax.h +Index: gdb-7.11.50.20160716/gdb/ax.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/ax.h 2015-11-02 21:23:11.183351463 +0100 -+++ gdb-7.10.50.20151027/gdb/ax.h 2015-11-02 21:23:13.201364741 +0100 -@@ -207,7 +207,7 @@ extern void ax_ext (struct agent_expr *E +--- gdb-7.11.50.20160716.orig/gdb/ax.h 2016-07-16 14:33:42.060510173 +0200 ++++ gdb-7.11.50.20160716/gdb/ax.h 2016-07-16 14:33:44.529530044 +0200 +@@ -210,7 +210,7 @@ extern void ax_zero_ext (struct agent_expr *EXPR, int N); /* Append a trace_quick instruction to EXPR, to record N bytes. */ @@ -1241,11 +1241,11 @@ Index: gdb-7.10.50.20151027/gdb/ax.h /* 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, -Index: gdb-7.10.50.20151027/gdb/breakpoint.c +Index: gdb-7.11.50.20160716/gdb/breakpoint.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/breakpoint.c 2015-11-02 21:23:11.188351496 +0100 -+++ gdb-7.10.50.20151027/gdb/breakpoint.c 2015-11-02 21:23:13.205364767 +0100 -@@ -2215,9 +2215,9 @@ should_be_inserted (struct bp_location * +--- gdb-7.11.50.20160716.orig/gdb/breakpoint.c 2016-07-16 14:33:42.067510230 +0200 ++++ gdb-7.11.50.20160716/gdb/breakpoint.c 2016-07-16 14:33:44.531530060 +0200 +@@ -2251,9 +2251,9 @@ { fprintf_unfiltered (gdb_stdlog, "infrun: stepping past non-steppable watchpoint. " @@ -1257,7 +1257,7 @@ Index: gdb-7.10.50.20151027/gdb/breakpoint.c } return 0; } -@@ -7053,7 +7053,7 @@ breakpoint_address_match (struct address +@@ -7181,7 +7181,7 @@ static int breakpoint_address_match_range (struct address_space *aspace1, CORE_ADDR addr1, @@ -1266,7 +1266,7 @@ Index: gdb-7.10.50.20151027/gdb/breakpoint.c CORE_ADDR addr2) { return ((gdbarch_has_global_breakpoints (target_gdbarch ()) -@@ -11387,7 +11387,7 @@ can_use_hardware_watchpoint (struct valu +@@ -11534,7 +11534,7 @@ && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) { CORE_ADDR vaddr = value_address (v); @@ -1275,11 +1275,11 @@ Index: gdb-7.10.50.20151027/gdb/breakpoint.c int num_regs; len = (target_exact_watchpoints -Index: gdb-7.10.50.20151027/gdb/breakpoint.h +Index: gdb-7.11.50.20160716/gdb/breakpoint.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/breakpoint.h 2015-11-02 21:23:11.190351509 +0100 -+++ gdb-7.10.50.20151027/gdb/breakpoint.h 2015-11-02 21:23:13.206364773 +0100 -@@ -237,7 +237,7 @@ struct bp_target_info +--- gdb-7.11.50.20160716.orig/gdb/breakpoint.h 2016-07-16 14:33:42.068510238 +0200 ++++ gdb-7.11.50.20160716/gdb/breakpoint.h 2016-07-16 14:33:44.532530068 +0200 +@@ -237,7 +237,7 @@ /* If this is a ranged breakpoint, then this field contains the length of the range that will be watched for execution. */ @@ -1288,7 +1288,7 @@ Index: gdb-7.10.50.20151027/gdb/breakpoint.h /* If the breakpoint lives in memory and reading that memory would give back the breakpoint, instead of the original contents, then -@@ -413,7 +413,7 @@ struct bp_location +@@ -413,7 +413,7 @@ /* For hardware watchpoints, the size of the memory region being watched. For hardware ranged breakpoints, the size of the breakpoint range. */ @@ -1297,11 +1297,11 @@ Index: gdb-7.10.50.20151027/gdb/breakpoint.h /* Type of hardware watchpoint. */ enum target_hw_bp_type watchpoint_type; -Index: gdb-7.10.50.20151027/gdb/c-lang.c +Index: gdb-7.11.50.20160716/gdb/c-lang.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/c-lang.c 2015-11-02 21:23:11.190351509 +0100 -+++ gdb-7.10.50.20151027/gdb/c-lang.c 2015-11-02 21:23:13.206364773 +0100 -@@ -187,7 +187,7 @@ c_printchar (int c, struct type *type, s +--- gdb-7.11.50.20160716.orig/gdb/c-lang.c 2016-07-16 14:33:42.069510246 +0200 ++++ gdb-7.11.50.20160716/gdb/c-lang.c 2016-07-16 14:33:44.532530068 +0200 +@@ -186,7 +186,7 @@ void c_printstr (struct ui_file *stream, struct type *type, @@ -1310,7 +1310,7 @@ Index: gdb-7.10.50.20151027/gdb/c-lang.c const char *user_encoding, int force_ellipses, const struct value_print_options *options) { -@@ -676,7 +676,7 @@ evaluate_subexp_c (struct type *expect_t +@@ -675,7 +675,7 @@ } else { @@ -1319,7 +1319,7 @@ Index: gdb-7.10.50.20151027/gdb/c-lang.c /* Write the terminating character. */ for (i = 0; i < TYPE_LENGTH (type); ++i) -@@ -685,7 +685,7 @@ evaluate_subexp_c (struct type *expect_t +@@ -684,7 +684,7 @@ if (satisfy_expected) { LONGEST low_bound, high_bound; @@ -1328,11 +1328,11 @@ Index: gdb-7.10.50.20151027/gdb/c-lang.c if (get_discrete_bounds (TYPE_INDEX_TYPE (expect_type), &low_bound, &high_bound) < 0) -Index: gdb-7.10.50.20151027/gdb/c-lang.h +Index: gdb-7.11.50.20160716/gdb/c-lang.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/c-lang.h 2015-11-02 21:23:11.191351515 +0100 -+++ gdb-7.10.50.20151027/gdb/c-lang.h 2015-11-02 21:23:13.206364773 +0100 -@@ -74,7 +74,7 @@ extern void c_print_typedef (struct type +--- gdb-7.11.50.20160716.orig/gdb/c-lang.h 2016-07-16 14:33:42.069510246 +0200 ++++ gdb-7.11.50.20160716/gdb/c-lang.h 2016-07-16 14:33:44.532530068 +0200 +@@ -77,7 +77,7 @@ struct ui_file *); extern void c_val_print (struct type *, const gdb_byte *, @@ -1341,7 +1341,7 @@ Index: gdb-7.10.50.20151027/gdb/c-lang.h struct ui_file *, int, const struct value *, const struct value_print_options *); -@@ -94,7 +94,7 @@ extern void c_printchar (int, struct typ +@@ -97,7 +97,7 @@ extern void c_printstr (struct ui_file * stream, struct type *elttype, const gdb_byte *string, @@ -1350,28 +1350,11 @@ Index: gdb-7.10.50.20151027/gdb/c-lang.h const char *user_encoding, int force_ellipses, const struct value_print_options *options); -@@ -120,14 +120,14 @@ extern void cp_print_class_member (const - struct ui_file *, char *); - - extern void cp_print_value_fields (struct type *, struct type *, -- const gdb_byte *, int, CORE_ADDR, -+ const gdb_byte *, LONGEST, CORE_ADDR, - struct ui_file *, int, - const struct value *, - const struct value_print_options *, - struct type **, int); - - extern void cp_print_value_fields_rtti (struct type *, -- const gdb_byte *, int, CORE_ADDR, -+ const gdb_byte *, LONGEST, CORE_ADDR, - struct ui_file *, int, - const struct value *, - const struct value_print_options *, -Index: gdb-7.10.50.20151027/gdb/c-valprint.c +Index: gdb-7.11.50.20160716/gdb/c-valprint.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/c-valprint.c 2015-11-02 21:23:11.191351515 +0100 -+++ gdb-7.10.50.20151027/gdb/c-valprint.c 2015-11-02 21:23:13.207364780 +0100 -@@ -242,7 +242,7 @@ c_val_print_array (struct type *type, co +--- gdb-7.11.50.20160716.orig/gdb/c-valprint.c 2016-07-16 14:33:42.070510254 +0200 ++++ gdb-7.11.50.20160716/gdb/c-valprint.c 2016-07-16 14:33:44.532530068 +0200 +@@ -244,7 +244,7 @@ if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (unresolved_elttype) > 0) { LONGEST low_bound, high_bound; @@ -1380,7 +1363,7 @@ Index: gdb-7.10.50.20151027/gdb/c-valprint.c struct gdbarch *gdbarch = get_type_arch (type); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); unsigned int i = 0; /* Number of characters printed. */ -@@ -316,8 +316,8 @@ c_val_print_array (struct type *type, co +@@ -318,8 +318,8 @@ if (cp_is_vtbl_ptr_type (elttype)) { i = 1; @@ -1391,7 +1374,7 @@ Index: gdb-7.10.50.20151027/gdb/c-valprint.c } else { -@@ -394,7 +394,7 @@ c_val_print_struct (struct type *type, c +@@ -396,7 +396,7 @@ -fvtable_thunks. (Otherwise, look under TYPE_CODE_PTR.) */ struct gdbarch *gdbarch = get_type_arch (type); @@ -1400,7 +1383,7 @@ Index: gdb-7.10.50.20151027/gdb/c-valprint.c + TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8); struct type *field_type = TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET); -@@ -493,7 +493,7 @@ c_val_print_memberptr (struct type *type +@@ -495,7 +495,7 @@ void c_val_print (struct type *type, const gdb_byte *valaddr, @@ -1409,29 +1392,18 @@ Index: gdb-7.10.50.20151027/gdb/c-valprint.c struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) -@@ -565,7 +565,8 @@ c_value_print (struct value *val, struct - const struct value_print_options *options) - { - struct type *type, *real_type, *val_type; -- int full, top, using_enc; -+ int full, using_enc; -+ LONGEST top; - struct value_print_options opts = *options; - - opts.deref_ref = 1; -Index: gdb-7.10.50.20151027/gdb/cp-abi.c +Index: gdb-7.11.50.20160716/gdb/cp-abi.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/cp-abi.c 2015-11-02 21:23:11.192351522 +0100 -+++ gdb-7.10.50.20151027/gdb/cp-abi.c 2015-11-02 21:23:13.207364780 +0100 -@@ -64,12 +64,12 @@ is_operator_name (const char *name) +--- gdb-7.11.50.20160716.orig/gdb/cp-abi.c 2016-07-16 14:33:42.070510254 +0200 ++++ gdb-7.11.50.20160716/gdb/cp-abi.c 2016-07-16 14:33:44.532530068 +0200 +@@ -64,12 +64,12 @@ return (*current_cp_abi.is_operator_name) (name); } -int +LONGEST baseclass_offset (struct type *type, int index, const gdb_byte *valaddr, -- int embedded_offset, CORE_ADDR address, -+ LONGEST embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, const struct value *val) { - int res = 0; @@ -1439,7 +1411,7 @@ Index: gdb-7.10.50.20151027/gdb/cp-abi.c gdb_assert (current_cp_abi.baseclass_offset != NULL); -@@ -96,7 +96,7 @@ baseclass_offset (struct type *type, int +@@ -96,7 +96,7 @@ struct value * value_virtual_fn_field (struct value **arg1p, struct fn_field *f, int j, @@ -1448,20 +1420,11 @@ Index: gdb-7.10.50.20151027/gdb/cp-abi.c { if ((current_cp_abi.virtual_fn_field) == NULL) return NULL; -@@ -106,7 +106,7 @@ value_virtual_fn_field (struct value **a - - struct type * - value_rtti_type (struct value *v, int *full, -- int *top, int *using_enc) -+ LONGEST *top, int *using_enc) - { - struct type *ret = NULL; - -Index: gdb-7.10.50.20151027/gdb/cp-abi.h +Index: gdb-7.11.50.20160716/gdb/cp-abi.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/cp-abi.h 2015-11-02 21:23:11.192351522 +0100 -+++ gdb-7.10.50.20151027/gdb/cp-abi.h 2015-11-02 21:23:13.207364780 +0100 -@@ -108,7 +108,7 @@ extern struct value *value_virtual_fn_fi +--- gdb-7.11.50.20160716.orig/gdb/cp-abi.h 2016-07-16 14:33:42.070510254 +0200 ++++ gdb-7.11.50.20160716/gdb/cp-abi.h 2016-07-16 14:33:44.532530068 +0200 +@@ -108,7 +108,7 @@ struct fn_field *f, int j, struct type *type, @@ -1470,22 +1433,13 @@ Index: gdb-7.10.50.20151027/gdb/cp-abi.h /* Try to find the run-time type of VALUE, using C++ run-time type -@@ -135,7 +135,7 @@ extern struct value *value_virtual_fn_fi - FULL, TOP, and USING_ENC can each be zero, in which case we don't - provide the corresponding piece of information. */ - extern struct type *value_rtti_type (struct value *value, -- int *full, int *top, -+ int *full, LONGEST *top, - int *using_enc); - - /* Compute the offset of the baseclass which is the INDEXth baseclass -@@ -144,11 +144,11 @@ extern struct type *value_rtti_type (str +@@ -144,11 +144,11 @@ 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, -- int embedded_offset, +- LONGEST embedded_offset, - CORE_ADDR address, - const struct value *val); +extern LONGEST baseclass_offset (struct type *type, @@ -1496,48 +1450,28 @@ Index: gdb-7.10.50.20151027/gdb/cp-abi.h /* Describe the target of a pointer to method. CONTENTS is the byte pattern representing the pointer to method. TYPE is the pointer to -@@ -227,12 +227,13 @@ struct cp_abi_ops +@@ -227,12 +227,12 @@ 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, -- int *top, int *using_enc); + LONGEST *top, int *using_enc); - int (*baseclass_offset) (struct type *type, int index, -- const bfd_byte *valaddr, int embedded_offset, +- const bfd_byte *valaddr, LONGEST embedded_offset, - CORE_ADDR address, const struct value *val); -+ LONGEST *top, int *using_enc); + LONGEST (*baseclass_offset) (struct type *type, int index, -+ const bfd_byte *valaddr, -+ LONGEST embedded_offset, CORE_ADDR address, -+ const struct value *val); ++ 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); -Index: gdb-7.10.50.20151027/gdb/cp-valprint.c +Index: gdb-7.11.50.20160716/gdb/cp-valprint.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/cp-valprint.c 2015-11-02 21:23:11.193351529 +0100 -+++ gdb-7.10.50.20151027/gdb/cp-valprint.c 2015-11-02 21:23:13.208364787 +0100 -@@ -80,7 +80,7 @@ static void cp_print_static_field (struc - const struct value_print_options *); - - static void cp_print_value (struct type *, struct type *, -- const gdb_byte *, int, -+ const gdb_byte *, LONGEST, - CORE_ADDR, struct ui_file *, - int, const struct value *, - const struct value_print_options *, -@@ -154,7 +154,7 @@ cp_is_vtbl_member (struct type *type) - - void - cp_print_value_fields (struct type *type, struct type *real_type, -- const gdb_byte *valaddr, int offset, -+ const gdb_byte *valaddr, LONGEST offset, - CORE_ADDR address, struct ui_file *stream, - int recurse, const struct value *val, - const struct value_print_options *options, -@@ -334,7 +334,7 @@ cp_print_value_fields (struct type *type +--- gdb-7.11.50.20160716.orig/gdb/cp-valprint.c 2016-07-16 14:33:42.071510262 +0200 ++++ gdb-7.11.50.20160716/gdb/cp-valprint.c 2016-07-16 14:33:44.532530068 +0200 +@@ -334,7 +334,7 @@ } else if (i == vptr_fieldno && type == vptr_basetype) { @@ -1546,57 +1480,11 @@ Index: gdb-7.10.50.20151027/gdb/cp-valprint.c struct type *i_type = TYPE_FIELD_TYPE (type, i); if (valprint_check_validity (stream, i_type, i_offset, val)) -@@ -417,7 +417,7 @@ cp_print_value_fields (struct type *type - - void - cp_print_value_fields_rtti (struct type *type, -- const gdb_byte *valaddr, int offset, -+ const gdb_byte *valaddr, LONGEST offset, - CORE_ADDR address, - struct ui_file *stream, int recurse, - const struct value *val, -@@ -434,7 +434,8 @@ cp_print_value_fields_rtti (struct type - TARGET_CHAR_BIT * TYPE_LENGTH (type))) - { - struct value *value; -- int full, top, using_enc; -+ int full, using_enc; -+ LONGEST top; - - /* Ugh, we have to convert back to a value here. */ - value = value_from_contents_and_address (type, valaddr + offset, -@@ -459,7 +460,7 @@ cp_print_value_fields_rtti (struct type - - static void - cp_print_value (struct type *type, struct type *real_type, -- const gdb_byte *valaddr, int offset, -+ const gdb_byte *valaddr, LONGEST offset, - CORE_ADDR address, struct ui_file *stream, - int recurse, const struct value *val, - const struct value_print_options *options, -@@ -469,7 +470,7 @@ cp_print_value (struct type *type, struc - = (struct type **) obstack_next_free (&dont_print_vb_obstack); - struct obstack tmp_obstack = dont_print_vb_obstack; - int i, n_baseclasses = TYPE_N_BASECLASSES (type); -- int thisoffset; -+ LONGEST thisoffset; - struct type *thistype; - - if (dont_print_vb == 0) -@@ -483,7 +484,7 @@ cp_print_value (struct type *type, struc - - for (i = 0; i < n_baseclasses; i++) - { -- int boffset = 0; -+ LONGEST boffset = 0; - int skip = 0; - struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); - const char *basename = TYPE_NAME (baseclass); -Index: gdb-7.10.50.20151027/gdb/d-lang.h +Index: gdb-7.11.50.20160716/gdb/d-lang.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/d-lang.h 2015-11-02 21:23:11.193351529 +0100 -+++ gdb-7.10.50.20151027/gdb/d-lang.h 2015-11-02 21:23:13.208364787 +0100 -@@ -81,7 +81,7 @@ extern struct block_symbol d_lookup_nest +--- gdb-7.11.50.20160716.orig/gdb/d-lang.h 2016-07-16 14:33:42.071510262 +0200 ++++ gdb-7.11.50.20160716/gdb/d-lang.h 2016-07-16 14:33:44.533530076 +0200 +@@ -81,7 +81,7 @@ /* Defined in d-valprint.c */ extern void d_val_print (struct type *type, const gdb_byte *valaddr, @@ -1605,20 +1493,11 @@ Index: gdb-7.10.50.20151027/gdb/d-lang.h struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); -Index: gdb-7.10.50.20151027/gdb/d-valprint.c +Index: gdb-7.11.50.20160716/gdb/d-valprint.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/d-valprint.c 2015-11-02 21:23:11.193351529 +0100 -+++ gdb-7.10.50.20151027/gdb/d-valprint.c 2015-11-02 21:23:13.208364787 +0100 -@@ -29,7 +29,7 @@ - - static int - dynamic_array_type (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) -@@ -73,9 +73,9 @@ dynamic_array_type (struct type *type, c +--- gdb-7.11.50.20160716.orig/gdb/d-valprint.c 2016-07-16 14:33:42.071510262 +0200 ++++ gdb-7.11.50.20160716/gdb/d-valprint.c 2016-07-16 14:33:44.533530076 +0200 +@@ -73,9 +73,9 @@ /* Implements the la_val_print routine for language D. */ void @@ -1631,11 +1510,11 @@ Index: gdb-7.10.50.20151027/gdb/d-valprint.c const struct value_print_options *options) { int ret; -Index: gdb-7.10.50.20151027/gdb/doublest.c +Index: gdb-7.11.50.20160716/gdb/doublest.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/doublest.c 2015-11-02 21:23:11.194351535 +0100 -+++ gdb-7.10.50.20151027/gdb/doublest.c 2015-11-02 21:23:13.208364787 +0100 -@@ -765,7 +765,7 @@ floatformat_from_doublest (const struct +--- gdb-7.11.50.20160716.orig/gdb/doublest.c 2016-07-16 14:33:42.072510270 +0200 ++++ gdb-7.11.50.20160716/gdb/doublest.c 2016-07-16 14:33:44.533530076 +0200 +@@ -784,7 +784,7 @@ but not passed on by GDB. This should be fixed. */ static const struct floatformat * @@ -1644,7 +1523,7 @@ Index: gdb-7.10.50.20151027/gdb/doublest.c { const struct floatformat *format; -@@ -793,8 +793,8 @@ floatformat_from_length (struct gdbarch +@@ -812,8 +812,8 @@ else format = NULL; if (format == NULL) @@ -1655,11 +1534,11 @@ Index: gdb-7.10.50.20151027/gdb/doublest.c return format; } -Index: gdb-7.10.50.20151027/gdb/dwarf2loc.c +Index: gdb-7.11.50.20160716/gdb/dwarf2loc.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/dwarf2loc.c 2015-11-02 21:23:11.197351555 +0100 -+++ gdb-7.10.50.20151027/gdb/dwarf2loc.c 2015-11-02 21:23:13.209364793 +0100 -@@ -1632,19 +1632,19 @@ insert_bits (unsigned int datum, +--- gdb-7.11.50.20160716.orig/gdb/dwarf2loc.c 2016-07-16 14:33:42.076510302 +0200 ++++ gdb-7.11.50.20160716/gdb/dwarf2loc.c 2016-07-16 14:33:44.533530076 +0200 +@@ -1638,19 +1638,19 @@ BITS_BIG_ENDIAN is taken directly from gdbarch. */ static void @@ -1685,7 +1564,7 @@ Index: gdb-7.10.50.20151027/gdb/dwarf2loc.c dest_avail = 8 - dest_offset_bits % 8; -@@ -1682,13 +1682,13 @@ static void +@@ -1688,13 +1688,13 @@ read_pieced_value (struct value *v) { int i; @@ -1701,7 +1580,7 @@ Index: gdb-7.10.50.20151027/gdb/dwarf2loc.c size_t buffer_size = 0; gdb_byte *buffer = NULL; struct cleanup *cleanup; -@@ -1715,8 +1715,8 @@ read_pieced_value (struct value *v) +@@ -1721,8 +1721,8 @@ for (i = 0; i < c->n_pieces && offset < type_len; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; @@ -1712,7 +1591,7 @@ Index: gdb-7.10.50.20151027/gdb/dwarf2loc.c const gdb_byte *intermediate_buffer; /* Compute size, source, and destination offsets for copying, in -@@ -1856,13 +1856,13 @@ static void +@@ -1862,13 +1862,13 @@ write_pieced_value (struct value *to, struct value *from) { int i; @@ -1728,7 +1607,7 @@ Index: gdb-7.10.50.20151027/gdb/dwarf2loc.c size_t buffer_size = 0; gdb_byte *buffer = NULL; struct cleanup *cleanup; -@@ -1890,8 +1890,8 @@ write_pieced_value (struct value *to, st +@@ -1896,8 +1896,8 @@ for (i = 0; i < c->n_pieces && offset < type_len; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; @@ -1739,18 +1618,16 @@ Index: gdb-7.10.50.20151027/gdb/dwarf2loc.c int need_bitwise; const gdb_byte *source_buffer; -@@ -2010,8 +2010,8 @@ write_pieced_value (struct value *to, st - a synthetic pointer. */ +@@ -2017,7 +2017,7 @@ static int --check_pieced_synthetic_pointer (const struct value *value, int bit_offset, + check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset, - int bit_length) -+check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset, + LONGEST bit_length) { struct piece_closure *c = (struct piece_closure *) value_computed_closure (value); -@@ -2024,7 +2024,7 @@ check_pieced_synthetic_pointer (const st +@@ -2030,7 +2030,7 @@ for (i = 0; i < c->n_pieces && bit_length > 0; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; @@ -1759,20 +1636,18 @@ Index: gdb-7.10.50.20151027/gdb/dwarf2loc.c if (bit_offset > 0) { -@@ -2066,9 +2066,10 @@ indirect_pieced_value (struct value *val +@@ -2132,8 +2132,8 @@ struct type *type; struct frame_info *frame; struct dwarf2_locexpr_baton baton; -- int i, bit_offset, bit_length; +- int i, bit_length; +- LONGEST bit_offset; + int i; -+ LONGEST bit_length; ++ LONGEST bit_length, bit_offset; struct dwarf_expr_piece *piece = NULL; -- LONGEST byte_offset; -+ LONGEST byte_offset, bit_offset; + LONGEST byte_offset; enum bfd_endian byte_order; - - type = check_typedef (value_type (value)); -@@ -2083,7 +2084,7 @@ indirect_pieced_value (struct value *val +@@ -2150,7 +2150,7 @@ for (i = 0; i < c->n_pieces && bit_length > 0; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; @@ -1781,7 +1656,7 @@ Index: gdb-7.10.50.20151027/gdb/dwarf2loc.c if (bit_offset > 0) { -@@ -2363,7 +2364,7 @@ dwarf2_evaluate_loc_desc_full (struct ty +@@ -2444,7 +2444,7 @@ struct value *value = dwarf_expr_fetch (ctx, 0); gdb_byte *contents; const gdb_byte *val_bytes; @@ -1790,11 +1665,11 @@ Index: gdb-7.10.50.20151027/gdb/dwarf2loc.c if (byte_offset + TYPE_LENGTH (type) > n) invalid_synthetic_pointer (); -Index: gdb-7.10.50.20151027/gdb/dwarf2read.c +Index: gdb-7.11.50.20160716/gdb/dwarf2read.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/dwarf2read.c 2015-11-02 21:23:11.204351601 +0100 -+++ gdb-7.10.50.20151027/gdb/dwarf2read.c 2015-11-02 21:23:13.215364833 +0100 -@@ -1917,12 +1917,12 @@ dwarf2_complex_location_expr_complaint ( +--- gdb-7.11.50.20160716.orig/gdb/dwarf2read.c 2016-07-16 14:33:42.083510358 +0200 ++++ gdb-7.11.50.20160716/gdb/dwarf2read.c 2016-07-16 14:33:44.536530100 +0200 +@@ -1935,12 +1935,12 @@ } static void @@ -1811,7 +1686,7 @@ Index: gdb-7.10.50.20151027/gdb/dwarf2read.c } static void -@@ -12554,8 +12554,8 @@ dwarf2_add_field (struct field_info *fip +@@ -12573,8 +12573,8 @@ 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. */ @@ -1822,11 +1697,11 @@ Index: gdb-7.10.50.20151027/gdb/dwarf2read.c attr = dwarf2_attr (die, DW_AT_byte_size, cu); if (attr) -Index: gdb-7.10.50.20151027/gdb/eval.c +Index: gdb-7.11.50.20160716/gdb/eval.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/eval.c 2015-11-02 21:23:11.206351614 +0100 -+++ gdb-7.10.50.20151027/gdb/eval.c 2015-11-02 21:23:13.216364839 +0100 -@@ -317,7 +317,8 @@ evaluate_struct_tuple (struct value *str +--- gdb-7.11.50.20160716.orig/gdb/eval.c 2016-07-16 14:33:42.086510383 +0200 ++++ gdb-7.11.50.20160716/gdb/eval.c 2016-07-16 14:33:44.537530108 +0200 +@@ -317,7 +317,8 @@ while (--nargs >= 0) { struct value *val = NULL; @@ -1836,7 +1711,7 @@ Index: gdb-7.10.50.20151027/gdb/eval.c bfd_byte *addr; fieldno++; -@@ -378,7 +379,7 @@ init_array_element (struct value *array, +@@ -378,7 +379,7 @@ enum noside noside, LONGEST low_bound, LONGEST high_bound) { LONGEST index; @@ -1845,7 +1720,7 @@ Index: gdb-7.10.50.20151027/gdb/eval.c if (exp->elts[*pos].opcode == BINOP_COMMA) { -@@ -526,11 +527,11 @@ binop_promote (const struct language_def +@@ -822,11 +823,11 @@ /* FIXME: Also mixed integral/booleans, with result an integer. */ { const struct builtin_type *builtin = builtin_type (gdbarch); @@ -1860,7 +1735,7 @@ Index: gdb-7.10.50.20151027/gdb/eval.c int unsigned_operation; /* Determine type length and signedness after promotion for -@@ -712,7 +713,7 @@ evaluate_subexp_standard (struct type *e +@@ -1008,7 +1009,7 @@ struct value **argvec; int code; int ix; @@ -1869,7 +1744,7 @@ Index: gdb-7.10.50.20151027/gdb/eval.c struct type **arg_types; int save_pos1; struct symbol *function = NULL; -@@ -891,7 +892,7 @@ evaluate_subexp_standard (struct type *e +@@ -1187,7 +1188,7 @@ struct type *range_type = TYPE_INDEX_TYPE (type); struct type *element_type = TYPE_TARGET_TYPE (type); struct value *array = allocate_value (expect_type); @@ -1878,21 +1753,11 @@ Index: gdb-7.10.50.20151027/gdb/eval.c LONGEST low_bound, high_bound, index; if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) -@@ -1900,7 +1901,8 @@ evaluate_subexp_standard (struct type *e - { - struct type *type = value_type (arg1); - struct type *real_type; -- int full, top, using_enc; -+ int full, using_enc; -+ LONGEST top; - struct value_print_options opts; - - get_user_print_options (&opts); -Index: gdb-7.10.50.20151027/gdb/f-lang.c +Index: gdb-7.11.50.20160716/gdb/f-lang.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/f-lang.c 2015-11-02 21:23:11.206351614 +0100 -+++ gdb-7.10.50.20151027/gdb/f-lang.c 2015-11-02 21:23:13.216364839 +0100 -@@ -103,7 +103,7 @@ f_printchar (int c, struct type *type, s +--- gdb-7.11.50.20160716.orig/gdb/f-lang.c 2016-07-16 14:33:42.087510391 +0200 ++++ gdb-7.11.50.20160716/gdb/f-lang.c 2016-07-16 14:33:44.537530108 +0200 +@@ -103,7 +103,7 @@ static void f_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, @@ -1901,11 +1766,11 @@ Index: gdb-7.10.50.20151027/gdb/f-lang.c const struct value_print_options *options) { const char *type_encoding = f_get_encoding (type); -Index: gdb-7.10.50.20151027/gdb/f-lang.h +Index: gdb-7.11.50.20160716/gdb/f-lang.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/f-lang.h 2015-11-02 21:23:11.207351620 +0100 -+++ gdb-7.10.50.20151027/gdb/f-lang.h 2015-11-02 21:23:13.216364839 +0100 -@@ -30,7 +30,7 @@ extern void f_error (char *); /* Defined +--- gdb-7.11.50.20160716.orig/gdb/f-lang.h 2016-07-16 14:33:42.087510391 +0200 ++++ gdb-7.11.50.20160716/gdb/f-lang.h 2016-07-16 14:33:44.537530108 +0200 +@@ -30,7 +30,7 @@ extern void f_print_type (struct type *, const char *, struct ui_file *, int, int, const struct type_print_options *); @@ -1914,11 +1779,11 @@ Index: gdb-7.10.50.20151027/gdb/f-lang.h struct ui_file *, int, const struct value *, const struct value_print_options *); -Index: gdb-7.10.50.20151027/gdb/f-valprint.c +Index: gdb-7.11.50.20160716/gdb/f-valprint.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/f-valprint.c 2015-11-02 21:23:11.207351620 +0100 -+++ gdb-7.10.50.20151027/gdb/f-valprint.c 2015-11-02 21:24:34.108897090 +0100 -@@ -38,7 +38,7 @@ extern void _initialize_f_valprint (void +--- gdb-7.11.50.20160716.orig/gdb/f-valprint.c 2016-07-16 14:33:42.087510391 +0200 ++++ gdb-7.11.50.20160716/gdb/f-valprint.c 2016-07-16 14:33:44.537530108 +0200 +@@ -38,7 +38,7 @@ static void info_common_command (char *, int); static void f77_get_dynamic_length_of_aggregate (struct type *); @@ -1927,7 +1792,7 @@ Index: gdb-7.10.50.20151027/gdb/f-valprint.c /* 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. */ -@@ -73,8 +73,8 @@ f77_get_upperbound (struct type *type) +@@ -73,8 +73,8 @@ static void f77_get_dynamic_length_of_aggregate (struct type *type) { @@ -1938,7 +1803,7 @@ Index: gdb-7.10.50.20151027/gdb/f-valprint.c /* Recursively go all the way down into a possibly multi-dimensional F77 array and get the bounds. For simple arrays, this is pretty -@@ -106,7 +106,7 @@ f77_get_dynamic_length_of_aggregate (str +@@ -106,7 +106,7 @@ static void f77_print_array_1 (int nss, int ndimensions, struct type *type, const gdb_byte *valaddr, @@ -1947,7 +1812,7 @@ Index: gdb-7.10.50.20151027/gdb/f-valprint.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, -@@ -115,7 +115,7 @@ f77_print_array_1 (int nss, int ndimensi +@@ -115,7 +115,7 @@ struct type *range_type = TYPE_INDEX_TYPE (check_typedef (type)); CORE_ADDR addr = address + embedded_offset; LONGEST lowerbound, upperbound; @@ -1956,7 +1821,7 @@ Index: gdb-7.10.50.20151027/gdb/f-valprint.c get_discrete_bounds (range_type, &lowerbound, &upperbound); -@@ -178,7 +178,7 @@ f77_print_array_1 (int nss, int ndimensi +@@ -172,7 +172,7 @@ static void f77_print_array (struct type *type, const gdb_byte *valaddr, @@ -1965,7 +1830,7 @@ Index: gdb-7.10.50.20151027/gdb/f-valprint.c CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, -@@ -215,8 +215,9 @@ static const struct generic_val_print_de +@@ -211,8 +211,9 @@ function; they are identical. */ void @@ -1977,11 +1842,11 @@ Index: gdb-7.10.50.20151027/gdb/f-valprint.c const struct value *original_value, const struct value_print_options *options) { -Index: gdb-7.10.50.20151027/gdb/findvar.c +Index: gdb-7.11.50.20160716/gdb/findvar.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/findvar.c 2015-11-02 21:23:11.208351627 +0100 -+++ gdb-7.10.50.20151027/gdb/findvar.c 2015-11-02 21:23:13.217364846 +0100 -@@ -801,7 +801,7 @@ struct value * +--- gdb-7.11.50.20160716.orig/gdb/findvar.c 2016-07-16 14:33:42.088510399 +0200 ++++ gdb-7.11.50.20160716/gdb/findvar.c 2016-07-16 14:33:44.537530108 +0200 +@@ -802,7 +802,7 @@ default_value_from_register (struct gdbarch *gdbarch, struct type *type, int regnum, struct frame_id frame_id) { @@ -1990,21 +1855,16 @@ Index: gdb-7.10.50.20151027/gdb/findvar.c struct value *value = allocate_value (type); VALUE_LVAL (value) = lval_register; -@@ -834,10 +834,10 @@ void - read_frame_register_value (struct value *value, struct frame_info *frame) - { - struct gdbarch *gdbarch = get_frame_arch (frame); -- int offset = 0; -- int reg_offset = value_offset (value); -+ LONGEST offset = 0; -+ LONGEST reg_offset = value_offset (value); +@@ -838,7 +838,7 @@ + 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); -@@ -852,7 +852,7 @@ read_frame_register_value (struct value +@@ -853,7 +853,7 @@ while (len > 0) { struct value *regval = get_frame_register_value (frame, regnum); @@ -2013,11 +1873,11 @@ Index: gdb-7.10.50.20151027/gdb/findvar.c /* If the register length is larger than the number of bytes remaining to copy, then only copy the appropriate bytes. */ -Index: gdb-7.10.50.20151027/gdb/frame.c +Index: gdb-7.11.50.20160716/gdb/frame.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/frame.c 2015-11-02 21:23:11.208351627 +0100 -+++ gdb-7.10.50.20151027/gdb/frame.c 2015-11-02 21:23:13.218364852 +0100 -@@ -1272,7 +1272,7 @@ deprecated_frame_register_read (struct f +--- gdb-7.11.50.20160716.orig/gdb/frame.c 2016-07-16 14:33:42.089510407 +0200 ++++ gdb-7.11.50.20160716/gdb/frame.c 2016-07-16 14:33:44.538530116 +0200 +@@ -1320,7 +1320,7 @@ int get_frame_register_bytes (struct frame_info *frame, int regnum, @@ -2026,7 +1886,7 @@ Index: gdb-7.10.50.20151027/gdb/frame.c int *optimizedp, int *unavailablep) { struct gdbarch *gdbarch = get_frame_arch (frame); -@@ -1301,7 +1301,7 @@ get_frame_register_bytes (struct frame_i +@@ -1349,7 +1349,7 @@ } if (len > maxsize) error (_("Bad debug information detected: " @@ -2035,11 +1895,11 @@ Index: gdb-7.10.50.20151027/gdb/frame.c /* Copy the data. */ while (len > 0) -Index: gdb-7.10.50.20151027/gdb/frame.h +Index: gdb-7.11.50.20160716/gdb/frame.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/frame.h 2015-11-02 21:23:11.209351634 +0100 -+++ gdb-7.10.50.20151027/gdb/frame.h 2015-11-02 21:23:13.218364852 +0100 -@@ -585,7 +585,7 @@ extern void put_frame_register (struct f +--- gdb-7.11.50.20160716.orig/gdb/frame.h 2016-07-16 14:33:42.090510415 +0200 ++++ gdb-7.11.50.20160716/gdb/frame.h 2016-07-16 14:33:44.538530116 +0200 +@@ -585,7 +585,7 @@ contents are optimized out or unavailable, set *OPTIMIZEDP, *UNAVAILABLEP accordingly. */ extern int get_frame_register_bytes (struct frame_info *frame, int regnum, @@ -2048,11 +1908,11 @@ Index: gdb-7.10.50.20151027/gdb/frame.h gdb_byte *myaddr, int *optimizedp, int *unavailablep); -Index: gdb-7.10.50.20151027/gdb/gdbtypes.c +Index: gdb-7.11.50.20160716/gdb/gdbtypes.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/gdbtypes.c 2015-11-02 21:23:11.212351653 +0100 -+++ gdb-7.10.50.20151027/gdb/gdbtypes.c 2015-11-02 21:23:13.220364866 +0100 -@@ -2719,7 +2719,7 @@ allocate_gnat_aux_type (struct type *typ +--- gdb-7.11.50.20160716.orig/gdb/gdbtypes.c 2016-07-16 14:33:42.092510431 +0200 ++++ gdb-7.11.50.20160716/gdb/gdbtypes.c 2016-07-16 14:33:44.539530124 +0200 +@@ -2722,7 +2722,7 @@ least as long as OBJFILE. */ struct type * @@ -2061,7 +1921,7 @@ Index: gdb-7.10.50.20151027/gdb/gdbtypes.c const char *name, struct objfile *objfile) { struct type *type; -@@ -2959,8 +2959,8 @@ is_public_ancestor (struct type *base, s +@@ -2962,8 +2962,8 @@ static int is_unique_ancestor_worker (struct type *base, struct type *dclass, @@ -2072,7 +1932,7 @@ Index: gdb-7.10.50.20151027/gdb/gdbtypes.c CORE_ADDR address, struct value *val) { int i, count = 0; -@@ -2971,7 +2971,7 @@ is_unique_ancestor_worker (struct type * +@@ -2974,7 +2974,7 @@ for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i) { struct type *iter; @@ -2081,7 +1941,7 @@ Index: gdb-7.10.50.20151027/gdb/gdbtypes.c iter = check_typedef (TYPE_BASECLASS (dclass, i)); -@@ -3012,7 +3012,7 @@ is_unique_ancestor_worker (struct type * +@@ -3015,7 +3015,7 @@ int is_unique_ancestor (struct type *base, struct value *val) { @@ -2090,7 +1950,7 @@ Index: gdb-7.10.50.20151027/gdb/gdbtypes.c return is_unique_ancestor_worker (base, value_type (val), &offset, value_contents_for_printing (val), -@@ -4200,7 +4200,7 @@ recursive_dump_type (struct type *type, +@@ -4203,7 +4203,7 @@ break; } puts_filtered ("\n"); @@ -2099,40 +1959,20 @@ Index: gdb-7.10.50.20151027/gdb/gdbtypes.c if (TYPE_OBJFILE_OWNED (type)) { printfi_filtered (spaces, "objfile "); -@@ -4328,8 +4328,8 @@ recursive_dump_type (struct type *type, - idx, plongest (TYPE_FIELD_ENUMVAL (type, idx))); - else - printfi_filtered (spaces + 2, -- "[%d] bitpos %d bitsize %d type ", -- idx, TYPE_FIELD_BITPOS (type, idx), -+ "[%d] bitpos %s bitsize %d type ", -+ idx, plongest (TYPE_FIELD_BITPOS (type, idx)), - TYPE_FIELD_BITSIZE (type, idx)); - gdb_print_host_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout); - printf_filtered (" name '%s' (", -@@ -4671,7 +4671,7 @@ copy_type (const struct type *type) +@@ -4663,7 +4663,7 @@ struct type * arch_type (struct gdbarch *gdbarch, -- enum type_code code, int length, char *name) -+ enum type_code code, LONGEST length, char *name) +- enum type_code code, int length, const char *name) ++ enum type_code code, LONGEST length, const char *name) { struct type *type; -Index: gdb-7.10.50.20151027/gdb/gdbtypes.h +Index: gdb-7.11.50.20160716/gdb/gdbtypes.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/gdbtypes.h 2015-11-02 21:23:11.213351660 +0100 -+++ gdb-7.10.50.20151027/gdb/gdbtypes.h 2015-11-02 21:23:13.220364866 +0100 -@@ -512,7 +512,7 @@ union field_location - gdbarch_bits_big_endian=0 targets, it is the bit offset to - the LSB. */ - -- int bitpos; -+ LONGEST bitpos; - - /* * Enum value. */ - LONGEST enumval; -@@ -822,7 +822,7 @@ struct type +--- gdb-7.11.50.20160716.orig/gdb/gdbtypes.h 2016-07-16 14:33:42.093510439 +0200 ++++ gdb-7.11.50.20160716/gdb/gdbtypes.h 2016-07-16 14:33:44.539530124 +0200 +@@ -806,7 +806,7 @@ type_length_units function should be used in order to get the length expressed in target addressable memory units. */ @@ -2141,7 +1981,7 @@ Index: gdb-7.10.50.20151027/gdb/gdbtypes.h /* * Core type, shared by a group of qualified types. */ -@@ -1717,11 +1717,12 @@ extern unsigned int type_length_units (s +@@ -1677,11 +1677,11 @@ /* * Helper function to construct objfile-owned types. */ @@ -2150,17 +1990,16 @@ Index: gdb-7.10.50.20151027/gdb/gdbtypes.h struct objfile *); /* Helper functions to construct architecture-owned types. */ --extern struct type *arch_type (struct gdbarch *, enum type_code, int, char *); +-extern struct type *arch_type (struct gdbarch *, enum type_code, int, +extern struct type *arch_type (struct gdbarch *, enum type_code, LONGEST, -+ char *); - extern struct type *arch_integer_type (struct gdbarch *, int, int, char *); - extern struct type *arch_character_type (struct gdbarch *, int, int, char *); - extern struct type *arch_boolean_type (struct gdbarch *, int, int, char *); -Index: gdb-7.10.50.20151027/gdb/gnu-v2-abi.c + const char *); + extern struct type *arch_integer_type (struct gdbarch *, int, int, + const char *); +Index: gdb-7.11.50.20160716/gdb/gnu-v2-abi.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/gnu-v2-abi.c 2015-11-02 21:23:11.213351660 +0100 -+++ gdb-7.10.50.20151027/gdb/gnu-v2-abi.c 2015-11-02 21:23:13.221364872 +0100 -@@ -82,7 +82,7 @@ gnuv2_is_operator_name (const char *name +--- gdb-7.11.50.20160716.orig/gdb/gnu-v2-abi.c 2016-07-16 14:33:42.093510439 +0200 ++++ gdb-7.11.50.20160716/gdb/gnu-v2-abi.c 2016-07-16 14:33:44.539530124 +0200 +@@ -82,7 +82,7 @@ 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, @@ -2169,40 +2008,26 @@ Index: gdb-7.10.50.20151027/gdb/gnu-v2-abi.c { struct value *arg1 = *arg1p; struct type *type1 = check_typedef (value_type (arg1)); -@@ -183,7 +183,8 @@ gnuv2_virtual_fn_field (struct value **a - - - static struct type * --gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc) -+gnuv2_value_rtti_type (struct value *v, int *full, LONGEST *top, -+ int *using_enc) - { - struct type *known_type; - struct type *rtti_type; -@@ -338,9 +339,9 @@ vb_match (struct type *type, int index, +@@ -338,7 +338,7 @@ 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, int embedded_offset, -+ const bfd_byte *valaddr, LONGEST embedded_offset, + const bfd_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, const struct value *val) - { - struct type *basetype = TYPE_BASECLASS (type, index); -@@ -358,8 +359,8 @@ gnuv2_baseclass_offset (struct type *typ +@@ -358,8 +358,7 @@ if (vb_match (type, i, basetype)) { struct type *field_type; -- int field_offset; +- LONGEST field_offset; - int field_length; -+ LONGEST field_offset; -+ LONGEST field_length; ++ LONGEST field_offset, field_length; CORE_ADDR addr; field_type = check_typedef (TYPE_FIELD_TYPE (type, i)); -@@ -383,7 +384,7 @@ gnuv2_baseclass_offset (struct type *typ +@@ -383,7 +382,7 @@ /* Don't go through baseclass_offset, as that wraps exceptions, thus, inner exceptions would be wrapped more than once. */ @@ -2211,11 +2036,11 @@ Index: gdb-7.10.50.20151027/gdb/gnu-v2-abi.c gnuv2_baseclass_offset (type, i, valaddr, embedded_offset, address, val); -Index: gdb-7.10.50.20151027/gdb/gnu-v3-abi.c +Index: gdb-7.11.50.20160716/gdb/gnu-v3-abi.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/gnu-v3-abi.c 2015-11-02 21:23:11.214351667 +0100 -+++ gdb-7.10.50.20151027/gdb/gnu-v3-abi.c 2015-11-02 21:23:13.221364872 +0100 -@@ -108,7 +108,7 @@ build_gdb_vtable_type (struct gdbarch *a +--- gdb-7.11.50.20160716.orig/gdb/gnu-v3-abi.c 2016-07-16 14:33:42.094510447 +0200 ++++ gdb-7.11.50.20160716/gdb/gnu-v3-abi.c 2016-07-16 14:33:44.539530124 +0200 +@@ -108,7 +108,7 @@ { struct type *t; struct field *field_list, *field; @@ -2224,7 +2049,7 @@ Index: gdb-7.10.50.20151027/gdb/gnu-v3-abi.c struct type *void_ptr_type = builtin_type (arch)->builtin_data_ptr; -@@ -184,7 +184,7 @@ vtable_ptrdiff_type (struct gdbarch *gdb +@@ -184,7 +184,7 @@ /* 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). */ @@ -2233,16 +2058,7 @@ Index: gdb-7.10.50.20151027/gdb/gnu-v3-abi.c vtable_address_point_offset (struct gdbarch *gdbarch) { struct type *vtable_type -@@ -286,7 +286,7 @@ gnuv3_get_vtable (struct gdbarch *gdbarc - - static struct type * - gnuv3_rtti_type (struct value *value, -- int *full_p, int *top_p, int *using_enc_p) -+ int *full_p, LONGEST *top_p, int *using_enc_p) - { - struct gdbarch *gdbarch; - struct type *values_type = check_typedef (value_type (value)); -@@ -411,7 +411,7 @@ gnuv3_get_virtual_fn (struct gdbarch *gd +@@ -411,7 +411,7 @@ static struct value * gnuv3_virtual_fn_field (struct value **value_p, struct fn_field *f, int j, @@ -2251,18 +2067,16 @@ Index: gdb-7.10.50.20151027/gdb/gnu-v3-abi.c { struct type *values_type = check_typedef (value_type (*value_p)); struct gdbarch *gdbarch; -@@ -441,16 +441,16 @@ gnuv3_virtual_fn_field (struct value **v +@@ -441,7 +441,7 @@ -1 is returned on error. */ -static int +static LONGEST gnuv3_baseclass_offset (struct type *type, int index, -- const bfd_byte *valaddr, int embedded_offset, -+ const bfd_byte *valaddr, LONGEST embedded_offset, + const bfd_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, const struct value *val) - { - struct gdbarch *gdbarch; +@@ -450,7 +450,7 @@ struct type *ptr_type; struct value *vtable; struct value *vbase_array; @@ -2271,7 +2085,7 @@ Index: gdb-7.10.50.20151027/gdb/gnu-v3-abi.c /* Determine architecture. */ gdbarch = get_type_arch (type); -@@ -474,7 +474,7 @@ gnuv3_baseclass_offset (struct type *typ +@@ -474,7 +474,7 @@ cur_base_offset = cur_base_offset + vtable_address_point_offset (gdbarch); if ((- cur_base_offset) % TYPE_LENGTH (ptr_type) != 0) error (_("Misaligned vbase offset.")); @@ -2280,7 +2094,7 @@ Index: gdb-7.10.50.20151027/gdb/gnu-v3-abi.c vtable = gnuv3_get_vtable (gdbarch, type, address + embedded_offset); gdb_assert (vtable != NULL); -@@ -518,7 +518,7 @@ gnuv3_find_method_in (struct type *domai +@@ -518,7 +518,7 @@ we're out of luck. */ for (i = 0; i < TYPE_N_BASECLASSES (domain); i++) { @@ -2289,11 +2103,11 @@ Index: gdb-7.10.50.20151027/gdb/gnu-v3-abi.c struct type *basetype; if (BASETYPE_VIA_VIRTUAL (domain, i)) -Index: gdb-7.10.50.20151027/gdb/go-lang.h +Index: gdb-7.11.50.20160716/gdb/go-lang.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/go-lang.h 2015-11-02 21:23:11.214351667 +0100 -+++ gdb-7.10.50.20151027/gdb/go-lang.h 2015-11-02 21:23:13.221364872 +0100 -@@ -85,7 +85,7 @@ extern void go_print_type (struct type * +--- gdb-7.11.50.20160716.orig/gdb/go-lang.h 2016-07-16 14:33:42.094510447 +0200 ++++ gdb-7.11.50.20160716/gdb/go-lang.h 2016-07-16 14:33:44.539530124 +0200 +@@ -85,7 +85,7 @@ /* Defined in go-valprint.c. */ extern void go_val_print (struct type *type, const gdb_byte *valaddr, @@ -2302,20 +2116,11 @@ Index: gdb-7.10.50.20151027/gdb/go-lang.h struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); -Index: gdb-7.10.50.20151027/gdb/go-valprint.c +Index: gdb-7.11.50.20160716/gdb/go-valprint.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/go-valprint.c 2015-11-02 21:23:11.214351667 +0100 -+++ gdb-7.10.50.20151027/gdb/go-valprint.c 2015-11-02 21:23:13.222364879 +0100 -@@ -37,7 +37,7 @@ - - static void - print_go_string (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) -@@ -86,9 +86,9 @@ print_go_string (struct type *type, cons +--- gdb-7.11.50.20160716.orig/gdb/go-valprint.c 2016-07-16 14:33:42.094510447 +0200 ++++ gdb-7.11.50.20160716/gdb/go-valprint.c 2016-07-16 14:33:44.539530124 +0200 +@@ -86,9 +86,9 @@ /* Implements the la_val_print routine for language Go. */ void @@ -2328,11 +2133,11 @@ Index: gdb-7.10.50.20151027/gdb/go-valprint.c const struct value_print_options *options) { type = check_typedef (type); -Index: gdb-7.10.50.20151027/gdb/jv-lang.c +Index: gdb-7.11.50.20160716/gdb/jv-lang.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/jv-lang.c 2015-11-02 21:23:11.215351673 +0100 -+++ gdb-7.10.50.20151027/gdb/jv-lang.c 2015-11-02 21:23:13.222364879 +0100 -@@ -440,7 +440,7 @@ java_link_class_type (struct gdbarch *gd +--- gdb-7.11.50.20160716.orig/gdb/jv-lang.c 2016-07-16 14:33:42.094510447 +0200 ++++ gdb-7.11.50.20160716/gdb/jv-lang.c 2016-07-16 14:33:44.540530132 +0200 +@@ -440,7 +440,7 @@ for (i = TYPE_N_BASECLASSES (type); i < nfields; i++) { int accflags; @@ -2341,7 +2146,7 @@ Index: gdb-7.10.50.20151027/gdb/jv-lang.c if (fields == NULL) { -@@ -890,7 +890,7 @@ java_printchar (int c, struct type *type +@@ -890,7 +890,7 @@ static void java_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, @@ -2350,11 +2155,11 @@ Index: gdb-7.10.50.20151027/gdb/jv-lang.c const struct value_print_options *options) { const char *type_encoding = java_get_encoding (type); -Index: gdb-7.10.50.20151027/gdb/jv-lang.h +Index: gdb-7.11.50.20160716/gdb/jv-lang.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/jv-lang.h 2015-11-02 21:23:11.215351673 +0100 -+++ gdb-7.10.50.20151027/gdb/jv-lang.h 2015-11-02 21:23:13.222364879 +0100 -@@ -43,8 +43,8 @@ struct builtin_java_type +--- gdb-7.11.50.20160716.orig/gdb/jv-lang.h 2016-07-16 14:33:42.094510447 +0200 ++++ gdb-7.11.50.20160716/gdb/jv-lang.h 2016-07-16 14:33:44.540530132 +0200 +@@ -43,8 +43,8 @@ extern const struct builtin_java_type *builtin_java_type (struct gdbarch *); @@ -2365,20 +2170,11 @@ Index: gdb-7.10.50.20151027/gdb/jv-lang.h const struct value *, const struct value_print_options *); -Index: gdb-7.10.50.20151027/gdb/jv-valprint.c +Index: gdb-7.11.50.20160716/gdb/jv-valprint.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/jv-valprint.c 2015-11-02 21:23:11.215351673 +0100 -+++ gdb-7.10.50.20151027/gdb/jv-valprint.c 2015-11-02 21:23:13.222364879 +0100 -@@ -266,7 +266,7 @@ java_value_print (struct value *val, str - - static void - java_print_value_fields (struct type *type, const gdb_byte *valaddr, -- int offset, -+ LONGEST offset, - CORE_ADDR address, struct ui_file *stream, - int recurse, - const struct value *val, -@@ -454,7 +454,7 @@ java_print_value_fields (struct type *ty +--- gdb-7.11.50.20160716.orig/gdb/jv-valprint.c 2016-07-16 14:33:42.095510455 +0200 ++++ gdb-7.11.50.20160716/gdb/jv-valprint.c 2016-07-16 14:33:44.540530132 +0200 +@@ -454,7 +454,7 @@ void java_val_print (struct type *type, const gdb_byte *valaddr, @@ -2387,11 +2183,11 @@ Index: gdb-7.10.50.20151027/gdb/jv-valprint.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) -Index: gdb-7.10.50.20151027/gdb/language.c +Index: gdb-7.11.50.20160716/gdb/language.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/language.c 2015-11-02 21:23:11.216351680 +0100 -+++ gdb-7.10.50.20151027/gdb/language.c 2015-11-02 21:23:13.223364885 +0100 -@@ -739,7 +739,7 @@ unk_lang_printchar (int c, struct type * +--- gdb-7.11.50.20160716.orig/gdb/language.c 2016-07-16 14:33:42.095510455 +0200 ++++ gdb-7.11.50.20160716/gdb/language.c 2016-07-16 14:33:44.540530132 +0200 +@@ -766,7 +766,7 @@ static void unk_lang_printstr (struct ui_file *stream, struct type *type, @@ -2400,7 +2196,7 @@ Index: gdb-7.10.50.20151027/gdb/language.c const char *encoding, int force_ellipses, const struct value_print_options *options) { -@@ -758,7 +758,7 @@ unk_lang_print_type (struct type *type, +@@ -785,7 +785,7 @@ static void unk_lang_val_print (struct type *type, const gdb_byte *valaddr, @@ -2409,11 +2205,11 @@ Index: gdb-7.10.50.20151027/gdb/language.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) -Index: gdb-7.10.50.20151027/gdb/language.h +Index: gdb-7.11.50.20160716/gdb/language.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/language.h 2015-11-02 21:23:11.216351680 +0100 -+++ gdb-7.10.50.20151027/gdb/language.h 2015-11-02 21:23:13.223364885 +0100 -@@ -189,7 +189,7 @@ struct language_defn +--- gdb-7.11.50.20160716.orig/gdb/language.h 2016-07-16 14:33:42.095510455 +0200 ++++ gdb-7.11.50.20160716/gdb/language.h 2016-07-16 14:33:44.540530132 +0200 +@@ -196,7 +196,7 @@ struct ui_file * stream); void (*la_printstr) (struct ui_file * stream, struct type *elttype, @@ -2422,7 +2218,7 @@ Index: gdb-7.10.50.20151027/gdb/language.h const char *encoding, int force_ellipses, const struct value_print_options *); -@@ -231,7 +231,7 @@ struct language_defn +@@ -238,7 +238,7 @@ void (*la_val_print) (struct type *type, const gdb_byte *contents, @@ -2431,11 +2227,11 @@ Index: gdb-7.10.50.20151027/gdb/language.h struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); -Index: gdb-7.10.50.20151027/gdb/m2-lang.c +Index: gdb-7.11.50.20160716/gdb/m2-lang.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/m2-lang.c 2015-11-02 21:23:11.217351686 +0100 -+++ gdb-7.10.50.20151027/gdb/m2-lang.c 2015-11-02 21:23:13.223364885 +0100 -@@ -104,10 +104,10 @@ m2_printchar (int c, struct type *type, +--- gdb-7.11.50.20160716.orig/gdb/m2-lang.c 2016-07-16 14:33:42.096510463 +0200 ++++ gdb-7.11.50.20160716/gdb/m2-lang.c 2016-07-16 14:33:44.540530132 +0200 +@@ -104,10 +104,10 @@ static void m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, @@ -2448,7 +2244,7 @@ Index: gdb-7.10.50.20151027/gdb/m2-lang.c unsigned int things_printed = 0; int in_quotes = 0; int need_comma = 0; -@@ -122,9 +122,9 @@ m2_printstr (struct ui_file *stream, str +@@ -122,9 +122,9 @@ { /* Position of the character we are examining to see whether it is repeated. */ @@ -2460,7 +2256,7 @@ Index: gdb-7.10.50.20151027/gdb/m2-lang.c QUIT; -@@ -150,7 +150,7 @@ m2_printstr (struct ui_file *stream, str +@@ -150,7 +150,7 @@ in_quotes = 0; } m2_printchar (string[i], type, stream); @@ -2469,11 +2265,11 @@ Index: gdb-7.10.50.20151027/gdb/m2-lang.c i = rep1 - 1; things_printed += options->repeat_count_threshold; need_comma = 1; -Index: gdb-7.10.50.20151027/gdb/m2-lang.h +Index: gdb-7.11.50.20160716/gdb/m2-lang.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/m2-lang.h 2015-11-02 21:23:11.217351686 +0100 -+++ gdb-7.10.50.20151027/gdb/m2-lang.h 2015-11-02 21:23:13.223364885 +0100 -@@ -34,7 +34,7 @@ extern void m2_print_typedef (struct typ +--- gdb-7.11.50.20160716.orig/gdb/m2-lang.h 2016-07-16 14:33:42.096510463 +0200 ++++ gdb-7.11.50.20160716/gdb/m2-lang.h 2016-07-16 14:33:44.540530132 +0200 +@@ -34,7 +34,7 @@ extern int m2_is_long_set (struct type *type); extern int m2_is_unbounded_array (struct type *type); @@ -2482,11 +2278,11 @@ Index: gdb-7.10.50.20151027/gdb/m2-lang.h struct ui_file *, int, const struct value *, const struct value_print_options *); -Index: gdb-7.10.50.20151027/gdb/m2-typeprint.c +Index: gdb-7.11.50.20160716/gdb/m2-typeprint.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/m2-typeprint.c 2015-11-02 21:23:11.217351686 +0100 -+++ gdb-7.10.50.20151027/gdb/m2-typeprint.c 2015-11-02 21:23:13.224364892 +0100 -@@ -234,9 +234,12 @@ static void m2_array (struct type *type, +--- gdb-7.11.50.20160716.orig/gdb/m2-typeprint.c 2016-07-16 14:33:42.096510463 +0200 ++++ gdb-7.11.50.20160716/gdb/m2-typeprint.c 2016-07-16 14:33:44.541530140 +0200 +@@ -234,9 +234,12 @@ m2_print_bounds (TYPE_INDEX_TYPE (type), stream, show, -1, 1); } else @@ -2502,11 +2298,11 @@ Index: gdb-7.10.50.20151027/gdb/m2-typeprint.c } fprintf_filtered (stream, "] OF "); m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags); -Index: gdb-7.10.50.20151027/gdb/m2-valprint.c +Index: gdb-7.11.50.20160716/gdb/m2-valprint.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/m2-valprint.c 2015-11-02 21:23:11.217351686 +0100 -+++ gdb-7.10.50.20151027/gdb/m2-valprint.c 2015-11-02 21:23:13.224364892 +0100 -@@ -35,7 +35,7 @@ static int print_unpacked_pointer (struc +--- gdb-7.11.50.20160716.orig/gdb/m2-valprint.c 2016-07-16 14:33:42.096510463 +0200 ++++ gdb-7.11.50.20160716/gdb/m2-valprint.c 2016-07-16 14:35:19.830297013 +0200 +@@ -35,7 +35,7 @@ struct ui_file *stream); static void m2_print_array_contents (struct type *type, const gdb_byte *valaddr, @@ -2515,7 +2311,7 @@ Index: gdb-7.10.50.20151027/gdb/m2-valprint.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, -@@ -67,7 +67,7 @@ get_long_set_bounds (struct type *type, +@@ -67,7 +67,7 @@ static void m2_print_long_set (struct type *type, const gdb_byte *valaddr, @@ -2524,7 +2320,7 @@ Index: gdb-7.10.50.20151027/gdb/m2-valprint.c struct ui_file *stream) { int empty_set = 1; -@@ -158,7 +158,7 @@ m2_print_long_set (struct type *type, co +@@ -158,7 +158,7 @@ static void m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr, @@ -2533,7 +2329,7 @@ Index: gdb-7.10.50.20151027/gdb/m2-valprint.c struct ui_file *stream, int recurse, const struct value_print_options *options) { -@@ -262,7 +262,7 @@ print_variable_at_address (struct type * +@@ -260,7 +260,7 @@ static void m2_print_array_contents (struct type *type, const gdb_byte *valaddr, @@ -2542,27 +2338,23 @@ Index: gdb-7.10.50.20151027/gdb/m2-valprint.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, -@@ -308,14 +308,15 @@ static const struct generic_val_print_de +@@ -308,13 +308,13 @@ function; they are identical. */ void -m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, -- CORE_ADDR address, struct ui_file *stream, int recurse, -+m2_val_print (struct type *type, const gdb_byte *valaddr, -+ LONGEST embedded_offset, CORE_ADDR address, -+ struct ui_file *stream, int recurse, ++m2_val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, + CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) { struct gdbarch *gdbarch = get_type_arch (type); -- unsigned int i = 0; /* Number of characters printed. */ - unsigned len; -+ ULONGEST i = 0; /* Number of characters printed. */ + ULONGEST len; struct type *elttype; CORE_ADDR addr; -@@ -340,7 +341,7 @@ m2_val_print (struct type *type, const g +@@ -339,7 +339,7 @@ elements up to it. */ if (options->stop_print_at_null) { @@ -2571,10 +2363,19 @@ Index: gdb-7.10.50.20151027/gdb/m2-valprint.c /* Look for a NULL char. */ for (temp_len = 0; -Index: gdb-7.10.50.20151027/gdb/memrange.c +@@ -415,7 +415,7 @@ + { + struct type *range = elttype; + LONGEST low_bound, high_bound; +- int i; ++ LONGEST i; + int need_comma = 0; + + fputs_filtered ("{", stream); +Index: gdb-7.11.50.20160716/gdb/memrange.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/memrange.c 2015-11-02 21:23:11.218351693 +0100 -+++ gdb-7.10.50.20151027/gdb/memrange.c 2015-11-02 21:23:13.224364892 +0100 +--- gdb-7.11.50.20160716.orig/gdb/memrange.c 2016-07-16 14:33:42.096510463 +0200 ++++ gdb-7.11.50.20160716/gdb/memrange.c 2016-07-16 14:33:44.541530140 +0200 @@ -21,8 +21,8 @@ #include "memrange.h" @@ -2586,11 +2387,11 @@ Index: gdb-7.10.50.20151027/gdb/memrange.c { ULONGEST h, l; -Index: gdb-7.10.50.20151027/gdb/memrange.h +Index: gdb-7.11.50.20160716/gdb/memrange.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/memrange.h 2015-11-02 21:23:11.218351693 +0100 -+++ gdb-7.10.50.20151027/gdb/memrange.h 2015-11-02 21:23:13.224364892 +0100 -@@ -30,7 +30,7 @@ struct mem_range +--- gdb-7.11.50.20160716.orig/gdb/memrange.h 2016-07-16 14:33:42.097510471 +0200 ++++ gdb-7.11.50.20160716/gdb/memrange.h 2016-07-16 14:33:44.541530140 +0200 +@@ -30,7 +30,7 @@ CORE_ADDR start; /* Length of the range. */ @@ -2599,7 +2400,7 @@ Index: gdb-7.10.50.20151027/gdb/memrange.h }; typedef struct mem_range mem_range_s; -@@ -40,8 +40,8 @@ DEF_VEC_O(mem_range_s); +@@ -40,8 +40,8 @@ /* Returns true if the ranges defined by [start1, start1+len1) and [start2, start2+len2) overlap. */ @@ -2610,11 +2411,11 @@ Index: gdb-7.10.50.20151027/gdb/memrange.h /* Returns true if ADDR is in RANGE. */ -Index: gdb-7.10.50.20151027/gdb/mips-linux-nat.c +Index: gdb-7.11.50.20160716/gdb/mips-linux-nat.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/mips-linux-nat.c 2015-11-02 21:23:11.218351693 +0100 -+++ gdb-7.10.50.20151027/gdb/mips-linux-nat.c 2015-11-02 21:23:13.225364899 +0100 -@@ -587,7 +587,7 @@ mips_linux_stopped_data_address (struct +--- gdb-7.11.50.20160716.orig/gdb/mips-linux-nat.c 2016-07-16 14:33:42.097510471 +0200 ++++ gdb-7.11.50.20160716/gdb/mips-linux-nat.c 2016-07-16 14:33:44.541530140 +0200 +@@ -587,7 +587,7 @@ static int mips_linux_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -2623,11 +2424,11 @@ Index: gdb-7.10.50.20151027/gdb/mips-linux-nat.c { struct pt_watch_regs dummy_regs; int i; -Index: gdb-7.10.50.20151027/gdb/opencl-lang.c +Index: gdb-7.11.50.20160716/gdb/opencl-lang.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/opencl-lang.c 2015-11-02 21:23:11.219351699 +0100 -+++ gdb-7.10.50.20151027/gdb/opencl-lang.c 2015-11-02 21:23:13.225364899 +0100 -@@ -78,11 +78,11 @@ builtin_opencl_type (struct gdbarch *gdb +--- gdb-7.11.50.20160716.orig/gdb/opencl-lang.c 2016-07-16 14:33:42.097510471 +0200 ++++ gdb-7.11.50.20160716/gdb/opencl-lang.c 2016-07-16 14:33:44.541530140 +0200 +@@ -78,11 +78,11 @@ static struct type * lookup_opencl_vector_type (struct gdbarch *gdbarch, enum type_code code, @@ -2641,37 +2442,29 @@ Index: gdb-7.10.50.20151027/gdb/opencl-lang.c struct type *type = NULL; struct type **types = builtin_opencl_type (gdbarch); -@@ -172,9 +172,9 @@ lval_func_read (struct value *v) - struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); - struct type *type = check_typedef (value_type (v)); +@@ -174,7 +174,7 @@ struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val))); -- int offset = value_offset (v); -- int elsize = TYPE_LENGTH (eltype); + LONGEST offset = value_offset (v); + LONGEST elsize = TYPE_LENGTH (eltype); - int n, i, j = 0; -+ LONGEST offset = value_offset (v); -+ LONGEST elsize = TYPE_LENGTH (eltype); + LONGEST n, i, j = 0; LONGEST lowb = 0; LONGEST highb = 0; -@@ -201,9 +201,9 @@ lval_func_write (struct value *v, struct - struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); - struct type *type = check_typedef (value_type (v)); +@@ -203,7 +203,7 @@ struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val))); -- int offset = value_offset (v); -- int elsize = TYPE_LENGTH (eltype); + LONGEST offset = value_offset (v); + LONGEST elsize = TYPE_LENGTH (eltype); - int n, i, j = 0; -+ LONGEST offset = value_offset (v); -+ LONGEST elsize = TYPE_LENGTH (eltype); + LONGEST n, i, j = 0; LONGEST lowb = 0; LONGEST highb = 0; -@@ -243,17 +243,17 @@ lval_func_write (struct value *v, struct +@@ -243,17 +243,17 @@ static int lval_func_check_synthetic_pointer (const struct value *v, -- int offset, int length) +- LONGEST offset, int length) + LONGEST offset, LONGEST length) { struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); @@ -2692,7 +2485,7 @@ Index: gdb-7.10.50.20151027/gdb/opencl-lang.c if (endrest) end++; -@@ -263,8 +263,8 @@ lval_func_check_synthetic_pointer (const +@@ -263,8 +263,8 @@ for (i = start; i < end; i++) { @@ -2703,11 +2496,11 @@ Index: gdb-7.10.50.20151027/gdb/opencl-lang.c if (!value_bits_synthetic_pointer (c->val, c->indices[i] * elsize + comp_offset, -Index: gdb-7.10.50.20151027/gdb/p-lang.c +Index: gdb-7.11.50.20160716/gdb/p-lang.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/p-lang.c 2015-11-02 21:23:11.219351699 +0100 -+++ gdb-7.10.50.20151027/gdb/p-lang.c 2015-11-02 21:23:13.225364899 +0100 -@@ -95,8 +95,8 @@ pascal_main_name (void) +--- gdb-7.11.50.20160716.orig/gdb/p-lang.c 2016-07-16 14:33:42.098510479 +0200 ++++ gdb-7.11.50.20160716/gdb/p-lang.c 2016-07-16 14:33:44.542530148 +0200 +@@ -95,8 +95,8 @@ are not multiple of TARGET_CHAR_BIT then the results are wrong but this does not happen for Free Pascal nor for GPC. */ int @@ -2718,7 +2511,7 @@ Index: gdb-7.10.50.20151027/gdb/p-lang.c struct type **char_type, const char **arrayname) { -@@ -216,12 +216,12 @@ pascal_printchar (int c, struct type *ty +@@ -216,12 +216,12 @@ void pascal_printstr (struct ui_file *stream, struct type *type, @@ -2733,7 +2526,7 @@ Index: gdb-7.10.50.20151027/gdb/p-lang.c unsigned int things_printed = 0; int in_quotes = 0; int need_comma = 0; -@@ -249,9 +249,9 @@ pascal_printstr (struct ui_file *stream, +@@ -249,9 +249,9 @@ { /* Position of the character we are examining to see whether it is repeated. */ @@ -2745,7 +2538,7 @@ Index: gdb-7.10.50.20151027/gdb/p-lang.c unsigned long int current_char; QUIT; -@@ -283,7 +283,7 @@ pascal_printstr (struct ui_file *stream, +@@ -283,7 +283,7 @@ in_quotes = 0; } pascal_printchar (current_char, type, stream); @@ -2754,11 +2547,11 @@ Index: gdb-7.10.50.20151027/gdb/p-lang.c i = rep1 - 1; things_printed += options->repeat_count_threshold; need_comma = 1; -Index: gdb-7.10.50.20151027/gdb/p-lang.h +Index: gdb-7.11.50.20160716/gdb/p-lang.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/p-lang.h 2015-11-02 21:23:11.219351699 +0100 -+++ gdb-7.10.50.20151027/gdb/p-lang.h 2015-11-02 21:23:13.226364905 +0100 -@@ -36,7 +36,7 @@ extern void pascal_print_type (struct ty +--- gdb-7.11.50.20160716.orig/gdb/p-lang.h 2016-07-16 14:33:42.098510479 +0200 ++++ gdb-7.11.50.20160716/gdb/p-lang.h 2016-07-16 14:33:44.542530148 +0200 +@@ -36,7 +36,7 @@ extern void pascal_print_typedef (struct type *, struct symbol *, struct ui_file *); @@ -2767,7 +2560,7 @@ Index: gdb-7.10.50.20151027/gdb/p-lang.h CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); -@@ -50,13 +50,13 @@ extern void pascal_type_print_method_arg +@@ -50,13 +50,13 @@ /* These are in p-lang.c: */ extern int @@ -2783,20 +2576,11 @@ Index: gdb-7.10.50.20151027/gdb/p-lang.h const struct value_print_options *); extern struct type **const (pascal_builtin_types[]); -@@ -72,7 +72,7 @@ extern void - const struct type_print_options *); - - extern void pascal_object_print_value_fields (struct type *, const gdb_byte *, -- int, -+ LONGEST, - CORE_ADDR, struct ui_file *, - int, - const struct value *, -Index: gdb-7.10.50.20151027/gdb/p-valprint.c +Index: gdb-7.11.50.20160716/gdb/p-valprint.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/p-valprint.c 2015-11-02 21:23:11.220351706 +0100 -+++ gdb-7.10.50.20151027/gdb/p-valprint.c 2015-11-02 21:23:13.226364905 +0100 -@@ -57,7 +57,7 @@ static const struct generic_val_print_de +--- gdb-7.11.50.20160716.orig/gdb/p-valprint.c 2016-07-16 14:33:42.098510479 +0200 ++++ gdb-7.11.50.20160716/gdb/p-valprint.c 2016-07-16 14:33:44.542530148 +0200 +@@ -59,7 +59,7 @@ void pascal_val_print (struct type *type, const gdb_byte *valaddr, @@ -2805,7 +2589,7 @@ Index: gdb-7.10.50.20151027/gdb/p-valprint.c struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) -@@ -68,8 +68,8 @@ pascal_val_print (struct type *type, con +@@ -70,8 +70,8 @@ unsigned len; LONGEST low_bound, high_bound; struct type *elttype; @@ -2816,52 +2600,11 @@ Index: gdb-7.10.50.20151027/gdb/p-valprint.c struct type *char_type; CORE_ADDR addr; int want_space = 0; -@@ -467,7 +467,7 @@ static void pascal_object_print_static_f - const struct value_print_options *); - - static void pascal_object_print_value (struct type *, const gdb_byte *, -- int, -+ LONGEST, - CORE_ADDR, struct ui_file *, int, - const struct value *, - const struct value_print_options *, -@@ -526,7 +526,7 @@ pascal_object_is_vtbl_member (struct typ - - void - pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr, -- int offset, -+ LONGEST offset, - CORE_ADDR address, struct ui_file *stream, - int recurse, - const struct value *val, -@@ -697,7 +697,7 @@ pascal_object_print_value_fields (struct - - static void - pascal_object_print_value (struct type *type, const gdb_byte *valaddr, -- int offset, -+ LONGEST offset, - CORE_ADDR address, struct ui_file *stream, - int recurse, - const struct value *val, -@@ -720,11 +720,11 @@ pascal_object_print_value (struct type * - - for (i = 0; i < n_baseclasses; i++) - { -- int boffset = 0; -+ LONGEST boffset = 0; - struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); - const char *basename = type_name_no_tag (baseclass); - const gdb_byte *base_valaddr = NULL; -- int thisoffset; -+ LONGEST thisoffset; - int skip = 0; - - if (BASETYPE_VIA_VIRTUAL (type, i)) -Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c +Index: gdb-7.11.50.20160716/gdb/ppc-linux-nat.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/ppc-linux-nat.c 2015-11-02 21:23:11.221351713 +0100 -+++ gdb-7.10.50.20151027/gdb/ppc-linux-nat.c 2015-11-02 21:23:13.227364912 +0100 -@@ -1449,7 +1449,7 @@ ppc_linux_can_use_hw_breakpoint (struct +--- gdb-7.11.50.20160716.orig/gdb/ppc-linux-nat.c 2016-07-16 14:33:42.099510487 +0200 ++++ gdb-7.11.50.20160716/gdb/ppc-linux-nat.c 2016-07-16 14:33:44.542530148 +0200 +@@ -1449,7 +1449,7 @@ static int ppc_linux_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -2870,11 +2613,11 @@ Index: gdb-7.10.50.20151027/gdb/ppc-linux-nat.c { /* Handle sub-8-byte quantities. */ if (len <= 0) -Index: gdb-7.10.50.20151027/gdb/printcmd.c +Index: gdb-7.11.50.20160716/gdb/printcmd.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/printcmd.c 2015-11-02 21:23:11.221351713 +0100 -+++ gdb-7.10.50.20151027/gdb/printcmd.c 2015-11-02 21:23:13.227364912 +0100 -@@ -274,7 +274,7 @@ print_formatted (struct value *val, int +--- gdb-7.11.50.20160716.orig/gdb/printcmd.c 2016-07-16 14:33:42.099510487 +0200 ++++ gdb-7.11.50.20160716/gdb/printcmd.c 2016-07-16 14:33:44.543530156 +0200 +@@ -279,7 +279,7 @@ struct ui_file *stream) { struct type *type = check_typedef (value_type (val)); @@ -2883,7 +2626,7 @@ Index: gdb-7.10.50.20151027/gdb/printcmd.c if (VALUE_LVAL (val) == lval_memory) next_address = value_address (val) + len; -@@ -352,7 +352,7 @@ print_scalar_formatted (const gdb_byte * +@@ -357,7 +357,7 @@ { struct gdbarch *gdbarch = get_type_arch (type); LONGEST val_long = 0; @@ -2892,11 +2635,11 @@ Index: gdb-7.10.50.20151027/gdb/printcmd.c enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); /* String printing should go through val_print_scalar_formatted. */ -Index: gdb-7.10.50.20151027/gdb/procfs.c +Index: gdb-7.11.50.20160716/gdb/procfs.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/procfs.c 2015-11-02 21:23:11.223351726 +0100 -+++ gdb-7.10.50.20151027/gdb/procfs.c 2015-11-02 21:23:13.228364918 +0100 -@@ -4863,7 +4863,7 @@ procfs_remove_watchpoint (struct target_ +--- gdb-7.11.50.20160716.orig/gdb/procfs.c 2016-07-16 14:33:42.100510495 +0200 ++++ gdb-7.11.50.20160716/gdb/procfs.c 2016-07-16 14:33:44.543530156 +0200 +@@ -4863,7 +4863,7 @@ static int procfs_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -2905,24 +2648,11 @@ Index: gdb-7.10.50.20151027/gdb/procfs.c { /* The man page for proc(4) on Solaris 2.6 and up says that the system can support "thousands" of hardware watchpoints, but gives -Index: gdb-7.10.50.20151027/gdb/python/py-prettyprint.c +Index: gdb-7.11.50.20160716/gdb/regcache.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/python/py-prettyprint.c 2015-11-02 21:23:11.223351726 +0100 -+++ gdb-7.10.50.20151027/gdb/python/py-prettyprint.c 2015-11-02 21:23:13.229364925 +0100 -@@ -703,7 +703,7 @@ print_children (PyObject *printer, const - enum ext_lang_rc - gdbpy_apply_val_pretty_printer (const struct extension_language_defn *extlang, - 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, -Index: gdb-7.10.50.20151027/gdb/regcache.c -=================================================================== ---- gdb-7.10.50.20151027.orig/gdb/regcache.c 2015-11-02 21:23:11.224351732 +0100 -+++ gdb-7.10.50.20151027/gdb/regcache.c 2015-11-02 21:23:13.229364925 +0100 -@@ -958,7 +958,7 @@ typedef void (regcache_write_ftype) (str +--- gdb-7.11.50.20160716.orig/gdb/regcache.c 2016-07-16 14:33:42.101510503 +0200 ++++ gdb-7.11.50.20160716/gdb/regcache.c 2016-07-16 14:33:44.544530165 +0200 +@@ -967,7 +967,7 @@ static enum register_status regcache_xfer_part (struct regcache *regcache, int regnum, @@ -2931,7 +2661,7 @@ Index: gdb-7.10.50.20151027/gdb/regcache.c enum register_status (*read) (struct regcache *regcache, int regnum, gdb_byte *buf), -@@ -1002,7 +1002,7 @@ regcache_xfer_part (struct regcache *reg +@@ -1011,7 +1011,7 @@ enum register_status regcache_raw_read_part (struct regcache *regcache, int regnum, @@ -2940,7 +2670,7 @@ Index: gdb-7.10.50.20151027/gdb/regcache.c { struct regcache_descr *descr = regcache->descr; -@@ -1013,7 +1013,7 @@ regcache_raw_read_part (struct regcache +@@ -1022,7 +1022,7 @@ void regcache_raw_write_part (struct regcache *regcache, int regnum, @@ -2949,7 +2679,7 @@ Index: gdb-7.10.50.20151027/gdb/regcache.c { struct regcache_descr *descr = regcache->descr; -@@ -1024,7 +1024,7 @@ regcache_raw_write_part (struct regcache +@@ -1033,7 +1033,7 @@ enum register_status regcache_cooked_read_part (struct regcache *regcache, int regnum, @@ -2958,7 +2688,7 @@ Index: gdb-7.10.50.20151027/gdb/regcache.c { struct regcache_descr *descr = regcache->descr; -@@ -1035,7 +1035,7 @@ regcache_cooked_read_part (struct regcac +@@ -1044,7 +1044,7 @@ void regcache_cooked_write_part (struct regcache *regcache, int regnum, @@ -2967,11 +2697,11 @@ Index: gdb-7.10.50.20151027/gdb/regcache.c { struct regcache_descr *descr = regcache->descr; -Index: gdb-7.10.50.20151027/gdb/regcache.h +Index: gdb-7.11.50.20160716/gdb/regcache.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/regcache.h 2015-11-02 21:23:11.224351732 +0100 -+++ gdb-7.10.50.20151027/gdb/regcache.h 2015-11-02 21:23:13.230364931 +0100 -@@ -92,9 +92,9 @@ extern void regcache_raw_write_unsigned +--- gdb-7.11.50.20160716.orig/gdb/regcache.h 2016-07-16 14:33:42.101510503 +0200 ++++ gdb-7.11.50.20160716/gdb/regcache.h 2016-07-16 14:33:44.544530165 +0200 +@@ -80,9 +80,9 @@ extern enum register_status regcache_raw_read_part (struct regcache *regcache, int regnum, @@ -2983,7 +2713,7 @@ Index: gdb-7.10.50.20151027/gdb/regcache.h void regcache_invalidate (struct regcache *regcache, int regnum); -@@ -131,10 +131,11 @@ extern void regcache_cooked_write_unsign +@@ -119,10 +119,11 @@ write style operations. */ enum register_status regcache_cooked_read_part (struct regcache *regcache, @@ -2998,11 +2728,11 @@ Index: gdb-7.10.50.20151027/gdb/regcache.h /* Special routines to read/write the PC. */ -Index: gdb-7.10.50.20151027/gdb/remote.c +Index: gdb-7.11.50.20160716/gdb/remote.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/remote.c 2015-11-02 21:23:11.227351752 +0100 -+++ gdb-7.10.50.20151027/gdb/remote.c 2015-11-02 21:23:13.232364945 +0100 -@@ -9157,7 +9157,7 @@ int remote_hw_breakpoint_limit = -1; +--- gdb-7.11.50.20160716.orig/gdb/remote.c 2016-07-16 14:33:42.104510527 +0200 ++++ gdb-7.11.50.20160716/gdb/remote.c 2016-07-16 14:33:44.545530172 +0200 +@@ -9473,7 +9473,7 @@ static int remote_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -3011,11 +2741,11 @@ Index: gdb-7.10.50.20151027/gdb/remote.c { if (remote_hw_watchpoint_length_limit == 0) return 0; -Index: gdb-7.10.50.20151027/gdb/spu-multiarch.c +Index: gdb-7.11.50.20160716/gdb/spu-multiarch.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/spu-multiarch.c 2015-11-02 21:23:11.228351759 +0100 -+++ gdb-7.10.50.20151027/gdb/spu-multiarch.c 2015-11-02 21:23:13.233364951 +0100 -@@ -127,7 +127,7 @@ spu_thread_architecture (struct target_o +--- gdb-7.11.50.20160716.orig/gdb/spu-multiarch.c 2016-07-16 14:33:42.105510536 +0200 ++++ gdb-7.11.50.20160716/gdb/spu-multiarch.c 2016-07-16 14:33:44.545530172 +0200 +@@ -127,7 +127,7 @@ /* Override the to_region_ok_for_hw_watchpoint routine. */ static int spu_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -3024,11 +2754,11 @@ Index: gdb-7.10.50.20151027/gdb/spu-multiarch.c { struct target_ops *ops_beneath = find_target_beneath (self); -Index: gdb-7.10.50.20151027/gdb/stack.c +Index: gdb-7.11.50.20160716/gdb/stack.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/stack.c 2015-11-02 21:23:11.229351765 +0100 -+++ gdb-7.10.50.20151027/gdb/stack.c 2015-11-02 21:23:13.233364951 +0100 -@@ -176,7 +176,7 @@ print_stack_frame (struct frame_info *fr +--- gdb-7.11.50.20160716.orig/gdb/stack.c 2016-07-16 14:33:42.106510544 +0200 ++++ gdb-7.11.50.20160716/gdb/stack.c 2016-07-16 14:33:44.546530181 +0200 +@@ -176,7 +176,7 @@ argument (not just the first nameless argument). */ static void @@ -3037,7 +2767,7 @@ Index: gdb-7.10.50.20151027/gdb/stack.c int first, struct ui_file *stream) { struct gdbarch *gdbarch = get_frame_arch (frame); -@@ -539,7 +539,7 @@ print_frame_args (struct symbol *func, s +@@ -537,7 +537,7 @@ /* 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. */ @@ -3046,7 +2776,7 @@ Index: gdb-7.10.50.20151027/gdb/stack.c /* Number of ints of arguments that we have printed so far. */ int args_printed = 0; struct cleanup *old_chain; -@@ -573,8 +573,8 @@ print_frame_args (struct symbol *func, s +@@ -571,8 +571,8 @@ case LOC_ARG: case LOC_REF_ARG: { @@ -3057,7 +2787,7 @@ Index: gdb-7.10.50.20151027/gdb/stack.c /* 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, s +@@ -707,7 +707,7 @@ enough about the stack to find them. */ if (num != -1) { @@ -3066,11 +2796,11 @@ Index: gdb-7.10.50.20151027/gdb/stack.c if (highest_offset == -1) start = gdbarch_frame_args_skip (get_frame_arch (frame)); -Index: gdb-7.10.50.20151027/gdb/symmisc.c +Index: gdb-7.11.50.20160716/gdb/symmisc.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/symmisc.c 2015-11-02 21:23:11.229351765 +0100 -+++ gdb-7.10.50.20151027/gdb/symmisc.c 2015-11-02 21:23:13.234364958 +0100 -@@ -534,11 +534,11 @@ print_symbol (void *args) +--- gdb-7.11.50.20160716.orig/gdb/symmisc.c 2016-07-16 14:33:42.107510552 +0200 ++++ gdb-7.11.50.20160716/gdb/symmisc.c 2016-07-16 14:33:44.546530181 +0200 +@@ -538,11 +538,11 @@ case LOC_CONST_BYTES: { @@ -3085,11 +2815,11 @@ Index: gdb-7.10.50.20151027/gdb/symmisc.c for (i = 0; i < TYPE_LENGTH (type); i++) fprintf_filtered (outfile, " %02x", (unsigned) SYMBOL_VALUE_BYTES (symbol)[i]); -Index: gdb-7.10.50.20151027/gdb/target.c +Index: gdb-7.11.50.20160716/gdb/target.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/target.c 2015-11-02 21:23:11.230351772 +0100 -+++ gdb-7.10.50.20151027/gdb/target.c 2015-11-02 21:23:13.234364958 +0100 -@@ -54,7 +54,7 @@ static int default_watchpoint_addr_withi +--- gdb-7.11.50.20160716.orig/gdb/target.c 2016-07-16 14:33:42.108510560 +0200 ++++ gdb-7.11.50.20160716/gdb/target.c 2016-07-16 14:33:44.546530181 +0200 +@@ -56,7 +56,7 @@ CORE_ADDR, CORE_ADDR, int); static int default_region_ok_for_hw_watchpoint (struct target_ops *, @@ -3098,7 +2828,7 @@ Index: gdb-7.10.50.20151027/gdb/target.c static void default_rcmd (struct target_ops *, const char *, struct ui_file *); -@@ -3132,7 +3132,7 @@ target_fileio_read_stralloc (struct infe +@@ -3196,7 +3196,7 @@ static int default_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -3107,11 +2837,11 @@ Index: gdb-7.10.50.20151027/gdb/target.c { return (len <= gdbarch_ptr_bit (target_gdbarch ()) / TARGET_CHAR_BIT); } -Index: gdb-7.10.50.20151027/gdb/target.h +Index: gdb-7.11.50.20160716/gdb/target.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/target.h 2015-11-02 21:23:11.231351779 +0100 -+++ gdb-7.10.50.20151027/gdb/target.h 2015-11-02 21:23:13.235364964 +0100 -@@ -549,7 +549,7 @@ struct target_ops +--- gdb-7.11.50.20160716.orig/gdb/target.h 2016-07-16 14:33:42.109510568 +0200 ++++ gdb-7.11.50.20160716/gdb/target.h 2016-07-16 14:33:44.547530189 +0200 +@@ -551,7 +551,7 @@ /* Documentation of this routine is provided with the corresponding target_* macro. */ int (*to_region_ok_for_hw_watchpoint) (struct target_ops *, @@ -3120,11 +2850,11 @@ Index: gdb-7.10.50.20151027/gdb/target.h TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint); int (*to_can_accel_watchpoint_condition) (struct target_ops *, -Index: gdb-7.10.50.20151027/gdb/tracepoint.c +Index: gdb-7.11.50.20160716/gdb/tracepoint.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/tracepoint.c 2015-11-02 21:23:11.233351792 +0100 -+++ gdb-7.10.50.20151027/gdb/tracepoint.c 2015-11-02 21:23:13.236364971 +0100 -@@ -930,13 +930,13 @@ add_register (struct collection_list *co +--- gdb-7.11.50.20160716.orig/gdb/tracepoint.c 2016-07-16 14:33:42.112510592 +0200 ++++ gdb-7.11.50.20160716/gdb/tracepoint.c 2016-07-16 14:33:44.547530189 +0200 +@@ -930,13 +930,13 @@ static void add_memrange (struct collection_list *memranges, int type, bfd_signed_vma base, @@ -3140,7 +2870,7 @@ Index: gdb-7.10.50.20151027/gdb/tracepoint.c } /* type: memrange_absolute == memory, other n == basereg */ -@@ -966,7 +966,7 @@ collect_symbol (struct collection_list * +@@ -966,7 +966,7 @@ CORE_ADDR scope, int trace_string) { @@ -3149,7 +2879,7 @@ Index: gdb-7.10.50.20151027/gdb/tracepoint.c unsigned int reg; bfd_signed_vma offset; int treat_as_expr = 0; -@@ -990,8 +990,8 @@ collect_symbol (struct collection_list * +@@ -990,8 +990,8 @@ char tmp[40]; sprintf_vma (tmp, offset); @@ -3160,7 +2890,7 @@ Index: gdb-7.10.50.20151027/gdb/tracepoint.c tmp /* address */); } /* A struct may be a C++ class with static fields, go to general -@@ -1023,8 +1023,8 @@ collect_symbol (struct collection_list * +@@ -1023,8 +1023,8 @@ offset = frame_offset + SYMBOL_VALUE (sym); if (info_verbose) { @@ -3171,7 +2901,7 @@ Index: gdb-7.10.50.20151027/gdb/tracepoint.c printf_vma (offset); printf_filtered (" from frame ptr reg %d\n", reg); } -@@ -1035,8 +1035,8 @@ collect_symbol (struct collection_list * +@@ -1035,8 +1035,8 @@ offset = 0; if (info_verbose) { @@ -3182,7 +2912,7 @@ Index: gdb-7.10.50.20151027/gdb/tracepoint.c printf_vma (offset); printf_filtered (" from reg %d\n", reg); } -@@ -1047,8 +1047,8 @@ collect_symbol (struct collection_list * +@@ -1047,8 +1047,8 @@ offset = frame_offset + SYMBOL_VALUE (sym); if (info_verbose) { @@ -3193,7 +2923,7 @@ Index: gdb-7.10.50.20151027/gdb/tracepoint.c printf_vma (offset); printf_filtered (" from frame ptr reg %d\n", reg); } -@@ -2708,7 +2708,8 @@ scope_info (char *args, int from_tty) +@@ -2703,7 +2703,8 @@ const char *symname; char *save_args = args; struct block_iterator iter; @@ -3203,7 +2933,7 @@ Index: gdb-7.10.50.20151027/gdb/tracepoint.c struct gdbarch *gdbarch; int regno; struct event_location *location; -@@ -2852,8 +2853,11 @@ scope_info (char *args, int from_tty) +@@ -2847,8 +2848,11 @@ } } if (SYMBOL_TYPE (sym)) @@ -3217,24 +2947,11 @@ Index: gdb-7.10.50.20151027/gdb/tracepoint.c } if (BLOCK_FUNCTION (block)) break; -Index: gdb-7.10.50.20151027/gdb/typeprint.c +Index: gdb-7.11.50.20160716/gdb/valarith.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/typeprint.c 2015-11-02 21:23:11.234351798 +0100 -+++ gdb-7.10.50.20151027/gdb/typeprint.c 2015-11-02 21:23:13.236364971 +0100 -@@ -406,7 +406,7 @@ whatis_exp (char *exp, int show) - struct type *real_type = NULL; - struct type *type; - int full = 0; -- int top = -1; -+ LONGEST top = -1; - int using_enc = 0; - struct value_print_options opts; - struct type_print_options flags = default_ptype_flags; -Index: gdb-7.10.50.20151027/gdb/valarith.c -=================================================================== ---- gdb-7.10.50.20151027.orig/gdb/valarith.c 2015-11-02 21:23:11.234351798 +0100 -+++ gdb-7.10.50.20151027/gdb/valarith.c 2015-11-02 21:23:59.822671496 +0100 -@@ -188,12 +188,12 @@ value_subscript (struct value *array, LO +--- gdb-7.11.50.20160716.orig/gdb/valarith.c 2016-07-16 14:33:42.114510608 +0200 ++++ gdb-7.11.50.20160716/gdb/valarith.c 2016-07-16 14:33:44.548530197 +0200 +@@ -188,7 +188,7 @@ to doubles, but no longer does. */ struct value * @@ -3243,14 +2960,7 @@ Index: gdb-7.10.50.20151027/gdb/valarith.c { struct type *array_type = check_typedef (value_type (array)); struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type)); -- unsigned int elt_size = type_length_units (elt_type); -- unsigned int elt_offs; -+ ULONGEST elt_size = type_length_units (elt_type); -+ ULONGEST elt_offs; - LONGEST elt_stride = TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (array_type)); - struct value *v; - -@@ -678,7 +678,7 @@ value_concat (struct value *arg1, struct +@@ -674,7 +674,7 @@ struct value *inval1; struct value *inval2; struct value *outval = NULL; @@ -3259,7 +2969,7 @@ Index: gdb-7.10.50.20151027/gdb/valarith.c int count, idx; char *ptr; char inchar; -@@ -1531,7 +1531,7 @@ value_binop (struct value *arg1, struct +@@ -1527,7 +1527,7 @@ int value_logical_not (struct value *arg1) { @@ -3268,7 +2978,7 @@ Index: gdb-7.10.50.20151027/gdb/valarith.c const gdb_byte *p; struct type *type1; -@@ -1562,11 +1562,11 @@ value_logical_not (struct value *arg1) +@@ -1558,11 +1558,11 @@ static int value_strcmp (struct value *arg1, struct value *arg2) { @@ -3283,20 +2993,11 @@ Index: gdb-7.10.50.20151027/gdb/valarith.c for (i = 0; i < len; i++) { -Index: gdb-7.10.50.20151027/gdb/valops.c +Index: gdb-7.11.50.20160716/gdb/valops.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/valops.c 2015-11-02 21:23:11.240351838 +0100 -+++ gdb-7.10.50.20151027/gdb/valops.c 2015-11-02 21:23:13.238364984 +0100 -@@ -51,7 +51,7 @@ static struct value *search_struct_field - - static struct value *search_struct_method (const char *, struct value **, - struct value **, -- int, int *, struct type *); -+ LONGEST, int *, struct type *); - - static int find_oload_champ_namespace (struct value **, int, - const char *, const char *, -@@ -79,7 +79,7 @@ oload_classification classify_oload_matc +--- gdb-7.11.50.20160716.orig/gdb/valops.c 2016-07-16 14:33:42.117510632 +0200 ++++ gdb-7.11.50.20160716/gdb/valops.c 2016-07-16 14:33:44.548530197 +0200 +@@ -79,7 +79,7 @@ int, int); static struct value *value_struct_elt_for_reference (struct type *, @@ -3305,19 +3006,7 @@ Index: gdb-7.10.50.20151027/gdb/valops.c const char *, struct type *, int, enum noside); -@@ -96,9 +96,9 @@ static CORE_ADDR allocate_space_in_infer - static struct value *cast_into_complex (struct type *, struct value *); - - static void find_method_list (struct value **, const char *, -- int, struct type *, struct fn_field **, int *, -+ LONGEST, struct type *, struct fn_field **, int *, - VEC (xmethod_worker_ptr) **, -- struct type **, int *); -+ struct type **, LONGEST *); - - void _initialize_valops (void); - -@@ -183,7 +183,7 @@ find_function_in_inferior (const char *n +@@ -183,7 +183,7 @@ space. */ struct value * @@ -3326,17 +3015,7 @@ Index: gdb-7.10.50.20151027/gdb/valops.c { struct objfile *objf; struct value *val = find_function_in_inferior ("malloc", &objf); -@@ -256,7 +256,8 @@ value_cast_structs (struct type *type, s - if (TYPE_NAME (t2) != NULL) - { - /* Try downcasting using the run-time type of the value. */ -- int full, top, using_enc; -+ int full, using_enc; -+ LONGEST top; - struct type *real_type; - - real_type = value_rtti_type (v2, &full, &top, &using_enc); -@@ -396,12 +397,12 @@ value_cast (struct type *type, struct va +@@ -397,12 +397,12 @@ if (code1 == TYPE_CODE_ARRAY) { struct type *element_type = TYPE_TARGET_TYPE (type); @@ -3351,64 +3030,7 @@ Index: gdb-7.10.50.20151027/gdb/valops.c LONGEST low_bound, high_bound, new_length; if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) -@@ -635,7 +636,7 @@ value_reinterpret_cast (struct type *typ - static int - dynamic_cast_check_1 (struct type *desired_type, - const gdb_byte *valaddr, -- int embedded_offset, -+ LONGEST embedded_offset, - CORE_ADDR address, - struct value *val, - struct type *search_type, -@@ -647,8 +648,8 @@ dynamic_cast_check_1 (struct type *desir - - for (i = 0; i < TYPE_N_BASECLASSES (search_type) && result_count < 2; ++i) - { -- int offset = baseclass_offset (search_type, i, valaddr, embedded_offset, -- address, val); -+ LONGEST offset = baseclass_offset (search_type, i, valaddr, -+ embedded_offset, address, val); - - if (class_types_same_p (desired_type, TYPE_BASECLASS (search_type, i))) - { -@@ -682,7 +683,7 @@ dynamic_cast_check_1 (struct type *desir - static int - dynamic_cast_check_2 (struct type *desired_type, - const gdb_byte *valaddr, -- int embedded_offset, -+ LONGEST embedded_offset, - CORE_ADDR address, - struct value *val, - struct type *search_type, -@@ -692,7 +693,7 @@ dynamic_cast_check_2 (struct type *desir - - for (i = 0; i < TYPE_N_BASECLASSES (search_type) && result_count < 2; ++i) - { -- int offset; -+ LONGEST offset; - - if (! BASETYPE_VIA_PUBLIC (search_type, i)) - continue; -@@ -723,7 +724,8 @@ dynamic_cast_check_2 (struct type *desir - struct value * - value_dynamic_cast (struct type *type, struct value *arg) - { -- int full, top, using_enc; -+ int full, using_enc; -+ LONGEST top; - struct type *resolved_type = check_typedef (type); - struct type *arg_type = check_typedef (value_type (arg)); - struct type *class_type, *rtti_type; -@@ -954,7 +956,7 @@ value_at_lazy (struct type *type, CORE_A - } - - void --read_value_memory (struct value *val, int embedded_offset, -+read_value_memory (struct value *val, LONGEST embedded_offset, - int stack, CORE_ADDR memaddr, - gdb_byte *buffer, size_t length) - { -@@ -1057,7 +1059,7 @@ value_assign (struct value *toval, struc +@@ -1063,7 +1063,7 @@ { const gdb_byte *dest_buffer; CORE_ADDR changed_addr; @@ -3417,134 +3039,7 @@ Index: gdb-7.10.50.20151027/gdb/valops.c gdb_byte buffer[sizeof (LONGEST)]; if (value_bitsize (toval)) -@@ -1126,7 +1128,7 @@ value_assign (struct value *toval, struc - if (value_bitsize (toval)) - { - struct value *parent = value_parent (toval); -- int offset = value_offset (parent) + value_offset (toval); -+ LONGEST offset = value_offset (parent) + value_offset (toval); - int changed_len; - gdb_byte buffer[sizeof (LONGEST)]; - int optim, unavail; -@@ -1590,7 +1592,7 @@ value_array (int lowbound, int highbound - { - int nelem; - int idx; -- unsigned int typelength; -+ ULONGEST typelength; - struct value *val; - struct type *arraytype; - -@@ -1766,7 +1768,7 @@ typecmp (int staticp, int varargs, int n - - static void - update_search_result (struct value **result_ptr, struct value *v, -- int *last_boffset, int boffset, -+ LONGEST *last_boffset, LONGEST boffset, - const char *name, struct type *type) - { - if (v != NULL) -@@ -1790,10 +1792,10 @@ update_search_result (struct value **res - lookup is ambiguous. */ - - static void --do_search_struct_field (const char *name, struct value *arg1, int offset, -+do_search_struct_field (const char *name, struct value *arg1, LONGEST offset, - struct type *type, int looking_for_baseclass, - struct value **result_ptr, -- int *last_boffset, -+ LONGEST *last_boffset, - struct type *outermost_type) - { - int i; -@@ -1840,7 +1842,7 @@ do_search_struct_field (const char *name - . */ - - struct value *v = NULL; -- int new_offset = offset; -+ LONGEST new_offset = offset; - - /* This is pretty gross. In G++, the offset in an - anonymous union is relative to the beginning of the -@@ -1879,7 +1881,7 @@ do_search_struct_field (const char *name - && (strcmp_iw (name, - TYPE_BASECLASS_NAME (type, - i)) == 0)); -- int boffset = value_embedded_offset (arg1) + offset; -+ LONGEST boffset = value_embedded_offset (arg1) + offset; - - if (BASETYPE_VIA_VIRTUAL (type, i)) - { -@@ -1955,7 +1957,7 @@ search_struct_field (const char *name, s - struct type *type, int looking_for_baseclass) - { - struct value *result = NULL; -- int boffset = 0; -+ LONGEST boffset = 0; - - do_search_struct_field (name, arg1, 0, type, looking_for_baseclass, - &result, &boffset, type); -@@ -1972,7 +1974,7 @@ search_struct_field (const char *name, s - - static struct value * - search_struct_method (const char *name, struct value **arg1p, -- struct value **args, int offset, -+ struct value **args, LONGEST offset, - int *static_memfuncp, struct type *type) - { - int i; -@@ -2036,8 +2038,8 @@ search_struct_method (const char *name, - - for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) - { -- int base_offset; -- int this_offset; -+ LONGEST base_offset; -+ LONGEST this_offset; - - if (BASETYPE_VIA_VIRTUAL (type, i)) - { -@@ -2272,10 +2274,10 @@ value_struct_elt_bitpos (struct value ** - - static void - find_method_list (struct value **argp, const char *method, -- int offset, struct type *type, -+ LONGEST offset, struct type *type, - struct fn_field **fn_list, int *num_fns, - VEC (xmethod_worker_ptr) **xm_worker_vec, -- struct type **basetype, int *boffset) -+ struct type **basetype, LONGEST *boffset) - { - int i; - struct fn_field *f = NULL; -@@ -2332,7 +2334,7 @@ find_method_list (struct value **argp, c - extension methods. */ - for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) - { -- int base_offset; -+ LONGEST base_offset; - - if (BASETYPE_VIA_VIRTUAL (type, i)) - { -@@ -2375,7 +2377,7 @@ value_find_oload_method_list (struct val - int offset, struct fn_field **fn_list, - int *num_fns, - VEC (xmethod_worker_ptr) **xm_worker_vec, -- struct type **basetype, int *boffset) -+ struct type **basetype, LONGEST *boffset) - { - struct type *t; - -@@ -2486,7 +2488,7 @@ find_overload_match (struct value **args - /* Number of overloaded instances being considered. */ - int num_fns = 0; - struct type *basetype = NULL; -- int boffset; -+ LONGEST boffset; - - struct cleanup *all_cleanups = make_cleanup (null_cleanup, NULL); - -@@ -3300,7 +3302,7 @@ compare_parameters (struct type *t1, str +@@ -3328,7 +3328,7 @@ the form "DOMAIN::NAME". */ static struct value * @@ -3553,7 +3048,7 @@ Index: gdb-7.10.50.20151027/gdb/valops.c struct type *curtype, const char *name, struct type *intype, int want_address, -@@ -3334,7 +3336,7 @@ value_struct_elt_for_reference (struct t +@@ -3362,7 +3362,7 @@ if (want_address) return value_from_longest (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain), @@ -3562,7 +3057,7 @@ Index: gdb-7.10.50.20151027/gdb/valops.c else if (noside != EVAL_NORMAL) return allocate_value (TYPE_FIELD_TYPE (t, i)); else -@@ -3502,7 +3504,7 @@ value_struct_elt_for_reference (struct t +@@ -3530,7 +3530,7 @@ for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--) { struct value *v; @@ -3571,16 +3066,7 @@ Index: gdb-7.10.50.20151027/gdb/valops.c if (BASETYPE_VIA_VIRTUAL (t, i)) base_offset = 0; -@@ -3583,7 +3585,7 @@ value_maybe_namespace_elt (const struct - - struct type * - value_rtti_indirect_type (struct value *v, int *full, -- int *top, int *using_enc) -+ LONGEST *top, int *using_enc) - { - struct value *target = NULL; - struct type *type, *real_type, *target_type; -@@ -3651,12 +3653,12 @@ value_rtti_indirect_type (struct value * +@@ -3679,7 +3679,7 @@ struct value * value_full_object (struct value *argp, struct type *rtype, @@ -3589,26 +3075,11 @@ Index: gdb-7.10.50.20151027/gdb/valops.c int xusing_enc) { struct type *real_type; - int full = 0; -- int top = -1; -+ LONGEST top = -1; - int using_enc = 0; - struct value *new_val; - -Index: gdb-7.10.50.20151027/gdb/valprint.c +Index: gdb-7.11.50.20160716/gdb/valprint.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/valprint.c 2015-11-02 21:23:11.242351851 +0100 -+++ gdb-7.10.50.20151027/gdb/valprint.c 2015-11-02 21:23:13.239364991 +0100 -@@ -299,7 +299,7 @@ val_print_scalar_type_p (struct type *ty - int - valprint_check_validity (struct ui_file *stream, - struct type *type, -- int embedded_offset, -+ LONGEST embedded_offset, - const struct value *val) - { - type = check_typedef (type); -@@ -834,7 +834,7 @@ generic_val_print_complex (struct type * +--- gdb-7.11.50.20160716.orig/gdb/valprint.c 2016-07-16 14:33:42.118510640 +0200 ++++ gdb-7.11.50.20160716/gdb/valprint.c 2016-07-16 14:33:44.549530205 +0200 +@@ -907,7 +907,7 @@ void generic_val_print (struct type *type, const gdb_byte *valaddr, @@ -3617,25 +3088,7 @@ Index: gdb-7.10.50.20151027/gdb/valprint.c struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options, -@@ -969,7 +969,7 @@ generic_val_print (struct type *type, co - RECURSE. */ - - void --val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, -+val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, - CORE_ADDR address, struct ui_file *stream, int recurse, - const struct value *val, - const struct value_print_options *options, -@@ -1221,7 +1221,7 @@ val_print_type_code_flags (struct type * - - void - val_print_scalar_formatted (struct type *type, -- const gdb_byte *valaddr, int embedded_offset, -+ const gdb_byte *valaddr, LONGEST embedded_offset, - const struct value *val, - const struct value_print_options *options, - int size, -@@ -1766,7 +1766,7 @@ print_decimal_chars (struct ui_file *str +@@ -1842,7 +1842,7 @@ void print_hex_chars (struct ui_file *stream, const gdb_byte *valaddr, @@ -3644,13 +3097,7 @@ Index: gdb-7.10.50.20151027/gdb/valprint.c { const gdb_byte *p; -@@ -1883,22 +1883,22 @@ maybe_print_array_index (struct type *in - - void - val_print_array_elements (struct type *type, -- const gdb_byte *valaddr, int embedded_offset, -+ const gdb_byte *valaddr, LONGEST embedded_offset, - CORE_ADDR address, struct ui_file *stream, +@@ -1964,17 +1964,17 @@ int recurse, const struct value *val, const struct value_print_options *options, @@ -3673,7 +3120,7 @@ Index: gdb-7.10.50.20151027/gdb/valprint.c LONGEST low_bound, high_bound; LONGEST low_pos, high_pos; -@@ -1988,7 +1988,7 @@ val_print_array_elements (struct type *t +@@ -2064,7 +2064,7 @@ address, stream, recurse + 1, val, options, current_language); annotate_elt_rep (reps); @@ -3682,7 +3129,7 @@ Index: gdb-7.10.50.20151027/gdb/valprint.c annotate_elt_rep_end (); i = rep1 - 1; -@@ -2644,7 +2644,7 @@ print_converted_chars_to_obstack (struct +@@ -2720,7 +2720,7 @@ void generic_printstr (struct ui_file *stream, struct type *type, @@ -3691,16 +3138,11 @@ Index: gdb-7.10.50.20151027/gdb/valprint.c const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options) -Index: gdb-7.10.50.20151027/gdb/valprint.h +Index: gdb-7.11.50.20160716/gdb/valprint.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/valprint.h 2015-11-02 21:23:11.242351851 +0100 -+++ gdb-7.10.50.20151027/gdb/valprint.h 2015-11-02 21:23:13.239364991 +0100 -@@ -115,11 +115,11 @@ extern void maybe_print_array_index (str - struct ui_file *stream, - const struct value_print_options *); - --extern void val_print_array_elements (struct type *, const gdb_byte *, int, -+extern void val_print_array_elements (struct type *, const gdb_byte *, LONGEST, +--- gdb-7.11.50.20160716.orig/gdb/valprint.h 2016-07-16 14:33:42.118510640 +0200 ++++ gdb-7.11.50.20160716/gdb/valprint.h 2016-07-16 14:33:44.549530205 +0200 +@@ -119,7 +119,7 @@ CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, @@ -3709,16 +3151,7 @@ Index: gdb-7.10.50.20151027/gdb/valprint.h extern void val_print_type_code_int (struct type *, const gdb_byte *, struct ui_file *); -@@ -129,7 +129,7 @@ extern void val_print_type_code_flags (s - struct ui_file *stream); - - extern void val_print_scalar_formatted (struct type *, -- const gdb_byte *, int, -+ const gdb_byte *, LONGEST, - const struct value *, - const struct value_print_options *, - int, -@@ -145,7 +145,7 @@ extern void print_decimal_chars (struct +@@ -141,7 +141,7 @@ unsigned int, enum bfd_endian); extern void print_hex_chars (struct ui_file *, const gdb_byte *, @@ -3727,7 +3160,7 @@ Index: gdb-7.10.50.20151027/gdb/valprint.h extern void print_char_chars (struct ui_file *, struct type *, const gdb_byte *, unsigned int, enum bfd_endian); -@@ -194,7 +194,7 @@ struct generic_val_print_decorations +@@ -194,7 +194,7 @@ extern void generic_val_print (struct type *type, const gdb_byte *valaddr, @@ -3736,7 +3169,7 @@ Index: gdb-7.10.50.20151027/gdb/valprint.h struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options, -@@ -204,7 +204,7 @@ extern void generic_emit_char (int c, st +@@ -204,7 +204,7 @@ int quoter, const char *encoding); extern void generic_printstr (struct ui_file *stream, struct type *type, @@ -3745,83 +3178,11 @@ Index: gdb-7.10.50.20151027/gdb/valprint.h const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options); -Index: gdb-7.10.50.20151027/gdb/value.c +Index: gdb-7.11.50.20160716/gdb/value.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/value.c 2015-11-02 21:23:11.248351890 +0100 -+++ gdb-7.10.50.20151027/gdb/value.c 2015-11-02 21:23:13.241365004 +0100 -@@ -66,10 +66,10 @@ struct internal_function - struct range - { - /* Lowest offset in the range. */ -- int offset; -+ LONGEST offset; - - /* Length of the range. */ -- int length; -+ LONGEST length; - }; - - typedef struct range range_s; -@@ -80,8 +80,8 @@ DEF_VEC_O(range_s); - [offset2, offset2+len2) overlap. */ - - static int --ranges_overlap (int offset1, int len1, -- int offset2, int len2) -+ranges_overlap (LONGEST offset1, LONGEST len1, -+ LONGEST offset2, LONGEST len2) - { - ULONGEST h, l; - -@@ -105,7 +105,7 @@ range_lessthan (const range_s *r1, const - OFFSET+LENGTH). */ - - static int --ranges_contain (VEC(range_s) *ranges, int offset, int length) -+ranges_contain (VEC(range_s) *ranges, LONGEST offset, LONGEST length) - { - range_s what; - int i; -@@ -240,7 +240,7 @@ struct value - the address. If lval == lval_register, this is a further offset from - location.address within the registers structure. Note also the member - embedded_offset below. */ -- int offset; -+ LONGEST offset; - - /* Only used for bitfields; number of bits contained in them. */ - int bitsize; -@@ -310,8 +310,8 @@ struct value - `type', and `embedded_offset' is zero, so everything works - normally. */ - struct type *enclosing_type; -- int embedded_offset; -- int pointed_to_offset; -+ LONGEST embedded_offset; -+ LONGEST pointed_to_offset; - - /* Values are stored in a chain, so that they can be deleted easily - over calls to the inferior. Values assigned to internal -@@ -350,7 +350,7 @@ get_value_arch (const struct value *valu - } - - int --value_bits_available (const struct value *value, int offset, int length) -+value_bits_available (const struct value *value, LONGEST offset, LONGEST length) - { - gdb_assert (!value->lazy); - -@@ -358,7 +358,8 @@ value_bits_available (const struct value - } - - int --value_bytes_available (const struct value *value, int offset, int length) -+value_bytes_available (const struct value *value, LONGEST offset, -+ LONGEST length) - { - return value_bits_available (value, - offset * TARGET_CHAR_BIT, -@@ -366,7 +367,8 @@ value_bytes_available (const struct valu +--- gdb-7.11.50.20160716.orig/gdb/value.c 2016-07-16 14:33:42.119510648 +0200 ++++ gdb-7.11.50.20160716/gdb/value.c 2016-07-16 14:33:44.549530205 +0200 +@@ -366,7 +366,8 @@ } int @@ -3831,36 +3192,7 @@ Index: gdb-7.10.50.20151027/gdb/value.c { gdb_assert (!value->lazy); -@@ -428,7 +430,8 @@ value_entirely_optimized_out (struct val - OFFSET bits, and extending for the next LENGTH bits. */ - - static void --insert_into_bit_range_vector (VEC(range_s) **vectorp, int offset, int length) -+insert_into_bit_range_vector (VEC(range_s) **vectorp, LONGEST offset, -+ LONGEST length) - { - range_s newr; - int i; -@@ -599,7 +602,8 @@ mark_value_bits_unavailable (struct valu - } - - void --mark_value_bytes_unavailable (struct value *value, int offset, int length) -+mark_value_bytes_unavailable (struct value *value, LONGEST offset, -+ LONGEST length) - { - mark_value_bits_unavailable (value, - offset * TARGET_CHAR_BIT, -@@ -613,7 +617,7 @@ mark_value_bytes_unavailable (struct val - - static int - find_first_range_overlap (VEC(range_s) *ranges, int pos, -- int offset, int length) -+ LONGEST offset, LONGEST length) - { - range_s *r; - int i; -@@ -809,9 +813,9 @@ find_first_range_overlap_and_match (stru +@@ -812,9 +813,9 @@ Return true if the available bits match. */ static int @@ -3873,59 +3205,7 @@ Index: gdb-7.10.50.20151027/gdb/value.c { /* Each array element corresponds to a ranges source (unavailable, optimized out). '1' is for VAL1, '2' for VAL2. */ -@@ -871,9 +875,9 @@ value_contents_bits_eq (const struct val - } - - int --value_contents_eq (const struct value *val1, int offset1, -- const struct value *val2, int offset2, -- int length) -+value_contents_eq (const struct value *val1, LONGEST offset1, -+ const struct value *val2, LONGEST offset2, -+ LONGEST length) - { - return value_contents_bits_eq (val1, offset1 * TARGET_CHAR_BIT, - val2, offset2 * TARGET_CHAR_BIT, -@@ -1037,13 +1041,13 @@ deprecated_set_value_type (struct value - value->type = type; - } - --int -+LONGEST - value_offset (const struct value *value) - { - return value->offset; - } - void --set_value_offset (struct value *value, int offset) -+set_value_offset (struct value *value, LONGEST offset) - { - value->offset = offset; - } -@@ -1257,8 +1261,9 @@ value_ranges_copy_adjusted (struct value - DST_OFFSET+LENGTH) range are wholly available. */ - - void --value_contents_copy_raw (struct value *dst, int dst_offset, -- struct value *src, int src_offset, int length) -+value_contents_copy_raw (struct value *dst, ssize_t dst_offset, -+ struct value *src, ssize_t src_offset, -+ ssize_t length) - { - range_s *r; - int src_bit_offset, dst_bit_offset, bit_length; -@@ -1305,8 +1310,8 @@ value_contents_copy_raw (struct value *d - DST_OFFSET+LENGTH) range are wholly available. */ - - void --value_contents_copy (struct value *dst, int dst_offset, -- struct value *src, int src_offset, int length) -+value_contents_copy (struct value *dst, ssize_t dst_offset, -+ struct value *src, ssize_t src_offset, ssize_t length) - { - if (src->lazy) - value_fetch_lazy (src); -@@ -1370,7 +1375,8 @@ value_optimized_out (struct value *value +@@ -1456,7 +1457,8 @@ the following LENGTH bytes. */ void @@ -3935,199 +3215,20 @@ Index: gdb-7.10.50.20151027/gdb/value.c { mark_value_bits_optimized_out (value, offset * TARGET_CHAR_BIT, -@@ -1380,14 +1386,15 @@ mark_value_bytes_optimized_out (struct v - /* See value.h. */ - - void --mark_value_bits_optimized_out (struct value *value, int offset, int length) -+mark_value_bits_optimized_out (struct value *value, LONGEST offset, -+ LONGEST length) - { - insert_into_bit_range_vector (&value->optimized_out, offset, length); - } - - int - value_bits_synthetic_pointer (const struct value *value, -- int offset, int length) -+ LONGEST offset, LONGEST length) - { - if (value->lval != lval_computed - || !value->location.computed.funcs->check_synthetic_pointer) -@@ -1397,26 +1404,26 @@ value_bits_synthetic_pointer (const stru - length); - } - --int -+LONGEST - value_embedded_offset (struct value *value) - { - return value->embedded_offset; - } - - void --set_value_embedded_offset (struct value *value, int val) -+set_value_embedded_offset (struct value *value, LONGEST val) - { - value->embedded_offset = val; - } - --int -+LONGEST - value_pointed_to_offset (struct value *value) - { - return value->pointed_to_offset; - } - - void --set_value_pointed_to_offset (struct value *value, int val) -+set_value_pointed_to_offset (struct value *value, LONGEST val) - { - value->pointed_to_offset = val; - } -@@ -2295,7 +2302,7 @@ get_internalvar_function (struct interna - } - - void --set_internalvar_component (struct internalvar *var, int offset, int bitpos, -+set_internalvar_component (struct internalvar *var, LONGEST offset, int bitpos, - int bitsize, struct value *newval) - { - gdb_byte *addr; -@@ -3020,7 +3027,7 @@ set_value_enclosing_type (struct value * - FIELDNO says which field. */ - - struct value * --value_primitive_field (struct value *arg1, int offset, -+value_primitive_field (struct value *arg1, LONGEST offset, - int fieldno, struct type *arg_type) - { - struct value *v; -@@ -3072,7 +3079,7 @@ value_primitive_field (struct value *arg - /* This field is actually a base subobject, so preserve the - entire object's contents for later references to virtual - bases, etc. */ -- int boffset; -+ LONGEST boffset; - - /* Lazy register values with offsets are not supported. */ - if (VALUE_LVAL (arg1) == lval_register && value_lazy (arg1)) -@@ -3159,7 +3166,7 @@ value_field (struct value *arg1, int fie - struct value * - value_fn_field (struct value **arg1p, struct fn_field *f, - int j, struct type *type, -- int offset) -+ LONGEST offset) - { - struct value *v; - struct type *ftype = TYPE_FN_FIELD_TYPE (f, j); -@@ -3229,14 +3236,14 @@ value_fn_field (struct value **arg1p, st - - static LONGEST - unpack_bits_as_long (struct type *field_type, const gdb_byte *valaddr, -- int bitpos, int bitsize) -+ LONGEST bitpos, int bitsize) - { - enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (field_type)); - ULONGEST val; - ULONGEST valmask; - int lsbcount; - int bytes_read; -- int read_offset; -+ LONGEST read_offset; - - /* Read the minimum number of bytes required; there may not be - enough bytes to read an entire ULONGEST. */ -@@ -3285,7 +3292,7 @@ unpack_bits_as_long (struct type *field_ - - int - unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, -- int embedded_offset, int fieldno, -+ LONGEST embedded_offset, int fieldno, - const struct value *val, LONGEST *result) - { - int bitpos = TYPE_FIELD_BITPOS (type, fieldno); -@@ -3329,7 +3336,7 @@ unpack_field_as_long (struct type *type, - void - unpack_value_bitfield (struct value *dest_val, - int bitpos, int bitsize, -- const gdb_byte *valaddr, int embedded_offset, -+ const gdb_byte *valaddr, LONGEST embedded_offset, - const struct value *val) - { - enum bfd_endian byte_order; -@@ -3367,7 +3374,7 @@ unpack_value_bitfield (struct value *des - struct value * - value_field_bitfield (struct type *type, int fieldno, - const gdb_byte *valaddr, -- int embedded_offset, const struct value *val) -+ LONGEST embedded_offset, const struct value *val) - { - int bitpos = TYPE_FIELD_BITPOS (type, fieldno); - int bitsize = TYPE_FIELD_BITSIZE (type, fieldno); -@@ -3388,12 +3395,12 @@ value_field_bitfield (struct type *type, - - void - modify_field (struct type *type, gdb_byte *addr, -- LONGEST fieldval, int bitpos, int bitsize) -+ LONGEST fieldval, LONGEST bitpos, int bitsize) - { - enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); - ULONGEST oword; - ULONGEST mask = (ULONGEST) -1 >> (8 * sizeof (ULONGEST) - bitsize); -- int bytesize; -+ LONGEST bytesize; - - /* Normalize BITPOS. */ - addr += bitpos / 8; -Index: gdb-7.10.50.20151027/gdb/value.h +Index: gdb-7.11.50.20160716/gdb/value.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/value.h 2015-11-02 21:23:11.250351904 +0100 -+++ gdb-7.10.50.20151027/gdb/value.h 2015-11-02 21:23:13.241365004 +0100 -@@ -135,8 +135,8 @@ extern void set_value_parent (struct val - within the registers structure. Note also the member - embedded_offset below. */ - --extern int value_offset (const struct value *); --extern void set_value_offset (struct value *, int offset); -+extern LONGEST value_offset (const struct value *); -+extern void set_value_offset (struct value *, LONGEST offset); - - /* The comment from "struct value" reads: ``Is it modifiable? Only - relevant if lval != not_lval.''. Shouldn't the value instead be -@@ -205,10 +205,10 @@ extern struct type *value_actual_type (s - int resolve_simple_types, - int *real_type_found); - --extern int value_pointed_to_offset (struct value *value); --extern void set_value_pointed_to_offset (struct value *value, int val); --extern int value_embedded_offset (struct value *value); --extern void set_value_embedded_offset (struct value *value, int val); -+extern LONGEST value_pointed_to_offset (struct value *value); -+extern void set_value_pointed_to_offset (struct value *value, LONGEST val); -+extern LONGEST value_embedded_offset (struct value *value); -+extern void set_value_embedded_offset (struct value *value, LONGEST val); - - /* For lval_computed values, this structure holds functions used to - retrieve and set the value (or portions of the value). -@@ -246,7 +246,7 @@ struct lval_funcs +--- gdb-7.11.50.20160716.orig/gdb/value.h 2016-07-16 14:33:42.120510656 +0200 ++++ gdb-7.11.50.20160716/gdb/value.h 2016-07-16 14:33:44.550530213 +0200 +@@ -246,7 +246,7 @@ /* 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, -- int offset, int length); +- 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 -@@ -283,7 +283,7 @@ extern struct value *allocate_computed_v - Otherwise, return 1. */ - - extern int valprint_check_validity (struct ui_file *stream, struct type *type, -- int embedded_offset, -+ LONGEST embedded_offset, - const struct value *val); - - extern struct value *allocate_optimized_out_value (struct type *type); -@@ -377,7 +377,8 @@ extern int value_optimized_out (struct v +@@ -377,7 +377,8 @@ otherwise. */ extern int value_bits_any_optimized_out (const struct value *value, @@ -4137,7 +3238,7 @@ Index: gdb-7.10.50.20151027/gdb/value.h /* Like value_optimized_out, but return true iff the whole value is optimized out. */ -@@ -387,13 +388,13 @@ extern int value_entirely_optimized_out +@@ -387,7 +388,7 @@ LENGTH bytes as optimized out. */ extern void mark_value_bytes_optimized_out (struct value *value, @@ -4146,124 +3247,12 @@ Index: gdb-7.10.50.20151027/gdb/value.h /* Mark VALUE's content bits starting at OFFSET and extending for LENGTH bits as optimized out. */ - - extern void mark_value_bits_optimized_out (struct value *value, -- int offset, int length); -+ LONGEST offset, LONGEST length); - - /* Set or return field indicating whether a variable is initialized or - not, based on debugging information supplied by the compiler. -@@ -476,7 +477,7 @@ extern struct value *coerce_array (struc - extending for LENGTH bits are a synthetic pointer. */ - - extern int value_bits_synthetic_pointer (const struct value *value, -- int offset, int length); -+ LONGEST offset, LONGEST length); - - /* Given a value, determine whether the contents bytes starting at - OFFSET and extending for LENGTH bytes are available. This returns -@@ -484,7 +485,7 @@ extern int value_bits_synthetic_pointer - byte is unavailable. */ - - extern int value_bytes_available (const struct value *value, -- int offset, int length); -+ LONGEST offset, LONGEST length); - - /* Given a value, determine whether the contents bits starting at - OFFSET and extending for LENGTH bits are available. This returns -@@ -492,7 +493,7 @@ extern int value_bytes_available (const - bit is unavailable. */ - - extern int value_bits_available (const struct value *value, -- int offset, int length); -+ LONGEST offset, LONGEST length); - - /* Like value_bytes_available, but return false if any byte in the - whole object is unavailable. */ -@@ -506,7 +507,7 @@ extern int value_entirely_unavailable (s - LENGTH bytes as unavailable. */ - - extern void mark_value_bytes_unavailable (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 unavailable. */ -@@ -567,9 +568,9 @@ extern void mark_value_bits_unavailable - after the inferior is gone, it works with const values. Therefore, - this routine must not be called with lazy values. */ - --extern int value_contents_eq (const struct value *val1, int offset1, -- const struct value *val2, int offset2, -- int length); -+extern int value_contents_eq (const struct value *val1, LONGEST offset1, -+ const struct value *val2, LONGEST offset2, -+ LONGEST length); - - /* Read LENGTH addressable memory units starting at MEMADDR into BUFFER, - which is (or will be copied to) VAL's contents buffer offset by -@@ -578,7 +579,7 @@ extern int value_contents_eq (const stru - memory is likewise unavailable. STACK indicates whether the memory - is known to be stack memory. */ - --extern void read_value_memory (struct value *val, int embedded_offset, -+extern void read_value_memory (struct value *val, LONGEST embedded_offset, - int stack, CORE_ADDR memaddr, - gdb_byte *buffer, size_t length); - -@@ -614,17 +615,18 @@ extern LONGEST unpack_field_as_long (str - const gdb_byte *valaddr, - int fieldno); - extern int unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, -- int embedded_offset, int fieldno, -+ LONGEST embedded_offset, int fieldno, - const struct value *val, LONGEST *result); - - extern void unpack_value_bitfield (struct value *dest_val, - int bitpos, int bitsize, -- const gdb_byte *valaddr, int embedded_offset, -+ const gdb_byte *valaddr, -+ LONGEST embedded_offset, - const struct value *val); - - extern struct value *value_field_bitfield (struct type *type, int fieldno, - const gdb_byte *valaddr, -- int embedded_offset, -+ LONGEST embedded_offset, - const struct value *val); - - extern void pack_long (gdb_byte *buf, struct type *type, LONGEST num); -@@ -683,12 +685,12 @@ extern struct value *default_read_var_va - - extern struct value *allocate_value (struct type *type); - extern struct value *allocate_value_lazy (struct type *type); --extern void value_contents_copy (struct value *dst, int dst_offset, -- struct value *src, int src_offset, -- int length); --extern void value_contents_copy_raw (struct value *dst, int dst_offset, -- struct value *src, int src_offset, -- int length); -+extern void value_contents_copy (struct value *dst, ssize_t dst_offset, -+ struct value *src, ssize_t src_offset, -+ ssize_t length); -+extern void value_contents_copy_raw (struct value *dst, ssize_t dst_offset, -+ struct value *src, ssize_t src_offset, -+ ssize_t length); - - extern struct value *allocate_repeat_value (struct type *type, int count); - -@@ -766,16 +768,16 @@ extern int find_overload_match (struct v - - extern struct value *value_field (struct value *arg1, int fieldno); - --extern struct value *value_primitive_field (struct value *arg1, int offset, -+extern struct value *value_primitive_field (struct value *arg1, LONGEST offset, +@@ -771,12 +772,11 @@ int fieldno, struct type *arg_type); - --extern struct type *value_rtti_indirect_type (struct value *, int *, int *, -+extern struct type *value_rtti_indirect_type (struct value *, int *, LONGEST *, +- + extern struct type *value_rtti_indirect_type (struct value *, int *, LONGEST *, int *); extern struct value *value_full_object (struct value *, struct type *, int, @@ -4272,44 +3261,7 @@ Index: gdb-7.10.50.20151027/gdb/value.h extern struct value *value_cast_pointers (struct type *, struct value *, int); -@@ -870,7 +872,7 @@ extern void set_internalvar_string (stru - extern void clear_internalvar (struct internalvar *var); - - extern void set_internalvar_component (struct internalvar *var, -- int offset, -+ LONGEST offset, - int bitpos, int bitsize, - struct value *newvalue); - -@@ -951,7 +953,7 @@ extern struct value *value_x_unop (struc - enum noside noside); - - extern struct value *value_fn_field (struct value **arg1p, struct fn_field *f, -- int j, struct type *type, int offset); -+ int j, struct type *type, LONGEST offset); - - extern int binop_types_user_defined_p (enum exp_opcode op, - struct type *type1, -@@ -979,7 +981,8 @@ extern void release_value_or_incref (str - extern int record_latest_value (struct value *val); - - extern void modify_field (struct type *type, gdb_byte *addr, -- LONGEST fieldval, int bitpos, int bitsize); -+ LONGEST fieldval, LONGEST bitpos, -+ int bitsize); - - extern void type_print (struct type *type, const char *varstring, - struct ui_file *stream, int show); -@@ -1009,7 +1012,7 @@ extern void value_print_array_elements ( - extern struct value *value_release_to_mark (struct value *mark); - - extern void val_print (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, -@@ -1062,10 +1065,11 @@ extern struct value *value_literal_compl +@@ -1065,10 +1065,11 @@ extern struct value *find_function_in_inferior (const char *, struct objfile **); @@ -4323,11 +3275,11 @@ Index: gdb-7.10.50.20151027/gdb/value.h /* User function handler. */ -Index: gdb-7.10.50.20151027/gdb/s390-linux-nat.c +Index: gdb-7.11.50.20160716/gdb/s390-linux-nat.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/s390-linux-nat.c 2015-11-02 21:23:11.250351904 +0100 -+++ gdb-7.10.50.20151027/gdb/s390-linux-nat.c 2015-11-02 21:23:13.242365010 +0100 -@@ -612,7 +612,7 @@ s390_can_use_hw_breakpoint (struct targe +--- gdb-7.11.50.20160716.orig/gdb/s390-linux-nat.c 2016-07-16 14:33:42.120510656 +0200 ++++ gdb-7.11.50.20160716/gdb/s390-linux-nat.c 2016-07-16 14:33:44.550530213 +0200 +@@ -612,7 +612,7 @@ static int s390_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -4336,37 +3288,11 @@ Index: gdb-7.10.50.20151027/gdb/s390-linux-nat.c { return 1; } -Index: gdb-7.10.50.20151027/gdb/extension-priv.h +Index: gdb-7.11.50.20160716/gdb/target-delegates.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/extension-priv.h 2015-11-02 21:23:11.250351904 +0100 -+++ gdb-7.10.50.20151027/gdb/extension-priv.h 2015-11-02 21:23:13.242365010 +0100 -@@ -181,7 +181,7 @@ struct extension_language_ops - enum ext_lang_rc (*apply_val_pretty_printer) - (const struct extension_language_defn *, - 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, - const struct language_defn *language); -Index: gdb-7.10.50.20151027/gdb/python/python-internal.h -=================================================================== ---- gdb-7.10.50.20151027.orig/gdb/python/python-internal.h 2015-11-02 21:23:11.250351904 +0100 -+++ gdb-7.10.50.20151027/gdb/python/python-internal.h 2015-11-02 21:23:13.242365010 +0100 -@@ -316,7 +316,7 @@ extern int gdbpy_auto_load_enabled (cons - extern enum ext_lang_rc gdbpy_apply_val_pretty_printer - (const struct extension_language_defn *, - 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, -Index: gdb-7.10.50.20151027/gdb/target-delegates.c -=================================================================== ---- gdb-7.10.50.20151027.orig/gdb/target-delegates.c 2015-11-02 21:23:11.252351917 +0100 -+++ gdb-7.10.50.20151027/gdb/target-delegates.c 2015-11-02 21:23:13.243365017 +0100 -@@ -736,14 +736,14 @@ debug_watchpoint_addr_within_range (stru +--- gdb-7.11.50.20160716.orig/gdb/target-delegates.c 2016-07-16 14:33:42.121510664 +0200 ++++ gdb-7.11.50.20160716/gdb/target-delegates.c 2016-07-16 14:33:44.550530213 +0200 +@@ -736,14 +736,14 @@ } static int @@ -4383,7 +3309,7 @@ Index: gdb-7.10.50.20151027/gdb/target-delegates.c { int result; fprintf_unfiltered (gdb_stdlog, "-> %s->to_region_ok_for_hw_watchpoint (...)\n", debug_target.to_shortname); -@@ -753,7 +753,7 @@ debug_region_ok_for_hw_watchpoint (struc +@@ -753,7 +753,7 @@ fputs_unfiltered (", ", gdb_stdlog); target_debug_print_CORE_ADDR (arg1); fputs_unfiltered (", ", gdb_stdlog); @@ -4392,11 +3318,11 @@ Index: gdb-7.10.50.20151027/gdb/target-delegates.c fputs_unfiltered (") = ", gdb_stdlog); target_debug_print_int (result); fputs_unfiltered ("\n", gdb_stdlog); -Index: gdb-7.10.50.20151027/gdb/aarch64-linux-nat.c +Index: gdb-7.11.50.20160716/gdb/aarch64-linux-nat.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/aarch64-linux-nat.c 2015-11-02 21:23:11.252351917 +0100 -+++ gdb-7.10.50.20151027/gdb/aarch64-linux-nat.c 2015-11-02 21:23:13.243365017 +0100 -@@ -736,7 +736,7 @@ aarch64_linux_remove_watchpoint (struct +--- gdb-7.11.50.20160716.orig/gdb/aarch64-linux-nat.c 2016-07-16 14:33:42.122510672 +0200 ++++ gdb-7.11.50.20160716/gdb/aarch64-linux-nat.c 2016-07-16 14:33:44.551530221 +0200 +@@ -736,7 +736,7 @@ static int aarch64_linux_region_ok_for_hw_watchpoint (struct target_ops *self, @@ -4405,11 +3331,11 @@ Index: gdb-7.10.50.20151027/gdb/aarch64-linux-nat.c { return aarch64_linux_region_ok_for_watchpoint (addr, len); } -Index: gdb-7.10.50.20151027/gdb/nat/x86-dregs.c +Index: gdb-7.11.50.20160716/gdb/nat/x86-dregs.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/nat/x86-dregs.c 2015-11-02 21:23:11.252351917 +0100 -+++ gdb-7.10.50.20151027/gdb/nat/x86-dregs.c 2015-11-02 21:23:13.244365024 +0100 -@@ -384,7 +384,7 @@ x86_remove_aligned_watchpoint (struct x8 +--- gdb-7.11.50.20160716.orig/gdb/nat/x86-dregs.c 2016-07-16 14:33:42.122510672 +0200 ++++ gdb-7.11.50.20160716/gdb/nat/x86-dregs.c 2016-07-16 14:33:44.551530221 +0200 +@@ -384,7 +384,7 @@ static int x86_handle_nonaligned_watchpoint (struct x86_debug_reg_state *state, @@ -4418,7 +3344,7 @@ Index: gdb-7.10.50.20151027/gdb/nat/x86-dregs.c enum target_hw_bp_type type) { int retval = 0; -@@ -552,7 +552,7 @@ x86_dr_remove_watchpoint (struct x86_deb +@@ -552,7 +552,7 @@ int x86_dr_region_ok_for_watchpoint (struct x86_debug_reg_state *state, @@ -4427,11 +3353,11 @@ Index: gdb-7.10.50.20151027/gdb/nat/x86-dregs.c { int nregs; -Index: gdb-7.10.50.20151027/gdb/compile/compile-c-support.c +Index: gdb-7.11.50.20160716/gdb/compile/compile-c-support.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/compile/compile-c-support.c 2015-11-02 21:23:11.253351923 +0100 -+++ gdb-7.10.50.20151027/gdb/compile/compile-c-support.c 2015-11-02 21:23:13.244365024 +0100 -@@ -299,11 +299,11 @@ generate_register_struct (struct ui_file +--- gdb-7.11.50.20160716.orig/gdb/compile/compile-c-support.c 2016-07-16 14:33:42.122510672 +0200 ++++ gdb-7.11.50.20160716/gdb/compile/compile-c-support.c 2016-07-16 14:33:44.551530221 +0200 +@@ -299,11 +299,11 @@ default: fprintf_unfiltered (stream, @@ -4445,11 +3371,11 @@ Index: gdb-7.10.50.20151027/gdb/compile/compile-c-support.c } fputs_unfiltered (";\n", stream); -Index: gdb-7.10.50.20151027/gdb/nat/x86-dregs.h +Index: gdb-7.11.50.20160716/gdb/nat/x86-dregs.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/nat/x86-dregs.h 2015-11-02 21:23:11.253351923 +0100 -+++ gdb-7.10.50.20151027/gdb/nat/x86-dregs.h 2015-11-02 21:23:13.244365024 +0100 -@@ -116,7 +116,7 @@ extern int x86_dr_remove_watchpoint (str +--- gdb-7.11.50.20160716.orig/gdb/nat/x86-dregs.h 2016-07-16 14:33:42.122510672 +0200 ++++ gdb-7.11.50.20160716/gdb/nat/x86-dregs.h 2016-07-16 14:33:44.551530221 +0200 +@@ -116,7 +116,7 @@ /* 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, @@ -4458,11 +3384,11 @@ Index: gdb-7.10.50.20151027/gdb/nat/x86-dregs.h /* If the inferior has some break/watchpoint that triggered, set the address associated with that break/watchpoint and return true. -Index: gdb-7.10.50.20151027/gdb/x86-nat.c +Index: gdb-7.11.50.20160716/gdb/x86-nat.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/x86-nat.c 2015-11-02 21:23:11.253351923 +0100 -+++ gdb-7.10.50.20151027/gdb/x86-nat.c 2015-11-02 21:23:13.244365024 +0100 -@@ -174,7 +174,7 @@ x86_remove_watchpoint (struct target_ops +--- gdb-7.11.50.20160716.orig/gdb/x86-nat.c 2016-07-16 14:33:42.123510680 +0200 ++++ gdb-7.11.50.20160716/gdb/x86-nat.c 2016-07-16 14:33:44.551530221 +0200 +@@ -174,7 +174,7 @@ static int x86_region_ok_for_watchpoint (struct target_ops *self, @@ -4471,29 +3397,25 @@ Index: gdb-7.10.50.20151027/gdb/x86-nat.c { struct x86_debug_reg_state *state = x86_debug_reg_state (ptid_get_pid (inferior_ptid)); -Index: gdb-7.10.50.20151027/gdb/guile/guile-internal.h +Index: gdb-7.11.50.20160716/gdb/rust-lang.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/guile/guile-internal.h 2015-11-02 21:23:11.253351923 +0100 -+++ gdb-7.10.50.20151027/gdb/guile/guile-internal.h 2015-11-02 21:23:13.244365024 +0100 -@@ -606,7 +606,7 @@ extern void gdbscm_preserve_values - extern enum ext_lang_rc gdbscm_apply_val_pretty_printer - (const struct extension_language_defn *, - 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, -Index: gdb-7.10.50.20151027/gdb/guile/scm-pretty-print.c -=================================================================== ---- gdb-7.10.50.20151027.orig/gdb/guile/scm-pretty-print.c 2015-11-02 21:23:11.254351930 +0100 -+++ gdb-7.10.50.20151027/gdb/guile/scm-pretty-print.c 2015-11-02 21:23:13.245365030 +0100 -@@ -958,7 +958,7 @@ ppscm_print_children (SCM printer, enum - enum ext_lang_rc - gdbscm_apply_val_pretty_printer (const struct extension_language_defn *extlang, - 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, +--- gdb-7.11.50.20160716.orig/gdb/rust-lang.c 2016-07-16 14:33:42.123510680 +0200 ++++ gdb-7.11.50.20160716/gdb/rust-lang.c 2016-07-16 14:33:44.551530221 +0200 +@@ -410,7 +410,7 @@ + + 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) + { +@@ -456,7 +456,7 @@ + /* la_val_print implementation for Rust. */ + + static void +-rust_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, ++rust_val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, + CORE_ADDR address, struct ui_file *stream, int recurse, + const struct value *val, + const struct value_print_options *options) diff --git a/gdb-rhbz795424-bitpos-23of25.patch b/gdb-rhbz795424-bitpos-23of25.patch index 6e5fb10..ef34fb7 100644 --- a/gdb-rhbz795424-bitpos-23of25.patch +++ b/gdb-rhbz795424-bitpos-23of25.patch @@ -137,10 +137,10 @@ Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-tdep.patch -Index: gdb-7.10.50.20160106/gdb/alpha-tdep.c +Index: gdb-7.11.50.20160716/gdb/alpha-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/alpha-tdep.c 2016-01-08 19:16:16.592813990 +0100 -+++ gdb-7.10.50.20160106/gdb/alpha-tdep.c 2016-01-08 19:16:20.308834717 +0100 +--- gdb-7.11.50.20160716.orig/gdb/alpha-tdep.c 2016-07-16 14:35:45.390502718 +0200 ++++ gdb-7.11.50.20160716/gdb/alpha-tdep.c 2016-07-16 14:35:47.511519788 +0200 @@ -299,17 +299,17 @@ { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -183,11 +183,11 @@ Index: gdb-7.10.50.20160106/gdb/alpha-tdep.c memcpy (arg_reg_buffer + offset, contents, tlen); offset += tlen; contents += tlen; -Index: gdb-7.10.50.20160106/gdb/amd64-tdep.c +Index: gdb-7.11.50.20160716/gdb/amd64-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/amd64-tdep.c 2016-01-08 19:16:16.594814001 +0100 -+++ gdb-7.10.50.20160106/gdb/amd64-tdep.c 2016-01-08 19:16:20.309834723 +0100 -@@ -699,7 +699,7 @@ +--- gdb-7.11.50.20160716.orig/gdb/amd64-tdep.c 2016-07-16 14:35:45.391502726 +0200 ++++ gdb-7.11.50.20160716/gdb/amd64-tdep.c 2016-07-16 14:35:47.512519796 +0200 +@@ -729,7 +729,7 @@ gdb_byte *readbuf, const gdb_byte *writebuf) { enum amd64_reg_class theclass[2]; @@ -196,7 +196,7 @@ Index: gdb-7.10.50.20160106/gdb/amd64-tdep.c static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM }; static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM }; int integer_reg = 0; -@@ -850,8 +850,8 @@ +@@ -880,8 +880,8 @@ }; struct value **stack_args = XALLOCAVEC (struct value *, nargs); int num_stack_args = 0; @@ -207,7 +207,7 @@ Index: gdb-7.10.50.20160106/gdb/amd64-tdep.c int integer_reg = 0; int sse_reg = 0; int i; -@@ -863,7 +863,7 @@ +@@ -893,7 +893,7 @@ for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); @@ -216,10 +216,10 @@ Index: gdb-7.10.50.20160106/gdb/amd64-tdep.c enum amd64_reg_class theclass[2]; int needed_integer_regs = 0; int needed_sse_regs = 0; -Index: gdb-7.10.50.20160106/gdb/amd64-windows-tdep.c +Index: gdb-7.11.50.20160716/gdb/amd64-windows-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/amd64-windows-tdep.c 2016-01-08 19:16:16.595814006 +0100 -+++ gdb-7.10.50.20160106/gdb/amd64-windows-tdep.c 2016-01-08 19:16:20.310834728 +0100 +--- gdb-7.11.50.20160716.orig/gdb/amd64-windows-tdep.c 2016-07-16 14:35:45.393502742 +0200 ++++ gdb-7.11.50.20160716/gdb/amd64-windows-tdep.c 2016-07-16 14:35:47.512519796 +0200 @@ -288,7 +288,7 @@ struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) @@ -229,11 +229,11 @@ Index: gdb-7.10.50.20160106/gdb/amd64-windows-tdep.c int regnum = -1; /* See if our value is returned through a register. If it is, then -Index: gdb-7.10.50.20160106/gdb/arm-tdep.c +Index: gdb-7.11.50.20160716/gdb/arm-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/arm-tdep.c 2016-01-08 19:16:16.603814051 +0100 -+++ gdb-7.10.50.20160106/gdb/arm-tdep.c 2016-01-08 19:17:05.737088107 +0100 -@@ -3340,7 +3340,7 @@ +--- gdb-7.11.50.20160716.orig/gdb/arm-tdep.c 2016-07-16 14:35:45.400502798 +0200 ++++ gdb-7.11.50.20160716/gdb/arm-tdep.c 2016-07-16 14:36:30.328864376 +0200 +@@ -3443,7 +3443,7 @@ array). Vector types are not currently supported, matching the generic AAPCS support. */ @@ -242,7 +242,7 @@ Index: gdb-7.10.50.20160106/gdb/arm-tdep.c arm_vfp_cprc_sub_candidate (struct type *t, enum arm_vfp_cprc_base_type *base_type) { -@@ -3423,7 +3423,7 @@ +@@ -3526,7 +3526,7 @@ } else { @@ -251,7 +251,7 @@ Index: gdb-7.10.50.20160106/gdb/arm-tdep.c unsigned unitlen; count = arm_vfp_cprc_sub_candidate (TYPE_TARGET_TYPE (t), -@@ -3446,13 +3446,15 @@ +@@ -3549,12 +3549,12 @@ case TYPE_CODE_STRUCT: { @@ -261,16 +261,12 @@ Index: gdb-7.10.50.20160106/gdb/arm-tdep.c 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 += sub_count; -@@ -3472,13 +3474,15 @@ +- 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), +@@ -3578,13 +3578,15 @@ case TYPE_CODE_UNION: { @@ -289,7 +285,7 @@ Index: gdb-7.10.50.20160106/gdb/arm-tdep.c if (sub_count == -1) return -1; count = (count > sub_count ? count : sub_count); -@@ -3514,7 +3518,7 @@ +@@ -3620,7 +3622,7 @@ int *count) { enum arm_vfp_cprc_base_type b = VFP_CPRC_UNKNOWN; @@ -298,7 +294,7 @@ Index: gdb-7.10.50.20160106/gdb/arm-tdep.c if (c <= 0 || c > 4) return 0; *base_type = b; -@@ -3595,7 +3599,7 @@ +@@ -3701,7 +3703,7 @@ for (argnum = 0; argnum < nargs; argnum++) { @@ -307,11 +303,11 @@ Index: gdb-7.10.50.20160106/gdb/arm-tdep.c struct type *arg_type; struct type *target_type; enum type_code typecode; -Index: gdb-7.10.50.20160106/gdb/avr-tdep.c +Index: gdb-7.11.50.20160716/gdb/avr-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/avr-tdep.c 2016-01-08 19:16:16.604814057 +0100 -+++ gdb-7.10.50.20160106/gdb/avr-tdep.c 2016-01-08 19:16:20.314834750 +0100 -@@ -1196,13 +1196,13 @@ +--- gdb-7.11.50.20160716.orig/gdb/avr-tdep.c 2016-07-16 14:35:45.401502806 +0200 ++++ gdb-7.11.50.20160716/gdb/avr-tdep.c 2016-07-16 14:35:47.516519828 +0200 +@@ -1195,13 +1195,13 @@ struct stack_item { @@ -327,7 +323,7 @@ Index: gdb-7.10.50.20160106/gdb/avr-tdep.c { struct stack_item *si; si = XNEW (struct stack_item); -@@ -1291,12 +1291,12 @@ +@@ -1289,12 +1289,12 @@ for (i = 0; i < nargs; i++) { @@ -341,22 +337,22 @@ Index: gdb-7.10.50.20160106/gdb/avr-tdep.c - int len = TYPE_LENGTH (type); + ssize_t len = TYPE_LENGTH (type); - /* Calculate the potential last register needed. */ - last_regnum = regnum - (len + (len & 1)); -Index: gdb-7.10.50.20160106/gdb/bfin-tdep.c + /* Calculate the potential last register needed. + E.g. For length 2, registers regnum and regnum-1 (say 25 and 24) +Index: gdb-7.11.50.20160716/gdb/bfin-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/bfin-tdep.c 2016-01-08 19:16:16.605814062 +0100 -+++ gdb-7.10.50.20160106/gdb/bfin-tdep.c 2016-01-08 19:16:20.315834756 +0100 -@@ -504,7 +504,7 @@ - gdb_byte buf[4]; +--- gdb-7.11.50.20160716.orig/gdb/bfin-tdep.c 2016-07-16 14:35:45.401502806 +0200 ++++ gdb-7.11.50.20160716/gdb/bfin-tdep.c 2016-07-16 14:35:47.516519828 +0200 +@@ -502,7 +502,7 @@ + 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; - enum bfin_abi abi = bfin_abi (gdbarch); - CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -528,7 +528,7 @@ + for (i = nargs - 1; i >= 0; i--) + { +@@ -524,7 +524,7 @@ { struct type *value_type = value_enclosing_type (args[i]); struct type *arg_type = check_typedef (value_type); @@ -365,10 +361,10 @@ Index: gdb-7.10.50.20160106/gdb/bfin-tdep.c sp -= container_len; write_memory (sp, value_contents (args[i]), container_len); -Index: gdb-7.10.50.20160106/gdb/cris-tdep.c +Index: gdb-7.11.50.20160716/gdb/cris-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/cris-tdep.c 2016-01-08 19:16:16.606814068 +0100 -+++ gdb-7.10.50.20160106/gdb/cris-tdep.c 2016-01-08 19:16:20.316834762 +0100 +--- gdb-7.11.50.20160716.orig/gdb/cris-tdep.c 2016-07-16 14:35:45.403502823 +0200 ++++ gdb-7.11.50.20160716/gdb/cris-tdep.c 2016-07-16 14:35:47.517519836 +0200 @@ -663,13 +663,13 @@ struct stack_item @@ -385,7 +381,7 @@ Index: gdb-7.10.50.20160106/gdb/cris-tdep.c { struct stack_item *si = XNEW (struct stack_item); si->data = (gdb_byte *) xmalloc (len); -@@ -841,13 +841,13 @@ +@@ -833,13 +833,13 @@ for (argnum = 0; argnum < nargs; argnum++) { @@ -403,11 +399,11 @@ Index: gdb-7.10.50.20160106/gdb/cris-tdep.c /* How may registers worth of storage do we need for this argument? */ reg_demand = (len / 4) + (len % 4 != 0 ? 1 : 0); -Index: gdb-7.10.50.20160106/gdb/h8300-tdep.c +Index: gdb-7.11.50.20160716/gdb/h8300-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/h8300-tdep.c 2016-01-08 19:16:16.607814073 +0100 -+++ gdb-7.10.50.20160106/gdb/h8300-tdep.c 2016-01-08 19:16:20.316834762 +0100 -@@ -639,7 +639,7 @@ +--- gdb-7.11.50.20160716.orig/gdb/h8300-tdep.c 2016-07-16 14:35:45.403502823 +0200 ++++ gdb-7.11.50.20160716/gdb/h8300-tdep.c 2016-07-16 14:35:47.517519836 +0200 +@@ -637,7 +637,7 @@ int struct_return, CORE_ADDR struct_addr) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -416,7 +412,7 @@ Index: gdb-7.10.50.20160106/gdb/h8300-tdep.c int wordsize = BINWORD (gdbarch); int reg = E_ARG0_REGNUM; int argument; -@@ -666,11 +666,11 @@ +@@ -664,11 +664,11 @@ { struct cleanup *back_to; struct type *type = value_type (args[argument]); @@ -430,7 +426,7 @@ Index: gdb-7.10.50.20160106/gdb/h8300-tdep.c gdb_byte *padded = (gdb_byte *) xmalloc (padded_len); back_to = make_cleanup (xfree, padded); -@@ -699,7 +699,7 @@ +@@ -697,7 +697,7 @@ /* 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. */ @@ -439,11 +435,11 @@ Index: gdb-7.10.50.20160106/gdb/h8300-tdep.c for (offset = 0; offset < padded_len; offset += wordsize) { -Index: gdb-7.10.50.20160106/gdb/hppa-tdep.c +Index: gdb-7.11.50.20160716/gdb/hppa-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/hppa-tdep.c 2016-01-08 19:16:16.609814085 +0100 -+++ gdb-7.10.50.20160106/gdb/hppa-tdep.c 2016-01-08 19:16:20.317834767 +0100 -@@ -995,7 +995,7 @@ +--- gdb-7.11.50.20160716.orig/gdb/hppa-tdep.c 2016-07-16 14:35:45.405502839 +0200 ++++ gdb-7.11.50.20160716/gdb/hppa-tdep.c 2016-07-16 14:35:47.518519844 +0200 +@@ -991,7 +991,7 @@ { struct value *arg = args[i]; struct type *type = value_type (arg); @@ -452,7 +448,7 @@ Index: gdb-7.10.50.20160106/gdb/hppa-tdep.c const bfd_byte *valbuf; bfd_byte fptrbuf[8]; int regnum; -@@ -1190,7 +1190,7 @@ +@@ -1186,7 +1186,7 @@ struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { @@ -461,10 +457,10 @@ Index: gdb-7.10.50.20160106/gdb/hppa-tdep.c int regnum, offset; if (len > 16) -Index: gdb-7.10.50.20160106/gdb/i386-darwin-tdep.c +Index: gdb-7.11.50.20160716/gdb/i386-darwin-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/i386-darwin-tdep.c 2016-01-08 19:16:16.609814085 +0100 -+++ gdb-7.10.50.20160106/gdb/i386-darwin-tdep.c 2016-01-08 19:16:20.317834767 +0100 +--- gdb-7.11.50.20160716.orig/gdb/i386-darwin-tdep.c 2016-07-16 14:35:45.405502839 +0200 ++++ gdb-7.11.50.20160716/gdb/i386-darwin-tdep.c 2016-07-16 14:35:47.518519844 +0200 @@ -163,7 +163,7 @@ for (write_pass = 0; write_pass < 2; write_pass++) @@ -474,11 +470,11 @@ Index: gdb-7.10.50.20160106/gdb/i386-darwin-tdep.c int num_m128 = 0; if (struct_return) -Index: gdb-7.10.50.20160106/gdb/i386-tdep.c +Index: gdb-7.11.50.20160716/gdb/i386-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/i386-tdep.c 2016-01-08 19:16:16.615814118 +0100 -+++ gdb-7.10.50.20160106/gdb/i386-tdep.c 2016-01-08 19:16:20.319834778 +0100 -@@ -2663,7 +2663,7 @@ +--- gdb-7.11.50.20160716.orig/gdb/i386-tdep.c 2016-07-16 14:35:45.410502879 +0200 ++++ gdb-7.11.50.20160716/gdb/i386-tdep.c 2016-07-16 14:35:47.520519860 +0200 +@@ -2664,7 +2664,7 @@ gdb_byte buf[4]; int i; int write_pass; @@ -487,7 +483,7 @@ Index: gdb-7.10.50.20160106/gdb/i386-tdep.c /* Determine the total space required for arguments and struct return address in a first pass (allowing for 16-byte-aligned -@@ -2671,7 +2671,7 @@ +@@ -2672,7 +2672,7 @@ for (write_pass = 0; write_pass < 2; write_pass++) { @@ -496,7 +492,7 @@ Index: gdb-7.10.50.20160106/gdb/i386-tdep.c if (struct_return) { -@@ -2688,7 +2688,7 @@ +@@ -2689,7 +2689,7 @@ for (i = 0; i < nargs; i++) { @@ -505,7 +501,7 @@ Index: gdb-7.10.50.20160106/gdb/i386-tdep.c if (write_pass) { -@@ -2895,7 +2895,7 @@ +@@ -2896,7 +2896,7 @@ { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum type_code code = TYPE_CODE (type); @@ -514,7 +510,7 @@ Index: gdb-7.10.50.20160106/gdb/i386-tdep.c gdb_assert (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION -@@ -3641,7 +3641,7 @@ +@@ -3718,7 +3718,7 @@ i386_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type) { @@ -523,7 +519,7 @@ Index: gdb-7.10.50.20160106/gdb/i386-tdep.c /* Values may be spread across multiple registers. Most debugging formats aren't expressive enough to specify the locations, so -@@ -3674,7 +3674,7 @@ +@@ -3751,7 +3751,7 @@ int *optimizedp, int *unavailablep) { struct gdbarch *gdbarch = get_frame_arch (frame); @@ -532,7 +528,7 @@ Index: gdb-7.10.50.20160106/gdb/i386-tdep.c if (i386_fp_regnum_p (gdbarch, regnum)) return i387_register_to_value (frame, regnum, type, to, -@@ -3710,7 +3710,7 @@ +@@ -3787,7 +3787,7 @@ i386_value_to_register (struct frame_info *frame, int regnum, struct type *type, const gdb_byte *from) { @@ -541,11 +537,11 @@ Index: gdb-7.10.50.20160106/gdb/i386-tdep.c if (i386_fp_regnum_p (get_frame_arch (frame), regnum)) { -Index: gdb-7.10.50.20160106/gdb/iq2000-tdep.c +Index: gdb-7.11.50.20160716/gdb/iq2000-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/iq2000-tdep.c 2016-01-08 19:16:16.616814124 +0100 -+++ gdb-7.10.50.20160106/gdb/iq2000-tdep.c 2016-01-08 19:16:20.320834784 +0100 -@@ -651,8 +651,9 @@ +--- gdb-7.11.50.20160716.orig/gdb/iq2000-tdep.c 2016-07-16 14:35:45.411502887 +0200 ++++ gdb-7.11.50.20160716/gdb/iq2000-tdep.c 2016-07-16 14:35:47.520519860 +0200 +@@ -646,8 +646,9 @@ const bfd_byte *val; bfd_byte buf[4]; struct type *type; @@ -557,11 +553,11 @@ Index: gdb-7.10.50.20160106/gdb/iq2000-tdep.c /* Used to copy struct arguments into the stack. */ CORE_ADDR struct_ptr; -Index: gdb-7.10.50.20160106/gdb/m32r-tdep.c +Index: gdb-7.11.50.20160716/gdb/m32r-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/m32r-tdep.c 2016-01-08 19:16:16.616814124 +0100 -+++ gdb-7.10.50.20160106/gdb/m32r-tdep.c 2016-01-08 19:16:20.320834784 +0100 -@@ -687,7 +687,7 @@ +--- gdb-7.11.50.20160716.orig/gdb/m32r-tdep.c 2016-07-16 14:35:45.411502887 +0200 ++++ gdb-7.11.50.20160716/gdb/m32r-tdep.c 2016-07-16 14:35:47.520519860 +0200 +@@ -685,7 +685,7 @@ CORE_ADDR regval; gdb_byte *val; gdb_byte valbuf[MAX_REGISTER_SIZE]; @@ -570,10 +566,10 @@ Index: gdb-7.10.50.20160106/gdb/m32r-tdep.c /* First force sp to a 4-byte alignment. */ sp = sp & ~3; -Index: gdb-7.10.50.20160106/gdb/m68k-tdep.c +Index: gdb-7.11.50.20160716/gdb/m68k-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/m68k-tdep.c 2016-01-08 19:16:16.617814129 +0100 -+++ gdb-7.10.50.20160106/gdb/m68k-tdep.c 2016-01-08 19:16:20.320834784 +0100 +--- gdb-7.11.50.20160716.orig/gdb/m68k-tdep.c 2016-07-16 14:35:45.412502895 +0200 ++++ gdb-7.11.50.20160716/gdb/m68k-tdep.c 2016-07-16 14:35:47.520519860 +0200 @@ -382,7 +382,7 @@ { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -596,10 +592,10 @@ Index: gdb-7.10.50.20160106/gdb/m68k-tdep.c /* Non-scalars bigger than 4 bytes are left aligned, others are right aligned. */ -Index: gdb-7.10.50.20160106/gdb/m88k-tdep.c +Index: gdb-7.11.50.20160716/gdb/m88k-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/m88k-tdep.c 2016-01-08 19:16:16.617814129 +0100 -+++ gdb-7.10.50.20160106/gdb/m88k-tdep.c 2016-01-08 19:16:20.321834790 +0100 +--- gdb-7.11.50.20160716.orig/gdb/m88k-tdep.c 2016-07-16 14:35:45.412502895 +0200 ++++ gdb-7.11.50.20160716/gdb/m88k-tdep.c 2016-07-16 14:35:47.521519868 +0200 @@ -257,13 +257,13 @@ { struct gdbarch *gdbarch = get_regcache_arch (regcache); @@ -627,10 +623,10 @@ Index: gdb-7.10.50.20160106/gdb/m88k-tdep.c if (m88k_in_register_p (type)) { -Index: gdb-7.10.50.20160106/gdb/mep-tdep.c +Index: gdb-7.11.50.20160716/gdb/mep-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/mep-tdep.c 2016-01-08 19:16:16.618814135 +0100 -+++ gdb-7.10.50.20160106/gdb/mep-tdep.c 2016-01-08 19:16:20.321834790 +0100 +--- gdb-7.11.50.20160716.orig/gdb/mep-tdep.c 2016-07-16 14:35:45.413502903 +0200 ++++ gdb-7.11.50.20160716/gdb/mep-tdep.c 2016-07-16 14:35:47.521519868 +0200 @@ -2272,7 +2272,7 @@ for (i = 0; i < argc; i++) @@ -640,10 +636,10 @@ Index: gdb-7.10.50.20160106/gdb/mep-tdep.c if (arg_len > MEP_GPR_SIZE) { -Index: gdb-7.10.50.20160106/gdb/mips-tdep.c +Index: gdb-7.11.50.20160716/gdb/mips-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/mips-tdep.c 2016-01-08 19:16:16.626814179 +0100 -+++ gdb-7.10.50.20160106/gdb/mips-tdep.c 2016-01-08 19:16:20.324834806 +0100 +--- gdb-7.11.50.20160716.orig/gdb/mips-tdep.c 2016-07-16 14:35:45.421502967 +0200 ++++ gdb-7.11.50.20160716/gdb/mips-tdep.c 2016-07-16 14:35:47.523519884 +0200 @@ -455,7 +455,7 @@ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, int reg_num, int length, @@ -664,7 +660,7 @@ Index: gdb-7.10.50.20160106/gdb/mips-tdep.c if (mips_debug && out != NULL) { int i; -@@ -4554,13 +4554,13 @@ +@@ -4529,13 +4529,13 @@ gdb_byte valbuf[MAX_REGISTER_SIZE]; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -681,7 +677,7 @@ Index: gdb-7.10.50.20160106/gdb/mips-tdep.c /* The EABI passes structures that do not fit in a register by reference. */ -@@ -4829,7 +4829,7 @@ +@@ -4804,7 +4804,7 @@ static int mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, @@ -690,7 +686,7 @@ Index: gdb-7.10.50.20160106/gdb/mips-tdep.c { int i; -@@ -4844,7 +4844,7 @@ +@@ -4819,7 +4819,7 @@ for (i = 0; i < TYPE_NFIELDS (arg_type); i++) { @@ -699,7 +695,7 @@ Index: gdb-7.10.50.20160106/gdb/mips-tdep.c struct type *field_type; /* We're only looking at normal fields. */ -@@ -4886,7 +4886,7 @@ +@@ -4861,7 +4861,7 @@ int argreg; int float_argreg; int argnum; @@ -708,7 +704,7 @@ Index: gdb-7.10.50.20160106/gdb/mips-tdep.c int stack_offset = 0; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5237,11 +5237,11 @@ +@@ -5212,11 +5212,11 @@ : MIPS_V0_REGNUM); field < TYPE_NFIELDS (type); field++, regnum += 2) { @@ -724,7 +720,7 @@ Index: gdb-7.10.50.20160106/gdb/mips-tdep.c if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16) { /* A 16-byte long double field goes in two consecutive -@@ -5283,8 +5283,8 @@ +@@ -5258,8 +5258,8 @@ if (offset + xfer > TYPE_LENGTH (type)) xfer = TYPE_LENGTH (type) - offset; if (mips_debug) @@ -735,7 +731,7 @@ Index: gdb-7.10.50.20160106/gdb/mips-tdep.c mips_xfer_register (gdbarch, regcache, gdbarch_num_regs (gdbarch) + regnum, xfer, BFD_ENDIAN_UNKNOWN, readbuf, writebuf, -@@ -5342,7 +5342,7 @@ +@@ -5317,7 +5317,7 @@ int argreg; int float_argreg; int argnum; @@ -744,7 +740,7 @@ Index: gdb-7.10.50.20160106/gdb/mips-tdep.c int stack_offset = 0; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5406,13 +5406,13 @@ +@@ -5381,13 +5381,13 @@ const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -761,7 +757,7 @@ Index: gdb-7.10.50.20160106/gdb/mips-tdep.c val = value_contents (arg); -@@ -5870,8 +5870,8 @@ +@@ -5842,8 +5842,8 @@ int argreg; int float_argreg; int argnum; @@ -772,7 +768,7 @@ Index: gdb-7.10.50.20160106/gdb/mips-tdep.c enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5931,13 +5931,13 @@ +@@ -5903,13 +5903,13 @@ const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -789,11 +785,11 @@ Index: gdb-7.10.50.20160106/gdb/mips-tdep.c val = value_contents (arg); -Index: gdb-7.10.50.20160106/gdb/mn10300-tdep.c +Index: gdb-7.11.50.20160716/gdb/mn10300-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/mn10300-tdep.c 2016-01-08 19:16:16.627814185 +0100 -+++ gdb-7.10.50.20160106/gdb/mn10300-tdep.c 2016-01-08 19:16:20.324834806 +0100 -@@ -1227,7 +1227,7 @@ +--- gdb-7.11.50.20160716.orig/gdb/mn10300-tdep.c 2016-07-16 14:35:45.422502976 +0200 ++++ gdb-7.11.50.20160716/gdb/mn10300-tdep.c 2016-07-16 14:35:47.524519892 +0200 +@@ -1225,7 +1225,7 @@ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); const int push_size = register_size (gdbarch, E_PC_REGNUM); int regs_used; @@ -802,11 +798,11 @@ Index: gdb-7.10.50.20160106/gdb/mn10300-tdep.c int stack_offset = 0; int argnum; const gdb_byte *val; -Index: gdb-7.10.50.20160106/gdb/mt-tdep.c +Index: gdb-7.11.50.20160716/gdb/mt-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/mt-tdep.c 2016-01-08 19:16:16.628814190 +0100 -+++ gdb-7.10.50.20160106/gdb/mt-tdep.c 2016-01-08 19:16:20.324834806 +0100 -@@ -781,9 +781,9 @@ +--- gdb-7.11.50.20160716.orig/gdb/mt-tdep.c 2016-07-16 14:35:45.423502984 +0200 ++++ gdb-7.11.50.20160716/gdb/mt-tdep.c 2016-07-16 14:35:47.524519892 +0200 +@@ -780,9 +780,9 @@ gdb_byte buf[MT_MAX_STRUCT_SIZE]; int argreg = MT_1ST_ARGREG; int split_param_len = 0; @@ -818,10 +814,10 @@ Index: gdb-7.10.50.20160106/gdb/mt-tdep.c int i, j; /* First handle however many args we can fit into MT_1ST_ARGREG thru -Index: gdb-7.10.50.20160106/gdb/ppc-sysv-tdep.c +Index: gdb-7.11.50.20160716/gdb/ppc-sysv-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/ppc-sysv-tdep.c 2016-01-08 19:16:16.629814196 +0100 -+++ gdb-7.10.50.20160106/gdb/ppc-sysv-tdep.c 2016-01-08 19:16:20.325834812 +0100 +--- gdb-7.11.50.20160716.orig/gdb/ppc-sysv-tdep.c 2016-07-16 14:35:45.424502992 +0200 ++++ gdb-7.11.50.20160716/gdb/ppc-sysv-tdep.c 2016-07-16 14:35:47.524519892 +0200 @@ -66,7 +66,7 @@ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int opencl_abi = ppc_sysv_use_opencl_abi (value_type (function)); @@ -866,10 +862,10 @@ Index: gdb-7.10.50.20160106/gdb/ppc-sysv-tdep.c /* Enforce alignment of stack location, if requested. */ if (align > tdep->wordsize) -Index: gdb-7.10.50.20160106/gdb/rl78-tdep.c +Index: gdb-7.11.50.20160716/gdb/rl78-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/rl78-tdep.c 2016-01-08 19:16:16.629814196 +0100 -+++ gdb-7.10.50.20160106/gdb/rl78-tdep.c 2016-01-08 19:16:20.325834812 +0100 +--- gdb-7.11.50.20160716.orig/gdb/rl78-tdep.c 2016-07-16 14:35:45.424502992 +0200 ++++ gdb-7.11.50.20160716/gdb/rl78-tdep.c 2016-07-16 14:35:47.525519900 +0200 @@ -1336,8 +1336,8 @@ for (i = nargs - 1; i >= 0; i--) { @@ -881,10 +877,10 @@ Index: gdb-7.10.50.20160106/gdb/rl78-tdep.c sp -= container_len; write_memory (rl78_make_data_address (sp), -Index: gdb-7.10.50.20160106/gdb/rs6000-aix-tdep.c +Index: gdb-7.11.50.20160716/gdb/rs6000-aix-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/rs6000-aix-tdep.c 2016-01-08 19:16:16.630814202 +0100 -+++ gdb-7.10.50.20160106/gdb/rs6000-aix-tdep.c 2016-01-08 19:16:20.326834817 +0100 +--- gdb-7.11.50.20160716.orig/gdb/rs6000-aix-tdep.c 2016-07-16 14:35:45.425503000 +0200 ++++ gdb-7.11.50.20160716/gdb/rs6000-aix-tdep.c 2016-07-16 14:35:47.525519900 +0200 @@ -186,9 +186,9 @@ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -897,7 +893,7 @@ Index: gdb-7.10.50.20160106/gdb/rs6000-aix-tdep.c gdb_byte tmp_buffer[50]; int f_argno = 0; /* current floating point argno */ int wordsize = gdbarch_tdep (gdbarch)->wordsize; -@@ -321,7 +321,7 @@ +@@ -319,7 +319,7 @@ if ((argno < nargs) || argbytes) { @@ -906,11 +902,11 @@ Index: gdb-7.10.50.20160106/gdb/rs6000-aix-tdep.c if (argbytes) { -Index: gdb-7.10.50.20160106/gdb/s390-linux-tdep.c +Index: gdb-7.11.50.20160716/gdb/s390-linux-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/s390-linux-tdep.c 2016-01-08 19:16:16.632814213 +0100 -+++ gdb-7.10.50.20160106/gdb/s390-linux-tdep.c 2016-01-08 19:16:20.328834829 +0100 -@@ -2981,7 +2981,7 @@ +--- gdb-7.11.50.20160716.orig/gdb/s390-linux-tdep.c 2016-07-16 14:35:45.427503016 +0200 ++++ gdb-7.11.50.20160716/gdb/s390-linux-tdep.c 2016-07-16 14:35:47.526519908 +0200 +@@ -3125,7 +3125,7 @@ /* Determine whether N is a power of two. */ static int @@ -919,7 +915,7 @@ Index: gdb-7.10.50.20160106/gdb/s390-linux-tdep.c { return n && ((n & (n - 1)) == 0); } -@@ -3038,7 +3038,7 @@ +@@ -3182,7 +3182,7 @@ enum bfd_endian byte_order, int is_unnamed) { struct type *type = check_typedef (value_type (arg)); @@ -928,10 +924,10 @@ Index: gdb-7.10.50.20160106/gdb/s390-linux-tdep.c int write_mode = as->regcache != NULL; if (s390_function_arg_float (type)) -Index: gdb-7.10.50.20160106/gdb/score-tdep.c +Index: gdb-7.11.50.20160716/gdb/score-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/score-tdep.c 2016-01-08 19:16:16.633814218 +0100 -+++ gdb-7.10.50.20160106/gdb/score-tdep.c 2016-01-08 19:16:20.328834829 +0100 +--- gdb-7.11.50.20160716.orig/gdb/score-tdep.c 2016-07-16 14:35:45.428503024 +0200 ++++ gdb-7.11.50.20160716/gdb/score-tdep.c 2016-07-16 14:35:47.527519916 +0200 @@ -514,7 +514,7 @@ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int argnum; @@ -941,10 +937,10 @@ Index: gdb-7.10.50.20160106/gdb/score-tdep.c CORE_ADDR stack_offset = 0; CORE_ADDR addr = 0; -Index: gdb-7.10.50.20160106/gdb/sh-tdep.c +Index: gdb-7.11.50.20160716/gdb/sh-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/sh-tdep.c 2016-01-08 19:16:16.635814230 +0100 -+++ gdb-7.10.50.20160106/gdb/sh-tdep.c 2016-01-08 19:16:20.329834834 +0100 +--- gdb-7.11.50.20160716.orig/gdb/sh-tdep.c 2016-07-16 14:35:45.429503032 +0200 ++++ gdb-7.11.50.20160716/gdb/sh-tdep.c 2016-07-16 14:35:47.527519916 +0200 @@ -805,7 +805,7 @@ static int sh_use_struct_convention (int renesas_abi, struct type *type) @@ -983,20 +979,20 @@ Index: gdb-7.10.50.20160106/gdb/sh-tdep.c int pass_on_stack = 0; int last_reg_arg = INT_MAX; -Index: gdb-7.10.50.20160106/gdb/sh64-tdep.c +Index: gdb-7.11.50.20160716/gdb/sh64-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/sh64-tdep.c 2016-01-08 19:16:16.635814230 +0100 -+++ gdb-7.10.50.20160106/gdb/sh64-tdep.c 2016-01-08 19:16:20.329834834 +0100 -@@ -1056,7 +1056,7 @@ +--- gdb-7.11.50.20160716.orig/gdb/sh64-tdep.c 2016-07-16 14:35:45.430503040 +0200 ++++ gdb-7.11.50.20160716/gdb/sh64-tdep.c 2016-07-16 14:35:47.528519925 +0200 +@@ -1060,7 +1060,7 @@ CORE_ADDR struct_addr) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int stack_offset, stack_alloc; + LONGEST stack_offset, stack_alloc; int int_argreg; - int float_argreg; - int double_argreg; -@@ -1067,7 +1067,7 @@ + int float_arg_index = 0; + int double_arg_index = 0; +@@ -1069,7 +1069,7 @@ CORE_ADDR regval; const gdb_byte *val; gdb_byte valbuf[8]; @@ -1005,10 +1001,10 @@ Index: gdb-7.10.50.20160106/gdb/sh64-tdep.c int argreg_size; int fp_args[12]; -Index: gdb-7.10.50.20160106/gdb/sparc-tdep.c +Index: gdb-7.11.50.20160716/gdb/sparc-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/sparc-tdep.c 2016-01-08 19:16:16.636814235 +0100 -+++ gdb-7.10.50.20160106/gdb/sparc-tdep.c 2016-01-08 19:16:20.330834840 +0100 +--- gdb-7.11.50.20160716.orig/gdb/sparc-tdep.c 2016-07-16 14:35:45.431503048 +0200 ++++ gdb-7.11.50.20160716/gdb/sparc-tdep.c 2016-07-16 14:35:47.528519925 +0200 @@ -525,7 +525,7 @@ for (i = 0; i < nargs; i++) { @@ -1018,10 +1014,10 @@ Index: gdb-7.10.50.20160106/gdb/sparc-tdep.c if (sparc_structure_or_union_p (type) || (sparc_floating_p (type) && len == 16) -Index: gdb-7.10.50.20160106/gdb/sparc64-tdep.c +Index: gdb-7.11.50.20160716/gdb/sparc64-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/sparc64-tdep.c 2016-01-08 19:16:16.637814241 +0100 -+++ gdb-7.10.50.20160106/gdb/sparc64-tdep.c 2016-01-08 19:16:20.330834840 +0100 +--- gdb-7.11.50.20160716.orig/gdb/sparc64-tdep.c 2016-07-16 14:35:45.432503056 +0200 ++++ gdb-7.11.50.20160716/gdb/sparc64-tdep.c 2016-07-16 14:35:47.528519925 +0200 @@ -636,7 +636,8 @@ static void @@ -1077,10 +1073,10 @@ Index: gdb-7.10.50.20160106/gdb/sparc64-tdep.c int regnum = -1; gdb_byte buf[16]; -Index: gdb-7.10.50.20160106/gdb/spu-tdep.c +Index: gdb-7.11.50.20160716/gdb/spu-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/spu-tdep.c 2016-01-08 19:16:16.638814246 +0100 -+++ gdb-7.10.50.20160106/gdb/spu-tdep.c 2016-01-08 19:16:20.331834845 +0100 +--- gdb-7.11.50.20160716.orig/gdb/spu-tdep.c 2016-07-16 14:35:45.433503064 +0200 ++++ gdb-7.11.50.20160716/gdb/spu-tdep.c 2016-07-16 14:35:47.529519932 +0200 @@ -1429,7 +1429,7 @@ struct value *arg = args[i]; struct type *type = check_typedef (value_type (arg)); @@ -1099,11 +1095,11 @@ Index: gdb-7.10.50.20160106/gdb/spu-tdep.c int preferred_slot; if (spu_scalar_value_p (type)) -Index: gdb-7.10.50.20160106/gdb/tic6x-tdep.c +Index: gdb-7.11.50.20160716/gdb/tic6x-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/tic6x-tdep.c 2016-01-08 19:16:16.639814252 +0100 -+++ gdb-7.10.50.20160106/gdb/tic6x-tdep.c 2016-01-08 19:16:20.332834851 +0100 -@@ -895,7 +895,7 @@ +--- gdb-7.11.50.20160716.orig/gdb/tic6x-tdep.c 2016-07-16 14:35:45.433503064 +0200 ++++ gdb-7.11.50.20160716/gdb/tic6x-tdep.c 2016-07-16 14:35:47.529519932 +0200 +@@ -892,7 +892,7 @@ int argreg = 0; int argnum; int stack_offset = 4; @@ -1112,7 +1108,7 @@ Index: gdb-7.10.50.20160106/gdb/tic6x-tdep.c CORE_ADDR func_addr = find_function_addr (function, NULL); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); struct type *func_type = value_type (function); -@@ -929,7 +929,7 @@ +@@ -926,7 +926,7 @@ /* Now make space on the stack for the args. */ for (argnum = 0; argnum < nargs; argnum++) { @@ -1121,7 +1117,7 @@ Index: gdb-7.10.50.20160106/gdb/tic6x-tdep.c if (argnum >= 10 - argreg) references_offset += len; stack_offset += len; -@@ -948,7 +948,7 @@ +@@ -945,7 +945,7 @@ const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -1130,7 +1126,7 @@ Index: gdb-7.10.50.20160106/gdb/tic6x-tdep.c enum type_code typecode = TYPE_CODE (arg_type); val = value_contents (arg); -@@ -1108,7 +1108,8 @@ +@@ -1105,7 +1105,8 @@ } else internal_error (__FILE__, __LINE__, @@ -1140,23 +1136,23 @@ Index: gdb-7.10.50.20160106/gdb/tic6x-tdep.c addr = sp + stack_offset; write_memory (addr, val, len); -Index: gdb-7.10.50.20160106/gdb/tilegx-tdep.c +Index: gdb-7.11.50.20160716/gdb/tilegx-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/tilegx-tdep.c 2016-01-08 19:16:16.640814257 +0100 -+++ gdb-7.10.50.20160106/gdb/tilegx-tdep.c 2016-01-08 19:16:20.332834851 +0100 +--- gdb-7.11.50.20160716.orig/gdb/tilegx-tdep.c 2016-07-16 14:35:45.434503072 +0200 ++++ gdb-7.11.50.20160716/gdb/tilegx-tdep.c 2016-07-16 14:35:47.530519941 +0200 @@ -288,7 +288,7 @@ CORE_ADDR stack_dest = sp; int argreg = TILEGX_R0_REGNUM; int i, j; -- int typelen, slacklen, alignlen; -+ LONGEST typelen, slacklen, alignlen; +- 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 -Index: gdb-7.10.50.20160106/gdb/v850-tdep.c +Index: gdb-7.11.50.20160716/gdb/v850-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/v850-tdep.c 2016-01-08 19:16:16.640814257 +0100 -+++ gdb-7.10.50.20160106/gdb/v850-tdep.c 2016-01-08 19:16:20.332834851 +0100 +--- gdb-7.11.50.20160716.orig/gdb/v850-tdep.c 2016-07-16 14:35:45.434503072 +0200 ++++ gdb-7.11.50.20160716/gdb/v850-tdep.c 2016-07-16 14:35:47.530519941 +0200 @@ -1019,7 +1019,7 @@ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int argreg; @@ -1175,10 +1171,10 @@ Index: gdb-7.10.50.20160106/gdb/v850-tdep.c gdb_byte *val; gdb_byte valbuf[v850_reg_size]; -Index: gdb-7.10.50.20160106/gdb/vax-tdep.c +Index: gdb-7.11.50.20160716/gdb/vax-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/vax-tdep.c 2016-01-08 19:16:16.641814263 +0100 -+++ gdb-7.10.50.20160106/gdb/vax-tdep.c 2016-01-08 19:16:20.333834856 +0100 +--- gdb-7.11.50.20160716.orig/gdb/vax-tdep.c 2016-07-16 14:35:45.435503080 +0200 ++++ gdb-7.11.50.20160716/gdb/vax-tdep.c 2016-07-16 14:35:47.530519941 +0200 @@ -111,7 +111,7 @@ struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -1197,10 +1193,10 @@ Index: gdb-7.10.50.20160106/gdb/vax-tdep.c sp -= (len + 3) & ~3; count += (len + 3) / 4; -Index: gdb-7.10.50.20160106/gdb/xstormy16-tdep.c +Index: gdb-7.11.50.20160716/gdb/xstormy16-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/xstormy16-tdep.c 2016-01-08 19:16:16.641814263 +0100 -+++ gdb-7.10.50.20160106/gdb/xstormy16-tdep.c 2016-01-08 19:16:20.333834856 +0100 +--- gdb-7.11.50.20160716.orig/gdb/xstormy16-tdep.c 2016-07-16 14:35:45.435503080 +0200 ++++ gdb-7.11.50.20160716/gdb/xstormy16-tdep.c 2016-07-16 14:35:47.530519941 +0200 @@ -233,8 +233,9 @@ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR stack_dest = sp; @@ -1213,10 +1209,10 @@ Index: gdb-7.10.50.20160106/gdb/xstormy16-tdep.c const gdb_byte *val; gdb_byte buf[xstormy16_pc_size]; -Index: gdb-7.10.50.20160106/gdb/xtensa-tdep.c +Index: gdb-7.11.50.20160716/gdb/xtensa-tdep.c =================================================================== ---- gdb-7.10.50.20160106.orig/gdb/xtensa-tdep.c 2016-01-08 19:16:16.643814274 +0100 -+++ gdb-7.10.50.20160106/gdb/xtensa-tdep.c 2016-01-08 19:16:20.334834862 +0100 +--- gdb-7.11.50.20160716.orig/gdb/xtensa-tdep.c 2016-07-16 14:35:45.437503096 +0200 ++++ gdb-7.11.50.20160716/gdb/xtensa-tdep.c 2016-07-16 14:35:47.531519949 +0200 @@ -1638,8 +1638,7 @@ if (len > (callsize > 8 ? 8 : 16)) diff --git a/gdb-rhbz795424-bitpos-25of25.patch b/gdb-rhbz795424-bitpos-25of25.patch index c392e34..4ec7077 100644 --- a/gdb-rhbz795424-bitpos-25of25.patch +++ b/gdb-rhbz795424-bitpos-25of25.patch @@ -47,11 +47,11 @@ Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=f77-bounds.patch -Index: gdb-7.10.50.20151027/gdb/f-lang.h +Index: gdb-7.11.90.20160907/gdb/f-lang.h =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/f-lang.h 2015-11-02 21:25:14.233161097 +0100 -+++ gdb-7.10.50.20151027/gdb/f-lang.h 2015-11-02 21:25:22.404214860 +0100 -@@ -62,9 +62,9 @@ struct common_block +--- gdb-7.11.90.20160907.orig/gdb/f-lang.h 2016-09-07 21:48:33.308624019 +0200 ++++ gdb-7.11.90.20160907/gdb/f-lang.h 2016-09-07 21:48:40.967692469 +0200 +@@ -49,9 +49,9 @@ struct symbol *contents[1]; }; @@ -63,38 +63,38 @@ Index: gdb-7.10.50.20151027/gdb/f-lang.h extern void f77_get_dynamic_array_length (struct type *); -Index: gdb-7.10.50.20151027/gdb/f-typeprint.c +Index: gdb-7.11.90.20160907/gdb/f-typeprint.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/f-typeprint.c 2015-11-02 21:25:14.234161104 +0100 -+++ gdb-7.10.50.20151027/gdb/f-typeprint.c 2015-11-02 21:25:22.404214860 +0100 -@@ -171,7 +171,7 @@ f_type_print_varspec_suffix (struct type +--- gdb-7.11.90.20160907.orig/gdb/f-typeprint.c 2016-09-07 21:48:33.309624028 +0200 ++++ gdb-7.11.90.20160907/gdb/f-typeprint.c 2016-09-07 21:48:40.967692469 +0200 +@@ -147,7 +147,7 @@ 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; + LONGEST upper_bound, lower_bound; /* No static variables are permitted as an error call may occur during execution of this function. */ -@@ -204,7 +204,7 @@ f_type_print_varspec_suffix (struct type +@@ -194,7 +194,7 @@ + { + 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)); - 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 '*'. */ +@@ -204,7 +204,7 @@ + else + { + upper_bound = f77_get_upperbound (type); +- fprintf_filtered (stream, "%d", upper_bound); ++ fprintf_filtered (stream, "%s", plongest (upper_bound)); + } + } - /* Make sure that, if we have an assumed size array, we - print out a warning and print the upperbound as '*'. */ -@@ -214,7 +214,7 @@ f_type_print_varspec_suffix (struct type - else - { - upper_bound = f77_get_upperbound (type); -- fprintf_filtered (stream, "%d", upper_bound); -+ fprintf_filtered (stream, "%s", plongest (upper_bound)); - } - - if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY) -@@ -283,7 +283,7 @@ void +@@ -276,7 +276,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show, int level) { @@ -103,7 +103,7 @@ Index: gdb-7.10.50.20151027/gdb/f-typeprint.c int index; QUIT; -@@ -365,7 +365,7 @@ f_type_print_base (struct type *type, st +@@ -358,7 +358,7 @@ else { upper_bound = f77_get_upperbound (type); @@ -112,11 +112,11 @@ Index: gdb-7.10.50.20151027/gdb/f-typeprint.c } break; -Index: gdb-7.10.50.20151027/gdb/f-valprint.c +Index: gdb-7.11.90.20160907/gdb/f-valprint.c =================================================================== ---- gdb-7.10.50.20151027.orig/gdb/f-valprint.c 2015-11-02 21:25:14.234161104 +0100 -+++ gdb-7.10.50.20151027/gdb/f-valprint.c 2015-11-02 21:25:22.405214867 +0100 -@@ -43,7 +43,7 @@ LONGEST f77_array_offset_tbl[MAX_FORTRAN +--- gdb-7.11.90.20160907.orig/gdb/f-valprint.c 2016-09-07 21:48:33.309624028 +0200 ++++ gdb-7.11.90.20160907/gdb/f-valprint.c 2016-09-07 21:48:40.967692469 +0200 +@@ -43,7 +43,7 @@ /* 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. */ @@ -125,7 +125,7 @@ Index: gdb-7.10.50.20151027/gdb/f-valprint.c f77_get_lowerbound (struct type *type) { if (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED (type)) -@@ -52,7 +52,7 @@ f77_get_lowerbound (struct type *type) +@@ -52,7 +52,7 @@ return TYPE_ARRAY_LOWER_BOUND_VALUE (type); } diff --git a/gdb-rhbz795424-bitpos-lazyvalue.patch b/gdb-rhbz795424-bitpos-lazyvalue.patch index 7285196..273c87d 100644 --- a/gdb-rhbz795424-bitpos-lazyvalue.patch +++ b/gdb-rhbz795424-bitpos-lazyvalue.patch @@ -1,19 +1,7 @@ -Index: gdb-7.10.50.20151022/gdb/value.c -=================================================================== ---- gdb-7.10.50.20151022.orig/gdb/value.c 2015-10-24 23:17:04.042143628 +0200 -+++ gdb-7.10.50.20151022/gdb/value.c 2015-10-24 23:17:27.687300689 +0200 -@@ -934,7 +934,6 @@ allocate_value_lazy (struct type *type) - description correctly. */ - check_typedef (type); - -- ulongest_fits_host_or_error (TYPE_LENGTH (type)); - val = XCNEW (struct value); - val->contents = NULL; - val->next = all_values; -Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.base/longest-types-64bit.exp +Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.50.20151022/gdb/testsuite/gdb.base/longest-types-64bit.exp 2015-10-24 23:17:04.042143628 +0200 ++++ gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.exp 2016-07-03 15:00:57.617347850 +0200 @@ -0,0 +1,59 @@ +# This testcase is part of GDB, the GNU debugger. + @@ -45,8 +33,8 @@ Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.base/longest-types-64bit.exp + +# Test 64-bit file first as it is not compiled so its compilation never fails. + -+set file64bitbz2uu ${srcdir}/${subdir}/${testfile}-64bit.bz2.uu -+set file64bit ${objdir}/${subdir}/${testfile}-64bit ++set file64bitbz2uu ${srcdir}/${subdir}/${testfile}.bz2.uu ++set file64bit ${objdir}/${subdir}/${testfile} + +if {[catch "system \"uudecode -o - ${file64bitbz2uu} | bzip2 -dc >${file64bit}\""] != 0} { + untested "failed uudecode or bzip2" @@ -60,7 +48,7 @@ Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.base/longest-types-64bit.exp + +clean_restart ${file64bit} + -+#if { [prepare_for_testing ${testfile}.exp ${testfile}-64bit $srcfile2 {nodebug}] } { ++#if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile2 {nodebug}] } { +# return -1 +#} + @@ -74,10 +62,10 @@ Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.base/longest-types-64bit.exp +} + +test "native" -Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.base/longest-types-64bit.c +Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.50.20151022/gdb/testsuite/gdb.base/longest-types-64bit.c 2015-10-24 23:17:04.042143628 +0200 ++++ gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.c 2016-07-03 15:00:57.618347859 +0200 @@ -0,0 +1,28 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -107,10 +95,10 @@ Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.base/longest-types-64bit.c +{ + return 0; +} -Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.base/longest-types-64bit.S +Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.S =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.50.20151022/gdb/testsuite/gdb.base/longest-types-64bit.S 2015-10-24 23:17:04.042143628 +0200 ++++ gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.S 2016-07-03 15:00:57.618347859 +0200 @@ -0,0 +1,249 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -361,10 +349,10 @@ Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.base/longest-types-64bit.S + .string "char" + .ident "GCC: (GNU) 4.7.3 20121109 (prerelease)" + .section .note.GNU-stack,"",@progbits -Index: gdb-7.10.50.20151022/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu +Index: gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.10.50.20151022/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu 2015-10-24 23:17:04.042143628 +0200 ++++ gdb-7.11.50.20160630/gdb/testsuite/gdb.base/longest-types-64bit.bz2.uu 2016-07-03 15:00:57.618347859 +0200 @@ -0,0 +1,67 @@ +begin 755 gdb.base/longest-types-64bit.bz2 +M0EIH.3%!62936<'N#OH`"G/________^______?_Y______//]7SQD5'^/_% diff --git a/gdb-test-ivy-bridge.patch b/gdb-test-ivy-bridge.patch new file mode 100644 index 0000000..d5fbe36 --- /dev/null +++ b/gdb-test-ivy-bridge.patch @@ -0,0 +1,461 @@ +Index: gdb-7.12/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp 2016-10-20 20:57:31.652630455 +0200 +@@ -0,0 +1,170 @@ ++# Copyright 2011 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++if {![istarget "x86_64-*-*"]} then { ++ return ++} ++ ++set testfile amd64-ivy-bridge ++set test compilation ++if [prepare_for_testing ${testfile}.exp ${testfile}.x ${testfile}.S [list debug "additional_flags=-m64 -nostdlib"]] { ++ fail $test ++ return -1 ++} ++pass $test ++ ++gdb_test_no_output "set disassembly-flavor att" ++# gas/i386/x86-64-rdrnd.d ++# gas/i386/x86-64-f16c.d ++# gas/i386/x86-64-fsgs.d ++gdb_test "disassemble/r _start" "\r ++Dump of assembler code for function _start:\r ++\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand %bx\r ++\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand %ebx\r ++\[^\r\n\]+:\t48 0f c7 f3\t\( \)?rdrand %rbx\r ++\[^\r\n\]+:\t66 41 0f c7 f0\t\( \)?rdrand %r8w\r ++\[^\r\n\]+:\t41 0f c7 f0\t\( \)?rdrand %r8d\r ++\[^\r\n\]+:\t49 0f c7 f0\t\( \)?rdrand %r8\r ++\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand %bx\r ++\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand %ebx\r ++\[^\r\n\]+:\t48 0f c7 f3\t\( \)?rdrand %rbx\r ++\[^\r\n\]+:\t66 41 0f c7 f0\t\( \)?rdrand %r8w\r ++\[^\r\n\]+:\t41 0f c7 f0\t\( \)?rdrand %r8d\r ++\[^\r\n\]+:\t49 0f c7 f0\t\( \)?rdrand %r8\r ++\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps %xmm4,%ymm4\r ++\[^\r\n\]+:\tc4 42 7d 13 00\t\( \)?vcvtph2ps \\(%r8\\),%ymm8\r ++\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps %xmm4,%xmm6\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps \\(%rcx\\),%xmm4\r ++\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,%xmm4\r ++\[^\r\n\]+:\tc4 43 7d 1d 00 02\t\( \)?vcvtps2ph \\\$0x2,%ymm8,\\(%r8\\)\r ++\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,%xmm4\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,\\(%rcx\\)\r ++\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps %xmm4,%ymm4\r ++\[^\r\n\]+:\tc4 42 7d 13 00\t\( \)?vcvtph2ps \\(%r8\\),%ymm8\r ++\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps \\(%rcx\\),%ymm4\r ++\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps %xmm4,%xmm6\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps \\(%rcx\\),%xmm4\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps \\(%rcx\\),%xmm4\r ++\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,%xmm4\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,\\(%rcx\\)\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,\\(%rcx\\)\r ++\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,%xmm4\r ++\[^\r\n\]+:\tc4 43 79 1d 00 02\t\( \)?vcvtps2ph \\\$0x2,%xmm8,\\(%r8\\)\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,\\(%rcx\\)\r ++\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase %ebx\r ++\[^\r\n\]+:\tf3 48 0f ae c3\t\( \)?rdfsbase %rbx\r ++\[^\r\n\]+:\tf3 41 0f ae c0\t\( \)?rdfsbase %r8d\r ++\[^\r\n\]+:\tf3 49 0f ae c0\t\( \)?rdfsbase %r8\r ++\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase %ebx\r ++\[^\r\n\]+:\tf3 48 0f ae cb\t\( \)?rdgsbase %rbx\r ++\[^\r\n\]+:\tf3 41 0f ae c8\t\( \)?rdgsbase %r8d\r ++\[^\r\n\]+:\tf3 49 0f ae c8\t\( \)?rdgsbase %r8\r ++\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase %ebx\r ++\[^\r\n\]+:\tf3 48 0f ae d3\t\( \)?wrfsbase %rbx\r ++\[^\r\n\]+:\tf3 41 0f ae d0\t\( \)?wrfsbase %r8d\r ++\[^\r\n\]+:\tf3 49 0f ae d0\t\( \)?wrfsbase %r8\r ++\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase %ebx\r ++\[^\r\n\]+:\tf3 48 0f ae db\t\( \)?wrgsbase %rbx\r ++\[^\r\n\]+:\tf3 41 0f ae d8\t\( \)?wrgsbase %r8d\r ++\[^\r\n\]+:\tf3 49 0f ae d8\t\( \)?wrgsbase %r8\r ++\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase %ebx\r ++\[^\r\n\]+:\tf3 48 0f ae c3\t\( \)?rdfsbase %rbx\r ++\[^\r\n\]+:\tf3 41 0f ae c0\t\( \)?rdfsbase %r8d\r ++\[^\r\n\]+:\tf3 49 0f ae c0\t\( \)?rdfsbase %r8\r ++\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase %ebx\r ++\[^\r\n\]+:\tf3 48 0f ae cb\t\( \)?rdgsbase %rbx\r ++\[^\r\n\]+:\tf3 41 0f ae c8\t\( \)?rdgsbase %r8d\r ++\[^\r\n\]+:\tf3 49 0f ae c8\t\( \)?rdgsbase %r8\r ++\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase %ebx\r ++\[^\r\n\]+:\tf3 48 0f ae d3\t\( \)?wrfsbase %rbx\r ++\[^\r\n\]+:\tf3 41 0f ae d0\t\( \)?wrfsbase %r8d\r ++\[^\r\n\]+:\tf3 49 0f ae d0\t\( \)?wrfsbase %r8\r ++\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase %ebx\r ++\[^\r\n\]+:\tf3 48 0f ae db\t\( \)?wrgsbase %rbx\r ++\[^\r\n\]+:\tf3 41 0f ae d8\t\( \)?wrgsbase %r8d\r ++\[^\r\n\]+:\tf3 49 0f ae d8\t\( \)?wrgsbase %r8\r ++End of assembler dump\\." "att" ++ ++gdb_test_no_output "set disassembly-flavor intel" ++# gas/i386/x86-64-rdrnd-intel.d ++# gas/i386/x86-64-f16c-intel.d ++# gas/i386/x86-64-fsgs-intel.d ++gdb_test "disassemble/r _start" "\r ++Dump of assembler code for function _start:\r ++\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand bx\r ++\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand ebx\r ++\[^\r\n\]+:\t48 0f c7 f3\t\( \)?rdrand rbx\r ++\[^\r\n\]+:\t66 41 0f c7 f0\t\( \)?rdrand r8w\r ++\[^\r\n\]+:\t41 0f c7 f0\t\( \)?rdrand r8d\r ++\[^\r\n\]+:\t49 0f c7 f0\t\( \)?rdrand r8\r ++\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand bx\r ++\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand ebx\r ++\[^\r\n\]+:\t48 0f c7 f3\t\( \)?rdrand rbx\r ++\[^\r\n\]+:\t66 41 0f c7 f0\t\( \)?rdrand r8w\r ++\[^\r\n\]+:\t41 0f c7 f0\t\( \)?rdrand r8d\r ++\[^\r\n\]+:\t49 0f c7 f0\t\( \)?rdrand r8\r ++\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps ymm4,xmm4\r ++\[^\r\n\]+:\tc4 42 7d 13 00\t\( \)?vcvtph2ps ymm8,XMMWORD PTR \\\[r8\\\]\r ++\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps xmm6,xmm4\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps xmm4,QWORD PTR \\\[rcx\\\]\r ++\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph xmm4,ymm4,0x2\r ++\[^\r\n\]+:\tc4 43 7d 1d 00 02\t\( \)?vcvtps2ph XMMWORD PTR \\\[r8\\\],ymm8,0x2\r ++\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph xmm4,xmm4,0x2\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph QWORD PTR \\\[rcx\\\],xmm4,0x2\r ++\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps ymm4,xmm4\r ++\[^\r\n\]+:\tc4 42 7d 13 00\t\( \)?vcvtph2ps ymm8,XMMWORD PTR \\\[r8\\\]\r ++\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps ymm4,XMMWORD PTR \\\[rcx\\\]\r ++\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps xmm6,xmm4\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps xmm4,QWORD PTR \\\[rcx\\\]\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps xmm4,QWORD PTR \\\[rcx\\\]\r ++\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph xmm4,ymm4,0x2\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph XMMWORD PTR \\\[rcx\\\],ymm4,0x2\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph XMMWORD PTR \\\[rcx\\\],ymm4,0x2\r ++\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph xmm4,xmm4,0x2\r ++\[^\r\n\]+:\tc4 43 79 1d 00 02\t\( \)?vcvtps2ph QWORD PTR \\\[r8\\\],xmm8,0x2\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph QWORD PTR \\\[rcx\\\],xmm4,0x2\r ++\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase ebx\r ++\[^\r\n\]+:\tf3 48 0f ae c3\t\( \)?rdfsbase rbx\r ++\[^\r\n\]+:\tf3 41 0f ae c0\t\( \)?rdfsbase r8d\r ++\[^\r\n\]+:\tf3 49 0f ae c0\t\( \)?rdfsbase r8\r ++\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase ebx\r ++\[^\r\n\]+:\tf3 48 0f ae cb\t\( \)?rdgsbase rbx\r ++\[^\r\n\]+:\tf3 41 0f ae c8\t\( \)?rdgsbase r8d\r ++\[^\r\n\]+:\tf3 49 0f ae c8\t\( \)?rdgsbase r8\r ++\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase ebx\r ++\[^\r\n\]+:\tf3 48 0f ae d3\t\( \)?wrfsbase rbx\r ++\[^\r\n\]+:\tf3 41 0f ae d0\t\( \)?wrfsbase r8d\r ++\[^\r\n\]+:\tf3 49 0f ae d0\t\( \)?wrfsbase r8\r ++\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase ebx\r ++\[^\r\n\]+:\tf3 48 0f ae db\t\( \)?wrgsbase rbx\r ++\[^\r\n\]+:\tf3 41 0f ae d8\t\( \)?wrgsbase r8d\r ++\[^\r\n\]+:\tf3 49 0f ae d8\t\( \)?wrgsbase r8\r ++\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase ebx\r ++\[^\r\n\]+:\tf3 48 0f ae c3\t\( \)?rdfsbase rbx\r ++\[^\r\n\]+:\tf3 41 0f ae c0\t\( \)?rdfsbase r8d\r ++\[^\r\n\]+:\tf3 49 0f ae c0\t\( \)?rdfsbase r8\r ++\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase ebx\r ++\[^\r\n\]+:\tf3 48 0f ae cb\t\( \)?rdgsbase rbx\r ++\[^\r\n\]+:\tf3 41 0f ae c8\t\( \)?rdgsbase r8d\r ++\[^\r\n\]+:\tf3 49 0f ae c8\t\( \)?rdgsbase r8\r ++\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase ebx\r ++\[^\r\n\]+:\tf3 48 0f ae d3\t\( \)?wrfsbase rbx\r ++\[^\r\n\]+:\tf3 41 0f ae d0\t\( \)?wrfsbase r8d\r ++\[^\r\n\]+:\tf3 49 0f ae d0\t\( \)?wrfsbase r8\r ++\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase ebx\r ++\[^\r\n\]+:\tf3 48 0f ae db\t\( \)?wrgsbase rbx\r ++\[^\r\n\]+:\tf3 41 0f ae d8\t\( \)?wrgsbase r8d\r ++\[^\r\n\]+:\tf3 49 0f ae d8\t\( \)?wrgsbase r8\r ++End of assembler dump\\." "intel" +Index: gdb-7.12/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp 2016-10-20 20:57:43.251721147 +0200 +@@ -0,0 +1,106 @@ ++# Copyright 2011 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++if {![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"]} then { ++ return ++} ++ ++set testfile i386-ivy-bridge ++set test compilation ++if [prepare_for_testing ${testfile}.exp ${testfile}.x ${testfile}.S [list debug "additional_flags=-m32 -nostdlib"]] { ++ fail $test ++ return -1 ++} ++pass $test ++ ++gdb_test_no_output "set disassembly-flavor att" ++# gas/i386/rdrnd.d ++# gas/i386/f16c.d ++# gas/i386/fsgs.d ++gdb_test "disassemble/r _start" "\r ++Dump of assembler code for function _start:\r ++\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand %bx\r ++\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand %ebx\r ++\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand %bx\r ++\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand %ebx\r ++\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps %xmm4,%ymm4\r ++\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps \\(%ecx\\),%ymm4\r ++\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps %xmm4,%xmm6\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps \\(%ecx\\),%xmm4\r ++\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,%xmm4\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,\\(%ecx\\)\r ++\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,%xmm4\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,\\(%ecx\\)\r ++\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps %xmm4,%ymm4\r ++\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps \\(%ecx\\),%ymm4\r ++\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps \\(%ecx\\),%ymm4\r ++\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps %xmm4,%xmm6\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps \\(%ecx\\),%xmm4\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps \\(%ecx\\),%xmm4\r ++\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,%xmm4\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,\\(%ecx\\)\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,\\(%ecx\\)\r ++\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,%xmm4\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,\\(%ecx\\)\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,\\(%ecx\\)\r ++\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase %ebx\r ++\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase %ebx\r ++\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase %ebx\r ++\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase %ebx\r ++\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase %ebx\r ++\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase %ebx\r ++\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase %ebx\r ++\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase %ebx\r ++End of assembler dump\\." "att" ++ ++gdb_test_no_output "set disassembly-flavor intel" ++# gas/i386/rdrnd-intel.d ++# gas/i386/f16c-intel.d ++# gas/i386/fsgs-intel.d ++gdb_test "disassemble/r _start" "\r ++Dump of assembler code for function _start:\r ++\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand bx\r ++\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand ebx\r ++\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand bx\r ++\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand ebx\r ++\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps ymm4,xmm4\r ++\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps ymm4,XMMWORD PTR \\\[ecx\\\]\r ++\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps xmm6,xmm4\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps xmm4,QWORD PTR \\\[ecx\\\]\r ++\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph xmm4,ymm4,0x2\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph XMMWORD PTR \\\[ecx\\\],ymm4,0x2\r ++\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph xmm4,xmm4,0x2\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph QWORD PTR \\\[ecx\\\],xmm4,0x2\r ++\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps ymm4,xmm4\r ++\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps ymm4,XMMWORD PTR \\\[ecx\\\]\r ++\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps ymm4,XMMWORD PTR \\\[ecx\\\]\r ++\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps xmm6,xmm4\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps xmm4,QWORD PTR \\\[ecx\\\]\r ++\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps xmm4,QWORD PTR \\\[ecx\\\]\r ++\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph xmm4,ymm4,0x2\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph XMMWORD PTR \\\[ecx\\\],ymm4,0x2\r ++\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph XMMWORD PTR \\\[ecx\\\],ymm4,0x2\r ++\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph xmm4,xmm4,0x2\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph QWORD PTR \\\[ecx\\\],xmm4,0x2\r ++\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph QWORD PTR \\\[ecx\\\],xmm4,0x2\r ++\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase ebx\r ++\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase ebx\r ++\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase ebx\r ++\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase ebx\r ++\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase ebx\r ++\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase ebx\r ++\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase ebx\r ++\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase ebx\r ++End of assembler dump\\." "intel" +Index: gdb-7.12/gdb/testsuite/gdb.arch/amd64-ivy-bridge.S +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.arch/amd64-ivy-bridge.S 2016-10-20 20:55:50.853842324 +0200 +@@ -0,0 +1,98 @@ ++/* Copyright 2011 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. */ ++ ++ .globl _start ++_start: .text ++ ++/* gas/i386/x86-64-rdrnd.s */ ++ .att_syntax prefix ++ rdrand %bx ++ rdrand %ebx ++ rdrand %rbx ++ rdrand %r8w ++ rdrand %r8d ++ rdrand %r8 ++ ++ .intel_syntax noprefix ++ rdrand bx ++ rdrand ebx ++ rdrand rbx ++ rdrand r8w ++ rdrand r8d ++ rdrand r8 ++ ++/* gas/i386/x86-64-f16c.s */ ++ .att_syntax prefix ++ vcvtph2ps %xmm4,%ymm4 ++ vcvtph2ps (%r8),%ymm8 ++ vcvtph2ps %xmm4,%xmm6 ++ vcvtph2ps (%rcx),%xmm4 ++ vcvtps2ph $0x2,%ymm4,%xmm4 ++ vcvtps2ph $0x2,%ymm8,(%r8) ++ vcvtps2ph $0x2,%xmm4,%xmm4 ++ vcvtps2ph $0x2,%xmm4,(%rcx) ++ ++ .intel_syntax noprefix ++ vcvtph2ps ymm4,xmm4 ++ vcvtph2ps ymm8,XMMWORD PTR [r8] ++ vcvtph2ps ymm4,[rcx] ++ vcvtph2ps xmm6,xmm4 ++ vcvtph2ps xmm4,QWORD PTR [rcx] ++ vcvtph2ps xmm4,[rcx] ++ vcvtps2ph xmm4,ymm4,0x2 ++ vcvtps2ph XMMWORD PTR [rcx],ymm4,0x2 ++ vcvtps2ph [rcx],ymm4,0x2 ++ vcvtps2ph xmm4,xmm4,0x2 ++ vcvtps2ph QWORD PTR [r8],xmm8,0x2 ++ vcvtps2ph [rcx],xmm4,0x2 ++ ++/* gas/i386/x86-64-fsgs.s */ ++ .att_syntax prefix ++ rdfsbase %ebx ++ rdfsbase %rbx ++ rdfsbase %r8d ++ rdfsbase %r8 ++ rdgsbase %ebx ++ rdgsbase %rbx ++ rdgsbase %r8d ++ rdgsbase %r8 ++ wrfsbase %ebx ++ wrfsbase %rbx ++ wrfsbase %r8d ++ wrfsbase %r8 ++ wrgsbase %ebx ++ wrgsbase %rbx ++ wrgsbase %r8d ++ wrgsbase %r8 ++ ++ .intel_syntax noprefix ++ rdfsbase ebx ++ rdfsbase rbx ++ rdfsbase r8d ++ rdfsbase r8 ++ rdgsbase ebx ++ rdgsbase rbx ++ rdgsbase r8d ++ rdgsbase r8 ++ wrfsbase ebx ++ wrfsbase rbx ++ wrfsbase r8d ++ wrfsbase r8 ++ wrgsbase ebx ++ wrgsbase rbx ++ wrgsbase r8d ++ wrgsbase r8 +Index: gdb-7.12/gdb/testsuite/gdb.arch/i386-ivy-bridge.S +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.12/gdb/testsuite/gdb.arch/i386-ivy-bridge.S 2016-10-20 20:55:50.853842324 +0200 +@@ -0,0 +1,67 @@ ++/* Copyright 2011 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. */ ++ ++ .globl _start ++_start: .text ++ ++/* gas/i386/rdrnd.s */ ++ .att_syntax prefix ++ rdrand %bx ++ rdrand %ebx ++ ++ .intel_syntax noprefix ++ rdrand bx ++ rdrand ebx ++ ++/* gas/i386/f16c.s */ ++ .att_syntax prefix ++ vcvtph2ps %xmm4,%ymm4 ++ vcvtph2ps (%ecx),%ymm4 ++ vcvtph2ps %xmm4,%xmm6 ++ vcvtph2ps (%ecx),%xmm4 ++ vcvtps2ph $0x2,%ymm4,%xmm4 ++ vcvtps2ph $0x2,%ymm4,(%ecx) ++ vcvtps2ph $0x2,%xmm4,%xmm4 ++ vcvtps2ph $0x2,%xmm4,(%ecx) ++ ++ .intel_syntax noprefix ++ vcvtph2ps ymm4,xmm4 ++ vcvtph2ps ymm4,XMMWORD PTR [ecx] ++ vcvtph2ps ymm4,[ecx] ++ vcvtph2ps xmm6,xmm4 ++ vcvtph2ps xmm4,QWORD PTR [ecx] ++ vcvtph2ps xmm4,[ecx] ++ vcvtps2ph xmm4,ymm4,0x2 ++ vcvtps2ph XMMWORD PTR [ecx],ymm4,0x2 ++ vcvtps2ph [ecx],ymm4,0x2 ++ vcvtps2ph xmm4,xmm4,0x2 ++ vcvtps2ph QWORD PTR [ecx],xmm4,0x2 ++ vcvtps2ph [ecx],xmm4,0x2 ++ ++/* gas/i386/fsgs.s */ ++ .att_syntax prefix ++ rdfsbase %ebx ++ rdgsbase %ebx ++ wrfsbase %ebx ++ wrgsbase %ebx ++ ++ .intel_syntax noprefix ++ rdfsbase ebx ++ rdgsbase ebx ++ wrfsbase ebx ++ wrgsbase ebx ++ diff --git a/gdb-testsuite-casts.patch b/gdb-testsuite-casts.patch new file mode 100644 index 0000000..3d68c49 --- /dev/null +++ b/gdb-testsuite-casts.patch @@ -0,0 +1,80 @@ +http://sourceware.org/ml/gdb-patches/2016-09/msg00082.html +Subject: [testsuite patch] Fix false FAIL in gdb.cp/casts.exp + + +--ikeVEW9yuYc//A+q +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline + +Hi, + +gcc-6.2.1-1.fc26.x86_64 + +gdb compile failed, /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc:40:10: error: expected primary-expression before 'int' + decltype(int x) + ^~~ +/home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc:40:10: error: expected ')' before 'int' +/home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc:40:1: error: expected unqualified-id before 'decltype' + decltype(int x) + ^~~~~~~~ +/home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc: In function 'int main(int, char**)': +/home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/casts.cc:59:14: error: expected primary-expression before 'decltype' + double y = decltype(2); + ^~~~~~~~ + +'decltype' is a registered keyword since C++11 which is now a default for GCC. + +OK for check-in? + + +Jan + +--ikeVEW9yuYc//A+q +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline; filename=1 + +gdb/testsuite/ChangeLog +2016-09-11 Jan Kratochvil + + * gdb.cp/casts.cc: Rename decltype to int_to_double. + * gdb.cp/casts.exp (whatis decltype(5)): Rename to ... + (whatis int_to_double(5)): ... here. + +diff --git a/gdb/testsuite/gdb.cp/casts.cc b/gdb/testsuite/gdb.cp/casts.cc +index 43f112f..4f68ba0 100644 +--- a/gdb/testsuite/gdb.cp/casts.cc ++++ b/gdb/testsuite/gdb.cp/casts.cc +@@ -37,7 +37,7 @@ struct DoublyDerived : public VirtuallyDerived, + // Confuse a simpler approach. + + double +-decltype(int x) ++int_to_double(int x) + { + return x + 2.0; + } +@@ -56,7 +56,7 @@ main (int argc, char **argv) + Alpha *ad = &derived; + Alpha *add = &doublyderived; + +- double y = decltype(2); ++ double y = int_to_double(2); + + return 0; /* breakpoint spot: casts.exp: 1 */ + } +diff --git a/gdb/testsuite/gdb.cp/casts.exp b/gdb/testsuite/gdb.cp/casts.exp +index 34a2492..5798098 100644 +--- a/gdb/testsuite/gdb.cp/casts.exp ++++ b/gdb/testsuite/gdb.cp/casts.exp +@@ -112,7 +112,7 @@ gdb_test "print reinterpret_cast (*b)" " = \\(A \\&\\) @$hex: {a = 42}" \ + + # Test that keyword shadowing works. + +-gdb_test "whatis decltype(5)" " = double" ++gdb_test "whatis int_to_double(5)" " = double" + + # Basic tests using typeof. + + +--ikeVEW9yuYc//A+q-- + diff --git a/gdb-testsuite-m-static.patch b/gdb-testsuite-m-static.patch new file mode 100644 index 0000000..1690c77 --- /dev/null +++ b/gdb-testsuite-m-static.patch @@ -0,0 +1,79 @@ +http://sourceware.org/ml/gdb-patches/2016-09/msg00083.html +Subject: [testsuite patch] Fix C++11 compilation failure for gdb.cp/m-static.exp + + +--y0ulUmNC+osPPQO6 +Content-Type: text/plain; charset=iso-2022-jp +Content-Disposition: inline + +Hi, + +gcc-6.2.1-1.fc26.x86_64 + +g++ -std=c++03: +no warnings + +g++: +In file included from /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.cc:79:0: +/home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.h:9:34: error: $B!F(Bconstexpr$B!G(B needed for in-class initialization of static data member $B!F(Bconst float gnu_obj_4::somewhere$B!G(B of non-integral type [-fpermissive] + static const float somewhere = 3.14159; + ^~~~~~~ + +clang++: +In file included from /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.cc:79: +/home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.h:9:22: warning: in-class initializer for static data member of type 'const float' is a GNU extension [-Wgnu-static-float-init] + static const float somewhere = 3.14159; + ^ ~~~~~~~ +1 warning generated. + +clang++ -std=c++11: +In file included from /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.cc:79: +/home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.h:9:22: error: in-class initializer for static data member of type 'const float' requires 'constexpr' specifier [-Wstatic-float-init] + static const float somewhere = 3.14159; + ^ ~~~~~~~ +/home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.h:9:3: note: add 'constexpr' + static const float somewhere = 3.14159; + ^ + constexpr +1 error generated. + +OK for check-in? + +After the fix out of the 4 combinations above only this one remains non-empty: + +clang++: +In file included from /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.cc:79: +/home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.cp/m-static.h:9:22: warning: in-class initializer for static data member of type 'const float' is a GNU extension [-Wgnu-static-float-init] + static const float somewhere = 3.14159; + ^ ~~~~~~~ +1 warning generated. + + +Jan + +--y0ulUmNC+osPPQO6 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline; filename=1 + +gdb/testsuite/ChangeLog +2016-09-11 Jan Kratochvil + + * gdb.cp/m-static.h (gnu_obj_4::somewhere): Use constexpr for C++11. + +diff --git a/gdb/testsuite/gdb.cp/m-static.h b/gdb/testsuite/gdb.cp/m-static.h +index bcedfff..2992463 100644 +--- a/gdb/testsuite/gdb.cp/m-static.h ++++ b/gdb/testsuite/gdb.cp/m-static.h +@@ -6,6 +6,9 @@ class gnu_obj_4 + static const int elsewhere; + static const int nowhere; + static const int everywhere = 317; ++#if __cplusplus >= 201103L ++ constexpr ++#endif + static const float somewhere = 3.14159; + + // try to ensure test4 is actually allocated + +--y0ulUmNC+osPPQO6-- + diff --git a/gdb-testsuite-morestack-gold.patch b/gdb-testsuite-morestack-gold.patch new file mode 100644 index 0000000..8cfab1b --- /dev/null +++ b/gdb-testsuite-morestack-gold.patch @@ -0,0 +1,83 @@ +http://sourceware.org/ml/gdb-patches/2016-10/msg00652.html +Subject: [testsuite patch] Fix false FAIL for gdb.base/morestack.exp + + +--HlL+5n6rz5pIUxbD +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline + +Hi, + +since + [commit] [testsuite patch] Fix gcc_compiled for gcc 6 & 7 + https://sourceware.org/ml/gdb-patches/2016-10/msg00620.html + +there has started running again + Running gdb/testsuite/gdb.base/morestack.exp ... + +FAIL: gdb.base/morestack.exp: continue + +PASS: gdb.base/morestack.exp: up 3000 + +but as you can see it FAILs now - on Fedora 24 x86_64 (although for example it +still PASSes on CentOS-7.2 x86_64). + +Program received signal SIGSEGV, Segmentation fault. +0x00007ffff787c7bb in malloc_consolidate (av=av@entry=0x7ffff7bbcb00 ) at malloc.c:4181 +4181 unlink(av, nextchunk, bck, fwd); +(gdb) bt +#0 0x00007ffff787c7bb in malloc_consolidate (av=av@entry=0x7ffff7bbcb00 ) at malloc.c:4181 +#1 0x00007ffff787f235 in _int_malloc (av=av@entry=0x7ffff7bbcb00 , bytes=bytes@entry=1024) at malloc.c:3448 +[...] +#8 0x00007ffff784c5ac in _IO_vfprintf_internal (s=0x7ffff7bbd600 <_IO_2_1_stdout_>, format=, ap=ap@entry=0x7ffff77fd7f8) at vfprintf.c:1631 +#9 0x00007ffff7853939 in __printf (format=) at printf.c:33 +#10 0x0000000000400d6b in down () +#11 0x0000000000400f2c in __morestack () +#12 0x0000000000400dda in down () +[...] + +This apparently is due to - man gcc - -fsplit-stack: + When code compiled with -fsplit-stack calls code compiled without + -fsplit-stack, there may not be much stack space available for the + latter code to run. If compiling all code, including library code, + with -fsplit-stack is not an option, then the linker can fix up these + calls so that the code compiled without -fsplit-stack always has + a large stack. Support for this is implemented in the gold linker in + GNU binutils release 2.21 and later. + +Personally I do not understand why gold is not the default linker as GNU ld is +unusably slow (6x) for C++ but that is off-topic here. + +OK for check-in? + + +Thanks, +Jan + +--HlL+5n6rz5pIUxbD +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline; filename=1 + +gdb/testsuite/ChangeLog +2016-10-22 Jan Kratochvil + + * gdb.base/morestack.exp: Try to build it using -fuse-ld=gold first. + +diff --git a/gdb/testsuite/gdb.base/morestack.exp b/gdb/testsuite/gdb.base/morestack.exp +index 12f5d28..caa85b8 100644 +--- a/gdb/testsuite/gdb.base/morestack.exp ++++ b/gdb/testsuite/gdb.base/morestack.exp +@@ -23,7 +23,11 @@ if {$gcc_compiled == 0} { + + standard_testfile + +-if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {additional_flags=-fsplit-stack}] } { ++# -fuse-ld=gold is used for calling printf code built without -fsplit-stack ++# which could crash otherise. See GCC documentation of -fsplit-stack. ++set opts "additional_flags=-fsplit-stack" ++if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile [list $opts additional_flags=-fuse-ld=gold]] \ ++ && [prepare_for_testing ${testfile}.exp ${testfile} $srcfile $opts] } { + return -1 + } + + +--HlL+5n6rz5pIUxbD-- + diff --git a/gdb-tls-1of2.patch b/gdb-tls-1of2.patch new file mode 100644 index 0000000..9220d98 --- /dev/null +++ b/gdb-tls-1of2.patch @@ -0,0 +1,47 @@ +http://sourceware.org/ml/gdb-patches/2016-10/msg00206.html +Subject: [patch+7.12.1 1/2] Code cleanup: write_exp_msymbol: +is_tls + + +--XMCwj5IQnwKtuyBG +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline + +Hi, + +no functionality change, for patch 2/2. + + +Jan + +--XMCwj5IQnwKtuyBG +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline; filename="tls1.patch" + +gdb/ChangeLog +2016-10-09 Jan Kratochvil + + * parse.c (write_exp_msymbol): New variable is_tls, use it. + +--- a/gdb/parse.c ++++ b/gdb/parse.c +@@ -484,6 +484,8 @@ write_exp_msymbol (struct parser_state *ps, + struct obj_section *section = MSYMBOL_OBJ_SECTION (objfile, msymbol); + enum minimal_symbol_type type = MSYMBOL_TYPE (msymbol); + CORE_ADDR pc; ++ const int is_tls = (section != NULL ++ && section->the_bfd_section->flags & SEC_THREAD_LOCAL); + + /* The minimal symbol might point to a function descriptor; + resolve it to the actual code address instead. */ +@@ -520,7 +522,7 @@ write_exp_msymbol (struct parser_state *ps, + write_exp_elt_longcst (ps, (LONGEST) addr); + write_exp_elt_opcode (ps, OP_LONG); + +- if (section && section->the_bfd_section->flags & SEC_THREAD_LOCAL) ++ if (is_tls) + { + write_exp_elt_opcode (ps, UNOP_MEMVAL_TLS); + write_exp_elt_objfile (ps, objfile); + +--XMCwj5IQnwKtuyBG-- + diff --git a/gdb-tls-2of2.patch b/gdb-tls-2of2.patch new file mode 100644 index 0000000..5e3c9f9 --- /dev/null +++ b/gdb-tls-2of2.patch @@ -0,0 +1,159 @@ +http://sourceware.org/ml/gdb-patches/2016-10/msg00207.html +Subject: [patch+7.12.1 2/2] Fix TLS (such as 'errno') regression + + +--3Pql8miugIZX0722 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline + +Hi, + +2273f0ac95a79ce29ef42025c63f90e82cf907d7 is the first bad commit +commit 2273f0ac95a79ce29ef42025c63f90e82cf907d7 +Author: Tom Tromey +Date: Tue Oct 15 13:28:57 2013 -0600 + change minsyms not to be relocated at read-time +[FYI v3 06/10] change minsyms not to be relocated at read-time +Message-Id: <1393441273-32268-7-git-send-email-tromey@redhat.com> +https://sourceware.org/ml/gdb-patches/2014-02/msg00798.html + +mv /usr/lib/debug /usr/lib/debug-x +echo 'int main(){}'|gcc -pthread -x c - +./gdb -q -ex start -ex 'set debug expr 1' -ex 'p errno' ./a.out + 0 UNOP_MEMVAL_TLS TLS type @0x35df7e0 (__thread /* "/lib64/libc.so.6" */ ) + 4 OP_LONG Type @0x35df850 (__CORE_ADDR), value 140737345728528 (0x7ffff77fb010) +Cannot access memory at address 0xffffef7c9698 +-> + 0 UNOP_MEMVAL_TLS TLS type @0x3ad9520 (__thread /* "/lib64/libc.so.6" */ ) + 4 OP_LONG Type @0x3ad9590 (__CORE_ADDR), value 16 (0x10) +$1 = 0 + +With glibc debuginfo, that is without: mv /usr/lib/debug /usr/lib/debug-x + 0 OP_VAR_VALUE Block @0x3b30e70, symbol @0x3b30d10 (errno) +$1 = 0 +So such case is unrelated to this patch and the regression is not visible with +glibc debuginfo installed. + +I guess all these issues will be solved by Gary Benson's Infinity. +But at least for older non-Infinity glibcs GDB should not regress. + +For the testcase it is important the variable is in objfile with non-zero base +address. glibc is a shared library for 'errno' but I found easier for the +testcase to use PIE instead of a shlib. For TLS variables in PT_EXEC the +regression obviously does not happen. + +It has been found by a more complete testcase present in Fedora, the fix there +also solves more cases where FSF GDB currently cannot resolve 'errno': + http://pkgs.fedoraproject.org/cgit/rpms/gdb.git/tree/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch + FAIL: gdb.dwarf2/dw2-errno2.exp: macros=N threads=Y: print errno for core + +No regressions on {x86_64,x86_64-m32,i686}-fedora26pre-linux-gnu. + +OK for check-in? + + +Thanks, +Jan + +--3Pql8miugIZX0722 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline; filename="tls1-2.patch" + +gdb/ChangeLog +2016-10-09 Jan Kratochvil + + * parse.c (write_exp_msymbol): Fix ADDR computation. + +gdb/testsuite/ChangeLog +2016-10-09 Jan Kratochvil + + * gdb.threads/tls-nodebug-pie.c: New file. + * gdb.threads/tls-nodebug-pie.exp: New file. + +--- a/gdb/parse.c ++++ b/gdb/parse.c +@@ -480,13 +480,17 @@ write_exp_msymbol (struct parser_state *ps, + struct objfile *objfile = bound_msym.objfile; + struct gdbarch *gdbarch = get_objfile_arch (objfile); + +- CORE_ADDR addr = BMSYMBOL_VALUE_ADDRESS (bound_msym); + struct obj_section *section = MSYMBOL_OBJ_SECTION (objfile, msymbol); + enum minimal_symbol_type type = MSYMBOL_TYPE (msymbol); +- CORE_ADDR pc; ++ CORE_ADDR addr, pc; + const int is_tls = (section != NULL + && section->the_bfd_section->flags & SEC_THREAD_LOCAL); + ++ if (is_tls) ++ addr = MSYMBOL_VALUE_RAW_ADDRESS (bound_msym.minsym); ++ else ++ addr = BMSYMBOL_VALUE_ADDRESS (bound_msym); ++ + /* The minimal symbol might point to a function descriptor; + resolve it to the actual code address instead. */ + pc = gdbarch_convert_from_func_ptr_addr (gdbarch, addr, ¤t_target); +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/tls-nodebug-pie.c +@@ -0,0 +1,27 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2016 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++#include ++ ++__thread int thread_local = 42; ++ ++int main(void) ++{ ++ /* Ensure we link against pthreads even with --as-needed. */ ++ pthread_testcancel(); ++ return 0; ++} +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp +@@ -0,0 +1,29 @@ ++# Copyright 2016 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++standard_testfile ++ ++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ ++ [list "additional_flags=-fPIE -pie"]] != "" } { ++ return -1 ++} ++ ++clean_restart ${binfile} ++if ![runto_main] then { ++ return 0 ++} ++ ++# Formerly: Cannot access memory at address 0xd5554d5216fc ++gdb_test "p thread_local" " = 42" "thread local storage" + +--3Pql8miugIZX0722-- + diff --git a/gdb-upstream.patch b/gdb-upstream.patch new file mode 100644 index 0000000..6d351aa --- /dev/null +++ b/gdb-upstream.patch @@ -0,0 +1,722 @@ +commit 2c29df25b7c2ff006b45afd80ee6dd734ebbd47c +Author: Sergio Durigan Junior +Date: Sun Sep 11 16:53:09 2016 -0400 + + Fix false FAIL on gdb.base/stap-probe.exp, due to ICF optimization + + GCC 6's ICF optimization pass is making the declaration of 'm1' and + 'm2', on gdb.base/stap-probe.c, to be unified. However, this leads to + only one instance of the probe 'two' being created, which causes a + failure on the testsuite (which expects a multi-location breakpoint to + be inserted on the probe). + + This patch fixes this failure by declaring a dummy variable on 'm1', + and using it as an argument to m1's version of probe 'two'. Since we + do not care about the contents of the functions nor about the + arguments of each probe 'two', this is OK. + + gdb/testsuite/ChangeLog: + 2016-09-11 Sergio Durigan Junior + Jan Kratochvil + + * gdb.base/stap-probe.c (m1): New variable 'dummy', necessary to + make m1's definition to be different from m2's. Use 'dummy' as an + argument for probe 'two'. + +### a/gdb/testsuite/ChangeLog +### b/gdb/testsuite/ChangeLog +## -1,3 +1,10 @@ ++2016-09-11 Sergio Durigan Junior ++ Jan Kratochvil ++ ++ * gdb.base/stap-probe.c (m1): New variable 'dummy', necessary to ++ make m1's definition to be different from m2's. Use 'dummy' as an ++ argument for probe 'two'. ++ + 2016-09-10 Jon Beniston + + * lib/mi-support.exp (mi_gdb_target_load): Use target_sim_options +--- a/gdb/testsuite/gdb.base/stap-probe.c ++++ b/gdb/testsuite/gdb.base/stap-probe.c +@@ -53,8 +53,13 @@ struct funcs + static void + m1 (void) + { ++ /* m1 and m2 are equivalent, but because of some compiler ++ optimizations we have to make each of them unique. This is why ++ we have this dummy variable here. */ ++ volatile int dummy = 0; ++ + if (TEST2) +- STAP_PROBE (test, two); ++ STAP_PROBE1 (test, two, dummy); + } + + static void + + +commit f389f6fef76d7cf8e8beb7061edff2155c284898 +Author: Jan Kratochvil +Date: Wed Oct 5 21:56:46 2016 +0200 + + testsuite: Fix recent GCC FAIL: gdb.arch/i386-signal.exp + + gcc-6.2.1-2.fc24.x86_64 + + (gdb) backtrace 10^M + (gdb) FAIL: gdb.arch/i386-signal.exp: backtrace 10 + + (gdb) disas/s + Dump of assembler code for function main: + .../gdb/testsuite/gdb.arch/i386-signal.c: + 30 { + 0x000000000040057f <+0>: push %rbp + 0x0000000000400580 <+1>: mov %rsp,%rbp + 31 setup (); + 0x0000000000400583 <+4>: callq 0x400590 + => 0x0000000000400588 <+9>: mov $0x0,%eax + 32 } + 0x000000000040058d <+14>: pop %rbp + 0x000000000040058e <+15>: retq + End of assembler dump. + + The .exp patch is an obvious typo fix I think. The regex was written to + accept "ADDR in main" and I find it OK as checking .debug_line validity is not + the purpose of this testfile. + + gcc-4.8.5-11.el7.x86_64 did not put the 'mov $0x0,%eax' instruction there at + all so there was no problem with .debug_line. + + gdb/testsuite/ChangeLog + 2016-10-05 Jan Kratochvil + + * gdb.arch/i386-signal.exp (backtrace 10): Fix #2 typo. + +### a/gdb/testsuite/ChangeLog +### b/gdb/testsuite/ChangeLog +## -1,3 +1,7 @@ ++2016-10-05 Jan Kratochvil ++ ++ * gdb.arch/i386-signal.exp (backtrace 10): Fix #2 typo. ++ + 2016-10-05 Yao Qi + + * lib/gdb.exp (support_complex_tests): Return zero if +--- a/gdb/testsuite/gdb.arch/i386-signal.exp ++++ b/gdb/testsuite/gdb.arch/i386-signal.exp +@@ -35,6 +35,6 @@ gdb_load ${binfile} + + runto func + gdb_test "backtrace 10" \ +- "#0 ($hex in )?func.*\r\n#1 \r\n#2 ($hex in)?main.*" ++ "#0 ($hex in )?func.*\r\n#1 \r\n#2 ($hex in )?main.*" + + gdb_test "finish" "Run till exit from \#0 func.*" + + +commit 20c2c024c1e89e402a57e8c3577fb9777709d9a4 +Author: Carl E. Love +Date: Fri Aug 19 11:06:38 2016 -0700 + + Fix missing files for ld when test suite not compiled in the source directory + + This patch fixes an issues with six test suite expect files that do not + run correctly when the test suite is not built in the source directory. The + issue is these tests are not using the current "standard_testfile" call + but rather using the older set command to initialize the "testfile", + "srcfile" and "binprefix" variables or are missing the set for the + "binprefix" variable. + + ----------------------------------------------- + + gdb/testsuite/ChangeLog + + 2016-08-19 Carl Love + + * gdb.arch/altivec-regs.exp: Use standard_testfile instead of + maintaining separate logic for constructing the output path. + * gdb.arch/powerpc-d128-regs.exp: Likewise. + * gdb.arch/ppc-dfp.exp: Likewise. + * gdb.arch/ppc-fp.exp: Likewise. + * gdb.arch/vsx-regs.exp: Likewise. + * gdb.arch/altivec-abi.exp: Likewise, plus added local variable + binprefix for generating the additional binary files. + +### a/gdb/testsuite/ChangeLog +### b/gdb/testsuite/ChangeLog +## -1,3 +1,14 @@ ++2016-08-19 Carl Love ++ ++ * gdb.arch/altivec-regs.exp: Use standard_testfile instead of ++ maintaining separate logic for constructing the output path. ++ * gdb.arch/powerpc-d128-regs.exp: Likewise. ++ * gdb.arch/ppc-dfp.exp: Likewise. ++ * gdb.arch/ppc-fp.exp: Likewise. ++ * gdb.arch/vsx-regs.exp: Likewise. ++ * gdb.arch/altivec-abi.exp: Likewise, plus added local variable ++ binprefix for generating the additional binary files. ++ + 2016-08-19 Pedro Alves + + * gdb.trace/mi-trace-frame-collected.exp +--- a/gdb/testsuite/gdb.arch/altivec-abi.exp ++++ b/gdb/testsuite/gdb.arch/altivec-abi.exp +@@ -26,9 +26,7 @@ if {![istarget "powerpc*"] || [skip_altivec_tests]} then { + return + } + +-set testfile "altivec-abi" +-set binfile ${objdir}/${subdir}/${testfile} +-set srcfile ${testfile}.c ++standard_testfile + + if [get_compiler_info] { + warning "get_compiler failed" +@@ -146,6 +144,8 @@ proc altivec_abi_tests { extra_flags force_abi } { + } + + if [test_compiler_info gcc*] { ++ set binprefix ${binfile} ++ + with_test_prefix "default ABI, auto" { + altivec_abi_tests "additional_flags=-maltivec" "auto" + } +@@ -156,23 +156,23 @@ if [test_compiler_info gcc*] { + # On 64-bit GNU/Linux with GCC 4.1 and 4.2, -mabi=no-altivec + # was broken, so skip those tests there. + if { ![is_lp64_target] || ![test_compiler_info "gcc-4-\[12\]-*"] } { +- set binfile ${objdir}/${subdir}/${testfile}-ge-ge ++ set binfile ${binprefix}-ge-ge + with_test_prefix "generic ABI, forced" { + altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=no-altivec" "generic" + } + +- set binfile ${objdir}/${subdir}/${testfile}-ge-auto ++ set binfile ${binprefix}-ge-auto + with_test_prefix "generic ABI, auto" { + altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=no-altivec" "auto" + } + } + +- set binfile ${objdir}/${subdir}/${testfile}-av-av ++ set binfile ${binprefix}-av-av + with_test_prefix "AltiVec ABI, forced" { + altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=altivec" "altivec" + } + +- set binfile ${objdir}/${subdir}/${testfile}-av-auto ++ set binfile ${binprefix}-av-auto + with_test_prefix "AltiVec ABI, auto" { + altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=altivec" "auto" + } +--- a/gdb/testsuite/gdb.arch/altivec-regs.exp ++++ b/gdb/testsuite/gdb.arch/altivec-regs.exp +@@ -27,9 +27,7 @@ if {![istarget "powerpc*"] || [skip_altivec_tests]} then { + return + } + +-set testfile "altivec-regs" +-set binfile ${objdir}/${subdir}/${testfile} +-set srcfile ${testfile}.c ++standard_testfile + + set compile_flags {debug nowarnings} + if [get_compiler_info] { +--- a/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp ++++ b/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp +@@ -25,9 +25,7 @@ if ![istarget "powerpc64*-*"] then { + return + } + +-set testfile "powerpc-d128-regs" +-set srcfile ${testfile}.c +-set binfile ${objdir}/${subdir}/${testfile} ++standard_testfile + + if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {quiet debug}] != "" } { + untested powerpc-d128-regs.exp +--- a/gdb/testsuite/gdb.arch/ppc-dfp.exp ++++ b/gdb/testsuite/gdb.arch/ppc-dfp.exp +@@ -21,9 +21,7 @@ if ![istarget "powerpc*"] then { + return + } + +-set testfile "ppc-dfp" +-set binfile ${objdir}/${subdir}/${testfile} +-set srcfile ${testfile}.c ++standard_testfile + + if [get_compiler_info] { + warning "get_compiler failed" +--- a/gdb/testsuite/gdb.arch/ppc-fp.exp ++++ b/gdb/testsuite/gdb.arch/ppc-fp.exp +@@ -21,9 +21,7 @@ if ![istarget "powerpc*"] then { + return + } + +-set testfile "ppc-fp" +-set binfile ${objdir}/${subdir}/${testfile} +-set srcfile ${testfile}.c ++standard_testfile + + if [get_compiler_info] { + warning "get_compiler failed" +--- a/gdb/testsuite/gdb.arch/vsx-regs.exp ++++ b/gdb/testsuite/gdb.arch/vsx-regs.exp +@@ -24,9 +24,7 @@ if {![istarget "powerpc*"] || [skip_vsx_tests]} then { + return + } + +-set testfile "vsx-regs" +-set binfile ${objdir}/${subdir}/${testfile} +-set srcfile ${testfile}.c ++standard_testfile + + set compile_flags {debug nowarnings quiet} + if [get_compiler_info] { + + +http://sourceware.org/ml/gdb-patches/2016-10/msg00258.html +Subject: [testsuite obv] Use standard_output_file + +From: Jan Kratochvil +Date: Tue, 11 Oct 2016 16:43:58 +0200 +Subject: [PATCH] testsuite: Use standard_output_file +Subject: [PATCH] testsuite: Use standard_output_file + +gdb/testsuite/ChangeLog +2016-10-11 Jan Kratochvil + + * gdb.arch/powerpc-prologue.exp: Use standard_output_file. + * gdb.arch/ppc64-symtab-cordic.exp: Likewise. + * gdb.arch/vsx-regs.exp: Likewise. +--- + gdb/testsuite/ChangeLog | 6 ++++++ + gdb/testsuite/gdb.arch/powerpc-prologue.exp | 2 +- + gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp | 4 ++-- + gdb/testsuite/gdb.arch/vsx-regs.exp | 2 +- + 4 files changed, 10 insertions(+), 4 deletions(-) + +diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog +index 9c7df29..b6ba0ec 100644 +### a/gdb/testsuite/ChangeLog +### b/gdb/testsuite/ChangeLog +## -1,3 +1,9 @@ ++2016-10-11 Jan Kratochvil ++ ++ * gdb.arch/powerpc-prologue.exp: Use standard_output_file ++ * gdb.arch/ppc64-symtab-cordic.exp: Likewise. ++ * gdb.arch/vsx-regs.exp: Likewise. ++ + 2016-10-07 Yao Qi + + * gdb.xml/tdesc-regs.exp: Set regdir to "arm/". +diff --git a/gdb/testsuite/gdb.arch/powerpc-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-prologue.exp +index 341ae02..0c74d7e 100644 +--- a/gdb/testsuite/gdb.arch/powerpc-prologue.exp ++++ b/gdb/testsuite/gdb.arch/powerpc-prologue.exp +@@ -24,7 +24,7 @@ if {[istarget *-*-aix*] || ![istarget "powerpc-*-*"]} then { + + set testfile "powerpc-prologue" + set srcfile ${testfile}.c +-set binfile ${objdir}/${subdir}/${testfile} ++set binfile [standard_output_file ${testfile}] + + # Don't use "debug", so that we don't have line information for the assembly + # fragments. +diff --git a/gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp b/gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp +index c8cb429..3fdc490 100644 +--- a/gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp ++++ b/gdb/testsuite/gdb.arch/ppc64-symtab-cordic.exp +@@ -21,9 +21,9 @@ if {![istarget "powerpc*"] || ![is_lp64_target]} { + standard_testfile + + set kobz2file ${srcdir}/${subdir}/cordic.ko.bz2 +-set kofile ${objdir}/${subdir}/cordic.ko ++set kofile [standard_output_file cordic.ko] + set kodebugbz2file ${srcdir}/${subdir}/cordic.ko.debug.bz2 +-set kodebugfile ${objdir}/${subdir}/cordic.ko.debug ++set kodebugfile [standard_output_file cordic.ko.debug] + + if {[catch "system \"bzip2 -dc ${kobz2file} >${kofile}\""] != 0} { + untested "failed bzip2 for ${kobz2file}" +diff --git a/gdb/testsuite/gdb.arch/vsx-regs.exp b/gdb/testsuite/gdb.arch/vsx-regs.exp +index 307f12a..31e58e6 100644 +--- a/gdb/testsuite/gdb.arch/vsx-regs.exp ++++ b/gdb/testsuite/gdb.arch/vsx-regs.exp +@@ -152,7 +152,7 @@ for {set i 0} {$i < 32} {incr i 1} { + # later when loading the core file (i.e., different register values for different + # vector register banks). + +-set corefile "${objdir}/${subdir}/vsx-core.test" ++set corefile [standard_output_file vsx-core.test] + set core_supported [gdb_gcore_cmd "$corefile" "Save a VSX-enabled corefile"] + + # Now run the F32~F63/VR0~VR31 tests. +-- +2.7.4 + + +http://sourceware.org/ml/gdb-patches/2016-10/msg00268.html +Subject: [testsuite obv] Fix gdb.arch/powerpc-prologue.c compilation + +From: Jan Kratochvil +Date: Tue, 11 Oct 2016 19:09:05 +0200 +Subject: [PATCH] testsuite: Fix gdb.arch/powerpc-prologue.c compilation +Subject: [PATCH] testsuite: Fix gdb.arch/powerpc-prologue.c compilation + +gcc-6.2.1 + +gdb compile failed, gdb/testsuite/gdb.arch/powerpc-prologue.c: In function 'main': +gdb/testsuite/gdb.arch/powerpc-prologue.c:32:3: warning: implicit declaration of function 'optimized_1' [-Wimplicit-function-declaration] + optimized_1 (); + ^~~~~~~~~~~ + +gdb/testsuite/ChangeLog +2016-10-11 Jan Kratochvil + + * gdb.arch/powerpc-prologue.c (optimized_1): New declaration. +--- + gdb/testsuite/ChangeLog | 4 ++++ + gdb/testsuite/gdb.arch/powerpc-prologue.c | 1 + + 2 files changed, 5 insertions(+) + +diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog +index b6ba0ec..b4ccd4a 100644 +### a/gdb/testsuite/ChangeLog +### b/gdb/testsuite/ChangeLog +## -1,5 +1,9 @@ + 2016-10-11 Jan Kratochvil + ++ * gdb.arch/powerpc-prologue.c (optimized_1): New declaration. ++ ++2016-10-11 Jan Kratochvil ++ + * gdb.arch/powerpc-prologue.exp: Use standard_output_file + * gdb.arch/ppc64-symtab-cordic.exp: Likewise. + * gdb.arch/vsx-regs.exp: Likewise. +diff --git a/gdb/testsuite/gdb.arch/powerpc-prologue.c b/gdb/testsuite/gdb.arch/powerpc-prologue.c +index 6c10dfc..a1b8065 100644 +--- a/gdb/testsuite/gdb.arch/powerpc-prologue.c ++++ b/gdb/testsuite/gdb.arch/powerpc-prologue.c +@@ -24,6 +24,7 @@ + #endif + + void gdb2029 (void); ++void optimized_1 (void); + + int + main (void) +-- +2.7.4 + + + +http://sourceware.org/ml/gdb-patches/2016-10/msg00613.html +Subject: [testsuite patch] Fix gcc_compiled for gcc 6 & 7 + + +--IS0zKkzwUGydFO0o +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline + +Hi, + +OK for check-in? + + +Jan + +--IS0zKkzwUGydFO0o +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline; filename=1 + +gdb/testsuite/ChangeLog +2016-10-20 Jan Kratochvil + + * lib/gdb.exp (get_compiler_info): Generalize gcc_compile regexp. + +diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp +index 378eea0..7d9b198 100644 +--- a/gdb/testsuite/lib/gdb.exp ++++ b/gdb/testsuite/lib/gdb.exp +@@ -3290,12 +3290,8 @@ proc get_compiler_info {{arg ""}} { + } + + # Set the legacy symbols. +- set gcc_compiled 0 +- if { [regexp "^gcc-1-" "$compiler_info" ] } { set gcc_compiled 1 } +- if { [regexp "^gcc-2-" "$compiler_info" ] } { set gcc_compiled 2 } +- if { [regexp "^gcc-3-" "$compiler_info" ] } { set gcc_compiled 3 } +- if { [regexp "^gcc-4-" "$compiler_info" ] } { set gcc_compiled 4 } +- if { [regexp "^gcc-5-" "$compiler_info" ] } { set gcc_compiled 5 } ++ set gcc_compiled 0 ++ regexp "^gcc-(\[0-9\]+)-" "$compiler_info" matchall gcc_compiled + + # Log what happened. + verbose -log "get_compiler_info: $compiler_info" + +--IS0zKkzwUGydFO0o-- + + + +commit 1b7e3d2fb7036ce6f9d74e32dc052518f5cd45b6 +Author: Nick Clifton +Date: Fri Feb 3 09:04:21 2017 +0000 + + Fix compile time warning messages when compiling binutils with gcc 7.0.1. + + PR 21096 + bfd * coffcode.h (coff_write_object_contents): Enlarge size of + s_name_buf in order to avoid compile time warning about possible + integer truncation. + * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower + 32-bits of insn value before printing into buffer. + + opcodes * aarch64-opc.c (print_register_list): Ensure that the register + list index will fir into the tb buffer. + (print_register_offset_address): Likewise. + * tic6x-dis.c (print_insn_tic6x): Increase size of func_unit_buf. + +### a/bfd/ChangeLog +### b/bfd/ChangeLog +## -1,3 +1,12 @@ ++2017-02-03 Nick Clifton ++ ++ PR 21096 ++ * coffcode.h (coff_write_object_contents): Enlarge size of ++ s_name_buf in order to avoid compile time warning about possible ++ integer truncation. ++ * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower ++ 32-bits of insn value before printing into buffer. ++ + 2017-02-02 Maciej W. Rozycki + + * elfxx-mips.c (mips_elf_hash_sort_data): Add +--- a/bfd/coffcode.h ++++ b/bfd/coffcode.h +@@ -3755,7 +3755,9 @@ coff_write_object_contents (bfd * abfd) + NUL-terminated. We use a temporary buffer so that we can still + sprintf all eight chars without splatting a terminating NUL + over the first byte of the following member (s_paddr). */ +- char s_name_buf[SCNNMLEN + 1]; ++ /* PR 21096: The +20 is to stop a bogus warning from gcc7 about ++ a possible buffer overflow. */ ++ char s_name_buf[SCNNMLEN + 1 + 20]; + + /* An inherent limitation of the /nnnnnnn notation used to indicate + the offset of the long name in the string table is that we +@@ -3770,9 +3772,10 @@ coff_write_object_contents (bfd * abfd) + return FALSE; + } + +- /* snprintf not strictly necessary now we've verified the value +- has less than eight ASCII digits, but never mind. */ +- snprintf (s_name_buf, SCNNMLEN + 1, "/%lu", (unsigned long) string_size); ++ /* We do not need to use snprintf here as we have already verfied ++ that string_size is not too big, plus we have an overlarge ++ buffer, just in case. */ ++ sprintf (s_name_buf, "/%lu", (unsigned long) string_size); + /* Then strncpy takes care of any padding for us. */ + strncpy (section.s_name, s_name_buf, SCNNMLEN); + string_size += len + 1; +--- a/bfd/elf32-nds32.c ++++ b/bfd/elf32-nds32.c +@@ -14949,7 +14949,6 @@ nds32_elf_ex9_import_table (struct bfd_link_info *info) + { + int num = 0; + bfd_byte *contents; +- unsigned long insn; + FILE *ex9_import_file; + int update_ex9_table; + struct elf_nds32_link_hash_table *table; +@@ -14963,6 +14962,7 @@ nds32_elf_ex9_import_table (struct bfd_link_info *info) + /* Read instructions from the input file and build the list. */ + while (!feof (ex9_import_file)) + { ++ unsigned long insn; + char *code; + struct elf_nds32_insn_times_entry *ptr; + size_t nread; +@@ -14973,7 +14973,7 @@ nds32_elf_ex9_import_table (struct bfd_link_info *info) + break; + insn = bfd_getb32 (contents); + code = bfd_malloc (sizeof (char) * 9); +- snprintf (code, 9, "%08lx", insn); ++ snprintf (code, 9, "%08lx", (insn & 0xffffffff)); + ptr = bfd_malloc (sizeof (struct elf_nds32_insn_times_entry)); + ptr->string = code; + ptr->order = num; +### a/opcodes/ChangeLog +### b/opcodes/ChangeLog +## -1,3 +1,11 @@ ++2017-02-03 Nick Clifton ++ ++ PR 21096 ++ * aarch64-opc.c (print_register_list): Ensure that the register ++ list index will fir into the tb buffer. ++ (print_register_offset_address): Likewise. ++ * tic6x-dis.c (print_insn_tic6x): Increase size of func_unit_buf. ++ + 2017-01-27 Alexis Deruell + + PR 21056 +--- a/opcodes/aarch64-opc.c ++++ b/opcodes/aarch64-opc.c +@@ -2865,7 +2865,8 @@ print_register_list (char *buf, size_t size, const aarch64_opnd_info *opnd, + + /* Prepare the index if any. */ + if (opnd->reglist.has_index) +- snprintf (tb, 8, "[%" PRIi64 "]", opnd->reglist.index); ++ /* PR 21096: The %100 is to silence a warning about possible truncation. */ ++ snprintf (tb, 8, "[%" PRIi64 "]", (opnd->reglist.index % 100)); + else + tb[0] = '\0'; + +@@ -2344,7 +2344,9 @@ print_register_offset_address (char *buf + if (print_extend_p) + { + if (print_amount_p) +- snprintf (tb, sizeof (tb), ",%s #%d", shift_name, opnd->shifter.amount); ++ snprintf (tb, sizeof (tb), ",%s #%d", shift_name, ++ /* PR 21096: The %100 is to silence a warning about possible truncation. */ ++ (opnd->shifter.amount % 100)); + else + snprintf (tb, sizeof (tb), ",%s", shift_name); + } +--- a/opcodes/tic6x-dis.c ++++ b/opcodes/tic6x-dis.c +@@ -316,7 +316,7 @@ print_insn_tic6x (bfd_vma addr, struct disassemble_info *info) + const char *parallel; + const char *cond = ""; + const char *func_unit; +- char func_unit_buf[7]; ++ char func_unit_buf[8]; + unsigned int func_unit_side = 0; + unsigned int func_unit_data_side = 0; + unsigned int func_unit_cross = 0; +@@ -703,8 +703,9 @@ print_insn_tic6x (bfd_vma addr, struct disassemble_info *info) + if (opc->flags & TIC6X_FLAG_INSN16_BSIDE && func_unit_side == 1) + func_unit_cross = 1; + +- snprintf (func_unit_buf, 7, " .%c%u%s%s", func_unit_char, +- func_unit_side, (func_unit_cross ? "X" : ""), data_str); ++ snprintf (func_unit_buf, sizeof func_unit_buf, " .%c%u%s%s", ++ func_unit_char, func_unit_side, ++ (func_unit_cross ? "X" : ""), data_str); + func_unit = func_unit_buf; + } + + + + +commit db7b55faa1a11e632ddf57505c9bb64bc783471a +Author: Nick Clifton +Date: Fri Dec 16 10:59:36 2016 +0000 + + Fix compile time warning building arm-dis.c + +### a/opcodes/ChangeLog +### b/opcodes/ChangeLog +## -1,3 +1,8 @@ ++2016-12-16 Nick Clifton ++ ++ * arm-dis.c (print_insn_thumb32): Fix compile time warning ++ computing value_in_comment. ++ + 2016-12-14 Maciej W. Rozycki + + * mips-dis.c (mips_convert_abiflags_ases): New function. +--- a/opcodes/arm-dis.c ++++ b/opcodes/arm-dis.c +@@ -5759,7 +5759,7 @@ print_insn_thumb32 (bfd_vma pc, struct disassemble_info *info, long given) + if (off || !U) + { + func (stream, ", #%c%u", U ? '+' : '-', off * 4); +- value_in_comment = off * 4 * U ? 1 : -1; ++ value_in_comment = (off && U) ? 1 : -1; + } + func (stream, "]"); + if (W) +@@ -5771,7 +5771,7 @@ print_insn_thumb32 (bfd_vma pc, struct disassemble_info *info, long given) + if (W) + { + func (stream, "#%c%u", U ? '+' : '-', off * 4); +- value_in_comment = off * 4 * U ? 1 : -1; ++ value_in_comment = (off && U) ? 1 : -1; + } + else + { + + + +commit 97e64e5ab19dbf6a9babd711e8deec5545520954 +Author: Yao Qi +Date: Fri Sep 23 17:27:26 2016 +0100 + + Replace sprintf with xsnprintf in nat/linux-osdata.c + + I see the following build warning when I build GDB with GCC trunk. + + ../../binutils-gdb/gdb/nat/linux-osdata.c: In function ‘LONGEST linux_xfer_osdata_fds(gdb_byte*, ULONGEST, ULONGEST)’: + ../../binutils-gdb/gdb/nat/linux-osdata.c:767:1: error: ‘%s’ directive writing between 0 and 255 bytes into a region of size 11 [-Werror=format-length=] + linux_xfer_osdata_fds (gdb_byte *readbuf, + ^~~~~~~~~~~~~~~~~~~~~ + ../../binutils-gdb/gdb/nat/linux-osdata.c:800:51: note: format output between 7 and 262 bytes into a destination of size 17 + sprintf (procentry, "/proc/%s", dp->d_name); + ^ + ../../binutils-gdb/gdb/nat/linux-osdata.c: In function ‘LONGEST linux_xfer_osdata_threads(gdb_byte*, ULONGEST, ULONGEST)’: + ../../binutils-gdb/gdb/nat/linux-osdata.c:555:1: error: ‘%s’ directive writing between 0 and 255 bytes into a region of size 11 [-Werror=format-length=] + linux_xfer_osdata_threads (gdb_byte *readbuf, + ^~~~~~~~~~~~~~~~~~~~~~~~~ + ../../binutils-gdb/gdb/nat/linux-osdata.c:588:51: note: format output between 7 and 262 bytes into a destination of size 17 + sprintf (procentry, "/proc/%s", dp->d_name); + ^ + cc1plus: all warnings being treated as errors + + The warning is a false positive, but we can workaround it by replacing + sprintf with xsnprintf. On the other hand, it is always preferred to + use xsnprintf. + + gdb: + + 2016-09-23 Yao Qi + + * nat/linux-osdata.c (linux_xfer_osdata_threads): Replace + sprintf with xsnprintf. + (linux_xfer_osdata_fds): Likewise. + +### a/gdb/ChangeLog +### b/gdb/ChangeLog +## -1,3 +1,9 @@ ++2016-09-23 Yao Qi ++ ++ * nat/linux-osdata.c (linux_xfer_osdata_threads): Replace ++ sprintf with xsnprintf. ++ (linux_xfer_osdata_fds): Likewise. ++ + 2016-09-23 Pedro Alves + + * Makefile.in (SFILES): Add common/new-op.c. +--- a/gdb/nat/linux-osdata.c ++++ b/gdb/nat/linux-osdata.c +@@ -585,7 +585,8 @@ linux_xfer_osdata_threads (gdb_byte *readbuf, + || NAMELEN (dp) > sizeof ("4294967295") - 1) + continue; + +- sprintf (procentry, "/proc/%s", dp->d_name); ++ xsnprintf (procentry, sizeof (procentry), "/proc/%s", ++ dp->d_name); + if (stat (procentry, &statbuf) == 0 + && S_ISDIR (statbuf.st_mode)) + { +@@ -797,7 +798,8 @@ linux_xfer_osdata_fds (gdb_byte *readbuf, + || NAMELEN (dp) > sizeof ("4294967295") - 1) + continue; + +- sprintf (procentry, "/proc/%s", dp->d_name); ++ xsnprintf (procentry, sizeof (procentry), "/proc/%s", ++ dp->d_name); + if (stat (procentry, &statbuf) == 0 + && S_ISDIR (statbuf.st_mode)) + { diff --git a/gdb-vla-intel-fortran-strides.patch b/gdb-vla-intel-fortran-strides.patch new file mode 100644 index 0000000..ddb0036 --- /dev/null +++ b/gdb-vla-intel-fortran-strides.patch @@ -0,0 +1,1977 @@ +git diff --stat -p gdb/master...gdb/users/bheckel/fortran-strides +dbfd7140bf4c0500d1f5d192be781f83f78f7922 + + gdb/dwarf2loc.c | 46 ++- + gdb/dwarf2loc.h | 6 + + gdb/dwarf2read.c | 13 +- + gdb/eval.c | 391 +++++++++++++++++++++----- + gdb/expprint.c | 20 +- + gdb/expression.h | 18 +- + gdb/f-exp.y | 42 ++- + gdb/f-valprint.c | 8 +- + gdb/gdbtypes.c | 34 ++- + gdb/gdbtypes.h | 18 +- + gdb/parse.c | 24 +- + gdb/rust-exp.y | 12 +- + gdb/rust-lang.c | 17 +- + gdb/testsuite/gdb.fortran/static-arrays.exp | 421 ++++++++++++++++++++++++++++ + gdb/testsuite/gdb.fortran/static-arrays.f90 | 55 ++++ + gdb/testsuite/gdb.fortran/vla-ptype.exp | 4 + + gdb/testsuite/gdb.fortran/vla-sizeof.exp | 4 + + gdb/testsuite/gdb.fortran/vla-stride.exp | 44 +++ + gdb/testsuite/gdb.fortran/vla-stride.f90 | 29 ++ + gdb/testsuite/gdb.fortran/vla.f90 | 10 + + gdb/valarith.c | 10 +- + gdb/valops.c | 197 +++++++++++-- + gdb/value.h | 2 + + 23 files changed, 1242 insertions(+), 183 deletions(-) + +diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c +index 548e468..560e16f 100644 +--- a/gdb/dwarf2loc.c ++++ b/gdb/dwarf2loc.c +@@ -2601,11 +2601,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; + +@@ -2629,7 +2632,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, + + *value = value_as_address (val); + } +- return 1; ++ rc = 1; + } + } + break; +@@ -2651,7 +2654,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, + if (!value_optimized_out (val)) + { + *value = value_as_address (val); +- return 1; ++ rc = 1; + } + } + } +@@ -2659,8 +2662,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 +@@ -2681,11 +2684,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 +index fa83459..da6b9cd 100644 +--- a/gdb/dwarf2loc.h ++++ b/gdb/dwarf2loc.h +@@ -138,6 +138,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 +index 6658a38..a1ac659 100644 +--- a/gdb/dwarf2read.c ++++ b/gdb/dwarf2read.c +@@ -14952,7 +14952,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; +@@ -14972,7 +14972,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. */ +@@ -15006,6 +15008,13 @@ 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 (&symfile_complaints, _("Missing DW_AT_byte_stride " ++ "- DIE at 0x%x [in module %s]"), ++ die->offset.sect_off, objfile_name (cu->objfile)); ++ + attr = dwarf2_attr (die, DW_AT_lower_bound, cu); + if (attr) + attr_to_dynamic_prop (attr, die, cu, &low); +@@ -15082,7 +15091,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 +index 00a107c..91d8a03 100644 +--- a/gdb/eval.c ++++ b/gdb/eval.c +@@ -399,29 +399,325 @@ init_array_element (struct value *array, struct value *element, + return index; + } + ++/* Evaluates any operation on Fortran arrays or strings with at least ++ one user provided parameter. Expects the input ARRAY to be either ++ an array, or a string. Evaluates EXP by incrementing POS, and ++ writes the content from the elt stack into a local struct. NARGS ++ specifies number of literal or range arguments the user provided. ++ NARGS must be the same number as ARRAY has dimensions. */ ++ + static struct value * +-value_f90_subarray (struct value *array, +- struct expression *exp, int *pos, enum noside noside) ++value_f90_subarray (struct value *array, struct expression *exp, ++ int *pos, int nargs, enum noside noside) + { +- int pc = (*pos) + 1; ++ int i, dim_count = 0; + LONGEST low_bound, high_bound; +- struct type *range = check_typedef (TYPE_INDEX_TYPE (value_type (array))); +- enum range_type range_type +- = (enum range_type) longest_to_int (exp->elts[pc].longconst); +- +- *pos += 3; +- +- if (range_type == LOW_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT) +- low_bound = TYPE_LOW_BOUND (range); +- else +- low_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); ++ struct value *new_array = array; ++ struct type *array_type = check_typedef (value_type (new_array)); ++ struct type *elt_type; ++ ++ typedef struct subscript_range ++ { ++ enum range_type f90_range_type; ++ LONGEST low, high, stride; ++ } subscript_range; ++ ++ typedef enum subscript_kind ++ { ++ SUBSCRIPT_RANGE, /* e.g. "(lowbound:highbound)" */ ++ SUBSCRIPT_INDEX /* e.g. "(literal)" */ ++ } kind; ++ ++ /* Local struct to hold user data for Fortran subarray dimensions. */ ++ struct subscript_store ++ { ++ /* For every dimension, we are either working on a range or an index ++ expression, so we store this info separately for later. */ ++ enum subscript_kind kind; ++ ++ /* We also store either the lower and upper bound info, or the index ++ number. Before evaluation of the input values, we do not know if we are ++ actually working on a range of ranges, or an index in a range. So as a ++ first step we store all input in a union. The array calculation itself ++ deals with this later on. */ ++ union element_range ++ { ++ subscript_range range; ++ LONGEST number; ++ } U; ++ } *subscript_array; ++ ++ /* Check if the number of arguments provided by the user matches ++ the number of dimension of the array. A string has only one ++ dimension. */ ++ if (nargs != calc_f77_array_dims (value_type (new_array))) ++ error (_("Wrong number of subscripts")); ++ ++ subscript_array = (struct subscript_store*) alloca (sizeof (*subscript_array) * nargs); ++ ++ /* Parse the user input into the SUBSCRIPT_ARRAY to store it. We need ++ to evaluate it first, as the input is from left-to-right. The ++ array is stored from right-to-left. So we have to use the user ++ input in reverse order. Later on, we need the input information to ++ re-calculate the output array. For multi-dimensional arrays, we ++ can be dealing with any possible combination of ranges and indices ++ for every dimension. */ ++ for (i = 0; i < nargs; i++) ++ { ++ struct subscript_store *index = &subscript_array[i]; + +- if (range_type == HIGH_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT) +- high_bound = TYPE_HIGH_BOUND (range); +- else +- high_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); ++ /* The user input is a range, with or without lower and upper bound. ++ E.g.: "p arry(2:5)", "p arry( :5)", "p arry( : )", etc. */ ++ if (exp->elts[*pos].opcode == OP_RANGE) ++ { ++ int pc = (*pos) + 1; ++ subscript_range *range; ++ ++ index->kind = SUBSCRIPT_RANGE; ++ range = &index->U.range; ++ ++ *pos += 3; ++ range->f90_range_type = (enum range_type) exp->elts[pc].longconst; ++ ++ /* If a lower bound was provided by the user, the bit has been ++ set and we can assign the value from the elt stack. Same for ++ upper bound. */ ++ if ((range->f90_range_type & SUBARRAY_LOW_BOUND) ++ == SUBARRAY_LOW_BOUND) ++ range->low = value_as_long (evaluate_subexp (NULL_TYPE, exp, ++ pos, noside)); ++ if ((range->f90_range_type & SUBARRAY_HIGH_BOUND) ++ == SUBARRAY_HIGH_BOUND) ++ range->high = value_as_long (evaluate_subexp (NULL_TYPE, exp, ++ pos, noside)); ++ ++ /* Assign the user's stride value if provided. */ ++ if ((range->f90_range_type & SUBARRAY_STRIDE) == SUBARRAY_STRIDE) ++ range->stride = value_as_long (evaluate_subexp (NULL_TYPE, exp, ++ pos, noside)); ++ ++ /* Assign the default stride value '1'. */ ++ else ++ range->stride = 1; ++ ++ /* Check the provided stride value is illegal, aka '0'. */ ++ if (range->stride == 0) ++ error (_("Stride must not be 0")); ++ } ++ /* User input is an index. E.g.: "p arry(5)". */ ++ else ++ { ++ struct value *val; ++ ++ index->kind = SUBSCRIPT_INDEX; ++ ++ /* Evaluate each subscript; it must be a legal integer in F77. This ++ ensures the validity of the provided index. */ ++ val = evaluate_subexp_with_coercion (exp, pos, noside); ++ index->U.number = value_as_long (val); ++ } ++ ++ } ++ ++ /* Traverse the array from right to left and set the high and low bounds ++ for later use. */ ++ for (i = nargs - 1; i >= 0; i--) ++ { ++ struct subscript_store *index = &subscript_array[i]; ++ struct type *index_type = TYPE_INDEX_TYPE (array_type); ++ ++ switch (index->kind) ++ { ++ case SUBSCRIPT_RANGE: ++ { ++ ++ /* When we hit the first range specified by the user, we must ++ treat any subsequent user entry as a range. We simply ++ increment DIM_COUNT which tells us how many times we are ++ calling VALUE_SLICE_1. */ ++ subscript_range *range = &index->U.range; ++ ++ /* If no lower bound was provided by the user, we take the ++ default boundary. Same for the high bound. */ ++ if ((range->f90_range_type & SUBARRAY_LOW_BOUND) == 0) ++ range->low = TYPE_LOW_BOUND (index_type); ++ ++ if ((range->f90_range_type & SUBARRAY_HIGH_BOUND) == 0) ++ range->high = TYPE_HIGH_BOUND (index_type); ++ ++ /* Both user provided low and high bound have to be inside the ++ array bounds. Throw an error if not. */ ++ if (range->low < TYPE_LOW_BOUND (index_type) ++ || range->low > TYPE_HIGH_BOUND (index_type) ++ || range->high < TYPE_LOW_BOUND (index_type) ++ || range->high > TYPE_HIGH_BOUND (index_type)) ++ error (_("provided bound(s) outside array bound(s)")); ++ ++ /* For a negative stride the lower boundary must be larger than the ++ upper boundary. ++ For a positive stride the lower boundary must be smaller than the ++ upper boundary. */ ++ if ((range->stride < 0 && range->low < range->high) ++ || (range->stride > 0 && range->low > range->high)) ++ error (_("Wrong value provided for stride and boundaries")); ++ ++ } ++ break; ++ ++ case SUBSCRIPT_INDEX: ++ break; ++ ++ } ++ ++ array_type = TYPE_TARGET_TYPE (array_type); ++ } ++ ++ /* Reset ARRAY_TYPE before slicing.*/ ++ array_type = check_typedef (value_type (new_array)); ++ ++ /* Traverse the array from right to left and evaluate each corresponding ++ user input. VALUE_SUBSCRIPT is called for every index, until a range ++ expression is evaluated. After a range expression has been evaluated, ++ every subsequent expression is also treated as a range. */ ++ for (i = nargs - 1; i >= 0; i--) ++ { ++ struct subscript_store *index = &subscript_array[i]; ++ struct type *index_type = TYPE_INDEX_TYPE (array_type); ++ ++ switch (index->kind) ++ { ++ case SUBSCRIPT_RANGE: ++ { ++ ++ /* When we hit the first range specified by the user, we must ++ treat any subsequent user entry as a range. We simply ++ increment DIM_COUNT which tells us how many times we are ++ calling VALUE_SLICE_1. */ ++ subscript_range *range = &index->U.range; ++ ++ /* DIM_COUNT counts every user argument that is treated as a range. ++ This is necessary for expressions like 'print array(7, 8:9). ++ Here the first argument is a literal, but must be treated as a ++ range argument to allow the correct output representation. */ ++ dim_count++; ++ ++ new_array ++ = value_slice_1 (new_array, range->low, ++ range->high - range->low + 1, ++ range->stride, dim_count); ++ } ++ break; ++ ++ case SUBSCRIPT_INDEX: ++ { ++ /* DIM_COUNT only stays '0' when no range argument was processed ++ before, starting from the last dimension. This way we can ++ reduce the number of dimensions from the result array. ++ However, if a range has been processed before an index, we ++ treat the index like a range with equal low- and high bounds ++ to get the value offset right. */ ++ if (dim_count == 0) ++ new_array ++ = value_subscripted_rvalue (new_array, index->U.number, ++ f77_get_lowerbound (value_type ++ (new_array))); ++ else ++ { ++ dim_count++; ++ ++ /* We might end up here, because we have to treat the provided ++ index like a range. But now VALUE_SUBSCRIPTED_RVALUE ++ cannot do the range checks for us. So we have to make sure ++ ourselves that the user provided index is inside the ++ array bounds. Throw an error if not. */ ++ if (index->U.number < TYPE_LOW_BOUND (index_type) ++ && index->U.number > TYPE_HIGH_BOUND (index_type)) ++ error (_("provided bound(s) outside array bound(s)")); ++ ++ if (index->U.number > TYPE_LOW_BOUND (index_type) ++ && index->U.number > TYPE_HIGH_BOUND (index_type)) ++ error (_("provided bound(s) outside array bound(s)")); ++ ++ new_array = value_slice_1 (new_array, ++ index->U.number, ++ 1, /* COUNT is '1' element */ ++ 1, /* STRIDE set to '1' */ ++ dim_count); ++ } ++ ++ } ++ break; ++ } ++ array_type = TYPE_TARGET_TYPE (array_type); ++ } ++ ++ /* With DIM_COUNT > 1 we currently have a one dimensional array, but expect ++ an array of arrays, depending on how many ranges have been provided by ++ the user. So we need to rebuild the array dimensions for printing it ++ correctly. ++ Starting from right to left in the user input, after we hit the first ++ range argument every subsequent argument is also treated as a range. ++ E.g.: ++ "p ary(3, 7, 2:15)" in Fortran has only 1 dimension, but we calculated 3 ++ ranges. ++ "p ary(3, 7:12, 4)" in Fortran has only 1 dimension, but we calculated 2 ++ ranges. ++ "p ary(2:4, 5, 7)" in Fortran has only 1 dimension, and we calculated 1 ++ range. */ ++ if (dim_count > 1) ++ { ++ struct value *v = NULL; ++ ++ elt_type = TYPE_TARGET_TYPE (value_type (new_array)); ++ ++ /* Every SUBSCRIPT_RANGE in the user input signifies an actual range in ++ the output array. So we traverse the SUBSCRIPT_ARRAY again, looking ++ for a range entry. When we find one, we use the range info to create ++ an additional range_type to set the correct bounds and dimensions for ++ the output array. In addition, we may have a stride value that is not ++ '1', forcing us to adjust the number of elements in a range, according ++ to the stride value. */ ++ for (i = 0; i < nargs; i++) ++ { ++ struct subscript_store *index = &subscript_array[i]; ++ ++ if (index->kind == SUBSCRIPT_RANGE) ++ { ++ struct type *range_type, *interim_array_type; ++ ++ int new_length; + +- return value_slice (array, low_bound, high_bound - low_bound + 1); ++ /* The length of a sub-dimension with all elements between the ++ bounds plus the start element itself. It may be modified by ++ a user provided stride value. */ ++ new_length = index->U.range.high - index->U.range.low; ++ ++ new_length /= index->U.range.stride; ++ ++ range_type ++ = create_static_range_type (NULL, ++ elt_type, ++ index->U.range.low, ++ index->U.range.low + new_length); ++ ++ interim_array_type = create_array_type (NULL, ++ elt_type, ++ range_type); ++ ++ TYPE_CODE (interim_array_type) ++ = TYPE_CODE (value_type (new_array)); ++ ++ v = allocate_value (interim_array_type); ++ ++ elt_type = value_type (v); ++ } ++ ++ } ++ value_contents_copy (v, 0, new_array, 0, TYPE_LENGTH (elt_type)); ++ return v; ++ } ++ ++ return new_array; + } + + +@@ -1810,19 +2106,8 @@ evaluate_subexp_standard (struct type *expect_type, + switch (code) + { + case TYPE_CODE_ARRAY: +- if (exp->elts[*pos].opcode == OP_RANGE) +- return value_f90_subarray (arg1, exp, pos, noside); +- else +- goto multi_f77_subscript; +- + case TYPE_CODE_STRING: +- if (exp->elts[*pos].opcode == OP_RANGE) +- return value_f90_subarray (arg1, exp, pos, noside); +- else +- { +- arg2 = evaluate_subexp_with_coercion (exp, pos, noside); +- return value_subscript (arg1, value_as_long (arg2)); +- } ++ return value_f90_subarray (arg1, exp, pos, nargs, noside); + + case TYPE_CODE_PTR: + case TYPE_CODE_FUNC: +@@ -2223,49 +2508,6 @@ evaluate_subexp_standard (struct type *expect_type, + } + return (arg1); + +- multi_f77_subscript: +- { +- LONGEST subscript_array[MAX_FORTRAN_DIMS]; +- int ndimensions = 1, i; +- struct value *array = arg1; +- +- if (nargs > MAX_FORTRAN_DIMS) +- error (_("Too many subscripts for F77 (%d Max)"), MAX_FORTRAN_DIMS); +- +- ndimensions = calc_f77_array_dims (type); +- +- if (nargs != ndimensions) +- error (_("Wrong number of subscripts")); +- +- gdb_assert (nargs > 0); +- +- /* Now that we know we have a legal array subscript expression +- let us actually find out where this element exists in the array. */ +- +- /* Take array indices left to right. */ +- for (i = 0; i < nargs; i++) +- { +- /* Evaluate each subscript; it must be a legal integer in F77. */ +- arg2 = evaluate_subexp_with_coercion (exp, pos, noside); +- +- /* Fill in the subscript array. */ +- +- subscript_array[i] = value_as_long (arg2); +- } +- +- /* Internal type of array is arranged right to left. */ +- for (i = nargs; i > 0; i--) +- { +- struct type *array_type = check_typedef (value_type (array)); +- LONGEST index = subscript_array[i - 1]; +- +- array = value_subscripted_rvalue (array, index, +- f77_get_lowerbound (array_type)); +- } +- +- return array; +- } +- + case BINOP_LOGICAL_AND: + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + if (noside == EVAL_SKIP) +@@ -3123,6 +3365,9 @@ calc_f77_array_dims (struct type *array_type) + int ndimen = 1; + struct type *tmp_type; + ++ if (TYPE_CODE (array_type) == TYPE_CODE_STRING) ++ return 1; ++ + if ((TYPE_CODE (array_type) != TYPE_CODE_ARRAY)) + error (_("Can't get dimensions for a non-array type")); + +diff --git a/gdb/expprint.c b/gdb/expprint.c +index c37ecb0..214d58e 100644 +--- a/gdb/expprint.c ++++ b/gdb/expprint.c +@@ -568,12 +568,10 @@ print_subexp_standard (struct expression *exp, int *pos, + *pos += 2; + + fputs_filtered ("RANGE(", stream); +- if (range_type == HIGH_BOUND_DEFAULT +- || range_type == NONE_BOUND_DEFAULT) ++ if ((range_type & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND) + print_subexp (exp, pos, stream, PREC_ABOVE_COMMA); + fputs_filtered ("..", stream); +- if (range_type == LOW_BOUND_DEFAULT +- || range_type == NONE_BOUND_DEFAULT) ++ if ((range_type & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND) + print_subexp (exp, pos, stream, PREC_ABOVE_COMMA); + fputs_filtered (")", stream); + return; +@@ -1055,16 +1053,16 @@ dump_subexp_body_standard (struct expression *exp, + + switch (range_type) + { +- case BOTH_BOUND_DEFAULT: ++ case SUBARRAY_NONE_BOUND: + fputs_filtered ("Range '..'", stream); + break; +- case LOW_BOUND_DEFAULT: ++ case SUBARRAY_HIGH_BOUND: + fputs_filtered ("Range '..EXP'", stream); + break; +- case HIGH_BOUND_DEFAULT: ++ case SUBARRAY_LOW_BOUND: + fputs_filtered ("Range 'EXP..'", stream); + break; +- case NONE_BOUND_DEFAULT: ++ case (SUBARRAY_LOW_BOUND | SUBARRAY_HIGH_BOUND): + fputs_filtered ("Range 'EXP..EXP'", stream); + break; + default: +@@ -1072,11 +1070,9 @@ dump_subexp_body_standard (struct expression *exp, + break; + } + +- if (range_type == HIGH_BOUND_DEFAULT +- || range_type == NONE_BOUND_DEFAULT) ++ if ((range_type & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND) + elt = dump_subexp (exp, stream, elt); +- if (range_type == LOW_BOUND_DEFAULT +- || range_type == NONE_BOUND_DEFAULT) ++ if ((range_type & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND) + elt = dump_subexp (exp, stream, elt); + } + break; +diff --git a/gdb/expression.h b/gdb/expression.h +index 4952d84..34ca54b 100644 +--- a/gdb/expression.h ++++ b/gdb/expression.h +@@ -152,17 +152,17 @@ extern void dump_raw_expression (struct expression *, + struct ui_file *, char *); + extern void dump_prefix_expression (struct expression *, struct ui_file *); + +-/* In an OP_RANGE expression, either bound could be empty, indicating +- that its value is by default that of the corresponding bound of the +- array or string. So we have four sorts of subrange. This +- enumeration type is to identify this. */ +- ++/* In an OP_RANGE expression, either bound can be provided by the user, or not. ++ In addition to this, the user can also specify a stride value to indicated ++ only certain elements of the array. This enumeration type is to identify ++ this. */ ++ + enum range_type + { +- BOTH_BOUND_DEFAULT, /* "(:)" */ +- LOW_BOUND_DEFAULT, /* "(:high)" */ +- HIGH_BOUND_DEFAULT, /* "(low:)" */ +- NONE_BOUND_DEFAULT /* "(low:high)" */ ++ SUBARRAY_NONE_BOUND = 0x0, /* "( : )" */ ++ SUBARRAY_LOW_BOUND = 0x1, /* "(low:)" */ ++ SUBARRAY_HIGH_BOUND = 0x2, /* "(:high)" */ ++ SUBARRAY_STRIDE = 0x4 /* "(::stride)" */ + }; + + #endif /* !defined (EXPRESSION_H) */ +diff --git a/gdb/f-exp.y b/gdb/f-exp.y +index e3148a3..71f1823 100644 +--- a/gdb/f-exp.y ++++ b/gdb/f-exp.y +@@ -253,31 +253,63 @@ arglist : subrange + + arglist : arglist ',' exp %prec ABOVE_COMMA + { arglist_len++; } ++ | arglist ',' subrange %prec ABOVE_COMMA ++ { arglist_len++; } + ; + + /* There are four sorts of subrange types in F90. */ + + subrange: exp ':' exp %prec ABOVE_COMMA +- { write_exp_elt_opcode (pstate, OP_RANGE); +- write_exp_elt_longcst (pstate, NONE_BOUND_DEFAULT); ++ { write_exp_elt_opcode (pstate, OP_RANGE); ++ write_exp_elt_longcst (pstate, ++ SUBARRAY_LOW_BOUND | SUBARRAY_HIGH_BOUND); + write_exp_elt_opcode (pstate, OP_RANGE); } + ; + + subrange: exp ':' %prec ABOVE_COMMA + { write_exp_elt_opcode (pstate, OP_RANGE); +- write_exp_elt_longcst (pstate, HIGH_BOUND_DEFAULT); ++ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND); + write_exp_elt_opcode (pstate, OP_RANGE); } + ; + + subrange: ':' exp %prec ABOVE_COMMA + { write_exp_elt_opcode (pstate, OP_RANGE); +- write_exp_elt_longcst (pstate, LOW_BOUND_DEFAULT); ++ write_exp_elt_longcst (pstate, SUBARRAY_HIGH_BOUND); + write_exp_elt_opcode (pstate, OP_RANGE); } + ; + + subrange: ':' %prec ABOVE_COMMA + { write_exp_elt_opcode (pstate, OP_RANGE); +- write_exp_elt_longcst (pstate, BOTH_BOUND_DEFAULT); ++ write_exp_elt_longcst (pstate, SUBARRAY_NONE_BOUND); ++ write_exp_elt_opcode (pstate, OP_RANGE); } ++ ; ++ ++/* Each subrange type can have a stride argument. */ ++subrange: exp ':' exp ':' exp %prec ABOVE_COMMA ++ { write_exp_elt_opcode (pstate, OP_RANGE); ++ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND ++ | SUBARRAY_HIGH_BOUND ++ | SUBARRAY_STRIDE); ++ write_exp_elt_opcode (pstate, OP_RANGE); } ++ ; ++ ++subrange: exp ':' ':' exp %prec ABOVE_COMMA ++ { write_exp_elt_opcode (pstate, OP_RANGE); ++ write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND ++ | SUBARRAY_STRIDE); ++ write_exp_elt_opcode (pstate, OP_RANGE); } ++ ; ++ ++subrange: ':' exp ':' exp %prec ABOVE_COMMA ++ { write_exp_elt_opcode (pstate, OP_RANGE); ++ write_exp_elt_longcst (pstate, SUBARRAY_HIGH_BOUND ++ | SUBARRAY_STRIDE); ++ write_exp_elt_opcode (pstate, OP_RANGE); } ++ ; ++ ++subrange: ':' ':' exp %prec ABOVE_COMMA ++ { write_exp_elt_opcode (pstate, OP_RANGE); ++ write_exp_elt_longcst (pstate, SUBARRAY_STRIDE); + write_exp_elt_opcode (pstate, OP_RANGE); } + ; + +diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c +index 08215e2..e6eca6a 100644 +--- a/gdb/f-valprint.c ++++ b/gdb/f-valprint.c +@@ -121,8 +121,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; + 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); +diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c +index ec5c17a..eb83791 100644 +--- a/gdb/gdbtypes.c ++++ b/gdb/gdbtypes.c +@@ -836,7 +836,8 @@ allocate_stub_method (struct type *type) + 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); +@@ -851,6 +852,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; + TYPE_RANGE_DATA (result_type)->high = *high_bound; ++ TYPE_RANGE_DATA (result_type)->stride = *stride; + + if (low_bound->kind == PROP_CONST && low_bound->data.const_val >= 0) + TYPE_UNSIGNED (result_type) = 1; +@@ -879,7 +881,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; + + low.kind = PROP_CONST; + low.data.const_val = low_bound; +@@ -887,7 +889,11 @@ 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, &stride); + + return result_type; + } +@@ -1084,16 +1090,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; + + 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; +@@ -1888,12 +1898,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; +@@ -1905,7 +1915,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; +@@ -1920,12 +1930,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 +index 2dda074..bcc9200 100644 +--- a/gdb/gdbtypes.h ++++ b/gdb/gdbtypes.h +@@ -577,6 +577,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. */ + +@@ -739,7 +743,6 @@ struct main_type + /* * Union member used for range types. */ + + struct range_bounds *bounds; +- + } flds_bnds; + + /* * Slot to point to additional language-specific fields of this +@@ -1255,6 +1258,15 @@ extern void allocate_gnat_aux_type (struct type *); + TYPE_RANGE_DATA(range_type)->high.kind + #define TYPE_LOW_BOUND_KIND(range_type) \ + TYPE_RANGE_DATA(range_type)->low.kind ++#define TYPE_BYTE_STRIDE(range_type) \ ++ TYPE_RANGE_DATA(range_type)->stride.data.const_val ++#define TYPE_BYTE_STRIDE_BLOCK(range_type) \ ++ TYPE_RANGE_DATA(range_type)->stride.data.locexpr ++#define TYPE_BYTE_STRIDE_LOCLIST(range_type) \ ++ TYPE_RANGE_DATA(range_type)->stride.data.loclist ++#define TYPE_BYTE_STRIDE_KIND(range_type) \ ++ TYPE_RANGE_DATA(range_type)->stride.kind ++ + + /* Property accessors for the type data location. */ + #define TYPE_DATA_LOCATION(thistype) \ +@@ -1289,6 +1301,9 @@ extern void allocate_gnat_aux_type (struct type *); + TYPE_HIGH_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype)) + #define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \ + TYPE_LOW_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype)) ++#define TYPE_ARRAY_STRIDE_IS_UNDEFINED(arraytype) \ ++ (TYPE_BYTE_STRIDE(TYPE_INDEX_TYPE(arraytype)) == 0) ++ + + #define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \ + (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype)))) +@@ -1783,6 +1798,7 @@ extern struct type *create_array_type_with_stride + + extern struct type *create_range_type (struct type *, struct type *, + const struct dynamic_prop *, ++ const struct dynamic_prop *, + const struct dynamic_prop *); + + extern struct type *create_array_type (struct type *, struct type *, +diff --git a/gdb/parse.c b/gdb/parse.c +index 2b00708..992af87 100644 +--- a/gdb/parse.c ++++ b/gdb/parse.c +@@ -1006,22 +1006,20 @@ operator_length_standard (const struct expression *expr, int endpos, + + case OP_RANGE: + oplen = 3; ++ args = 0; + range_type = (enum range_type) + longest_to_int (expr->elts[endpos - 2].longconst); + +- switch (range_type) +- { +- case LOW_BOUND_DEFAULT: +- case HIGH_BOUND_DEFAULT: +- args = 1; +- break; +- case BOTH_BOUND_DEFAULT: +- args = 0; +- break; +- case NONE_BOUND_DEFAULT: +- args = 2; +- break; +- } ++ /* Increment the argument counter for each argument ++ provided by the user. */ ++ if ((range_type & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND) ++ args++; ++ ++ if ((range_type & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND) ++ args++; ++ ++ if ((range_type & SUBARRAY_STRIDE) == SUBARRAY_STRIDE) ++ args++; + + break; + +diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y +index aeb6058..b1b9633 100644 +--- a/gdb/rust-exp.y ++++ b/gdb/rust-exp.y +@@ -2429,23 +2429,17 @@ convert_ast_to_expression (struct parser_state *state, + + case OP_RANGE: + { +- enum range_type kind = BOTH_BOUND_DEFAULT; ++ enum range_type kind = SUBARRAY_NONE_BOUND; + + if (operation->left.op != NULL) + { + convert_ast_to_expression (state, operation->left.op, top); +- kind = HIGH_BOUND_DEFAULT; ++ kind = SUBARRAY_LOW_BOUND; + } + if (operation->right.op != NULL) + { + convert_ast_to_expression (state, operation->right.op, top); +- if (kind == BOTH_BOUND_DEFAULT) +- kind = LOW_BOUND_DEFAULT; +- else +- { +- gdb_assert (kind == HIGH_BOUND_DEFAULT); +- kind = NONE_BOUND_DEFAULT; +- } ++ kind = (range_type) (kind | SUBARRAY_HIGH_BOUND); + } + write_exp_elt_opcode (state, OP_RANGE); + write_exp_elt_longcst (state, kind); +diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c +index 17b20c6..295002f 100644 +--- a/gdb/rust-lang.c ++++ b/gdb/rust-lang.c +@@ -1241,9 +1241,9 @@ rust_range (struct expression *exp, int *pos, enum noside noside) + kind = (enum range_type) longest_to_int (exp->elts[*pos + 1].longconst); + *pos += 3; + +- if (kind == HIGH_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT) ++ if ((kind & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND) + low = evaluate_subexp (NULL_TYPE, exp, pos, noside); +- if (kind == LOW_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT) ++ if ((kind & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND) + high = evaluate_subexp (NULL_TYPE, exp, pos, noside); + + if (noside == EVAL_SKIP) +@@ -1332,7 +1332,7 @@ rust_compute_range (struct type *type, struct value *range, + + *low = 0; + *high = 0; +- *kind = BOTH_BOUND_DEFAULT; ++ *kind = SUBARRAY_NONE_BOUND; + + if (TYPE_NFIELDS (type) == 0) + return; +@@ -1340,15 +1340,14 @@ rust_compute_range (struct type *type, struct value *range, + i = 0; + if (strcmp (TYPE_FIELD_NAME (type, 0), "start") == 0) + { +- *kind = HIGH_BOUND_DEFAULT; ++ *kind = SUBARRAY_LOW_BOUND; + *low = value_as_long (value_field (range, 0)); + ++i; + } + if (TYPE_NFIELDS (type) > i + && strcmp (TYPE_FIELD_NAME (type, i), "end") == 0) + { +- *kind = (*kind == BOTH_BOUND_DEFAULT +- ? LOW_BOUND_DEFAULT : NONE_BOUND_DEFAULT); ++ *kind = (range_type) (*kind | SUBARRAY_HIGH_BOUND); + *high = value_as_long (value_field (range, i)); + } + } +@@ -1363,7 +1362,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, + struct type *rhstype; + LONGEST low, high_bound; + /* Initialized to appease the compiler. */ +- enum range_type kind = BOTH_BOUND_DEFAULT; ++ enum range_type kind = SUBARRAY_NONE_BOUND; + LONGEST high = 0; + int want_slice = 0; + +@@ -1425,7 +1424,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, + error (_("Cannot subscript non-array type")); + + if (want_slice +- && (kind == BOTH_BOUND_DEFAULT || kind == LOW_BOUND_DEFAULT)) ++ && ((kind & SUBARRAY_LOW_BOUND) != SUBARRAY_LOW_BOUND)) + low = low_bound; + if (low < 0) + error (_("Index less than zero")); +@@ -1443,7 +1442,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, + CORE_ADDR addr; + struct value *addrval, *tem; + +- if (kind == BOTH_BOUND_DEFAULT || kind == HIGH_BOUND_DEFAULT) ++ if ((kind & SUBARRAY_HIGH_BOUND) != SUBARRAY_HIGH_BOUND) + high = high_bound; + if (high < 0) + error (_("High index less than zero")); +diff --git a/gdb/testsuite/gdb.fortran/static-arrays.exp b/gdb/testsuite/gdb.fortran/static-arrays.exp +new file mode 100644 +index 0000000..cc9ecc0 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/static-arrays.exp +@@ -0,0 +1,421 @@ ++# Copyright 2015 Free Software Foundation, Inc. ++# ++# Contributed by Intel Corp. ++# ++# 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 static-arrays.f90 ++ ++if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}] } { ++ return -1 ++} ++ ++if ![runto MAIN__] then { ++ perror "couldn't run to breakpoint MAIN__" ++ continue ++} ++ ++gdb_breakpoint [gdb_get_line_number "BP1"] ++gdb_continue_to_breakpoint "BP1" ".*BP1.*" ++ ++# Tests subarrays of one dimensional arrays with subrange variations ++gdb_test "print ar1" "\\$\[0-9\]+ = \\(1, 2, 3, 4, 5, 6, 7, 8, 9\\)" \ ++ "print ar1." ++gdb_test "print ar1\(4:7\)" "\\$\[0-9\]+ = \\(4, 5, 6, 7\\)" \ ++ "print ar1\(4:7\)" ++gdb_test "print ar1\(8:\)" "\\$\[0-9\]+ = \\(8, 9\\).*" \ ++ "print ar1\(8:\)" ++gdb_test "print ar1\(:3\)" "\\$\[0-9\]+ = \\(1, 2, 3\\).*" \ ++ "print ar1\(:3\)" ++gdb_test "print ar1\(:\)" "\\$\[0-9\]+ = \\(1, 2, 3, 4, 5, 6, 7, 8, 9\\)" \ ++ "print ar1\(:\)" ++ ++# Check assignment ++gdb_test_no_output "set \$my_ary = ar1\(3:8\)" ++gdb_test "print \$my_ary" \ ++ "\\$\[0-9\]+ = \\(3, 4, 5, 6, 7, 8\\)" \ ++ "Assignment of subarray to variable" ++gdb_test_no_output "set ar1\(5\) = 42" ++ gdb_test "print ar1\(3:8\)" \ ++ "\\$\[0-9\]+ = \\(3, 4, 42, 6, 7, 8\\)" \ ++ "print ar1\(3:8\) after assignment" ++gdb_test "print \$my_ary" \ ++ "\\$\[0-9\]+ = \\(3, 4, 5, 6, 7, 8\\)" \ ++ "Assignment of subarray to variable after original array changed" ++ ++# Test for subarrays of one dimensional arrays with literals ++ gdb_test "print ar1\(3\)" "\\$\[0-9\]+ = 3" \ ++ "print ar1\(3\)" ++ ++# Tests for subranges of 2 dimensional arrays with subrange variations ++gdb_test "print ar2\(2:3, 3:4\)" \ ++ "\\$\[0-9\]+ = \\(\\( 23, 33\\) \\( 24, 34\\) \\)" \ ++ "print ar2\(2:3, 3:4\)." ++gdb_test "print ar2\(8:9,8:\)" \ ++ "\\$\[0-9\]+ = \\(\\( 88, 98\\) \\( 89, 99\\) \\)" \ ++ "print ar2\(8:9,8:\)" ++gdb_test "print ar2\(8:9,:2\)" \ ++ "\\$\[0-9\]+ = \\(\\( 81, 91\\) \\( 82, 92\\) \\)" \ ++ "print ar2\(8:9,:2\)" ++ ++gdb_test "print ar2\(8:,8:9\)" \ ++ "\\$\[0-9\]+ = \\(\\( 88, 98\\) \\( 89, 99\\) \\)" \ ++ "print ar2\(8:,8:9\)" ++gdb_test "print ar2\(8:,8:\)" \ ++ "\\$\[0-9\]+ = \\(\\( 88, 98\\) \\( 89, 99\\) \\)" \ ++ "print ar2\(8:,8:\)" ++gdb_test "print ar2\(8:,:2\)" \ ++ "\\$\[0-9\]+ = \\(\\( 81, 91\\) \\( 82, 92\\) \\)" \ ++ "print ar2\(8:,:2\)" ++ ++gdb_test "print ar2\(:2,2:3\)" \ ++ "\\$\[0-9\]+ = \\(\\( 12, 22\\) \\( 13, 23\\) \\)" \ ++ "print ar2\(:2,2:3\)" ++gdb_test "print ar2\(:2,8:\)" \ ++ "\\$\[0-9\]+ = \\(\\( 18, 28\\) \\( 19, 29\\) \\)" \ ++ "print ar2\(:2,8:\)" ++gdb_test "print ar2\(:2,:2\)" \ ++ "\\$\[0-9\]+ = \\(\\( 11, 21\\) \\( 12, 22\\) \\)" \ ++ "print ar2\(:2,:2\)" ++ ++# Test subranges of 2 dimensional arrays with literals and subrange variations ++gdb_test "print ar2\(7, 3:6\)" \ ++ "\\$\[0-9\]+ = \\(73, 74, 75, 76\\)" \ ++ "print ar2\(7, 3:6\)" ++gdb_test "print ar2\(7,8:\)" \ ++ "\\$\[0-9\]+ = \\(78, 79\\)" \ ++ "print ar2\(7,8:\)" ++gdb_test "print ar2\(7,:2\)" \ ++ "\\$\[0-9\]+ = \\(71, 72\\)" \ ++ "print ar2\(7,:2\)" ++ ++gdb_test "print ar2\(7:8,4\)" \ ++ "\\$\[0-9\]+ = \\(74, 84\\)" \ ++ "print ar2(7:8,4\)" ++gdb_test "print ar2\(8:,4\)" \ ++ "\\$\[0-9\]+ = \\(84, 94\\)" \ ++ "print ar2\(8:,4\)" ++gdb_test "print ar2\(:2,4\)" \ ++ "\\$\[0-9\]+ = \\(14, 24\\)" \ ++ "print ar2\(:2,4\)" ++gdb_test "print ar2\(3,4\)" \ ++ "\\$\[0-9\]+ = 34" \ ++ "print ar2\(3,4\)" ++ ++# Test subarrays of 3 dimensional arrays with literals and subrange variations ++gdb_test "print ar3\(2:4,3:4,7:8\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 237, 337, 437\\) \\( 247, 347, 447\\)\ ++ \\) \\( \\( 238, 338, 438\\) \\( 248, 348, 448\\) \\) \\)" \ ++ "print ar3\(2:4,3:4,7:8\)" ++gdb_test "print ar3\(2:3,4:5,8:\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 248, 348\\) \\( 258, 358\\) \\) \\(\ ++ \\( 249, 349\\) \\( 259, 359\\) \\) \\)" \ ++ "print ar3\(2:3,4:5,8:\)" ++gdb_test "print ar3\(2:3,4:5,:2\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 241, 341\\) \\( 251, 351\\) \\) \\(\ ++ \\( 242, 342\\) \\( 252, 352\\) \\) \\)" \ ++ "print ar3\(2:3,4:5,:2\)" ++ ++gdb_test "print ar3\(2:3,8:,7:8\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 287, 387\\) \\( 297, 397\\) \\) \\(\ ++ \\( 288, 388\\) \\( 298, 398\\) \\) \\)" \ ++ "print ar3\(2:3,8:,7:8\)" ++gdb_test "print ar3\(2:3,8:,8:\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 288, 388\\) \\( 298, 398\\) \\) \\(\ ++ \\( 289, 389\\) \\( 299, 399\\) \\) \\)" \ ++ "print ar3\(2:3,8:,8:\)" ++gdb_test "print ar3\(2:3,8:,:2\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 281, 381\\) \\( 291, 391\\) \\) \\(\ ++ \\( 282, 382\\) \\( 292, 392\\) \\) \\)" \ ++ "print ar3\(2:3,8:,:2\)" ++ ++gdb_test "print ar3\(2:3,:2,7:8\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 217, 317\\) \\( 227, 327\\) \\) \\(\ ++ \\( 218, 318\\) \\( 228, 328\\) \\) \\)" \ ++ "print ar3\(2:3,:2,7:8\)" ++gdb_test "print ar3\(2:3,:2,8:\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 218, 318\\) \\( 228, 328\\) \\) \\(\ ++ \\( 219, 319\\) \\( 229, 329\\) \\) \\)" \ ++ "print ar3\(2:3,:2,8:\)" ++gdb_test "print ar3\(2:3,:2,:2\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 211, 311\\) \\( 221, 321\\) \\) \\(\ ++ \\( 212, 312\\) \\( 222, 322\\) \\) \\)" \ ++ "print ar3\(2:3,:2,:2\)" ++ ++gdb_test "print ar3\(8:,3:4,7:8\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 837, 937\\) \\( 847, 947\\) \\) \\(\ ++ \\( 838, 938\\) \\( 848, 948\\) \\) \\)" \ ++ "print ar3\(8:,3:4,7:8\)" ++gdb_test "print ar3\(8:,4:5,8:\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 848, 948\\) \\( 858, 958\\) \\) \\(\ ++ \\( 849, 949\\) \\( 859, 959\\) \\) \\)" \ ++ "print ar3\(8:,4:5,8:\)" ++gdb_test "print ar3\(8:,4:5,:2\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 841, 941\\) \\( 851, 951\\) \\) \\(\ ++ \\( 842, 942\\) \\( 852, 952\\) \\) \\)" \ ++ "print ar3\(8:,4:5,:2\)" ++ ++gdb_test "print ar3\(8:,8:,7:8\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 887, 987\\) \\( 897, 997\\) \\) \\(\ ++ \\( 888, 988\\) \\( 898, 998\\) \\) \\)" \ ++ "print ar3\(8:,8:,7:8\)" ++gdb_test "print ar3\(8:,8:,8:\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 888, 988\\) \\( 898, 998\\) \\) \\(\ ++ \\( 889, 989\\) \\( 899, 999\\) \\) \\)" \ ++ "print ar3\(8:,8:,8:\)" ++gdb_test "print ar3\(8:,8:,:2\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 881, 981\\) \\( 891, 991\\) \\) \\(\ ++ \\( 882, 982\\) \\( 892, 992\\) \\) \\)" \ ++ "print ar3\(8:,8:,:2\)" ++ ++gdb_test "print ar3\(8:,:2,7:8\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 817, 917\\) \\( 827, 927\\) \\) \\(\ ++ \\( 818, 918\\) \\( 828, 928\\) \\) \\)" \ ++ "print ar3\(8:,:2,7:8\)" ++gdb_test "print ar3\(8:,:2,8:\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 818, 918\\) \\( 828, 928\\) \\) \\(\ ++ \\( 819, 919\\) \\( 829, 929\\) \\) \\)" \ ++ "print ar3\(8:,:2,8:\)" ++gdb_test "print ar3\(8:,:2,:2\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 811, 911\\) \\( 821, 921\\) \\) \\(\ ++ \\( 812, 912\\) \\( 822, 922\\) \\) \\)" \ ++ "print ar3\(8:,:2,:2\)" ++ ++ ++gdb_test "print ar3\(:2,3:4,7:8\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 137, 237\\) \\( 147, 247\\) \\) \\(\ ++ \\( 138, 238\\) \\( 148, 248\\) \\) \\)" \ ++ "print ar3 \(:2,3:4,7:8\)." ++gdb_test "print ar3\(:2,3:4,8:\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 138, 238\\) \\( 148, 248\\) \\) \\(\ ++ \\( 139, 239\\) \\( 149, 249\\) \\) \\)" \ ++ "print ar3\(:2,3:4,8:\)" ++gdb_test "print ar3\(:2,3:4,:2\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 131, 231\\) \\( 141, 241\\) \\) \\(\ ++ \\( 132, 232\\) \\( 142, 242\\) \\) \\)" \ ++ "print ar3\(:2,3:4,:2\)" ++ ++gdb_test "print ar3\(:2,8:,7:8\)" "\\$\[0-9\]+ = \\(\\( \\( 187, 287\\) \\(\ ++ 197, 297\\) \\) \\( \\( 188, 288\\) \\( 198, 298\\) \\) \\)" \ ++ "print ar3\(:2,8:,7:8\)" ++gdb_test "print ar3\(:2,8:,8:\)" "\\$\[0-9\]+ = \\(\\( \\( 188, 288\\) \\( 198,\ ++ 298\\) \\) \\( \\( 189, 289\\) \\( 199, 299\\) \\) \\)" \ ++ "print ar3\(:2,8:,8:\)" ++gdb_test "print ar3\(:2,8:,:2\)" "\\$\[0-9\]+ = \\(\\( \\( 181, 281\\) \\( 191,\ ++ 291\\) \\) \\( \\( 182, 282\\) \\( 192, 292\\) \\) \\)" \ ++ "print ar3\(:2,8:,:2\)" ++ ++gdb_test "print ar3\(:2,:2,7:8\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 117, 217\\) \\( 127, 227\\) \\) \\(\ ++ \\( 118, 218\\) \\( 128, 228\\) \\) \\)" \ ++ "print ar3\(:2,:2,7:8\)" ++gdb_test "print ar3\(:2,:2,8:\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 118, 218\\) \\( 128, 228\\) \\) \\(\ ++ \\( 119, 219\\) \\( 129, 229\\) \\) \\)" \ ++ "print ar3\(:2,:2,8:\)" ++gdb_test "print ar3\(:2,:2,:2\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 111, 211\\) \\( 121, 221\\) \\) \\(\ ++ \\( 112, 212\\) \\( 122, 222\\) \\) \\)" \ ++ "print ar3\(:2,:2,:2\)" ++ ++#Tests for subarrays of 3 dimensional arrays with literals and subranges ++gdb_test "print ar3\(3,3:4,7:8\)" \ ++ "\\$\[0-9\]+ = \\(\\( 337, 347\\) \\( 338, 348\\) \\)" \ ++ "print ar3\(3,3:4,7:8\)" ++gdb_test "print ar3\(3,4:5,8:\)" \ ++ "\\$\[0-9\]+ = \\(\\( 348, 358\\) \\( 349, 359\\) \\)" \ ++ "print ar3\(3,4:5,8:\)" ++gdb_test "print ar3\(3,4:5,:2\)" \ ++ "\\$\[0-9\]+ = \\(\\( 341, 351\\) \\( 342, 352\\) \\)" \ ++ "print ar3\(3,4:5,:2\)" ++gdb_test "print ar3\(3,4:5,3\)" \ ++ "\\$\[0-9\]+ = \\(343, 353\\)" \ ++ "print ar3\(3,4:5,3\)" ++ ++gdb_test "print ar3\(2,8:,7:8\)" \ ++ "\\$\[0-9\]+ = \\(\\( 287, 297\\) \\( 288, 298\\) \\)" \ ++ "print ar3\(2,8:,7:8\)" ++gdb_test "print ar3\(2,8:,8:\)" \ ++ "\\$\[0-9\]+ = \\(\\( 288, 298\\) \\( 289, 299\\) \\)" \ ++ "print ar3\(2,8:,8:\)" ++gdb_test "print ar3\(2,8:,:2\)"\ ++ "\\$\[0-9\]+ = \\(\\( 281, 291\\) \\( 282, 292\\) \\)" \ ++ "print ar3\(2,8:,:2\)" ++gdb_test "print ar3\(2,8:,3\)" \ ++ "\\$\[0-9\]+ = \\(283, 293\\)" \ ++ "print ar3\(2,8:,3\)" ++ ++gdb_test "print ar3\(2,:2,7:8\)" \ ++ "\\$\[0-9\]+ = \\(\\( 217, 227\\) \\( 218, 228\\) \\)" \ ++ "print ar3\(2,:2,7:8\)" ++gdb_test "print ar3\(2,:2,8:\)" \ ++ "\\$\[0-9\]+ = \\(\\( 218, 228\\) \\( 219, 229\\) \\)" \ ++ "print ar3\(2,:2,8:\)" ++gdb_test "print ar3\(2,:2,:2\)" \ ++ "\\$\[0-9\]+ = \\(\\( 211, 221\\) \\( 212, 222\\) \\)" \ ++ "print ar3\(2,:2,:2\)" ++gdb_test "print ar3\(2,:2,3\)" \ ++ "\\$\[0-9\]+ = \\(213, 223\\)" \ ++ "print ar3\(2,:2,3\)" ++ ++gdb_test "print ar3\(3,4,7:8\)" \ ++ "\\$\[0-9\]+ = \\(347, 348\\)" \ ++ "print ar3\(3,4,7:8\)" ++gdb_test "print ar3\(3,4,8:\)" \ ++ "\\$\[0-9\]+ = \\(348, 349\\)" \ ++i "print ar3\(3,4,8:\)" ++gdb_test "print ar3\(3,4,:2\)" \ ++ "\\$\[0-9\]+ = \\(341, 342\\)" \ ++ "print ar3\(3,4,:2\)" ++gdb_test "print ar3\(5,6,7\)" \ ++ "\\$\[0-9\]+ = 567" \ ++ "print ar3\(5,6,7\)" ++ ++gdb_test "print ar3\(3:4,6,7:8\)" \ ++ "\\$\[0-9\]+ = \\(\\( 367, 467\\) \\( 368, 468\\) \\)" \ ++ "print ar3\(3:4,6,7:8\)" ++gdb_test "print ar3\(3:4,6,8:\)" \ ++ "\\$\[0-9\]+ = \\(\\( 368, 468\\) \\( 369, 469\\) \\)" \ ++ "print ar3\(3:4,6,8:\)" ++gdb_test "print ar3\(3:4,6,:2\)" \ ++ "\\$\[0-9\]+ = \\(\\( 361, 461\\) \\( 362, 462\\) \\)" \ ++ "print ar3\(3:4,6,:2\)" ++gdb_test "print ar3\(3:4,6,5\)" \ ++ "\\$\[0-9\]+ = \\(365, 465\\)" \ ++ "print ar3\(3:4,6,5\)" ++ ++gdb_test "print ar3\(8:,6,7:8\)" \ ++ "\\$\[0-9\]+ = \\(\\( 867, 967\\) \\( 868, 968\\) \\)" \ ++ "print ar3\(8:,6,7:8\)" ++gdb_test "print ar3\(8:,6,8:\)" \ ++ "\\$\[0-9\]+ = \\(\\( 868, 968\\) \\( 869, 969\\) \\)" \ ++ "print ar3\(8:,6,8:\)" ++gdb_test "print ar3\(8:,6,:2\)" \ ++ "\\$\[0-9\]+ = \\(\\( 861, 961\\) \\( 862, 962\\) \\)" \ ++ "print ar3\(8:,6,:2\)" ++gdb_test "print ar3\(8:,6,5\)" \ ++ "\\$\[0-9\]+ = \\(865, 965\\)" \ ++ "print ar3\(8:,6,5\)" ++ ++gdb_test "print ar3\(:2,6,7:8\)" \ ++ "\\$\[0-9\]+ = \\(\\( 167, 267\\) \\( 168, 268\\) \\)" \ ++ "print ar3\(:2,6,7:8\)" ++gdb_test "print ar3\(:2,6,8:\)" \ ++ "\\$\[0-9\]+ = \\(\\( 168, 268\\) \\( 169, 269\\) \\)" \ ++ "print ar3\(:2,6,8:\)" ++gdb_test "print ar3\(:2,6,:2\)" \ ++ "\\$\[0-9\]+ = \\(\\( 161, 261\\) \\( 162, 262\\) \\)" \ ++ "print ar3\(:2,6,:2\)" ++gdb_test "print ar3\(:2,6,5\)" \ ++ "\\$\[0-9\]+ = \\(165, 265\\)" \ ++ "print ar3\(:2,6,5\)" ++ ++gdb_test "print ar3\(3:4,5:6,4\)" \ ++ "\\$\[0-9\]+ = \\(\\( 354, 454\\) \\( 364, 464\\) \\)" \ ++ "print ar2\(3:4,5:6,4\)" ++gdb_test "print ar3\(8:,5:6,4\)" \ ++ "\\$\[0-9\]+ = \\(\\( 854, 954\\) \\( 864, 964\\) \\)" \ ++ "print ar2\(8:,5:6,4\)" ++gdb_test "print ar3\(:2,5:6,4\)" \ ++ "\\$\[0-9\]+ = \\(\\( 154, 254\\) \\( 164, 264\\) \\)" \ ++ "print ar2\(:2,5:6,4\)" ++ ++# Stride > 1 ++gdb_test "print ar1\(2:6:2\)" \ ++ "\\$\[0-9\]+ = \\(2, 4, 6\\)" \ ++ "print ar1\(2:6:2\)" ++gdb_test "print ar2\(2:6:2,3:4\)" \ ++ "\\$\[0-9\]+ = \\(\\( 23, 43, 63\\) \\( 24, 44, 64\\) \\)" \ ++ "print ar2\(2:6:2,3:4\)" ++gdb_test "print ar2\(2:6:2,3\)" \ ++ "\\$\[0-9\]+ = \\(23, 43, 63\\)" \ ++ "print ar2\(2:6:2,3\)" ++gdb_test "print ar3\(2:6:2,3:5:2,4:7:3\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 234, 434, 634\\) \\( 254, 454, 654\\)\ ++ \\) \\( \\( 237, 437, 637\\) \\( 257, 457, 657\\) \\) \\)" \ ++ "print ar3\(2:6:2,3:5:2,4:7:3\)" ++gdb_test "print ar3\(2:6:2,5,4:7:3\)" \ ++ "\\$\[0-9\]+ = \\(\\( 254, 454, 654\\) \\( 257, 457, 657\\)\ ++ \\)" \ ++ "print ar3\(2:6:2,5,4:7:3\)" ++ ++# Stride < 0 ++gdb_test "print ar1\(8:2:-2\)" \ ++ "\\$\[0-9\]+ = \\(8, 6, 4, 2\\)" \ ++ "print ar1\(8:2:-2\)" ++gdb_test "print ar2\(8:2:-2,3:4\)" \ ++ "\\$\[0-9\]+ = \\(\\( 83, 63, 43, 23\\) \\( 84, 64, 44, 24\\)\ ++ \\)" \ ++ "print ar2\(8:2:-2,3:4\)" ++gdb_test "print ar2\(2:6:2,3\)" \ ++ "\\$\[0-9\]+ = \\(23, 43, 63\\)" \ ++ "print ar2\(2:6:2,3\)" ++gdb_test "print ar3\(2:3,7:3:-4,4:7:3\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 274, 374\\) \\( 234, 334\\) \\) \\(\ ++ \\( 277, 377\\) \\( 237, 337\\) \\) \\)" \ ++ "print ar3\(2:3,7:3:-4,4:7:3\)" ++gdb_test "print ar3\(2:6:2,5,7:4:-3\)" \ ++ "\\$\[0-9\]+ = \\(\\( 257, 457, 657\\) \\( 254, 454, 654\\)\ ++ \\)" \ ++ "print ar3\(2:6:2,5,7:4:-3\)" ++ ++# Tests with negative and mixed indices ++gdb_test "p ar4\(2:4, -2:1, -15:-14\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 261, 361, 461\\) \\( 271, 371, 471\\)\ ++ \\( 281, 381, 481\\) \\( 291, 391, 491\\) \\) \\( \\( 262,\ ++ 362, 462\\) \\( 272, 372, 472\\) \\( 282, 382, 482\\) \\( 292,\ ++ 392, 492\\) \\) \\)" \ ++ "print ar4(2:4, -2:1, -15:-14)" ++ ++gdb_test "p ar4\(7,-6:2:3,-7\)" \ ++ "\\$\[0-9\]+ = \\(729, 759, 789\\)" \ ++ "print ar4(7,-6:2:3,-7)" ++ ++gdb_test "p ar4\(9:2:-2, -6:2:3, -6:-15:-3\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 930, 730, 530, 330\\) \\( 960, 760,\ ++ 560, 360\\) \\( 990, 790, 590, 390\\) \\) \\( \\( 927, 727,\ ++ 527, 327\\) \\( 957, 757, 557, 357\\) \\( 987, 787, 587,\ ++ 387\\) \\) \\( \\( 924, 724, 524, 324\\) \\( 954, 754, 554,\ ++ 354\\) \\( 984, 784, 584, 384\\) \\) \\( \\( 921, 721, 521,\ ++ 321\\) \\( 951, 751, 551, 351\\) \\( 981, 781, 581, 381\\) \\)\ ++ \\)" \ ++ "print ar4(9:2:-2, -6:2:3, -6:-15:-3)" ++ ++gdb_test "p ar4\(:,:,:\)" \ ++ "\\$\[0-9\]+ = \\(\\( \\( 111, 211, 311, 411, 511, 611, 711,\ ++ 811, .*" \ ++ "print ar4(:,:,:)" ++ ++# Provoke error messages for bad user input ++gdb_test "print ar1\(0:4\)" \ ++ "provided bound\\(s\\) outside array bound\\(s\\)" \ ++ "print ar1\(0:4\)" ++gdb_test "print ar1\(8:12\)" \ ++ "provided bound\\(s\\) outside array bound\\(s\\)" \ ++ "print ar1\(8:12\)" ++gdb_test "print ar1\(8:2:\)" \ ++ "A syntax error in expression, near `\\)'." \ ++ "print ar1\(8:2:\)" ++gdb_test "print ar1\(8:2:2\)" \ ++ "Wrong value provided for stride and boundaries" \ ++ "print ar1\(8:2:2\)" ++gdb_test "print ar1\(2:8:-2\)" \ ++ "Wrong value provided for stride and boundaries" \ ++ "print ar1\(2:8:-2\)" ++gdb_test "print ar1\(2:7:0\)" \ ++ "Stride must not be 0" \ ++ "print ar1\(2:7:0\)" ++gdb_test "print ar1\(3:7\) = 42" \ ++ "Invalid cast." \ ++ "Assignment of value to subarray" +diff --git a/gdb/testsuite/gdb.fortran/static-arrays.f90 b/gdb/testsuite/gdb.fortran/static-arrays.f90 +new file mode 100644 +index 0000000..f22fcbe +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/static-arrays.f90 +@@ -0,0 +1,55 @@ ++! Copyright 2015 Free Software Foundation, Inc. ++! ++! Contributed by Intel Corp. ++! ++! 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 . ++ ++subroutine sub ++ integer, dimension(9) :: ar1 ++ integer, dimension(9,9) :: ar2 ++ integer, dimension(9,9,9) :: ar3 ++ integer, dimension(10,-7:3, -15:-5) :: ar4 ++ integer :: i,j,k ++ ++ ar1 = 1 ++ ar2 = 1 ++ ar3 = 1 ++ ar4 = 4 ++ ++ ! Resulting array ar3 looks like ((( 111, 112, 113, 114,...))) ++ do i = 1, 9, 1 ++ ar1(i) = i ++ do j = 1, 9, 1 ++ ar2(i,j) = i*10 + j ++ do k = 1, 9, 1 ++ ar3(i,j,k) = i*100 + j*10 + k ++ end do ++ end do ++ end do ++ ++ do i = 1, 10, 1 ++ do j = -7, 3, 1 ++ do k = -15, -5, 1 ++ ar4(i,j,k) = i*100 + (j+8)*10 + (k+16) ++ end do ++ end do ++ end do ++ ++ ar1(1) = 11 !BP1 ++ return ++end ++ ++program testprog ++ call sub ++end +diff --git a/gdb/testsuite/gdb.fortran/vla-ptype.exp b/gdb/testsuite/gdb.fortran/vla-ptype.exp +index 175661f..544d40a 100644 +--- 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 +index 8010c0a..f8258a1 100644 +--- 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" + gdb_test "print sizeof(pvla)" " = 4000" "print sizeof associated 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" +diff --git a/gdb/testsuite/gdb.fortran/vla-stride.exp b/gdb/testsuite/gdb.fortran/vla-stride.exp +new file mode 100644 +index 0000000..dcf15e5 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-stride.exp +@@ -0,0 +1,44 @@ ++# Copyright 2016 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++standard_testfile ".f90" ++ ++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ ++ {debug f90 quiet}] } { ++ return -1 ++} ++ ++if ![runto MAIN__] then { ++ perror "couldn't run to breakpoint MAIN__" ++ continue ++} ++ ++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\\\)" \ ++ "print re-reverse-elements" ++gdb_test "print pvla(1)" " = 1" "print first re-reverse-element" ++gdb_test "print pvla(10)" " = 10" "print last re-reverse-element" ++ ++gdb_breakpoint [gdb_get_line_number "odd-elements"] ++gdb_continue_to_breakpoint "odd-elements" ++gdb_test "print pvla" " = \\\(1, 3, 5, 7, 9\\\)" "print odd-elements" ++gdb_test "print pvla(1)" " = 1" "print first odd-element" ++gdb_test "print pvla(5)" " = 9" "print last odd-element" ++ ++gdb_breakpoint [gdb_get_line_number "single-element"] ++gdb_continue_to_breakpoint "single-element" ++gdb_test "print pvla" " = \\\(5\\\)" "print single-element" ++gdb_test "print pvla(1)" " = 5" "print one single-element" +diff --git a/gdb/testsuite/gdb.fortran/vla-stride.f90 b/gdb/testsuite/gdb.fortran/vla-stride.f90 +new file mode 100644 +index 0000000..8d24252 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-stride.f90 +@@ -0,0 +1,29 @@ ++! Copyright 2016 Free Software Foundation, Inc. ++! ++! This program is free software; you can redistribute it and/or modify ++! it under the terms of the GNU General Public License as published by ++! the Free Software Foundation; either version 3 of the License, or ++! (at your option) any later version. ++! ++! This program is distributed in the hope that it will be useful, ++! but WITHOUT ANY WARRANTY; without even the implied warranty of ++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++! GNU General Public License for more details. ++! ++! You should have received a copy of the GNU General Public License ++! along with this program. If not, see . ++ ++program vla_stride ++ integer, target, allocatable :: vla (:) ++ integer, pointer :: pvla (:) ++ ++ allocate(vla(10)) ++ vla = (/ (I, I = 1,10) /) ++ ++ pvla => vla(10:1:-1) ++ pvla => pvla(10:1:-1) ++ pvla => vla(1:10:2) ! re-reverse-elements ++ pvla => vla(5:4:-2) ! odd-elements ++ ++ pvla => null() ! single-element ++end program vla_stride +diff --git a/gdb/testsuite/gdb.fortran/vla.f90 b/gdb/testsuite/gdb.fortran/vla.f90 +index c76d24c..ef307b7 100644 +--- 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 +index de6fcfd..9753506 100644 +--- a/gdb/valarith.c ++++ b/gdb/valarith.c +@@ -193,11 +193,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)); + struct value *v; + ++ 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))) + { + if (type_not_associated (array_type)) + error (_("no such vector element (vector not associated)")); +diff --git a/gdb/valops.c b/gdb/valops.c +index 40392e8..24ffacb 100644 +--- a/gdb/valops.c ++++ b/gdb/valops.c +@@ -3775,56 +3775,191 @@ value_of_this_silent (const struct language_defn *lang) + struct value * + value_slice (struct value *array, int lowbound, int length) + { ++ /* Pass unaltered arguments to VALUE_SLICE_1, plus a default stride ++ value of '1', which returns every element between LOWBOUND and ++ (LOWBOUND + LENGTH). We also provide a default CALL_COUNT of '1' ++ as we are only considering the highest dimension, or we are ++ working on a one dimensional array. So we call VALUE_SLICE_1 ++ exactly once. */ ++ return value_slice_1 (array, lowbound, length, 1, 1); ++} ++ ++/* VALUE_SLICE_1 is called for each array dimension to calculate the number ++ of elements as defined by the subscript expression. ++ CALL_COUNT is used to determine if we are calling the function once, e.g. ++ we are working on the current dimension of ARRAY, or if we are calling ++ the function repeatedly. In the later case we need to take elements ++ from the TARGET_TYPE of ARRAY. ++ With a CALL_COUNT greater than 1 we calculate the offsets for every element ++ that should be in the result array. Then we fetch the contents and then ++ copy them into the result array. The result array will have one dimension ++ less than the input array, so later on we need to recreate the indices and ++ ranges in the calling function. */ ++ ++struct value * ++value_slice_1 (struct value *array, int lowbound, int length, ++ int stride_length, int call_count) ++{ + struct type *slice_range_type, *slice_type, *range_type; +- LONGEST lowerbound, upperbound; +- struct value *slice; +- struct type *array_type; ++ struct type *array_type = check_typedef (value_type (array)); ++ struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type)); ++ unsigned int elt_size, elt_offs; ++ LONGEST ary_high_bound, ary_low_bound; ++ struct value *v; ++ int slice_range_size, i = 0, row_count = 1, elem_count = 1; + +- array_type = check_typedef (value_type (array)); ++ /* Check for legacy code if we are actually dealing with an array or ++ string. */ + if (TYPE_CODE (array_type) != TYPE_CODE_ARRAY + && TYPE_CODE (array_type) != TYPE_CODE_STRING) + error (_("cannot take slice of non-array")); + +- range_type = TYPE_INDEX_TYPE (array_type); +- if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0) +- error (_("slice from bad array or bitstring")); ++ ary_low_bound = TYPE_LOW_BOUND (TYPE_INDEX_TYPE (array_type)); ++ ary_high_bound = TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (array_type)); ++ ++ /* When we are working on a multi-dimensional array, we need to get the ++ attributes of the underlying type. */ ++ if (call_count > 1) ++ { ++ ary_low_bound = TYPE_LOW_BOUND (TYPE_INDEX_TYPE (elt_type)); ++ ary_high_bound = TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (elt_type)); ++ elt_type = check_typedef (TYPE_TARGET_TYPE (elt_type)); ++ row_count = TYPE_LENGTH (array_type) ++ / TYPE_LENGTH (TYPE_TARGET_TYPE (array_type)); ++ } ++ ++ /* With a stride of '1', the number of elements per result row is equal to ++ the LENGTH of the subarray. With non-default stride values, we skip ++ elements, but have to add the start element to the total number of ++ elements per row. */ ++ if (stride_length == 1) ++ elem_count = length; ++ else ++ elem_count = ((length - 1) / stride_length) + 1; ++ ++ elt_size = TYPE_LENGTH (elt_type); ++ elt_offs = lowbound - ary_low_bound; + +- if (lowbound < lowerbound || length < 0 +- || lowbound + length - 1 > upperbound) +- error (_("slice out of range")); ++ elt_offs *= elt_size; ++ ++ /* Check for valid user input. In case of Fortran this was already done ++ in the calling function. */ ++ if (call_count == 1 ++ && (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type) ++ && elt_offs >= TYPE_LENGTH (array_type))) ++ error (_("no such vector element")); ++ ++ /* CALL_COUNT is 1 when we are dealing either with the highest dimension ++ of the array, or a one dimensional array. Set RANGE_TYPE accordingly. ++ In both cases we calculate how many rows/elements will be in the output ++ array by setting slice_range_size. */ ++ if (call_count == 1) ++ { ++ range_type = TYPE_INDEX_TYPE (array_type); ++ slice_range_size = ary_low_bound + elem_count - 1; ++ ++ /* Check if the array bounds are valid. */ ++ if (get_discrete_bounds (range_type, &ary_low_bound, &ary_high_bound) < 0) ++ error (_("slice from bad array or bitstring")); ++ } ++ /* When CALL_COUNT is greater than 1, we are dealing with an array of arrays. ++ So we need to get the type below the current one and set the RANGE_TYPE ++ accordingly. */ ++ else ++ { ++ range_type = TYPE_INDEX_TYPE (TYPE_TARGET_TYPE (array_type)); ++ slice_range_size = ary_low_bound + (row_count * elem_count) - 1; ++ ary_low_bound = TYPE_LOW_BOUND (range_type); ++ } + + /* 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, +- TYPE_TARGET_TYPE (range_type), +- lowbound, +- lowbound + length - 1); ++ done with it. */ + ++ slice_range_type = create_static_range_type (NULL, TYPE_TARGET_TYPE (range_type), ++ ary_low_bound, slice_range_size); + { +- struct type *element_type = TYPE_TARGET_TYPE (array_type); +- LONGEST offset +- = (lowbound - lowerbound) * TYPE_LENGTH (check_typedef (element_type)); ++ struct type *element_type; ++ ++ /* When both CALL_COUNT and STRIDE_LENGTH equal 1, we can use the legacy ++ code for subarrays. */ ++ if (call_count == 1 && stride_length == 1) ++ { ++ element_type = TYPE_TARGET_TYPE (array_type); ++ ++ slice_type = create_array_type (NULL, element_type, slice_range_type); + +- slice_type = create_array_type ((struct type *) NULL, +- element_type, +- slice_range_type); +- TYPE_CODE (slice_type) = TYPE_CODE (array_type); ++ TYPE_CODE (slice_type) = TYPE_CODE (array_type); + +- if (VALUE_LVAL (array) == lval_memory && value_lazy (array)) +- slice = allocate_value_lazy (slice_type); ++ if (VALUE_LVAL (array) == lval_memory && value_lazy (array)) ++ v = allocate_value_lazy (slice_type); ++ else ++ { ++ v = allocate_value (slice_type); ++ value_contents_copy (v, ++ value_embedded_offset (v), ++ array, ++ value_embedded_offset (array) + elt_offs, ++ elt_size * longest_to_int (length)); ++ } ++ ++ } ++ /* With a CALL_COUNT or STRIDE_LENGTH are greater than 1 we are working ++ on a range of ranges. So we copy the relevant elements into the ++ new array we return. */ + else + { +- slice = allocate_value (slice_type); +- value_contents_copy (slice, 0, array, offset, +- type_length_units (slice_type)); ++ int j, offs_store = elt_offs; ++ LONGEST dst_offset = 0; ++ LONGEST src_row_length = TYPE_LENGTH (TYPE_TARGET_TYPE (array_type)); ++ ++ if (call_count == 1) ++ { ++ /* When CALL_COUNT is equal to 1 we are working on the current range ++ and use these elements directly. */ ++ element_type = TYPE_TARGET_TYPE (array_type); ++ } ++ else ++ { ++ /* Working on an array of arrays, the type of the elements is the type ++ of the subarrays' type. */ ++ element_type = TYPE_TARGET_TYPE (TYPE_TARGET_TYPE (array_type)); ++ } ++ ++ slice_type = create_array_type (NULL, element_type, slice_range_type); ++ ++ /* If we have a one dimensional array, we copy its TYPE_CODE. For a ++ multi dimensional array we copy the embedded type's TYPE_CODE. */ ++ if (call_count == 1) ++ TYPE_CODE (slice_type) = TYPE_CODE (array_type); ++ else ++ TYPE_CODE (slice_type) = TYPE_CODE (TYPE_TARGET_TYPE (array_type)); ++ ++ v = allocate_value (slice_type); ++ ++ /* Iterate through the rows of the outer array and set the new offset ++ for each row. */ ++ for (i = 0; i < row_count; i++) ++ { ++ elt_offs = offs_store + i * src_row_length; ++ ++ /* Iterate through the elements in each row to copy only those. */ ++ for (j = 1; j <= elem_count; j++) ++ { ++ /* Fetches the contents of ARRAY and copies them into V. */ ++ value_contents_copy (v, dst_offset, array, elt_offs, elt_size); ++ elt_offs += elt_size * stride_length; ++ dst_offset += elt_size; ++ } ++ } + } + +- set_value_component_location (slice, array); +- VALUE_FRAME_ID (slice) = VALUE_FRAME_ID (array); +- set_value_offset (slice, value_offset (array) + offset); ++ set_value_component_location (v, array); ++ VALUE_REGNUM (v) = VALUE_REGNUM (array); ++ VALUE_FRAME_ID (v) = VALUE_FRAME_ID (array); ++ set_value_offset (v, value_offset (array) + elt_offs); + } + +- return slice; ++ return v; + } + + /* Create a value for a FORTRAN complex number. Currently most of the +diff --git a/gdb/value.h b/gdb/value.h +index 0b417b4..9c37713 100644 +--- a/gdb/value.h ++++ b/gdb/value.h +@@ -1057,6 +1057,8 @@ extern struct value *varying_to_slice (struct value *); + + extern struct value *value_slice (struct value *, int, int); + ++extern struct value *value_slice_1 (struct value *, int, int, int, int); ++ + extern struct value *value_literal_complex (struct value *, struct value *, + struct type *); + diff --git a/gdb-vla-intel-fortran-vla-strings.patch b/gdb-vla-intel-fortran-vla-strings.patch new file mode 100644 index 0000000..43c5374 --- /dev/null +++ b/gdb-vla-intel-fortran-vla-strings.patch @@ -0,0 +1,1488 @@ +git diff --stat -p gdb/master...gdb/users/bheckel/fortran-vla-strings +0ad7d8d1a3a36c6e04e3b6d37d8825f18d595723 + + gdb/NEWS | 2 + + gdb/c-valprint.c | 22 +++++ + gdb/dwarf2read.c | 158 +++++++++++++++++++++++++----- + gdb/f-typeprint.c | 93 +++++++++--------- + gdb/gdbtypes.c | 44 ++++++++- + gdb/testsuite/gdb.cp/vla-cxx.cc | 9 ++ + gdb/testsuite/gdb.cp/vla-cxx.exp | 9 ++ + gdb/testsuite/gdb.fortran/pointers.exp | 143 +++++++++++++++++++++++++++ + gdb/testsuite/gdb.fortran/pointers.f90 | 109 +++++++++++++++++++++ + gdb/testsuite/gdb.fortran/print_type.exp | 100 +++++++++++++++++++ + gdb/testsuite/gdb.fortran/vla-ptype.exp | 12 +-- + gdb/testsuite/gdb.fortran/vla-strings.exp | 103 +++++++++++++++++++ + gdb/testsuite/gdb.fortran/vla-strings.f90 | 39 ++++++++ + gdb/testsuite/gdb.fortran/vla-type.exp | 7 +- + gdb/testsuite/gdb.fortran/vla-value.exp | 12 ++- + gdb/testsuite/gdb.mi/mi-var-child-f.exp | 7 +- + gdb/testsuite/gdb.mi/mi-vla-fortran.exp | 27 ++--- + gdb/typeprint.c | 19 ++++ + gdb/valops.c | 16 ++- + gdb/valprint.c | 6 -- + 20 files changed, 827 insertions(+), 110 deletions(-) + +Index: gdb-7.11.90.20160907/gdb/NEWS +=================================================================== +--- gdb-7.11.90.20160907.orig/gdb/NEWS 2016-09-07 21:52:10.273563060 +0200 ++++ gdb-7.11.90.20160907/gdb/NEWS 2016-09-07 21:53:22.708210416 +0200 +@@ -1,6 +1,8 @@ + What has changed in GDB? + (Organized release by release) + ++* Fortran: Support pointers to dynamic types. ++ + *** Changes in GDB 7.12 + + * GDB and GDBserver now build with a C++ compiler by default. +Index: gdb-7.11.90.20160907/gdb/c-valprint.c +=================================================================== +--- gdb-7.11.90.20160907.orig/gdb/c-valprint.c 2016-09-07 21:52:10.272563051 +0200 ++++ gdb-7.11.90.20160907/gdb/c-valprint.c 2016-09-07 21:53:22.708210416 +0200 +@@ -645,6 +645,28 @@ + else + { + /* normal case */ ++ if (TYPE_CODE (type) == TYPE_CODE_PTR ++ && 1 == is_dynamic_type (type)) ++ { ++ CORE_ADDR addr; ++ if (NULL != TYPE_DATA_LOCATION (TYPE_TARGET_TYPE (type))) ++ addr = value_address (val); ++ else ++ addr = value_as_address (val); ++ ++ /* We resolve the target-type only when the ++ pointer is associated. */ ++ if ((addr != 0) ++ && (0 == type_not_associated (type))) ++ TYPE_TARGET_TYPE (type) = ++ resolve_dynamic_type (TYPE_TARGET_TYPE (type), ++ NULL, addr); ++ } ++ else ++ { ++ /* Do nothing. References are already resolved from the beginning, ++ only pointers are resolved when we actual need the target. */ ++ } + fprintf_filtered (stream, "("); + type_print (value_type (val), "", stream, -1); + fprintf_filtered (stream, ") "); +Index: gdb-7.11.90.20160907/gdb/dwarf2read.c +=================================================================== +--- gdb-7.11.90.20160907.orig/gdb/dwarf2read.c 2016-09-07 21:52:53.700951175 +0200 ++++ gdb-7.11.90.20160907/gdb/dwarf2read.c 2016-09-07 21:54:02.140562825 +0200 +@@ -1764,7 +1764,8 @@ + + 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, ++ int additional_data_size); + + /* memory allocation interface */ + +@@ -11446,7 +11447,7 @@ + { + 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); + } + + cu->list_in_scope = &local_symbols; +@@ -14512,29 +14513,94 @@ + struct gdbarch *gdbarch = get_objfile_arch (objfile); + struct type *type, *range_type, *index_type, *char_type; + struct attribute *attr; +- unsigned int length; ++ unsigned int length = UINT_MAX; + ++ 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) + { +- length = DW_UNSND (attr); ++ if (attr_form_is_block (attr)) ++ { ++ struct attribute *byte_size, *bit_size; ++ struct dynamic_prop high; ++ ++ byte_size = dwarf2_attr (die, DW_AT_byte_size, cu); ++ bit_size = dwarf2_attr (die, DW_AT_bit_size, cu); ++ ++ /* DW_AT_byte_size should never occur in combination with ++ DW_AT_bit_size. */ ++ if (byte_size != NULL && bit_size != NULL) ++ complaint (&symfile_complaints, ++ _("DW_AT_byte_size AND " ++ "DW_AT_bit_size found together at the same time.")); ++ ++ /* If DW_AT_string_length AND DW_AT_byte_size exist together, ++ DW_AT_byte_size describes the number of bytes that should be read ++ from the length memory location. */ ++ if (byte_size != NULL) ++ { ++ /* Build new dwarf2_locexpr_baton structure with additions to the ++ data attribute, to reflect DWARF specialities to get address ++ sizes. */ ++ const gdb_byte append_ops[] = ++ { ++ /* DW_OP_deref_size: size of an address on the target machine ++ (bytes), where the size will be specified by the next ++ operand. */ ++ DW_OP_deref_size, ++ /* Operand for DW_OP_deref_size. */ ++ DW_UNSND(byte_size) }; ++ ++ if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops, ++ ARRAY_SIZE(append_ops))) ++ complaint (&symfile_complaints, ++ _("Could not parse DW_AT_byte_size")); ++ } ++ else if (bit_size != NULL) ++ complaint (&symfile_complaints, ++ _("DW_AT_string_length AND " ++ "DW_AT_bit_size found but not supported yet.")); ++ /* If DW_AT_string_length WITHOUT DW_AT_byte_size exist, the default ++ is the address size of the target machine. */ ++ else ++ { ++ const gdb_byte append_ops[] = ++ { DW_OP_deref }; ++ ++ if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops, ++ ARRAY_SIZE(append_ops))) ++ complaint (&symfile_complaints, ++ _("Could not parse DW_AT_string_length")); ++ } ++ ++ TYPE_RANGE_DATA (range_type)->high = high; ++ } ++ else ++ { ++ TYPE_HIGH_BOUND (range_type) = DW_UNSND(attr); ++ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST; ++ } + } + 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); +- } ++ { ++ TYPE_HIGH_BOUND (range_type) = DW_UNSND(attr); ++ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST; ++ } + else +- { +- length = 1; +- } ++ { ++ TYPE_HIGH_BOUND (range_type) = 1; ++ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST; ++ } + } + +- index_type = objfile_type (objfile)->builtin_int; +- range_type = create_static_range_type (NULL, index_type, 1, length); + char_type = language_string_char_type (cu->language_defn, gdbarch); + type = create_string_type (NULL, char_type, range_type); + +@@ -14864,7 +14930,8 @@ + + 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, ++ const gdb_byte *additional_data, int additional_data_size) + { + struct dwarf2_property_baton *baton; + struct obstack *obstack = &cu->objfile->objfile_obstack; +@@ -14874,14 +14941,33 @@ + + 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; ++ ++ if (additional_data != NULL && additional_data_size > 0) ++ { ++ gdb_byte *data; ++ ++ data = (gdb_byte *) obstack_alloc( ++ &cu->objfile->objfile_obstack, ++ DW_BLOCK (attr)->size + additional_data_size); ++ memcpy (data, DW_BLOCK (attr)->data, DW_BLOCK (attr)->size); ++ memcpy (data + DW_BLOCK (attr)->size, additional_data, ++ additional_data_size); ++ ++ baton->locexpr.data = data; ++ baton->locexpr.size = DW_BLOCK (attr)->size + additional_data_size; ++ } ++ else ++ { ++ baton->locexpr.data = DW_BLOCK (attr)->data; ++ baton->locexpr.size = DW_BLOCK (attr)->size; ++ } ++ + prop->data.baton = baton; + prop->kind = PROP_LOCEXPR; +- gdb_assert (prop->data.baton != NULL); ++ gdb_assert(prop->data.baton != NULL); + } + else if (attr_form_is_ref (attr)) + { +@@ -14914,8 +15000,28 @@ + baton = XOBNEW (obstack, struct dwarf2_property_baton); + baton->referenced_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; ++ ++ if (additional_data != NULL && additional_data_size > 0) ++ { ++ gdb_byte *data; ++ ++ data = (gdb_byte *) obstack_alloc (&cu->objfile->objfile_obstack, ++ DW_BLOCK (target_attr)->size + additional_data_size); ++ memcpy (data, DW_BLOCK (target_attr)->data, ++ DW_BLOCK (target_attr)->size); ++ memcpy (data + DW_BLOCK (target_attr)->size, ++ additional_data, additional_data_size); ++ ++ baton->locexpr.data = data; ++ baton->locexpr.size = (DW_BLOCK (target_attr)->size ++ + additional_data_size); ++ } ++ else ++ { ++ baton->locexpr.data = DW_BLOCK (target_attr)->data; ++ baton->locexpr.size = DW_BLOCK (target_attr)->size; ++ } ++ + prop->data.baton = baton; + prop->kind = PROP_LOCEXPR; + gdb_assert (prop->data.baton != NULL); +@@ -15027,24 +15133,24 @@ + + 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 (&symfile_complaints, _("Missing DW_AT_byte_stride " + "- DIE at 0x%x [in module %s]"), + die->offset.sect_off, objfile_name (cu->objfile)); + + 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); + else if (!low_default_is_valid) + complaint (&symfile_complaints, _("Missing DW_AT_lower_bound " + "- DIE at 0x%x [in module %s]"), + die->offset.sect_off, objfile_name (cu->objfile)); + + attr = 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)) + { + attr = 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 bounds are constant do the final calculation here. */ + if (low.kind == PROP_CONST && high.kind == PROP_CONST) +@@ -22416,7 +22522,7 @@ + attr = dwarf2_attr (die, DW_AT_allocated, cu); + if (attr_form_is_block (attr)) + { +- if (attr_to_dynamic_prop (attr, die, cu, &prop)) ++ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0)) + add_dyn_prop (DYN_PROP_ALLOCATED, prop, type, objfile); + } + else if (attr != NULL) +@@ -22431,7 +22537,7 @@ + attr = dwarf2_attr (die, DW_AT_associated, cu); + if (attr_form_is_block (attr)) + { +- if (attr_to_dynamic_prop (attr, die, cu, &prop)) ++ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0)) + add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type, objfile); + } + else if (attr != NULL) +@@ -22444,7 +22550,7 @@ + + /* 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)) + add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type, objfile); + + if (dwarf2_per_objfile->die_type_hash == NULL) +Index: gdb-7.11.90.20160907/gdb/f-typeprint.c +=================================================================== +--- gdb-7.11.90.20160907.orig/gdb/f-typeprint.c 2016-09-07 21:52:10.272563051 +0200 ++++ gdb-7.11.90.20160907/gdb/f-typeprint.c 2016-09-07 21:53:22.713210461 +0200 +@@ -37,7 +37,7 @@ + #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); +@@ -54,18 +54,6 @@ + enum type_code code; + int demangled_args; + +- 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') +@@ -87,7 +75,7 @@ + so don't print an additional pair of ()'s. */ + + demangled_args = 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); + } + } + +@@ -157,7 +145,7 @@ + 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; + +@@ -181,34 +169,50 @@ + 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))) ++ || (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 = 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, ":"); + 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); ++ ++ /* 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 +@@ -219,13 +223,14 @@ + case TYPE_CODE_PTR: + 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, ")"); + 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, ")"); + +@@ -376,7 +381,7 @@ + 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 "); +Index: gdb-7.11.90.20160907/gdb/gdbtypes.c +=================================================================== +--- gdb-7.11.90.20160907.orig/gdb/gdbtypes.c 2016-09-07 21:52:53.703951202 +0200 ++++ gdb-7.11.90.20160907/gdb/gdbtypes.c 2016-09-07 21:53:22.714210470 +0200 +@@ -1816,7 +1816,8 @@ + type = check_typedef (type); + + /* We only want to recognize references at the outermost level. */ +- if (top_level && TYPE_CODE (type) == TYPE_CODE_REF) ++ if (top_level && ++ (TYPE_CODE (type) == TYPE_CODE_REF || TYPE_CODE (type) == TYPE_CODE_PTR)) + type = check_typedef (TYPE_TARGET_TYPE (type)); + + /* Types that have a dynamic TYPE_DATA_LOCATION are considered +@@ -1850,6 +1851,7 @@ + } + + case TYPE_CODE_ARRAY: ++ case TYPE_CODE_STRING: + { + gdb_assert (TYPE_NFIELDS (type) == 1); + +@@ -1962,7 +1964,8 @@ + struct type *ary_dim; + struct dynamic_prop *prop; + +- 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); + +@@ -1987,13 +1990,17 @@ + + 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); + else + elt_type = TYPE_TARGET_TYPE (type); + +- return create_array_type_with_stride (type, elt_type, range_type, +- TYPE_FIELD_BITSIZE (type, 0)); ++ if (TYPE_CODE (type) == TYPE_CODE_STRING) ++ return create_string_type (type, elt_type, range_type); ++ else ++ return create_array_type_with_stride (type, elt_type, range_type, ++ TYPE_FIELD_BITSIZE (type, 0)); + } + + /* Resolve dynamic bounds of members of the union TYPE to static +@@ -2123,6 +2130,28 @@ + return resolved_type; + } + ++/* Worker for pointer types. */ ++ ++static struct type * ++resolve_dynamic_pointer (struct type *type, ++ struct property_addr_info *addr_stack) ++{ ++ struct dynamic_prop *prop; ++ CORE_ADDR value; ++ ++ type = copy_type (type); ++ ++ /* Resolve associated property. */ ++ prop = TYPE_ASSOCIATED_PROP (type); ++ if (prop != NULL && dwarf2_evaluate_property (prop, NULL, addr_stack, &value)) ++ { ++ TYPE_DYN_PROP_ADDR (prop) = value; ++ TYPE_DYN_PROP_KIND (prop) = PROP_CONST; ++ } ++ ++ return type; ++} ++ + /* Worker for resolved_dynamic_type. */ + + static struct type * +@@ -2171,7 +2200,12 @@ + 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; + +Index: gdb-7.11.90.20160907/gdb/testsuite/gdb.cp/vla-cxx.cc +=================================================================== +--- gdb-7.11.90.20160907.orig/gdb/testsuite/gdb.cp/vla-cxx.cc 2016-09-07 21:52:10.272563051 +0200 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.cp/vla-cxx.cc 2016-09-07 21:53:22.714210470 +0200 +@@ -15,6 +15,10 @@ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + ++extern "C" { ++#include ++} ++ + struct container; + + struct element +@@ -40,11 +44,16 @@ + typedef typeof (vla) &vlareftypedef; + vlareftypedef vlaref2 (vla); + container c; ++ typeof (vla) *ptr = NULL; ++ ++ // Before pointer assignment ++ ptr = &vla; + + for (int i = 0; i < z; ++i) + vla[i] = 5 + 2 * i; + + // vlas_filled + vla[0] = 2 * vla[0]; ++ + return vla[2]; + } +Index: gdb-7.11.90.20160907/gdb/testsuite/gdb.cp/vla-cxx.exp +=================================================================== +--- gdb-7.11.90.20160907.orig/gdb/testsuite/gdb.cp/vla-cxx.exp 2016-09-07 21:52:10.272563051 +0200 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.cp/vla-cxx.exp 2016-09-07 21:53:22.715210479 +0200 +@@ -23,6 +23,12 @@ + return -1 + } + ++gdb_breakpoint [gdb_get_line_number "Before pointer assignment"] ++gdb_continue_to_breakpoint "Before pointer assignment" ++gdb_test "ptype ptr" "int \\(\\*\\)\\\[variable length\\\]" "ptype ptr, Before pointer assignment" ++gdb_test "print ptr" "\\(int \\(\\*\\)\\\[variable length\\\]\\) 0x0" "print ptr, Before pointer assignment" ++gdb_test "print *ptr" "Cannot access memory at address 0x0" "print *ptr, Before pointer assignment" ++ + gdb_breakpoint [gdb_get_line_number "vlas_filled"] + gdb_continue_to_breakpoint "vlas_filled" + +@@ -33,3 +39,6 @@ + # bug being tested, it's better not to depend on the exact spelling. + gdb_test "print vlaref2" " = \\(.*\\) @$hex: \\{5, 7, 9\\}" + gdb_test "print c" " = \\{e = \\{c = @$hex\\}\\}" ++gdb_test "ptype ptr" "int \\(\\*\\)\\\[3\\\]" ++gdb_test "print ptr" "\\(int \\(\\*\\)\\\[3\\\]\\) $hex" ++gdb_test "print *ptr" " = \\{5, 7, 9\\}" +Index: gdb-7.11.90.20160907/gdb/testsuite/gdb.fortran/pointers.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.fortran/pointers.exp 2016-09-07 21:53:22.715210479 +0200 +@@ -0,0 +1,143 @@ ++# Copyright 2016 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++standard_testfile "pointers.f90" ++load_lib fortran.exp ++ ++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ ++ {debug f90 quiet}] } { ++ return -1 ++} ++ ++if ![runto_main] { ++ untested "could not run to main" ++ return -1 ++} ++ ++# Depending on the compiler being used, the type names can be printed differently. ++set logical [fortran_logical4] ++set real [fortran_real4] ++set int [fortran_int4] ++set complex [fortran_complex4] ++ ++ ++gdb_breakpoint [gdb_get_line_number "Before pointer assignment"] ++gdb_continue_to_breakpoint "Before pointer assignment" ++gdb_test "print logp" "= \\(PTR TO -> \\( $logical \\)\\) 0x0" "print logp, not associated" ++gdb_test "print *logp" "Cannot access memory at address 0x0" "print *logp, not associated" ++gdb_test "print comp" "= \\(PTR TO -> \\( $complex \\)\\) 0x0" "print comp, not associated" ++gdb_test "print *comp" "Cannot access memory at address 0x0" "print *comp, not associated" ++gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1 \\)\\) 0x0" "print charp, not associated" ++gdb_test "print *charp" "Cannot access memory at address 0x0" "print *charp, not associated" ++gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3 \\)\\) 0x0" "print charap, not associated" ++gdb_test "print *charap" "Cannot access memory at address 0x0" "print *charap, not associated" ++gdb_test "print intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0" "print intp, not associated" ++gdb_test "print *intp" "Cannot access memory at address 0x0" "print *intp, not associated" ++set test "print intap, not associated" ++gdb_test_multiple "print intap" $test { ++ -re " = \\(PTR TO -> \\( $int \\(:,:\\)\\)\\) \r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re " = \r\n$gdb_prompt $" { ++ pass $test ++ } ++} ++gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) 0x0" "print realp, not associated" ++gdb_test "print *realp" "Cannot access memory at address 0x0" "print *realp, not associated" ++gdb_test "print \$my_var = intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0" ++set test "print cyclicp1, not associated" ++gdb_test_multiple "print cyclicp1" $test { ++ -re "= \\( i = -?\\d+, p = 0x0 \\)\r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re "= \\( i = -?\\d+, p = \\)\r\n$gdb_prompt $" { ++ pass $test ++ } ++} ++set test "print cyclicp1%p, not associated" ++gdb_test_multiple "print cyclicp1%p" $test { ++ -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) 0x0\r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) \r\n$gdb_prompt $" { ++ pass $test ++ } ++} ++ ++ ++gdb_breakpoint [gdb_get_line_number "Before value assignment"] ++gdb_continue_to_breakpoint "Before value assignment" ++gdb_test "print *(twop)%ivla2" "= " ++ ++ ++gdb_breakpoint [gdb_get_line_number "After value assignment"] ++gdb_continue_to_breakpoint "After value assignment" ++gdb_test "print logp" "= \\(PTR TO -> \\( $logical \\)\\) $hex\( <.*>\)?" ++gdb_test "print *logp" "= \\.TRUE\\." ++gdb_test "print comp" "= \\(PTR TO -> \\( $complex \\)\\) $hex\( <.*>\)?" ++gdb_test "print *comp" "= \\(1,2\\)" ++gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1 \\)\\) $hex\( <.*>\)?" ++gdb_test "print *charp" "= 'a'" ++gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3 \\)\\) $hex\( <.*>\)?" ++gdb_test "print *charap" "= 'abc'" ++gdb_test "print intp" "= \\(PTR TO -> \\( $int \\)\\) $hex\( <.*>\)?" ++gdb_test "print *intp" "= 10" ++set test_name "print intap, associated" ++gdb_test_multiple "print intap" $test_name { ++ -re "= \\(\\( 1, 1, 3(, 1){7}\\) \\( 1(, 1){9}\\) \\)\r\n$gdb_prompt $" { ++ pass $test_name ++ } ++ -re "= \\(PTR TO -> \\( $int \\(10,2\\)\\)\\) $hex\( <.*>\)?\r\n$gdb_prompt $" { ++ gdb_test "print *intap" "= \\(\\( 1, 1, 3(, 1){7}\\) \\( 1(, 1){9}\\) \\)" ++ pass $test_name ++ } ++} ++set test_name "print intvlap, associated" ++gdb_test_multiple "print intvlap" $test_name { ++ -re "= \\(2, 2, 2, 4(, 2){6}\\)\r\n$gdb_prompt $" { ++ pass $test_name ++ } ++ -re "= \\(PTR TO -> \\( $int \\(10\\)\\)\\) $hex\( <.*>\)?\r\n$gdb_prompt $" { ++ gdb_test "print *intvlap" "= \\(2, 2, 2, 4(, 2){6}\\)" ++ pass $test_name ++ } ++} ++gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) $hex\( <.*>\)?" ++gdb_test "print *realp" "= 3\\.14000\\d+" ++gdb_test "print arrayOfPtr(2)%p" "= \\(PTR TO -> \\( Type two \\)\\) $hex\( <.*>\)?" ++gdb_test "print *(arrayOfPtr(2)%p)" "= \\( ivla1 = \\(11, 12, 13\\), ivla2 = \\(\\( 211, 221\\) \\( 212, 222\\) \\) \\)" ++set test_name "print arrayOfPtr(3)%p" ++gdb_test_multiple $test_name $test_name { ++ -re "= \\(PTR TO -> \\( Type two \\)\\) \r\n$gdb_prompt $" { ++ pass $test_name ++ } ++ -re "= \\(PTR TO -> \\( Type two \\)\\) 0x0\r\n$gdb_prompt $" { ++ pass $test_name ++ } ++} ++set test_name "print *(arrayOfPtr(3)%p), associated" ++gdb_test_multiple "print *(arrayOfPtr(3)%p)" $test_name { ++ -re "Cannot access memory at address 0x0\r\n$gdb_prompt $" { ++ pass $test_name ++ } ++ -re "Attempt to take contents of a not associated pointer.\r\n$gdb_prompt $" { ++ pass $test_name ++ } ++} ++gdb_test "print cyclicp1" "= \\( i = 1, p = $hex\( <.*>\)? \\)" ++gdb_test "print cyclicp1%p" "= \\(PTR TO -> \\( Type typewithpointer \\)\\) $hex\( <.*>\)?" ++gdb_test "print *((integer*) &inta + 2)" "= 3" "print temporary pointer, array" ++gdb_test "print *((integer*) &intvla + 3)" "= 4" "print temporary pointer, allocated vla" ++gdb_test "print \$pc" "= \\(PTR TO -> \\( void \\(\\)\\(\\)\\)\\) $hex " "Print program counter" +Index: gdb-7.11.90.20160907/gdb/testsuite/gdb.fortran/pointers.f90 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.fortran/pointers.f90 2016-09-07 21:53:22.715210479 +0200 +@@ -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 ++ ++ type :: typeWithPointer ++ integer i ++ type(typeWithPointer), pointer:: p ++ end type typeWithPointer ++ ++ type :: twoPtr ++ type (two), pointer :: p ++ end type twoPtr ++ ++ logical, target :: logv ++ complex, target :: comv ++ character, target :: charv ++ character (len=3), target :: chara ++ integer, target :: intv ++ integer, target, dimension (10,2) :: inta ++ integer, target, allocatable, dimension (:) :: intvla ++ real, target :: realv ++ type(two), target :: twov ++ type(twoPtr) :: arrayOfPtr (3) ++ type(typeWithPointer), target:: cyclicp1,cyclicp2 ++ ++ logical, pointer :: logp ++ complex, pointer :: comp ++ character, pointer:: charp ++ character (len=3), pointer:: charap ++ 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) ++ nullify (intvlap) ++ nullify (realp) ++ nullify (twop) ++ nullify (arrayOfPtr(1)%p) ++ nullify (arrayOfPtr(2)%p) ++ nullify (arrayOfPtr(3)%p) ++ nullify (cyclicp1%p) ++ nullify (cyclicp2%p) ++ ++ logp => logv ! Before pointer assignment ++ comp => comv ++ charp => charv ++ charap => chara ++ intp => intv ++ intap => inta ++ intvlap => intvla ++ realp => realv ++ twop => twov ++ arrayOfPtr(2)%p => twov ++ cyclicp1%i = 1 ++ cyclicp1%p => cyclicp2 ++ cyclicp2%i = 2 ++ cyclicp2%p => cyclicp1 ++ ++ logv = associated(logp) ! Before value assignment ++ comv = cmplx(1,2) ++ charv = "a" ++ chara = "abc" ++ 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 +Index: gdb-7.11.90.20160907/gdb/testsuite/gdb.fortran/print_type.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.fortran/print_type.exp 2016-09-07 21:53:22.715210479 +0200 +@@ -0,0 +1,100 @@ ++# Copyright 2016 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++standard_testfile "pointers.f90" ++load_lib fortran.exp ++ ++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ ++ {debug f90 quiet}] } { ++ return -1 ++} ++ ++ ++if ![runto_main] { ++ untested "could not run to main" ++ return -1 ++} ++ ++# Depending on the compiler being used, the type names can be printed differently. ++set logical [fortran_logical4] ++set real [fortran_real4] ++set int [fortran_int4] ++set complex [fortran_complex4] ++ ++gdb_breakpoint [gdb_get_line_number "Before pointer assignment"] ++gdb_continue_to_breakpoint "Before pointer assignment" ++gdb_test "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 \\)" +Index: gdb-7.11.90.20160907/gdb/testsuite/gdb.fortran/vla-ptype.exp +=================================================================== +--- gdb-7.11.90.20160907.orig/gdb/testsuite/gdb.fortran/vla-ptype.exp 2016-09-07 21:52:53.705951220 +0200 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.fortran/vla-ptype.exp 2016-09-07 21:53:22.715210479 +0200 +@@ -32,9 +32,9 @@ + # 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_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 "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 "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" +Index: gdb-7.11.90.20160907/gdb/testsuite/gdb.fortran/vla-strings.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.fortran/vla-strings.exp 2016-09-07 21:53:22.716210488 +0200 +@@ -0,0 +1,103 @@ ++# Copyright 2016 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++standard_testfile ".f90" ++ ++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ ++ {debug f90 quiet}] } { ++ return -1 ++} ++ ++# check that all fortran standard datatypes will be ++# handled correctly when using as VLA's ++ ++if ![runto_main] { ++ untested "could not run to main" ++ return -1 ++} ++ ++gdb_breakpoint [gdb_get_line_number "var_char-allocated-1"] ++gdb_continue_to_breakpoint "var_char-allocated-1" ++set test "whatis var_char first time" ++gdb_test_multiple "whatis var_char" $test { ++ -re "type = PTR TO -> \\( character\\*10 \\)\r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re "type = character\\*10\r\n$gdb_prompt $" { ++ pass $test ++ } ++} ++set test "ptype var_char first time" ++gdb_test_multiple "ptype var_char" $test { ++ -re "type = PTR TO -> \\( character\\*10 \\)\r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re "type = character\\*10\r\n$gdb_prompt $" { ++ pass $test ++ } ++} ++ ++ ++gdb_test "next" "\\d+.*var_char = 'foo'.*" \ ++ "next to allocation status of var_char" ++gdb_test "print l" " = \\.TRUE\\." "print allocation status first time" ++ ++ ++gdb_breakpoint [gdb_get_line_number "var_char-filled-1"] ++gdb_continue_to_breakpoint "var_char-filled-1" ++set test "print var_char, var_char-filled-1" ++gdb_test_multiple "print var_char" $test { ++ -re "= \\(PTR TO -> \\( character\\*3 \\)\\) $hex\r\n$gdb_prompt $" { ++ gdb_test "print *var_char" "= 'foo'" "print *var_char, var_char-filled-1" ++ pass $test ++ } ++ -re "= 'foo'\r\n$gdb_prompt $" { ++ pass $test ++ } ++} ++set test "ptype var_char, var_char-filled-1" ++gdb_test_multiple "ptype var_char" $test { ++ -re "type = PTR TO -> \\( character\\*3 \\)\r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re "type = character\\*3\r\n$gdb_prompt $" { ++ pass $test ++ } ++} ++gdb_test "print var_char(1)" " = 102 'f'" "print var_char(1)" ++gdb_test "print var_char(3)" " = 111 'o'" "print var_char(3)" ++ ++ ++gdb_breakpoint [gdb_get_line_number "var_char-filled-2"] ++gdb_continue_to_breakpoint "var_char-filled-2" ++set test "print var_char, var_char-filled-2" ++gdb_test_multiple "print var_char" $test { ++ -re "= \\(PTR TO -> \\( character\\*6 \\)\\) $hex\r\n$gdb_prompt $" { ++ gdb_test "print *var_char" "= 'foobar'" "print *var_char, var_char-filled-2" ++ pass $test ++ } ++ -re "= 'foobar'\r\n$gdb_prompt $" { ++ pass $test ++ } ++} ++set test "ptype var_char, var_char-filled-2" ++gdb_test_multiple "ptype var_char" $test { ++ -re "type = PTR TO -> \\( character\\*6 \\)\r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re "type = character\\*6\r\n$gdb_prompt $" { ++ pass $test ++ } ++} +Index: gdb-7.11.90.20160907/gdb/testsuite/gdb.fortran/vla-strings.f90 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.fortran/vla-strings.f90 2016-09-07 21:53:22.716210488 +0200 +@@ -0,0 +1,39 @@ ++! Copyright 2016 Free Software Foundation, Inc. ++! ++! This program is free software; you can redistribute it and/or modify ++! it under the terms of the GNU General Public License as published by ++! the Free Software Foundation; either version 3 of the License, or ++! (at your option) any later version. ++! ++! This program is distributed in the hope that it will be useful, ++! but WITHOUT ANY WARRANTY; without even the implied warranty of ++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++! GNU General Public License for more details. ++! ++! You should have received a copy of the GNU General Public License ++! along with this program. If not, see . ++ ++program vla_strings ++ character(len=:), target, allocatable :: var_char ++ character(len=:), pointer :: var_char_p ++ logical :: l ++ ++ allocate(character(len=10) :: var_char) ++ l = allocated(var_char) ! var_char-allocated-1 ++ var_char = 'foo' ++ deallocate(var_char) ! var_char-filled-1 ++ l = allocated(var_char) ! var_char-deallocated ++ allocate(character(len=42) :: var_char) ++ l = allocated(var_char) ++ var_char = 'foobar' ++ var_char = '' ! var_char-filled-2 ++ var_char = 'bar' ! var_char-empty ++ deallocate(var_char) ++ allocate(character(len=21) :: var_char) ++ l = allocated(var_char) ! var_char-allocated-3 ++ var_char = 'johndoe' ++ var_char_p => var_char ++ l = associated(var_char_p) ! var_char_p-associated ++ var_char_p => null() ++ l = associated(var_char_p) ! var_char_p-not-associated ++end program vla_strings +Index: gdb-7.11.90.20160907/gdb/testsuite/gdb.fortran/vla-type.exp +=================================================================== +--- gdb-7.11.90.20160907.orig/gdb/testsuite/gdb.fortran/vla-type.exp 2016-09-07 21:52:10.272563051 +0200 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.fortran/vla-type.exp 2016-09-07 21:53:22.716210488 +0200 +@@ -132,7 +132,10 @@ + "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 @@ + "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" + +Index: gdb-7.11.90.20160907/gdb/testsuite/gdb.fortran/vla-value.exp +=================================================================== +--- gdb-7.11.90.20160907.orig/gdb/testsuite/gdb.fortran/vla-value.exp 2016-09-07 21:52:10.272563051 +0200 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.fortran/vla-value.exp 2016-09-07 21:53:22.716210488 +0200 +@@ -14,6 +14,7 @@ + # along with this program. If not, see . + + standard_testfile "vla.f90" ++load_lib "fortran.exp" + + if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ + {debug f90 quiet}] } { +@@ -25,12 +26,15 @@ + return -1 + } + ++# Depending on the compiler being used, the type names can be printed differently. ++set real [fortran_real4] ++ + # Try to access values in non allocated VLA + gdb_breakpoint [gdb_get_line_number "vla1-init"] + gdb_continue_to_breakpoint "vla1-init" + gdb_test "print vla1" " = " "print non-allocated vla1" + gdb_test "print &vla1" \ +- " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(\\\)\\\)\\\) $hex" \ ++ " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\)\\\)\\\) $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)" +@@ -51,7 +55,7 @@ + "step over value assignment of vla1" + } + gdb_test "print &vla1" \ +- " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(10,10,10\\\)\\\)\\\) $hex" \ ++ " = \\\(PTR TO -> \\\( $real \\\(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)" +@@ -71,7 +75,7 @@ + # Try to access values in undefined pointer to VLA (dangling) + gdb_test "print pvla" " = " "print undefined pvla" + gdb_test "print &pvla" \ +- " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(\\\)\\\)\\\) $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)" +@@ -80,7 +84,7 @@ + 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" \ ++ " = \\\(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)" +Index: gdb-7.11.90.20160907/gdb/testsuite/gdb.mi/mi-var-child-f.exp +=================================================================== +--- gdb-7.11.90.20160907.orig/gdb/testsuite/gdb.mi/mi-var-child-f.exp 2016-09-07 21:52:10.272563051 +0200 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.mi/mi-var-child-f.exp 2016-09-07 21:53:22.716210488 +0200 +@@ -17,6 +17,7 @@ + + load_lib mi-support.exp + set MIFLAGS "-i=mi" ++load_lib "fortran.exp" + + if { [skip_fortran_tests] } { return -1 } + +@@ -40,10 +41,8 @@ + mi_create_varobj "array" "array" "create local variable array" + + +-# Depending on the compiler version being used, the name of the 4-byte integer +-# and real types can be printed differently. For instance, gfortran-4.1 uses +-# "int4" whereas gfortran-4.3 uses "integer(kind=4)". +-set int4 "(int4|integer\\(kind=4\\))" ++# Depending on the compiler being used, the type names can be printed differently. ++set int4 [fortran_int4] + + set children [list [list "array.-1" "-1" 2 "$int4 \\(2\\)"] \ + [list "array.0" "0" 2 "$int4 \\(2\\)"] \ +Index: gdb-7.11.90.20160907/gdb/testsuite/gdb.mi/mi-vla-fortran.exp +=================================================================== +--- gdb-7.11.90.20160907.orig/gdb/testsuite/gdb.mi/mi-vla-fortran.exp 2016-09-07 21:52:10.272563051 +0200 ++++ gdb-7.11.90.20160907/gdb/testsuite/gdb.mi/mi-vla-fortran.exp 2016-09-07 21:53:22.716210488 +0200 +@@ -17,7 +17,9 @@ + # Array (VLA). + + load_lib mi-support.exp ++load_lib fortran.exp + set MIFLAGS "-i=mi" ++load_lib "fortran.exp" + + gdb_exit + if [mi_gdb_start] { +@@ -32,6 +34,9 @@ + return -1 + } + ++# Depending on the compiler being used, the type names can be printed differently. ++set real [fortran_real4] ++ + mi_delete_breakpoints + mi_gdb_reinitialize_dir $srcdir/$subdir + mi_gdb_load ${binfile} +@@ -46,10 +51,10 @@ + mi_gdb_test "500-data-evaluate-expression vla1" \ + "500\\^done,value=\"\"" "evaluate not allocated vla" + +-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\"" \ +@@ -58,7 +63,7 @@ + "503\\^done,value=\"\\\[0\\\]\"" \ + "eval variable vla1_not_allocated" + mi_list_array_varobj_children_with_index "vla1_not_allocated" "0" "1" \ +- "real\\\(kind=4\\\)" "get children of vla1_not_allocated" ++ "$real" "get children of vla1_not_allocated" + + + +@@ -71,10 +76,10 @@ + mi_gdb_test "510-data-evaluate-expression vla1" \ + "510\\^done,value=\"\\(.*\\)\"" "evaluate allocated vla" + +-mi_create_varobj_checked vla1_allocated vla1 "real\\\(kind=4\\\) \\\(5\\\)" \ ++mi_create_varobj_checked vla1_allocated vla1 "$real \\\(5\\\)" \ + "create local variable vla1_allocated" + mi_gdb_test "511-var-info-type vla1_allocated" \ +- "511\\^done,type=\"real\\\(kind=4\\\) \\\(5\\\)\"" \ ++ "511\\^done,type=\"$real \\\(5\\\)\"" \ + "info type variable vla1_allocated" + mi_gdb_test "512-var-show-format vla1_allocated" \ + "512\\^done,format=\"natural\"" \ +@@ -83,7 +88,7 @@ + "513\\^done,value=\"\\\[5\\\]\"" \ + "eval variable vla1_allocated" + mi_list_array_varobj_children_with_index "vla1_allocated" "5" "1" \ +- "real\\\(kind=4\\\)" "get children of vla1_allocated" ++ "$real" "get children of vla1_allocated" + + + set bp_lineno [gdb_get_line_number "vla1-filled"] +@@ -136,10 +141,10 @@ + -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\"" \ +@@ -148,7 +153,7 @@ + "583\\^done,value=\"\\\[0\\\]\"" \ + "eval variable pvla2_not_associated" + mi_list_array_varobj_children_with_index "pvla2_not_associated" "0" "1" \ +- "real\\\(kind=4\\\)" "get children of pvla2_not_associated" ++ "$real" "get children of pvla2_not_associated" + } + -re "580\\^error,msg=\"value contents too large \\(\[0-9\]+ bytes\\).*${mi_gdb_prompt}$" { + # Undefined behaviour in gfortran. +@@ -173,9 +178,9 @@ + "evaluate associated vla" + + mi_create_varobj_checked pvla2_associated pvla2 \ +- "real\\\(kind=4\\\) \\\(5,2\\\)" "create local variable pvla2_associated" ++ "$real \\\(5,2\\\)" "create local variable pvla2_associated" + mi_gdb_test "591-var-info-type pvla2_associated" \ +- "591\\^done,type=\"real\\\(kind=4\\\) \\\(5,2\\\)\"" \ ++ "591\\^done,type=\"$real \\\(5,2\\\)\"" \ + "info type variable pvla2_associated" + mi_gdb_test "592-var-show-format pvla2_associated" \ + "592\\^done,format=\"natural\"" \ +Index: gdb-7.11.90.20160907/gdb/typeprint.c +=================================================================== +--- gdb-7.11.90.20160907.orig/gdb/typeprint.c 2016-09-07 21:52:10.272563051 +0200 ++++ gdb-7.11.90.20160907/gdb/typeprint.c 2016-09-07 21:53:22.717210497 +0200 +@@ -485,6 +485,25 @@ + printf_filtered (" */\n"); + } + ++ /* Resolve any dynamic target type, as we might print ++ additional information about the target. ++ For example, in Fortran and C we are printing the dimension of the ++ dynamic array the pointer is pointing to. */ ++ if (TYPE_CODE (type) == TYPE_CODE_PTR ++ && is_dynamic_type (type) == 1) ++ { ++ CORE_ADDR addr; ++ if (NULL != TYPE_DATA_LOCATION (TYPE_TARGET_TYPE(type))) ++ addr = value_address (val); ++ else ++ addr = value_as_address (val); ++ ++ if (addr != 0 ++ && type_not_associated (type) == 0) ++ TYPE_TARGET_TYPE (type) = resolve_dynamic_type (TYPE_TARGET_TYPE (type), ++ NULL, addr); ++ } ++ + LA_PRINT_TYPE (type, "", gdb_stdout, show, 0, &flags); + printf_filtered ("\n"); + +Index: gdb-7.11.90.20160907/gdb/valops.c +=================================================================== +--- gdb-7.11.90.20160907.orig/gdb/valops.c 2016-09-07 21:52:53.707951238 +0200 ++++ gdb-7.11.90.20160907/gdb/valops.c 2016-09-07 21:53:22.717210497 +0200 +@@ -1562,6 +1562,19 @@ + if (TYPE_CODE (base_type) == TYPE_CODE_PTR) + { + struct type *enc_type; ++ CORE_ADDR addr; ++ ++ if (type_not_associated (base_type)) ++ error (_("Attempt to take contents of a not associated pointer.")); ++ ++ if (NULL != TYPE_DATA_LOCATION (TYPE_TARGET_TYPE (base_type))) ++ addr = value_address (arg1); ++ else ++ addr = value_as_address (arg1); ++ ++ if (addr != 0) ++ TYPE_TARGET_TYPE (base_type) = ++ resolve_dynamic_type (TYPE_TARGET_TYPE (base_type), NULL, addr); + + /* We may be pointing to something embedded in a larger object. + Get the real type of the enclosing object. */ +@@ -1577,8 +1590,7 @@ + else + /* Retrieve the enclosing object pointed to. */ + arg2 = value_at_lazy (enc_type, +- (value_as_address (arg1) +- - value_pointed_to_offset (arg1))); ++ (addr - value_pointed_to_offset (arg1))); + + enc_type = value_type (arg2); + return readjust_indirect_value_type (arg2, enc_type, base_type, arg1); +Index: gdb-7.11.90.20160907/gdb/valprint.c +=================================================================== +--- gdb-7.11.90.20160907.orig/gdb/valprint.c 2016-09-07 21:52:10.273563060 +0200 ++++ gdb-7.11.90.20160907/gdb/valprint.c 2016-09-07 21:53:22.718210506 +0200 +@@ -1141,12 +1141,6 @@ + return 0; + } + +- if (type_not_associated (value_type (val))) +- { +- val_print_not_associated (stream); +- return 0; +- } +- + if (type_not_allocated (value_type (val))) + { + val_print_not_allocated (stream); diff --git a/gdb-vla-intel-stringbt-fix.patch b/gdb-vla-intel-stringbt-fix.patch index 6bdb554..fc56139 100644 --- a/gdb-vla-intel-stringbt-fix.patch +++ b/gdb-vla-intel-stringbt-fix.patch @@ -27,30 +27,36 @@ cannot reproduce it. Thanks, Jan ---FCuugMFkClbJLl1L -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline; filename="vlastringonly.patch" - -Index: gdb-7.9.50.20150520/gdb/gdbtypes.c -=================================================================== ---- gdb-7.9.50.20150520.orig/gdb/gdbtypes.c 2015-05-31 16:14:04.164533833 +0200 -+++ gdb-7.9.50.20150520/gdb/gdbtypes.c 2015-05-31 16:14:05.844545344 +0200 -@@ -1851,6 +1851,7 @@ is_dynamic_type_internal (struct type *t - } +--- ./gdb/dwarf2loc.c 2016-08-29 04:01:25.000000000 +0200 ++++ ./gdb/dwarf2loc.c 2016-09-01 11:00:20.258909494 +0200 +@@ -2289,6 +2289,15 @@ const struct dwarf_expr_context_funcs dw + dwarf_expr_get_obj_addr + }; - case TYPE_CODE_ARRAY: -+ case TYPE_CODE_STRING: - { - gdb_assert (TYPE_NFIELDS (type) == 1); ++static void ++select_frame_cleanup (void *arg) ++{ ++ struct frame_info *frame = (struct frame_info *) arg; ++ ++ if (frame != NULL) ++ select_frame (frame); ++} ++ + /* Evaluate a location description, starting at DATA and with length + SIZE, to find the current location of variable of TYPE in the + context of FRAME. BYTE_OFFSET is applied after the contents are +@@ -2318,6 +2327,11 @@ dwarf2_evaluate_loc_desc_full (struct ty -@@ -2192,6 +2193,7 @@ resolve_dynamic_type_internal (struct ty - } - - case TYPE_CODE_ARRAY: -+ case TYPE_CODE_STRING: - resolved_type = resolve_dynamic_array (type, addr_stack); - break; + ctx = new_dwarf_expr_context (); + old_chain = make_cleanup_free_dwarf_expr_context (ctx); ++ ++ make_cleanup (select_frame_cleanup, deprecated_safe_get_selected_frame ()); ++ if (frame != NULL) ++ select_frame (frame); ++ + value_chain = make_cleanup_value_free_to_mark (value_mark ()); + ctx->gdbarch = get_objfile_arch (objfile); Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 diff --git a/gdb-vla-intel-tests.patch b/gdb-vla-intel-tests.patch new file mode 100644 index 0000000..ff43a60 --- /dev/null +++ b/gdb-vla-intel-tests.patch @@ -0,0 +1,293 @@ +Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.exp 2016-01-08 19:15:44.983637680 +0100 +@@ -0,0 +1,61 @@ ++# Copyright 2014 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++standard_testfile ".f90" ++ ++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ ++ {debug f90 quiet}] } { ++ return -1 ++} ++ ++if ![runto MAIN__] then { ++ perror "couldn't run to breakpoint MAIN__" ++ continue ++} ++ ++# Check VLA passed to first Fortran function. ++gdb_breakpoint [gdb_get_line_number "func1-vla-passed"] ++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\\\)" \ ++ "ptype vla (func1)" ++ ++gdb_breakpoint [gdb_get_line_number "func1-vla-modified"] ++gdb_continue_to_breakpoint "func1-vla-modified" ++gdb_test "print vla(5,5)" " = 55" "print vla(5,5) (func1)" ++gdb_test "print vla(7,7)" " = 77" "print vla(5,5) (func1)" ++ ++# Check if the values are correct after returning from func1 ++gdb_breakpoint [gdb_get_line_number "func1-returned"] ++gdb_continue_to_breakpoint "func1-returned" ++gdb_test "print ret" " = .TRUE." "print ret after func1 returned" ++ ++# Check VLA passed to second Fortran function ++gdb_breakpoint [gdb_get_line_number "func2-vla-passed"] ++gdb_continue_to_breakpoint "func2-vla-passed" ++gdb_test "print vla" \ ++ " = \\\(44, 44, 44, 44, 44, 44, 44, 44, 44, 44\\\)" \ ++ "print vla (func2)" ++gdb_test "ptype vla" "type = integer\\\(kind=4\\\) \\\(10\\\)" \ ++ "ptype vla (func2)" ++ ++# Check if the returned VLA has the correct values and ptype. ++gdb_breakpoint [gdb_get_line_number "func2-returned"] ++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\\\)" \ ++ "ptype vla3 (after func2)" +Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.f90 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.f90 2016-01-08 19:15:44.983637680 +0100 +@@ -0,0 +1,71 @@ ++! Copyright 2014 Free Software Foundation, Inc. ++! ++! This program is free software; you can redistribute it and/or modify ++! it under the terms of the GNU General Public License as published by ++! the Free Software Foundation; either version 2 of the License, or ++! (at your option) any later version. ++! ++! This program is distributed in the hope that it will be useful, ++! but WITHOUT ANY WARRANTY; without even the implied warranty of ++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++! GNU General Public License for more details. ++! ++! You should have received a copy of the GNU General Public License ++! along with this program; if not, write to the Free Software ++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++logical function func1 (vla) ++ implicit none ++ integer, allocatable :: vla (:, :) ++ func1 = allocated(vla) ++ vla(5,5) = 55 ! func1-vla-passed ++ vla(7,7) = 77 ++ return ! func1-vla-modified ++end function func1 ++ ++function func2(vla) ++ implicit none ++ integer :: vla (:) ++ integer :: func2(size(vla)) ++ integer :: k ++ ++ vla(1) = 1 ! func2-vla-passed ++ vla(2) = 2 ++ vla(4) = 4 ++ vla(8) = 8 ++ ++ func2 = vla ++end function func2 ++ ++program vla_func ++ implicit none ++ interface ++ logical function func1 (vla) ++ integer, allocatable :: vla (:, :) ++ end function ++ end interface ++ interface ++ function func2 (vla) ++ integer :: vla (:) ++ integer func2(size(vla)) ++ end function ++ end interface ++ ++ logical :: ret ++ integer, allocatable :: vla1 (:, :) ++ integer, allocatable :: vla2 (:) ++ integer, allocatable :: vla3 (:) ++ ++ ret = .FALSE. ++ ++ allocate (vla1 (10,10)) ++ vla1(:,:) = 22 ++ ++ allocate (vla2 (10)) ++ vla2(:) = 44 ++ ++ ret = func1(vla1) ++ vla3 = func2(vla2) ! func1-returned ++ ++ ret = .TRUE. ! func2-returned ++end program vla_func +Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stringsold.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stringsold.exp 2016-01-08 19:15:44.984637686 +0100 +@@ -0,0 +1,101 @@ ++# Copyright 2014 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++standard_testfile ".f90" ++ ++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ ++ {debug f90 quiet}] } { ++ return -1 ++} ++ ++# check that all fortran standard datatypes will be ++# handled correctly when using as VLA's ++ ++if ![runto MAIN__] then { ++ perror "couldn't run to breakpoint MAIN__" ++ continue ++} ++ ++gdb_breakpoint [gdb_get_line_number "var_char-allocated-1"] ++gdb_continue_to_breakpoint "var_char-allocated-1" ++gdb_test "print var_char" \ ++ " = \\(PTR TO -> \\( character\\*10 \\)\\) ${hex}" \ ++ "print var_char after allocated first time" ++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*10 \\)" \ ++ "whatis var_char first time" ++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*10 \\)" \ ++ "ptype var_char first time" ++gdb_test "next" "\\d+.*var_char = 'foo'.*" \ ++ "next to allocation status of var_char" ++gdb_test "print l" " = .TRUE." "print allocation status first time" ++ ++gdb_breakpoint [gdb_get_line_number "var_char-filled-1"] ++gdb_continue_to_breakpoint "var_char-filled-1" ++gdb_test "print var_char" \ ++ " = \\(PTR TO -> \\( character\\*3 \\)\\) ${hex}" \ ++ "print var_char after filled first time" ++gdb_test "print *var_char" " = 'foo'" \ ++ "print *var_char after filled first time" ++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*3 \\)" \ ++ "whatis var_char after filled first time" ++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*3 \\)" \ ++ "ptype var_char after filled first time" ++gdb_test "print var_char(1)" " = 102 'f'" "print var_char(1)" ++gdb_test "print var_char(3)" " = 111 'o'" "print var_char(3)" ++ ++gdb_breakpoint [gdb_get_line_number "var_char-filled-2"] ++gdb_continue_to_breakpoint "var_char-filled-2" ++gdb_test "print var_char" \ ++ " = \\(PTR TO -> \\( character\\*6 \\)\\) ${hex}" \ ++ "print var_char after allocated second time" ++gdb_test "print *var_char" " = 'foobar'" \ ++ "print *var_char after allocated second time" ++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*6 \\)" \ ++ "whatis var_char second time" ++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*6 \\)" \ ++ "ptype var_char second time" ++ ++gdb_breakpoint [gdb_get_line_number "var_char-empty"] ++gdb_continue_to_breakpoint "var_char-empty" ++gdb_test "print var_char" \ ++ " = \\(PTR TO -> \\( character\\*0 \\)\\) ${hex}" \ ++ "print var_char after set empty" ++gdb_test "print *var_char" " = \"\"" "print *var_char after set empty" ++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*0 \\)" \ ++ "whatis var_char after set empty" ++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*0 \\)" \ ++ "ptype var_char after set empty" ++ ++gdb_breakpoint [gdb_get_line_number "var_char-allocated-3"] ++gdb_continue_to_breakpoint "var_char-allocated-3" ++gdb_test "print var_char" \ ++ " = \\(PTR TO -> \\( character\\*21 \\)\\) ${hex}" \ ++ "print var_char after allocated third time" ++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*21 \\)" \ ++ "whatis var_char after allocated third time" ++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*21 \\)" \ ++ "ptype var_char after allocated third time" ++ ++gdb_breakpoint [gdb_get_line_number "var_char_p-associated"] ++gdb_continue_to_breakpoint "var_char_p-associated" ++gdb_test "print var_char_p" \ ++ " = \\(PTR TO -> \\( character\\*7 \\)\\) ${hex}" \ ++ "print var_char_p after associated" ++gdb_test "print *var_char_p" " = 'johndoe'" \ ++ "print *var_char_ after associated" ++gdb_test "whatis var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \ ++ "whatis var_char_p after associated" ++gdb_test "ptype var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \ ++ "ptype var_char_p after associated" +Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stringsold.f90 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stringsold.f90 2016-01-08 19:15:44.984637686 +0100 +@@ -0,0 +1,40 @@ ++! Copyright 2014 Free Software Foundation, Inc. ++! ++! This program is free software; you can redistribute it and/or modify ++! it under the terms of the GNU General Public License as published by ++! the Free Software Foundation; either version 2 of the License, or ++! (at your option) any later version. ++! ++! This program is distributed in the hope that it will be useful, ++! but WITHOUT ANY WARRANTY; without even the implied warranty of ++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++! GNU General Public License for more details. ++! ++! You should have received a copy of the GNU General Public License ++! along with this program; if not, write to the Free Software ++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++program vla_strings ++ character(len=:), target, allocatable :: var_char ++ character(len=:), pointer :: var_char_p ++ logical :: l ++ ++ allocate(character(len=10) :: var_char) ++ l = allocated(var_char) ! var_char-allocated-1 ++ var_char = 'foo' ++ deallocate(var_char) ! var_char-filled-1 ++ l = allocated(var_char) ! var_char-deallocated ++ allocate(character(len=42) :: var_char) ++ l = allocated(var_char) ++ var_char = 'foobar' ++ var_char = '' ! var_char-filled-2 ++ var_char = 'bar' ! var_char-empty ++ deallocate(var_char) ++ allocate(character(len=21) :: var_char) ++ l = allocated(var_char) ! var_char-allocated-3 ++ var_char = 'johndoe' ++ var_char_p => var_char ++ l = associated(var_char_p) ! var_char_p-associated ++ var_char_p => null() ++ l = associated(var_char_p) ! var_char_p-not-associated ++end program vla_strings diff --git a/gdb.changes b/gdb.changes index b0197b5..1e4f889 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,46 @@ +------------------------------------------------------------------- +Wed Feb 15 15:55:11 UTC 2017 - matz@suse.com + +- Update to gdb 7.12.1 + * negative repeat count for x examines backwards + * fortran: support structs/arrays with dynamically types fields + * support MPX bound checking + * support for the Rust language + * 'catch syscall' now can catch groups of related syscalls + * New (sub)commands: + - skip {-file,-gfile,-function,-rfunction}: generic skip + mechanism + - maint {selftest,info line-table} + - new-ui: create new user interface for GUI clients + * (fast) tracepoints on s390x and ppc64le added to gdbserver + * New target Andes NDS32 +- Remove patch gdb-aarch64-v81-hwbreakpoints.diff (upstream) +- Add patches from Fedora package: + gdb-6.7-testsuite-stable-results.patch + gdb-add-index-chmod.patch + gdb-bison-old.patch + gdb-container-rh-pkg.patch + gdb-libexec-add-index.patch + gdb-linux_perf-bundle.patch + gdb-physname-pr11734-test.patch + gdb-physname-pr12273-test.patch + gdb-rhbz1007614-memleak-infpy_read_memory-test.patch + gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch + gdb-rhbz1149205-catch-syscall-after-fork-test.patch + gdb-rhbz1156192-recursive-dlopen-test.patch + gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch + gdb-rhbz1350436-type-printers-error.patch + gdb-test-ivy-bridge.patch + gdb-testsuite-casts.patch + gdb-testsuite-m-static.patch + gdb-testsuite-morestack-gold.patch + gdb-tls-1of2.patch + gdb-tls-2of2.patch + gdb-upstream.patch + gdb-vla-intel-fortran-strides.patch + gdb-vla-intel-fortran-vla-strings.patch + gdb-vla-intel-tests.patch + ------------------------------------------------------------------- Mon Jan 9 15:37:41 UTC 2017 - matz@suse.com diff --git a/gdb.spec b/gdb.spec index e17f743..79cc46d 100644 --- a/gdb.spec +++ b/gdb.spec @@ -24,10 +24,7 @@ License: GPL-3.0+ and GPL-3.0-with-GCC-exception and LGPL-2.1+ and LGPL-3 Group: Development/Tools/Debuggers Name: gdb -%global snap 20130731 -# See timestamp of source gnulib installed into gdb/gnulib/ . -%global snapgnulib 20121213 -Version: 7.11.1 +Version: 7.12.1 Release: 0 # The release always contains a leading reserved number, start it at 1. @@ -78,7 +75,7 @@ Source3: gdb-gstack.man Source4: gdbinit # libstdc++ pretty printers from GCC SVN HEAD (4.5 experimental). -%global libstdcxxpython gdb-libstdc++-v3-python-r225521 +%global libstdcxxpython gdb-libstdc++-v3-python-6.3.1-20170212 Source5: %{libstdcxxpython}.tar.bz2 # Provide gdbtui for RHEL-5 and RHEL-6 as it is removed upstream (BZ 797664). @@ -92,128 +89,139 @@ Source13: gdb-rpmlintrc #Fedora Packages begin Patch1: gdb-6.3-rh-testversion-20041202.patch -Patch2: gdb-archer.patch -Patch3: gdb-fortran-stride-intel-1of6.patch -Patch4: gdb-fortran-stride-intel-2of6.patch -Patch5: gdb-fortran-stride-intel-3of6.patch -Patch6: gdb-fortran-stride-intel-4of6.patch -Patch7: gdb-fortran-stride-intel-5of6.patch -Patch8: gdb-fortran-stride-intel-6of6.patch -Patch9: gdb-vla-intel.patch -Patch10: gdb-vla-intel-logical-not.patch -Patch11: gdb-vla-intel-stringbt-fix.patch -Patch12: gdb-vla-intel-04of23-fix.patch -Patch13: gdb-6.3-rh-dummykfail-20041202.patch -Patch14: gdb-6.3-ppc64syscall-20040622.patch -Patch15: gdb-6.3-ppc64displaysymbol-20041124.patch -Patch16: gdb-6.3-gstack-20050411.patch -Patch17: gdb-6.3-test-pie-20050107.patch -Patch18: gdb-6.3-test-self-20050110.patch -Patch19: gdb-6.3-test-dtorfix-20050121.patch -Patch20: gdb-6.3-test-movedir-20050125.patch -Patch21: gdb-6.3-threaded-watchpoints2-20050225.patch -Patch22: gdb-6.3-inferior-notification-20050721.patch -Patch23: gdb-6.3-inheritancetest-20050726.patch -Patch24: gdb-6.3-readnever-20050907.patch -Patch25: gdb-6.5-bz203661-emit-relocs.patch -Patch26: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch -Patch27: gdb-6.5-sharedlibrary-path.patch -Patch28: gdb-6.5-BEA-testsuite.patch -Patch29: gdb-6.5-last-address-space-byte-test.patch -Patch30: gdb-6.5-readline-long-line-crash-test.patch -Patch31: gdb-6.5-bz216711-clone-is-outermost.patch -Patch32: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch -Patch33: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch -Patch34: gdb-6.5-bz109921-DW_AT_decl_file-test.patch -Patch35: gdb-6.3-bz140532-ppc-unwinding-test.patch -Patch36: gdb-6.3-bz202689-exec-from-pthread-test.patch -Patch37: gdb-6.6-bz230000-power6-disassembly-test.patch -Patch38: gdb-6.6-bz229517-gcore-without-terminal.patch -Patch39: gdb-6.6-bz235197-fork-detach-info.patch -Patch40: gdb-6.6-testsuite-timeouts.patch -Patch41: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch -Patch42: gdb-6.6-scheduler_locking-step-is-default.patch -Patch43: gdb-6.3-attach-see-vdso-test.patch -Patch44: gdb-6.5-bz243845-stale-testing-zombie-test.patch -Patch45: gdb-6.6-buildid-locate.patch -Patch46: gdb-6.6-buildid-locate-solib-missing-ids.patch -Patch47: gdb-6.6-buildid-locate-rpm.patch -Patch48: gdb-6.7-charsign-test.patch -Patch49: gdb-6.7-ppc-clobbered-registers-O2-test.patch -Patch50: gdb-6.5-ia64-libunwind-leak-test.patch -Patch51: gdb-6.5-missed-trap-on-step-test.patch -Patch52: gdb-6.7-bz426600-DW_TAG_interface_type-test.patch -Patch53: gdb-6.5-gcore-buffer-limit-test.patch -Patch54: gdb-6.6-threads-static-test.patch -Patch55: gdb-6.3-mapping-zero-inode-test.patch -Patch56: gdb-6.3-focus-cmd-prev-test.patch -Patch57: gdb-6.8-bz442765-threaded-exec-test.patch -Patch58: gdb-6.8-sparc64-silence-memcpy-check.patch -Patch59: gdb-6.5-section-num-fixup-test.patch -Patch60: gdb-6.8-bz436037-reg-no-longer-active.patch -Patch61: gdb-6.8-watchpoint-conditionals-test.patch -Patch62: gdb-6.8-bz466901-backtrace-full-prelinked.patch -Patch63: gdb-simultaneous-step-resume-breakpoint-test.patch -Patch64: gdb-core-open-vdso-warning.patch -Patch65: gdb-x86_64-i386-syscall-restart.patch -Patch66: gdb-bz533176-fortran-omp-step.patch -Patch67: gdb-follow-child-stale-parent.patch -Patch68: gdb-ccache-workaround.patch -Patch69: gdb-archer-pie-addons.patch -Patch70: gdb-archer-pie-addons-keep-disabled.patch -Patch71: gdb-lineno-makeup-test.patch -Patch72: gdb-ppc-power7-test.patch -Patch73: gdb-bz541866-rwatch-before-run.patch -Patch74: gdb-moribund-utrace-workaround.patch -Patch75: gdb-archer-next-over-throw-cxx-exec.patch -Patch76: gdb-bz601887-dwarf4-rh-test.patch -Patch77: gdb-6.6-buildid-locate-core-as-arg.patch -Patch78: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch -Patch79: gdb-test-bt-cfi-without-die.patch -Patch80: gdb-gdb-add-index-script.patch -Patch81: gdb-bz568248-oom-is-error.patch -Patch82: gdb-bz634108-solib_address.patch -Patch83: gdb-test-pid0-core.patch -Patch84: gdb-test-dw2-aranges.patch -Patch85: gdb-test-expr-cumulative-archer.patch -Patch86: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch -Patch87: gdb-glibc-vdso-workaround.patch -Patch88: gdb-runtest-pie-override.patch -Patch89: gdb-attach-fail-reasons-5of5.patch -Patch90: gdb-stale-frame_info.patch -Patch91: gdb-glibc-strstr-workaround.patch -Patch92: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch -Patch93: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch94: gdb-rhbz795424-bitpos-20of25.patch -Patch95: gdb-rhbz795424-bitpos-21of25.patch -Patch96: gdb-rhbz795424-bitpos-22of25.patch -Patch97: gdb-rhbz795424-bitpos-23of25.patch -Patch98: gdb-rhbz795424-bitpos-25of25.patch -Patch99: gdb-rhbz795424-bitpos-25of25-test.patch -Patch100: gdb-rhbz795424-bitpos-lazyvalue.patch -Patch101: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch -Patch102: gdb-gnat-dwarf-crash-3of3.patch -Patch103: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch -Patch104: gdb-archer-vla-tests.patch -Patch105: gdb-fortran-stride-intel-6of6-nokfail.patch -Patch106: gdb-btrobust.patch -Patch107: gdb-fortran-frame-string.patch -Patch108: gdb-python-gil.patch +Patch2: gdb-upstream.patch +Patch3: gdb-archer.patch +Patch4: gdb-vla-intel-fortran-strides.patch +Patch5: gdb-vla-intel-fortran-vla-strings.patch +Patch6: gdb-vla-intel-stringbt-fix.patch +Patch7: gdb-6.3-rh-dummykfail-20041202.patch +Patch8: gdb-6.3-ppc64syscall-20040622.patch +Patch9: gdb-6.3-ppc64displaysymbol-20041124.patch +Patch10: gdb-6.3-gstack-20050411.patch +Patch11: gdb-6.3-test-pie-20050107.patch +Patch12: gdb-6.3-test-self-20050110.patch +Patch13: gdb-6.3-test-dtorfix-20050121.patch +Patch14: gdb-6.3-test-movedir-20050125.patch +Patch15: gdb-6.3-threaded-watchpoints2-20050225.patch +Patch16: gdb-6.3-inferior-notification-20050721.patch +Patch17: gdb-6.3-inheritancetest-20050726.patch +Patch18: gdb-6.3-readnever-20050907.patch +Patch19: gdb-6.5-bz203661-emit-relocs.patch +Patch20: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +Patch21: gdb-6.5-sharedlibrary-path.patch +Patch22: gdb-6.5-BEA-testsuite.patch +Patch23: gdb-6.5-last-address-space-byte-test.patch +Patch24: gdb-6.5-readline-long-line-crash-test.patch +Patch25: gdb-6.5-bz216711-clone-is-outermost.patch +Patch26: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch +Patch27: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch +Patch28: gdb-6.5-bz109921-DW_AT_decl_file-test.patch +Patch29: gdb-6.3-bz140532-ppc-unwinding-test.patch +Patch30: gdb-6.3-bz202689-exec-from-pthread-test.patch +Patch31: gdb-6.6-bz230000-power6-disassembly-test.patch +Patch32: gdb-6.6-bz229517-gcore-without-terminal.patch +Patch33: gdb-6.6-bz235197-fork-detach-info.patch +Patch34: gdb-6.6-testsuite-timeouts.patch +Patch35: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch +Patch36: gdb-6.6-scheduler_locking-step-is-default.patch +Patch37: gdb-6.3-attach-see-vdso-test.patch +Patch38: gdb-6.5-bz243845-stale-testing-zombie-test.patch +Patch39: gdb-6.6-buildid-locate.patch +Patch40: gdb-6.6-buildid-locate-solib-missing-ids.patch +Patch41: gdb-6.6-buildid-locate-rpm.patch +Patch42: gdb-6.7-charsign-test.patch +Patch43: gdb-6.7-ppc-clobbered-registers-O2-test.patch +Patch44: gdb-6.7-testsuite-stable-results.patch +Patch45: gdb-6.5-ia64-libunwind-leak-test.patch +Patch46: gdb-6.5-missed-trap-on-step-test.patch +Patch47: gdb-6.7-bz426600-DW_TAG_interface_type-test.patch +Patch48: gdb-6.5-gcore-buffer-limit-test.patch +Patch49: gdb-6.6-threads-static-test.patch +Patch50: gdb-6.3-mapping-zero-inode-test.patch +Patch51: gdb-6.3-focus-cmd-prev-test.patch +Patch52: gdb-6.8-bz442765-threaded-exec-test.patch +Patch53: gdb-6.8-sparc64-silence-memcpy-check.patch +Patch54: gdb-6.5-section-num-fixup-test.patch +Patch55: gdb-6.8-bz436037-reg-no-longer-active.patch +Patch56: gdb-6.8-watchpoint-conditionals-test.patch +Patch57: gdb-6.8-bz466901-backtrace-full-prelinked.patch +Patch58: gdb-simultaneous-step-resume-breakpoint-test.patch +Patch59: gdb-core-open-vdso-warning.patch +Patch60: gdb-x86_64-i386-syscall-restart.patch +Patch61: gdb-bz533176-fortran-omp-step.patch +Patch62: gdb-follow-child-stale-parent.patch +Patch63: gdb-ccache-workaround.patch +Patch64: gdb-archer-pie-addons.patch +Patch65: gdb-archer-pie-addons-keep-disabled.patch +Patch66: gdb-lineno-makeup-test.patch +Patch67: gdb-ppc-power7-test.patch +Patch68: gdb-bz541866-rwatch-before-run.patch +Patch69: gdb-moribund-utrace-workaround.patch +Patch70: gdb-archer-next-over-throw-cxx-exec.patch +Patch71: gdb-bz601887-dwarf4-rh-test.patch +Patch72: gdb-6.6-buildid-locate-core-as-arg.patch +Patch73: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +Patch74: gdb-test-bt-cfi-without-die.patch +Patch75: gdb-gdb-add-index-script.patch +Patch76: gdb-bz568248-oom-is-error.patch +Patch77: gdb-bz634108-solib_address.patch +Patch78: gdb-test-pid0-core.patch +Patch79: gdb-test-dw2-aranges.patch +Patch80: gdb-test-expr-cumulative-archer.patch +Patch81: gdb-physname-pr11734-test.patch +Patch82: gdb-physname-pr12273-test.patch +Patch83: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch +Patch84: gdb-test-ivy-bridge.patch +Patch85: gdb-glibc-vdso-workaround.patch +Patch86: gdb-runtest-pie-override.patch +Patch87: gdb-attach-fail-reasons-5of5.patch +Patch88: gdb-stale-frame_info.patch +Patch89: gdb-glibc-strstr-workaround.patch +Patch90: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch +Patch91: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch92: gdb-rhbz795424-bitpos-20of25.patch +Patch93: gdb-rhbz795424-bitpos-21of25.patch +Patch94: gdb-rhbz795424-bitpos-22of25.patch +Patch95: gdb-rhbz795424-bitpos-23of25.patch +Patch96: gdb-rhbz795424-bitpos-25of25.patch +Patch97: gdb-rhbz795424-bitpos-25of25-test.patch +Patch98: gdb-rhbz795424-bitpos-lazyvalue.patch +Patch99: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +Patch100: gdb-gnat-dwarf-crash-3of3.patch +Patch101: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +Patch102: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch +Patch103: gdb-archer-vla-tests.patch +Patch104: gdb-vla-intel-tests.patch +Patch105: gdb-btrobust.patch +Patch106: gdb-fortran-frame-string.patch +Patch107: gdb-python-gil.patch +Patch108: gdb-rhbz1156192-recursive-dlopen-test.patch Patch109: gdb-jit-reader-multilib.patch -Patch110: gdb-bz1219747-attach-kills.patch -Patch111: gdb-fedora-libncursesw.patch -Patch112: gdb-opcodes-clflushopt-test.patch -Patch113: gdb-dts-rhel6-python-compat.patch -Patch114: gdb-6.6-buildid-locate-rpm-scl.patch -Patch115: gdb-readline62-ask-more-rh.patch -Patch116: gdb-6.8-attach-signalled-detach-stopped.patch -Patch117: gdb-6.8-quit-never-aborts.patch -Patch118: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch120: gdb-testsuite-dw2-undefined-ret-addr.patch -Patch121: gdb-rhbz1325795-framefilters-test.patch -Patch122: gdb-bare-DW_TAG_lexical_block-1of2.patch -Patch123: gdb-bare-DW_TAG_lexical_block-2of2.patch -Patch124: gdb-testsuite-readline63-sigint.patch +Patch110: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch111: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch +Patch112: gdb-rhbz1350436-type-printers-error.patch +Patch113: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch114: gdb-bz1219747-attach-kills.patch +Patch115: gdb-fedora-libncursesw.patch +Patch116: gdb-opcodes-clflushopt-test.patch +Patch117: gdb-dts-rhel6-python-compat.patch +Patch118: gdb-6.6-buildid-locate-rpm-scl.patch +Patch119: gdb-readline62-ask-more-rh.patch +Patch120: gdb-6.8-attach-signalled-detach-stopped.patch +Patch121: gdb-6.8-quit-never-aborts.patch +Patch122: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch123: gdb-container-rh-pkg.patch +Patch124: gdb-rhbz1325795-framefilters-test.patch +Patch125: gdb-linux_perf-bundle.patch +Patch126: gdb-bison-old.patch +Patch127: gdb-testsuite-casts.patch +Patch128: gdb-testsuite-m-static.patch +Patch129: gdb-tls-1of2.patch +Patch130: gdb-tls-2of2.patch +Patch131: gdb-testsuite-morestack-gold.patch +Patch132: gdb-libexec-add-index.patch +Patch133: gdb-add-index-chmod.patch +Patch134: gdb-testsuite-readline63-sigint.patch #Fedora Packages end # Upstream patch to fix gcc -Werror @@ -221,7 +229,6 @@ Patch1002: gdb-6.6-buildid-locate-rpm-suse.patch Patch1003: gdb-pahole-python2.patch Patch1004: gdb-fix-buf-overflow.diff Patch1005: gdb-7.10-swo18929.patch -Patch1006: gdb-aarch64-v81-hwbreakpoints.diff BuildRequires: bison BuildRequires: flex @@ -291,7 +298,7 @@ BuildRequires: gcc-ada BuildRequires: gcc-ada %endif %endif -%if ! (0%{?is_opensuse} && %_arch == "s390x" ) +%if ! (0%{?is_opensuse} && %_target_cpu == "s390x" ) # openSUSE for s390x doesn't build 32bit libs %if 0%{suse_version} > 1110 %ifarch x86_64 ppc64 s390x @@ -498,18 +505,28 @@ find -name "*.info*"|xargs rm -f %patch116 -p1 %patch117 -p1 %patch118 -p1 +%patch119 -p1 %patch120 -p1 %patch121 -p1 %patch122 -p1 %patch123 -p1 %patch124 -p1 +%patch125 -p1 +%patch126 -p1 +%patch127 -p1 +%patch128 -p1 +%patch129 -p1 +%patch130 -p1 +%patch131 -p1 +%patch132 -p1 +%patch133 -p1 +%patch134 -p1 #Fedora patching end %patch1002 -p1 %patch1003 -p1 %patch1004 -p1 %patch1005 -p1 -%patch1006 -p1 find -name "*.orig" | xargs rm -f ! find -name "*.rej" # Should not happen.