]> git.pld-linux.org Git - packages/gdb.git/commitdiff
- up to 8.2 auto/th/gdb-8.2-1
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Thu, 4 Oct 2018 15:45:27 +0000 (17:45 +0200)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Thu, 4 Oct 2018 15:45:27 +0000 (17:45 +0200)
16 files changed:
gdb-6.3-gstack-20050411.patch
gdb-6.6-buildid-locate-core-as-arg.patch
gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
gdb-6.6-buildid-locate-rpm-scl.patch
gdb-6.6-buildid-locate-rpm.patch
gdb-6.6-buildid-locate-solib-missing-ids.patch
gdb-6.6-buildid-locate.patch
gdb-archer-vla-tests.patch
gdb-gdb-add-index-script.patch [deleted file]
gdb-readline.patch
gdb-vla-intel-fortran-strides.patch
gdb-vla-intel-fortran-vla-strings.patch
gdb-vla-intel-stringbt-fix.patch
gdb-vla-intel-tests.patch
gdb.spec

index 361950406b0ec8159433e4f8549736550d8e9e85..37b09de089ba3a0fc18bb59967868b6143684ff7 100644 (file)
@@ -3,8 +3,6 @@ From: Andrew Cagney <cagney@gnu.org>
 Date: Fri, 27 Oct 2017 21:07:50 +0200
 Subject: gdb-6.3-gstack-20050411.patch
 
-FileName: gdb-6.3-gstack-20050411.patch
-
 ;; Add a wrapper script to GDB that implements pstack using the
 ;; --readnever option.
 ;;=push
@@ -14,21 +12,11 @@ FileName: gdb-6.3-gstack-20050411.patch
        * Makefile.in (uninstall-gstack, install-gstack): New rules, add
        to install and uninstall.
        * gstack.sh, gstack.1: New files.
----
- gdb/Makefile.in                   | 34 ++++++++++++++++++--
- gdb/gstack.sh                     | 43 +++++++++++++++++++++++++
- gdb/testsuite/gdb.base/gstack.c   | 43 +++++++++++++++++++++++++
- gdb/testsuite/gdb.base/gstack.exp | 66 +++++++++++++++++++++++++++++++++++++++
- 4 files changed, 184 insertions(+), 2 deletions(-)
- create mode 100644 gdb/gstack.sh
- create mode 100644 gdb/testsuite/gdb.base/gstack.c
- create mode 100644 gdb/testsuite/gdb.base/gstack.exp
 
 diff --git a/gdb/Makefile.in b/gdb/Makefile.in
-index 17b71c6e7c..e77d6a5c03 100644
 --- a/gdb/Makefile.in
 +++ b/gdb/Makefile.in
-@@ -1744,7 +1744,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
+@@ -1735,7 +1735,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
  install: all
        @$(MAKE) $(FLAGS_TO_PASS) install-only
  
@@ -85,7 +73,6 @@ index 17b71c6e7c..e77d6a5c03 100644
        $(COMPILE) -DTEST_CPNAMES cp-name-parser.c
 diff --git a/gdb/gstack.sh b/gdb/gstack.sh
 new file mode 100644
-index 0000000000..f7f07248f7
 --- /dev/null
 +++ b/gdb/gstack.sh
 @@ -0,0 +1,43 @@
@@ -134,7 +121,6 @@ index 0000000000..f7f07248f7
 +    -e '/^Thread/p'
 diff --git a/gdb/testsuite/gdb.base/gstack.c b/gdb/testsuite/gdb.base/gstack.c
 new file mode 100644
-index 0000000000..dc10813f04
 --- /dev/null
 +++ b/gdb/testsuite/gdb.base/gstack.c
 @@ -0,0 +1,43 @@
@@ -183,7 +169,6 @@ index 0000000000..dc10813f04
 +}
 diff --git a/gdb/testsuite/gdb.base/gstack.exp b/gdb/testsuite/gdb.base/gstack.exp
 new file mode 100644
-index 0000000000..1186ec57bc
 --- /dev/null
 +++ b/gdb/testsuite/gdb.base/gstack.exp
 @@ -0,0 +1,66 @@
@@ -253,6 +238,3 @@ index 0000000000..1186ec57bc
 +gdb_exit
 +
 +remote_exec host "kill -9 $pid"
--- 
-2.14.3
-
index 5d9792a86d61e3e12611746b4ad6da2be89d4246..40938a540ed7fb45342ffc2b499f7b44a70f2b9b 100644 (file)
@@ -1,9 +1,7 @@
 From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
 From: Fedora GDB patches <invalid@email.com>
 Date: Fri, 27 Oct 2017 21:07:50 +0200
-Subject: print a more useful error message for "gdb core"
-
-FileName: gdb-6.6-buildid-locate-core-as-arg.patch
+Subject: gdb-6.6-buildid-locate-core-as-arg.patch
 
 ;;=push+jan
 
@@ -62,14 +60,8 @@ Http://sourceware.org/ml/gdb-patches/2010-01/msg00517.html
 
        * exec.c (exec_file_attach): Print a more useful error message if the
        user did "gdb core".
----
- gdb/common/common-exceptions.h |  3 +++
- gdb/exec.c                     | 22 +++++++++++++++---
- gdb/main.c                     | 53 +++++++++++++++++++++++++++++++++++++++---
- 3 files changed, 72 insertions(+), 6 deletions(-)
 
 diff --git a/gdb/common/common-exceptions.h b/gdb/common/common-exceptions.h
-index 15c85e28ab..9fe2375bce 100644
 --- a/gdb/common/common-exceptions.h
 +++ b/gdb/common/common-exceptions.h
 @@ -104,6 +104,9 @@ enum errors {
@@ -83,18 +75,17 @@ index 15c85e28ab..9fe2375bce 100644
    NR_ERRORS
  };
 diff --git a/gdb/exec.c b/gdb/exec.c
-index c8c32ecc27..b329e2b834 100644
 --- a/gdb/exec.c
 +++ b/gdb/exec.c
-@@ -35,6 +35,7 @@
- #include "progspace.h"
+@@ -36,6 +36,7 @@
  #include "gdb_bfd.h"
  #include "gcore.h"
+ #include "source.h"
 +#include "exceptions.h"
  
  #include <fcntl.h>
  #include "readline/readline.h"
-@@ -346,12 +347,27 @@ exec_file_attach (const char *filename, int from_tty)
+@@ -357,12 +358,27 @@ exec_file_attach (const char *filename, int from_tty)
  
        if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
        {
@@ -126,10 +117,9 @@ index c8c32ecc27..b329e2b834 100644
  
        if (build_section_table (exec_bfd, &sections, &sections_end))
 diff --git a/gdb/main.c b/gdb/main.c
-index 3c98787edb..17d35f4a8a 100644
 --- a/gdb/main.c
 +++ b/gdb/main.c
-@@ -446,6 +446,37 @@ struct cmdarg
+@@ -447,6 +447,37 @@ struct cmdarg
    char *string;
  };
  
@@ -167,7 +157,7 @@ index 3c98787edb..17d35f4a8a 100644
  static void
  captured_main_1 (struct captured_main_args *context)
  {
-@@ -882,6 +913,8 @@ captured_main_1 (struct captured_main_args *context)
+@@ -883,6 +914,8 @@ captured_main_1 (struct captured_main_args *context)
        {
          symarg = argv[optind];
          execarg = argv[optind];
@@ -176,7 +166,7 @@ index 3c98787edb..17d35f4a8a 100644
          optind++;
        }
  
-@@ -1032,11 +1065,25 @@ captured_main_1 (struct captured_main_args *context)
+@@ -1033,11 +1066,25 @@ captured_main_1 (struct captured_main_args *context)
        && symarg != NULL
        && strcmp (execarg, symarg) == 0)
      {
@@ -205,6 +195,3 @@ index 3c98787edb..17d35f4a8a 100644
        catch_command_errors (symbol_file_add_main_adapter, symarg,
                              !batch_flag);
      }
--- 
-2.14.3
-
index f228577d694cec999fcdede955f9755720b1f8c7..a25057ec30d85c4094a6975a257409d0a59dbc1e 100644 (file)
@@ -4,8 +4,6 @@ Date: Fri, 27 Oct 2017 21:07:50 +0200
 Subject: 
  gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
 
-FileName: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
-
 ;; Fix 'gdb gives highly misleading error when debuginfo pkg is present,
 ;; but not corresponding binary pkg' (RH BZ 981154).
 ;;=push+jan
@@ -26,17 +24,11 @@ Comments by Sergio Durigan Junior <sergiodj@redhat.com>:
   and had a little thinko there.  The variable 'filename' needs to be set to
   NULL after it is free'd, otherwise the code below thinks that it is still
   valid and doesn't print the necessary warning ("Try: yum install ...").
----
- gdb/build-id.c                                     |  5 +-
- .../rhbz981154-misleading-yum-install-warning.exp  | 97 ++++++++++++++++++++++
- 2 files changed, 101 insertions(+), 1 deletion(-)
- create mode 100644 gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
 
 diff --git a/gdb/build-id.c b/gdb/build-id.c
-index 409a5b8c54..e2c1e81266 100644
 --- a/gdb/build-id.c
 +++ b/gdb/build-id.c
-@@ -592,7 +592,10 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id,
+@@ -581,7 +581,10 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id,
          do_cleanups (inner);
  
          if (abfd == NULL)
@@ -50,7 +42,6 @@ index 409a5b8c54..e2c1e81266 100644
            break;
 diff --git a/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
 new file mode 100644
-index 0000000000..bb70c5cf44
 --- /dev/null
 +++ b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
 @@ -0,0 +1,97 @@
@@ -151,6 +142,3 @@ index 0000000000..bb70c5cf44
 +
 +# Leaving the link there will cause breakage in the next run.
 +remote_exec build "rm -f [standard_output_file ${build_id_without_debug}]"
--- 
-2.14.3
-
index b94cc1f271a26df3b680209e0c6be1b1890b66ce..375b1780c9fef8100092f63593f8989ee6cba423 100644 (file)
@@ -3,20 +3,13 @@ From: Fedora GDB patches <invalid@email.com>
 Date: Fri, 27 Oct 2017 21:07:50 +0200
 Subject: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
 
-FileName: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
-
 ;; Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879).
 ;;=push+jan
----
- gdb/build-id.c        | 13 +++++++++++++
- gdb/proc-service.list |  3 +++
- 2 files changed, 16 insertions(+)
 
 diff --git a/gdb/build-id.c b/gdb/build-id.c
-index d60cf622dc..409a5b8c54 100644
 --- a/gdb/build-id.c
 +++ b/gdb/build-id.c
-@@ -678,6 +678,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
+@@ -652,6 +652,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
  #include <dlfcn.h>
  #endif
  
@@ -37,7 +30,6 @@ index d60cf622dc..409a5b8c54 100644
     and avoid their duplicities during a single inferior run.  */
  
 diff --git a/gdb/proc-service.list b/gdb/proc-service.list
-index 53f7ed8b1e..323f5e83c2 100644
 --- a/gdb/proc-service.list
 +++ b/gdb/proc-service.list
 @@ -37,4 +37,7 @@
@@ -48,6 +40,3 @@ index 53f7ed8b1e..323f5e83c2 100644
 +  /* gdb-6.6-buildid-locate-rpm.patch */
 +  rpmsqEnable;
  };
--- 
-2.14.3
-
index 9200bab22e8549c71cf37d8b4656148a113ecc6b..7e3948857c44b7332f323080ace16b7c8c021905 100644 (file)
@@ -3,23 +3,16 @@ From: Fedora GDB patches <invalid@email.com>
 Date: Fri, 27 Oct 2017 21:07:50 +0200
 Subject: gdb-6.6-buildid-locate-rpm-scl.patch
 
-FileName: gdb-6.6-buildid-locate-rpm-scl.patch
-
 ;; [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585).
 ;;=push+jan
 
 warning: Skipping deprecated .gdb_index section
 https://bugzilla.redhat.com/show_bug.cgi?id=953585
----
- gdb/build-id.c   | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
- gdb/dwarf2read.c | 14 ++++++++++++++
- 2 files changed, 68 insertions(+)
 
 diff --git a/gdb/build-id.c b/gdb/build-id.c
-index e2c1e81266..1b75530f91 100644
 --- a/gdb/build-id.c
 +++ b/gdb/build-id.c
-@@ -715,7 +715,11 @@ static int missing_rpm_list_entries;
+@@ -689,7 +689,11 @@ static int missing_rpm_list_entries;
  /* Returns the count of newly added rpms.  */
  
  static int
@@ -31,7 +24,7 @@ index e2c1e81266..1b75530f91 100644
  {
    static int rpm_init_done = 0;
    rpmts ts;
-@@ -822,7 +826,11 @@ missing_rpm_enlist (const char *filename)
+@@ -796,7 +800,11 @@ missing_rpm_enlist (const char *filename)
    mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
    if (mi != NULL)
      {
@@ -43,7 +36,7 @@ index e2c1e81266..1b75530f91 100644
        {
          Header h;
          char *debuginfo, **slot, *s, *s2;
-@@ -940,6 +948,37 @@ missing_rpm_enlist (const char *filename)
+@@ -914,6 +922,37 @@ missing_rpm_enlist (const char *filename)
            xfree (debuginfo);
          count++;
        }
@@ -81,7 +74,7 @@ index e2c1e81266..1b75530f91 100644
  
        rpmdbFreeIterator_p (mi);
      }
-@@ -950,6 +989,21 @@ missing_rpm_enlist (const char *filename)
+@@ -924,6 +963,21 @@ missing_rpm_enlist (const char *filename)
  }
  
  static int
@@ -104,10 +97,9 @@ index e2c1e81266..1b75530f91 100644
  {
    return strcoll (*ap, *bp);
 diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
-index 2c972d5e74..64329af71e 100644
 --- a/gdb/dwarf2read.c
 +++ b/gdb/dwarf2read.c
-@@ -3725,6 +3725,16 @@ read_index_from_section (struct objfile *objfile,
+@@ -3469,6 +3469,16 @@ read_gdb_index_from_section (struct objfile *objfile,
       "set use-deprecated-index-sections on".  */
    if (version < 6 && !deprecated_ok)
      {
@@ -124,7 +116,7 @@ index 2c972d5e74..64329af71e 100644
        static int warning_printed = 0;
        if (!warning_printed)
        {
-@@ -3736,6 +3746,10 @@ to use the section anyway."),
+@@ -3480,6 +3490,10 @@ to use the section anyway."),
          warning_printed = 1;
        }
        return 0;
@@ -135,6 +127,3 @@ index 2c972d5e74..64329af71e 100644
      }
    /* Version 7 indices generated by gold refer to the CU for a symbol instead
       of the TU (for symbols coming from TUs),
--- 
-2.14.3
-
index 7697afaf36331364365928ce38a52817c7c9aac4..d5ec4b08c7d1f1692edd216cae7e69bcc83a9fc0 100644 (file)
@@ -3,25 +3,12 @@ From: Fedora GDB patches <invalid@email.com>
 Date: Fri, 27 Oct 2017 21:07:50 +0200
 Subject: gdb-6.6-buildid-locate-rpm.patch
 
-FileName: gdb-6.6-buildid-locate-rpm.patch
-
 ;;=push+jan
----
- gdb/aclocal.m4   | 215 +++++++++++++++++++++++
- gdb/build-id.c   | 407 +++++++++++++++++++++++++++++++++++++++++++-
- gdb/config.in    |   6 +
- gdb/configure    | 508 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
- gdb/configure.ac | 193 +++++++++++++++++++++
- gdb/corelow.c    |   2 +-
- gdb/event-top.c  |   8 +-
- gdb/symfile.h    |   2 +
- 8 files changed, 1331 insertions(+), 10 deletions(-)
 
 diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4
-index e0d38ea267..da5ac313e3 100644
 --- a/gdb/aclocal.m4
 +++ b/gdb/aclocal.m4
-@@ -12,6 +12,221 @@
+@@ -11,7 +11,223 @@
  # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  # PARTICULAR PURPOSE.
  
@@ -239,12 +226,13 @@ index e0d38ea267..da5ac313e3 100644
 +
 +AS_VAR_IF([$1], [""], [$5], [$4])dnl
 +])# PKG_CHECK_VAR
++
+ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
 +
  # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
  
- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+ # Copyright (C) 2001-2017 Free Software Foundation, Inc.
 diff --git a/gdb/build-id.c b/gdb/build-id.c
-index 5740628386..d60cf622dc 100644
 --- a/gdb/build-id.c
 +++ b/gdb/build-id.c
 @@ -35,6 +35,8 @@
@@ -256,7 +244,7 @@ index 5740628386..d60cf622dc 100644
  
  #define BUILD_ID_VERBOSE_NONE 0
  #define BUILD_ID_VERBOSE_FILENAMES 1
-@@ -666,8 +668,366 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
+@@ -640,8 +642,366 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
    return result;
  }
  
@@ -624,7 +612,7 @@ index 5740628386..d60cf622dc 100644
     avoidance.  */
  
  struct missing_filepair
-@@ -721,11 +1081,17 @@ missing_filepair_change (void)
+@@ -695,11 +1055,17 @@ missing_filepair_change (void)
        /* All their memory came just from missing_filepair_OBSTACK.  */
        missing_filepair_hash = NULL;
      }
@@ -642,7 +630,7 @@ index 5740628386..d60cf622dc 100644
    missing_filepair_change ();
  }
  
-@@ -792,14 +1158,39 @@ debug_print_missing (const char *binary, const char *debug)
+@@ -766,14 +1132,39 @@ debug_print_missing (const char *binary, const char *debug)
  
    *slot = missing_filepair;
  
@@ -690,7 +678,6 @@ index 5740628386..d60cf622dc 100644
  
  /* See build-id.h.  */
 diff --git a/gdb/config.in b/gdb/config.in
-index 1d11a97080..edd7028f76 100644
 --- a/gdb/config.in
 +++ b/gdb/config.in
 @@ -33,6 +33,9 @@
@@ -703,7 +690,7 @@ index 1d11a97080..edd7028f76 100644
  /* Define to 1 if translation of program messages to the user's native
     language is requested. */
  #undef ENABLE_NLS
-@@ -264,6 +267,9 @@
+@@ -270,6 +273,9 @@
  /* Define if Python 2.7 is being used. */
  #undef HAVE_LIBPYTHON2_7
  
@@ -714,10 +701,9 @@ index 1d11a97080..edd7028f76 100644
  #undef HAVE_LIBUNWIND_IA64_H
  
 diff --git a/gdb/configure b/gdb/configure
-index 092893d757..1cecdbc3b5 100755
 --- a/gdb/configure
 +++ b/gdb/configure
-@@ -716,6 +716,11 @@ PKGVERSION
+@@ -749,6 +749,11 @@ CODESIGN_CERT
  HAVE_NATIVE_GCORE_TARGET
  TARGET_OBS
  subdirs
@@ -729,7 +715,7 @@ index 092893d757..1cecdbc3b5 100755
  GDB_DATADIR
  DEBUGDIR
  MAKEINFO_EXTRA_FLAGS
-@@ -820,6 +825,7 @@ with_gdb_datadir
+@@ -853,6 +858,7 @@ with_gdb_datadir
  with_relocated_sources
  with_auto_load_dir
  with_auto_load_safe_path
@@ -737,7 +723,7 @@ index 092893d757..1cecdbc3b5 100755
  enable_targets
  enable_64_bit_bfd
  enable_gdbcli
-@@ -878,6 +884,11 @@ CCC
+@@ -912,6 +918,11 @@ CCC
  CPP
  MAKEINFO
  MAKEINFOFLAGS
@@ -749,7 +735,7 @@ index 092893d757..1cecdbc3b5 100755
  YACC
  YFLAGS
  XMKMF'
-@@ -1548,6 +1559,8 @@ Optional Packages:
+@@ -1583,6 +1594,8 @@ Optional Packages:
                            [--with-auto-load-dir]
    --without-auto-load-safe-path
                            do not restrict auto-loaded files locations
@@ -758,7 +744,7 @@ index 092893d757..1cecdbc3b5 100755
    --with-libunwind-ia64   use libunwind frame unwinding for ia64 targets
    --with-curses           use the curses library instead of the termcap
                            library
-@@ -1605,6 +1618,13 @@ Some influential environment variables:
+@@ -1640,6 +1653,13 @@ Some influential environment variables:
    MAKEINFO    Parent configure detects if it is of sufficient version.
    MAKEINFOFLAGS
                Parameters for MAKEINFO.
@@ -769,10 +755,10 @@ index 092893d757..1cecdbc3b5 100755
 +              path overriding pkg-config's built-in search path
 +  RPM_CFLAGS  C compiler flags for RPM, overriding pkg-config
 +  RPM_LIBS    linker flags for RPM, overriding pkg-config
-   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.
-@@ -6486,6 +6506,494 @@ _ACEOF
+   YACC        The `Yet Another Compiler Compiler' implementation to use.
+               Defaults to the first program found out of: `bison -y', `byacc',
+               `yacc'.
+@@ -6575,6 +6595,494 @@ _ACEOF
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
  $as_echo "$with_auto_load_safe_path" >&6; }
  
@@ -1268,10 +1254,9 @@ index 092893d757..1cecdbc3b5 100755
  
  subdirs="$subdirs testsuite"
 diff --git a/gdb/configure.ac b/gdb/configure.ac
-index d4133ea71e..e232c1adcb 100644
 --- a/gdb/configure.ac
 +++ b/gdb/configure.ac
-@@ -167,6 +167,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir,
+@@ -166,6 +166,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir,
              [Directories safe to hold auto-loaded files.])
  AC_MSG_RESULT([$with_auto_load_safe_path])
  
@@ -1472,10 +1457,9 @@ index d4133ea71e..e232c1adcb 100644
  
  # Check whether to support alternative target configurations
 diff --git a/gdb/corelow.c b/gdb/corelow.c
-index c5b642db81..6e027c12e2 100644
 --- a/gdb/corelow.c
 +++ b/gdb/corelow.c
-@@ -309,7 +309,7 @@ build_id_locate_exec (int from_tty)
+@@ -366,7 +366,7 @@ build_id_locate_exec (int from_tty)
          symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED;
      }
    else
@@ -1485,7 +1469,6 @@ index c5b642db81..6e027c12e2 100644
    do_cleanups (back_to);
  
 diff --git a/gdb/event-top.c b/gdb/event-top.c
-index 0c1528e5eb..0d668f35e0 100644
 --- a/gdb/event-top.c
 +++ b/gdb/event-top.c
 @@ -40,6 +40,7 @@
@@ -1518,10 +1501,9 @@ index 0c1528e5eb..0d668f35e0 100644
  }
  
 diff --git a/gdb/symfile.h b/gdb/symfile.h
-index 0d51f46d78..82c76431e1 100644
 --- a/gdb/symfile.h
 +++ b/gdb/symfile.h
-@@ -546,6 +546,8 @@ void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
+@@ -540,6 +540,8 @@ void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
  /* 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);
@@ -1530,6 +1512,3 @@ index 0d51f46d78..82c76431e1 100644
  
  /* From dwarf2read.c */
  
--- 
-2.14.3
-
index 6afc250a0ff84d81e87e4e8aa4fbfdd55b045c1f..2b961666c9034755b2b5ebdc1e41897375bc4d4f 100644 (file)
@@ -3,8 +3,6 @@ From: Fedora GDB patches <invalid@email.com>
 Date: Fri, 27 Oct 2017 21:07:50 +0200
 Subject: gdb-6.6-buildid-locate-solib-missing-ids.patch
 
-FileName: gdb-6.6-buildid-locate-solib-missing-ids.patch
-
 ;; Fix loading of core files without build-ids but with build-ids in executables.
 ;; Load strictly build-id-checked core files only if no executable is specified
 ;; (Jan Kratochvil, RH BZ 1339862).
@@ -12,33 +10,23 @@ FileName: gdb-6.6-buildid-locate-solib-missing-ids.patch
 
 gdb returns an incorrect back trace when applying a debuginfo
 https://bugzilla.redhat.com/show_bug.cgi?id=1339862
----
- gdb/solib-svr4.c                                   |  35 ++++---
- .../gcore-buildid-exec-but-not-solib-lib.c         |  21 +++++
- .../gcore-buildid-exec-but-not-solib-main.c        |  25 +++++
- .../gdb.base/gcore-buildid-exec-but-not-solib.exp  | 105 +++++++++++++++++++++
- 4 files changed, 167 insertions(+), 19 deletions(-)
- create mode 100644 gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c
- create mode 100644 gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c
- create mode 100644 gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp
 
 diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
-index a3399ad8f7..d7eeb6350d 100644
 --- a/gdb/solib-svr4.c
 +++ b/gdb/solib-svr4.c
-@@ -1387,14 +1387,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
+@@ -1358,14 +1358,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
        }
  
        {
 -      struct bfd_build_id *build_id;
 +      struct bfd_build_id *build_id = NULL;
  
-       strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+       strncpy (newobj->so_original_name, buffer.get (), SO_NAME_MAX_PATH_SIZE - 1);
        newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
        /* May get overwritten below.  */
        strcpy (newobj->so_name, newobj->so_original_name);
  
--      build_id = build_id_addr_get (newobj->lm_info->l_ld);
+-      build_id = build_id_addr_get (((lm_info_svr4 *) newobj->lm_info)->l_ld);
 +      /* In the case the main executable was found according to its build-id
 +         (from a core file) prevent loading a different build of a library
 +         with accidentally the same SO_NAME.
@@ -56,7 +44,7 @@ index a3399ad8f7..d7eeb6350d 100644
        if (build_id != NULL)
          {
            char *name, *build_id_filename;
-@@ -1409,23 +1422,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
+@@ -1380,23 +1393,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
                xfree (name);
              }
            else
@@ -83,7 +71,6 @@ index a3399ad8f7..d7eeb6350d 100644
            xfree (build_id);
 diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c
 new file mode 100644
-index 0000000000..d74b690c73
 --- /dev/null
 +++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-lib.c
 @@ -0,0 +1,21 @@
@@ -110,7 +97,6 @@ index 0000000000..d74b690c73
 +}
 diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c
 new file mode 100644
-index 0000000000..46b9dfe161
 --- /dev/null
 +++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib-main.c
 @@ -0,0 +1,25 @@
@@ -141,7 +127,6 @@ index 0000000000..46b9dfe161
 +}
 diff --git a/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp
 new file mode 100644
-index 0000000000..0c46489f31
 --- /dev/null
 +++ b/gdb/testsuite/gdb.base/gcore-buildid-exec-but-not-solib.exp
 @@ -0,0 +1,105 @@
@@ -250,6 +235,3 @@ index 0000000000..0c46489f31
 +
 +gdb_test "bt"
 +gdb_test "info shared"
--- 
-2.14.3
-
index 947a75217e3fe35e60cb84eec22943b967650e7d..6acb6bc744454bf8016e258ca34ad0f9a63f5e8f 100644 (file)
@@ -3,30 +3,10 @@ From: Fedora GDB patches <invalid@email.com>
 Date: Fri, 27 Oct 2017 21:07:50 +0200
 Subject: gdb-6.6-buildid-locate.patch
 
-FileName: gdb-6.6-buildid-locate.patch
-
 ;; New locating of the matching binaries from the pure core file (build-id).
 ;;=push+jan
----
- gdb/build-id.c                                  | 753 +++++++++++++++++++++++-
- gdb/build-id.h                                  |  15 +-
- gdb/coffread.c                                  |   2 +-
- gdb/corelow.c                                   |  67 +++
- gdb/doc/gdb.texinfo                             |  21 +
- gdb/dwarf2read.c                                |   2 +-
- gdb/elfread.c                                   |   7 +-
- gdb/objfiles.h                                  |   4 +
- gdb/python/py-objfile.c                         |   4 +-
- gdb/solib-svr4.c                                |  50 +-
- gdb/symfile.h                                   |   4 +
- gdb/testsuite/gdb.base/corefile.exp             |  30 +
- gdb/testsuite/gdb.base/new-ui-pending-input.exp |   1 +
- gdb/testsuite/lib/gdb.exp                       |  10 +
- gdb/testsuite/lib/mi-support.exp                |  10 +
- 15 files changed, 940 insertions(+), 40 deletions(-)
 
 diff --git a/gdb/build-id.c b/gdb/build-id.c
-index 945da4f3cf..5740628386 100644
 --- a/gdb/build-id.c
 +++ b/gdb/build-id.c
 @@ -26,11 +26,67 @@
@@ -36,7 +16,7 @@ index 945da4f3cf..5740628386 100644
 +#include "libbfd.h"
 +#include "gdbcore.h"
 +#include "gdbcmd.h"
-+#include "observer.h"
++#include "observable.h"
 +#include "elf/external.h"
 +#include "elf/internal.h"
 +#include "elf/common.h"
@@ -456,7 +436,7 @@ index 945da4f3cf..5740628386 100644
  
    if (found == NULL)
      warning (_("File \"%s\" has no build-id, file skipped"),
-@@ -65,23 +463,54 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
+@@ -65,11 +463,50 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
    return retval;
  }
  
@@ -501,84 +481,80 @@ index 945da4f3cf..5740628386 100644
 +build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id,
 +                     char **link_return, int add_debug_suffix)
  {
--  char *link, *debugdir;
-+  char *link, *debugdir, *link_all = NULL;
-   VEC (char_ptr) *debugdir_vec;
-   struct cleanup *back_to;
-   int ix;
++  char *debugdir;
++  std::string link, link_all;
++  struct cleanup *back_to;
++  int ix;
    gdb_bfd_ref_ptr abfd;
--  int alloc_len;
-   /* DEBUG_FILE_DIRECTORY/.build-id/ab/cdef */
--  alloc_len = (strlen (debug_file_directory)
--             + (sizeof "/.build-id/" - 1) + 1
--             + 2 * build_id_len + (sizeof ".debug" - 1) + 1);
--  link = (char *) alloca (alloc_len);
-+  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.  */
-@@ -94,9 +523,12 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
-       size_t debugdir_len = strlen (debugdir);
+@@ -82,63 +519,296 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
+     {
        const gdb_byte *data = build_id;
        size_t size = build_id_len;
--      char *s;
-       char *filename = NULL;
-       struct cleanup *inner;
++      char *filename = NULL;
++      struct cleanup *inner;
 +      unsigned seqno;
 +      struct stat statbuf_trash;
-+      /* Initialize it just to avoid a GCC false warning.  */
-+      char *s, *link0 = NULL, *link0_resolved;
++      std::string link0;
+-      std::string link = debugdir.get ();
++      link = debugdir.get ();
+       link += "/.build-id/";
  
-       memcpy (link, debugdir, debugdir_len);
-       s = &link[debugdir_len];
-@@ -110,52 +542,299 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
-       *s++ = '/';
+       if (size > 0)
+       {
+         size--;
+-        string_appendf (link, "%02x/", (unsigned) *data++);
++        string_appendf (link, "%02x", (unsigned) *data++);
+       }
+-
++      if (size > 0)
++      link += "/";
        while (size-- > 0)
-       s += sprintf (s, "%02x", (unsigned) *data++);
--      strcpy (s, ".debug");
+       string_appendf (link, "%02x", (unsigned) *data++);
  
+-      link += ".debug";
+-
        if (separate_debug_file_debug)
-       printf_unfiltered (_("  Trying %s\n"), link);
+       printf_unfiltered (_("  Trying %s\n"), link.c_str ());
  
 -      /* lrealpath() is expensive even for the usually non-existent files.  */
--      if (access (link, F_OK) == 0)
--      filename = lrealpath (link);
+-      gdb::unique_xmalloc_ptr<char> filename;
+-      if (access (link.c_str (), F_OK) == 0)
+-      filename.reset (lrealpath (link.c_str ()));
+-
+-      if (filename == NULL)
+-      continue;
 +      for (seqno = 0;; seqno++)
 +      {
-+        char *s2;
-+
 +        if (seqno)
 +          {
 +            /* There can be multiple build-id symlinks pointing to real files
 +               with the same build-id (such as hard links).  Some of the real
 +               files may not be installed.  */
 +
-+            s2 = s + sprintf (s, ".%u", seqno);
++            string_appendf (link, ".%u", seqno);
 +          }
-+        else
-+          s2 = s;
 +
 +        if (add_debug_suffix)
-+          strcpy (s2, ".debug");
-+        else
-+          *s2 = 0;
++          link += ".debug";
 +
 +        if (!seqno)
 +          {
 +            /* If none of the real files is found report as missing file
 +               always the non-.%u-suffixed file.  */
-+            link0 = xstrdup (link);
++            link0 = link;
 +          }
 +
 +        /* `access' automatically dereferences LINK.  */
-+        if (lstat (link, &statbuf_trash) != 0)
++        if (lstat (link.c_str (), &statbuf_trash) != 0)
 +          {
 +            /* Stop increasing SEQNO.  */
 +            break;
 +          }
 +
-+        filename = lrealpath (link);
++        filename = lrealpath (link.c_str ());
 +        if (filename == NULL)
 +          continue;
 +
@@ -598,65 +574,46 @@ index 945da4f3cf..5740628386 100644
 +        filename = NULL;
 +      }
  
--      if (filename == NULL)
--      continue;
+-      /* We expect to be silent on the non-existing files.  */
+-      abfd = gdb_bfd_open (filename.get (), gnutarget, -1);
 +      if (filename != NULL)
 +      {
 +        /* LINK_ALL is not used below in this non-NULL FILENAME case.  */
-+        xfree (link0);
 +        break;
 +      }
  
--      /* We expect to be silent on the non-existing files.  */
--      inner = make_cleanup (xfree, filename);
--      abfd = gdb_bfd_open (filename, gnutarget, -1);
--      do_cleanups (inner);
+-      if (abfd == NULL)
+-      continue;
 +      /* If the symlink has target request to install the target.
 +         BASE-debuginfo.rpm contains the symlink but BASE.rpm may be missing.
 +         https://bugzilla.redhat.com/show_bug.cgi?id=981154  */
-+      link0_resolved = link_resolve (link0, 0);
-+      xfree (link0);
++      std::string link0_resolved (link_resolve (link0.c_str (), 0));
  
--      if (abfd == NULL)
--      continue;
-+      if (link_all == NULL)
+-      if (build_id_verify (abfd.get(), build_id_len, build_id))
+-      break;
++      if (link_all.empty ())
 +      link_all = link0_resolved;
 +      else
 +      {
-+        size_t len_orig = strlen (link_all);
--      if (build_id_verify (abfd.get(), build_id_len, build_id))
--      break;
-+        link_all = (char *) xrealloc (link_all,
-+                                      len_orig + 1 + strlen (link0_resolved) + 1);
--      abfd.release ();
 +        /* Use whitespace instead of DIRNAME_SEPARATOR to be compatible with
 +           its possible use as an argument for installation command.  */
-+        link_all[len_orig] = ' ';
-+
-+        strcpy (&link_all[len_orig + 1], link0_resolved);
-+        xfree (link0_resolved);
++        link_all += " " + link0_resolved;
 +      }
 +    }
-+
+-      abfd.release ();
 +  if (link_return != NULL)
 +    {
 +      if (abfd != NULL)
 +      {
-+        *link_return = link;
-+        link = NULL;
++        *link_return = xstrdup (link.c_str ());
 +      }
 +      else
 +      {
-+        *link_return = link_all;
-+        link_all = NULL;
++        *link_return = xstrdup (link_all.c_str ());
 +      }
      }
-+  xfree (link);
-+  xfree (link_all);
  
-   do_cleanups (back_to);
    return abfd;
  }
  
@@ -813,7 +770,7 @@ index 945da4f3cf..5740628386 100644
 +
  /* See build-id.h.  */
  
- char *
+ std::string
 -find_separate_debug_file_by_buildid (struct objfile *objfile)
 +find_separate_debug_file_by_buildid (struct objfile *objfile,
 +                      gdb::unique_xmalloc_ptr<char> *build_id_filename_return)
@@ -850,9 +807,9 @@ index 945da4f3cf..5740628386 100644
        /* Prevent looping on a stripped .debug file.  */
        if (abfd != NULL
          && filename_cmp (bfd_get_filename (abfd.get ()),
-@@ -167,3 +846,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
-     }
-   return NULL;
+@@ -151,3 +821,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
+   return std::string ();
  }
 +
 +extern void _initialize_build_id (void);
@@ -870,10 +827,9 @@ index 945da4f3cf..5740628386 100644
 +                          show_build_id_verbose,
 +                          &setlist, &showlist);
 +
-+  observer_attach_executable_changed (debug_print_executable_changed);
++  gdb::observers::executable_changed.attach (debug_print_executable_changed);
 +}
 diff --git a/gdb/build-id.h b/gdb/build-id.h
-index 0f13c7d4cf..2d105dba88 100644
 --- a/gdb/build-id.h
 +++ b/gdb/build-id.h
 @@ -22,9 +22,10 @@
@@ -889,7 +845,7 @@ index 0f13c7d4cf..2d105dba88 100644
  
  /* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value.
     Otherwise, issue a warning and return false.  */
-@@ -38,13 +39,19 @@ extern int build_id_verify (bfd *abfd,
+@@ -38,13 +39,18 @@ extern int build_id_verify (bfd *abfd,
     the caller.  */
  
  extern gdb_bfd_ref_ptr build_id_to_debug_bfd (size_t build_id_len,
@@ -902,30 +858,29 @@ index 0f13c7d4cf..2d105dba88 100644
 +                                 char **link_return);
  
  /* Find the separate debug file for OBJFILE, by using the build-id
-    associated with OBJFILE's BFD.  If successful, returns a malloc'd
-    file name for the separate debug file.  The caller must free this.
-    Otherwise, returns NULL.  */
+    associated with OBJFILE's BFD.  If successful, returns the file name for the
+    separate debug file, otherwise, return an empty string.  */
  
--extern char *find_separate_debug_file_by_buildid (struct objfile *objfile);
-+extern char *find_separate_debug_file_by_buildid (struct objfile *objfile,
+-extern std::string find_separate_debug_file_by_buildid
+-  (struct objfile *objfile);
++extern std::string find_separate_debug_file_by_buildid (struct objfile *objfile,
 +                     gdb::unique_xmalloc_ptr<char> *build_id_filename_return);
  
  #endif /* BUILD_ID_H */
 diff --git a/gdb/coffread.c b/gdb/coffread.c
-index fbbbb68f71..9698ec2191 100644
 --- a/gdb/coffread.c
 +++ b/gdb/coffread.c
-@@ -735,7 +735,7 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
+@@ -733,7 +733,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
+   /* Try to add separate debug file if no symbols table found.   */
+   if (!objfile_has_partial_symbols (objfile))
      {
-       char *debugfile;
+-      std::string debugfile = find_separate_debug_file_by_buildid (objfile);
++      std::string debugfile = find_separate_debug_file_by_buildid (objfile,
++                                                                 NULL);
  
--      debugfile = find_separate_debug_file_by_buildid (objfile);
-+      debugfile = find_separate_debug_file_by_buildid (objfile, NULL);
-       if (debugfile == NULL)
+       if (debugfile.empty ())
        debugfile = find_separate_debug_file_by_debuglink (objfile);
 diff --git a/gdb/corelow.c b/gdb/corelow.c
-index 3a5256cb17..c5b642db81 100644
 --- a/gdb/corelow.c
 +++ b/gdb/corelow.c
 @@ -45,6 +45,10 @@
@@ -939,7 +894,7 @@ index 3a5256cb17..c5b642db81 100644
  
  #ifndef O_LARGEFILE
  #define O_LARGEFILE 0
-@@ -264,6 +268,54 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
+@@ -321,6 +325,54 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
      inferior_ptid = ptid;                     /* Yes, make it current.  */
  }
  
@@ -957,7 +912,7 @@ index 3a5256cb17..c5b642db81 100644
 +  if (exec_bfd != NULL || symfile_objfile != NULL)
 +    return;
 +
-+  if (target_auxv_search (&current_target, AT_ENTRY, &at_entry) <= 0)
++  if (target_auxv_search (current_top_target (), AT_ENTRY, &at_entry) <= 0)
 +    return;
 +
 +  build_id = build_id_addr_get (at_entry);
@@ -991,11 +946,11 @@ index 3a5256cb17..c5b642db81 100644
 +  /* No automatic SOLIB_ADD as the libraries would get read twice.  */
 +}
 +
- /* This routine opens and sets up the core file bfd.  */
+ /* Issue a message saying we have no core to debug, if FROM_TTY.  */
  
  static void
-@@ -391,6 +443,14 @@ core_open (const char *arg, int from_tty)
-       switch_to_thread (thread->ptid);
+@@ -464,6 +516,14 @@ core_target_open (const char *arg, int from_tty)
+       switch_to_thread (thread);
      }
  
 +  /* Find the build_id identifiers.  If it gets executed after
@@ -1006,13 +961,13 @@ index 3a5256cb17..c5b642db81 100644
 +  if (build_id_core_loads != 0)
 +    build_id_locate_exec (from_tty);
 +
-   post_create_inferior (&core_ops, from_tty);
+   post_create_inferior (target, from_tty);
  
    /* Now go through the target stack looking for threads since there
-@@ -1040,4 +1100,11 @@ _initialize_corelow (void)
-   init_core_ops ();
-   add_target_with_completer (&core_ops, filename_completer);
+@@ -1072,4 +1132,11 @@ void
+ _initialize_corelow (void)
+ {
+   add_target (core_target_info, core_target_open, filename_completer);
 +
 +  add_setshow_boolean_cmd ("build-id-core-loads", class_files,
 +                         &build_id_core_loads, _("\
@@ -1022,10 +977,9 @@ index 3a5256cb17..c5b642db81 100644
 +                         &setlist, &showlist);
  }
 diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
-index 8bdafb0ba4..2f2cbd3dea 100644
 --- a/gdb/doc/gdb.texinfo
 +++ b/gdb/doc/gdb.texinfo
-@@ -19447,6 +19447,27 @@ information files.
+@@ -19570,6 +19570,27 @@ information files.
  
  @end table
  
@@ -1054,10 +1008,9 @@ index 8bdafb0ba4..2f2cbd3dea 100644
  @cindex debug link sections
  A debug link is a special section of the executable file named
 diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
-index 98e7d842f0..c8db955f2f 100644
 --- a/gdb/dwarf2read.c
 +++ b/gdb/dwarf2read.c
-@@ -2907,7 +2907,7 @@ dwarf2_get_dwz_file (void)
+@@ -2683,7 +2683,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile)
      }
  
    if (dwz_bfd == NULL)
@@ -1067,22 +1020,21 @@ index 98e7d842f0..c8db955f2f 100644
    if (dwz_bfd == NULL)
      error (_("could not find '.gnu_debugaltlink' file for %s"),
 diff --git a/gdb/elfread.c b/gdb/elfread.c
-index 103b2144c3..fb32e03af5 100644
 --- a/gdb/elfread.c
 +++ b/gdb/elfread.c
-@@ -1259,8 +1259,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
+@@ -1290,7 +1290,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
           && objfile->separate_debug_objfile == NULL
           && objfile->separate_debug_objfile_backlink == NULL)
      {
+-      std::string debugfile = find_separate_debug_file_by_buildid (objfile);
 +      gdb::unique_xmalloc_ptr<char> build_id_filename;
-       gdb::unique_xmalloc_ptr<char> debugfile
--      (find_separate_debug_file_by_buildid (objfile));
-+      (find_separate_debug_file_by_buildid (objfile, &build_id_filename));
++      std::string debugfile
++      = find_separate_debug_file_by_buildid (objfile, &build_id_filename);
  
-       if (debugfile == NULL)
-       debugfile.reset (find_separate_debug_file_by_debuglink (objfile));
-@@ -1272,6 +1273,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
-         symbol_file_add_separate (abfd.get (), debugfile.get (),
+       if (debugfile.empty ())
+       debugfile = find_separate_debug_file_by_debuglink (objfile);
+@@ -1302,6 +1304,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
+         symbol_file_add_separate (abfd.get (), debugfile.c_str (),
                                    symfile_flags, objfile);
        }
 +      /* Check if any separate debug info has been extracted out.  */
@@ -1093,7 +1045,6 @@ index 103b2144c3..fb32e03af5 100644
  }
  
 diff --git a/gdb/objfiles.h b/gdb/objfiles.h
-index 28e66eca36..5ab0e33fb6 100644
 --- a/gdb/objfiles.h
 +++ b/gdb/objfiles.h
 @@ -470,6 +470,10 @@ struct objfile
@@ -1108,7 +1059,6 @@ index 28e66eca36..5ab0e33fb6 100644
  
  extern struct gdbarch *get_objfile_arch (const struct objfile *);
 diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c
-index c2b40ff535..112cbf6560 100644
 --- a/gdb/python/py-objfile.c
 +++ b/gdb/python/py-objfile.c
 @@ -137,7 +137,7 @@ objfpy_get_build_id (PyObject *self, void *closure)
@@ -1130,7 +1080,6 @@ index c2b40ff535..112cbf6560 100644
        continue;
        if (objfpy_build_id_matches (obfd_build_id, build_id))
 diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
-index 4973cc2f25..a3399ad8f7 100644
 --- a/gdb/solib-svr4.c
 +++ b/gdb/solib-svr4.c
 @@ -45,6 +45,7 @@
@@ -1141,22 +1090,22 @@ index 4973cc2f25..a3399ad8f7 100644
  
  static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
  static int svr4_have_link_map_offsets (void);
-@@ -1385,9 +1386,52 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
+@@ -1356,9 +1357,51 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
          continue;
        }
  
--      strncpy (newobj->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+-      strncpy (newobj->so_name, buffer.get (), SO_NAME_MAX_PATH_SIZE - 1);
 -      newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
 -      strcpy (newobj->so_original_name, newobj->so_name);
 +      {
 +      struct bfd_build_id *build_id;
 +
-+      strncpy (newobj->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
++      strncpy (newobj->so_original_name, buffer.get (), SO_NAME_MAX_PATH_SIZE - 1);
 +      newobj->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
 +      /* May get overwritten below.  */
 +      strcpy (newobj->so_name, newobj->so_original_name);
 +
-+      build_id = build_id_addr_get (newobj->lm_info->l_ld);
++      build_id = build_id_addr_get (((lm_info_svr4 *) newobj->lm_info)->l_ld);
 +      if (build_id != NULL)
 +        {
 +          char *name, *build_id_filename;
@@ -1193,15 +1142,13 @@ index 4973cc2f25..a3399ad8f7 100644
 +          xfree (build_id);
 +        }
 +      }
-+
-       xfree (buffer);
  
        /* If this entry has no name, or its name matches the name
+        for the main executable, don't include it in the list.  */
 diff --git a/gdb/symfile.h b/gdb/symfile.h
-index 7c3fd8240a..0d51f46d78 100644
 --- a/gdb/symfile.h
 +++ b/gdb/symfile.h
-@@ -543,6 +543,10 @@ void expand_symtabs_matching
+@@ -537,6 +537,10 @@ void expand_symtabs_matching
  void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
                           int need_fullname);
  
@@ -1213,7 +1160,6 @@ index 7c3fd8240a..0d51f46d78 100644
  
  /* Names for a dwarf2 debugging section.  The field NORMAL is the normal
 diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp
-index 63a7fa8e5b..8a4fab77df 100644
 --- a/gdb/testsuite/gdb.base/corefile.exp
 +++ b/gdb/testsuite/gdb.base/corefile.exp
 @@ -311,3 +311,33 @@ gdb_test_multiple "core-file $corefile" $test {
@@ -1251,7 +1197,6 @@ index 63a7fa8e5b..8a4fab77df 100644
 +    pass $wholetest
 +}
 diff --git a/gdb/testsuite/gdb.base/new-ui-pending-input.exp b/gdb/testsuite/gdb.base/new-ui-pending-input.exp
-index a6dc14e3c9..54a10df155 100644
 --- a/gdb/testsuite/gdb.base/new-ui-pending-input.exp
 +++ b/gdb/testsuite/gdb.base/new-ui-pending-input.exp
 @@ -62,6 +62,7 @@ proc test_command_line_new_ui_pending_input {} {
@@ -1263,10 +1208,9 @@ index a6dc14e3c9..54a10df155 100644
      append options " -ex \"b $bpline\""
      append options " -ex \"run\""
 diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
-index 7702d9c238..a165bf0938 100644
 --- a/gdb/testsuite/lib/gdb.exp
 +++ b/gdb/testsuite/lib/gdb.exp
-@@ -1694,6 +1694,16 @@ proc default_gdb_start { } {
+@@ -1695,6 +1695,16 @@ proc default_gdb_start { } {
            warning "Couldn't set the width to 0."
        }
      }
@@ -1284,7 +1228,6 @@ index 7702d9c238..a165bf0938 100644
  }
  
 diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
-index 2846da74e4..004c3e6c1c 100644
 --- a/gdb/testsuite/lib/mi-support.exp
 +++ b/gdb/testsuite/lib/mi-support.exp
 @@ -309,6 +309,16 @@ proc default_mi_gdb_start { args } {
@@ -1304,6 +1247,3 @@ index 2846da74e4..004c3e6c1c 100644
  
      if { $separate_inferior_pty } {
        mi_create_inferior_pty
--- 
-2.14.3
-
index 03a3d7d7093d29420e4852110663720146a88ed1..fa4fa0db891bcc574e909893734c08b82ceb227a 100644 (file)
@@ -3,101 +3,9 @@ From: Fedora GDB patches <invalid@email.com>
 Date: Fri, 27 Oct 2017 21:07:50 +0200
 Subject: gdb-archer-vla-tests.patch
 
-FileName: gdb-archer-vla-tests.patch
-
 ;;=fedoratest
----
- gdb/testsuite/gdb.ada/packed_array.exp             |   6 +
- gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S    | 358 ++++++++++++++++
- gdb/testsuite/gdb.arch/x86_64-vla-pointer.c        |  45 ++
- gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp      |  65 +++
- gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S    | 455 +++++++++++++++++++++
- gdb/testsuite/gdb.arch/x86_64-vla-typedef.c        |  45 ++
- gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp      |  64 +++
- gdb/testsuite/gdb.base/arrayidx.c                  |   7 +
- gdb/testsuite/gdb.base/arrayidx.exp                |  10 +-
- .../gdb.base/internal-var-field-address.c          |  20 +
- .../gdb.base/internal-var-field-address.exp        |  26 ++
- gdb/testsuite/gdb.base/vla-frame.c                 |  31 ++
- gdb/testsuite/gdb.base/vla-frame.exp               |  38 ++
- gdb/testsuite/gdb.base/vla-overflow.c              |  30 ++
- gdb/testsuite/gdb.base/vla-overflow.exp            | 109 +++++
- gdb/testsuite/gdb.base/vla.c                       |  55 +++
- gdb/testsuite/gdb.base/vla.exp                     |  62 +++
- gdb/testsuite/gdb.cp/gdb9593.cc                    | 180 ++++++++
- gdb/testsuite/gdb.cp/gdb9593.exp                   | 182 +++++++++
- gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S       | 246 +++++++++++
- gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp     |  66 +++
- gdb/testsuite/gdb.dwarf2/dw2-stripped.c            |  42 ++
- gdb/testsuite/gdb.dwarf2/dw2-stripped.exp          |  79 ++++
- .../gdb.dwarf2/dw2-struct-member-data-location.S   |  83 ++++
- .../gdb.dwarf2/dw2-struct-member-data-location.exp |  37 ++
- gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S    | 121 ++++++
- gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp  |  39 ++
- gdb/testsuite/gdb.fortran/dwarf-stride.exp         |  42 ++
- gdb/testsuite/gdb.fortran/dwarf-stride.f90         |  40 ++
- gdb/testsuite/gdb.fortran/dynamic.exp              | 154 +++++++
- gdb/testsuite/gdb.fortran/dynamic.f90              |  98 +++++
- gdb/testsuite/gdb.fortran/string.exp               |  59 +++
- gdb/testsuite/gdb.fortran/string.f90               |  37 ++
- gdb/testsuite/gdb.fortran/subrange.exp             |  72 ++++
- gdb/testsuite/gdb.fortran/subrange.f90             |  28 ++
- gdb/testsuite/gdb.mi/mi2-var-stale-type.c          |  26 ++
- gdb/testsuite/gdb.mi/mi2-var-stale-type.exp        |  57 +++
- gdb/testsuite/gdb.opt/array-from-register-func.c   |  22 +
- gdb/testsuite/gdb.opt/array-from-register.c        |  28 ++
- gdb/testsuite/gdb.opt/array-from-register.exp      |  33 ++
- gdb/testsuite/gdb.opt/fortran-string.exp           |  39 ++
- gdb/testsuite/gdb.opt/fortran-string.f90           |  28 ++
- gdb/testsuite/gdb.pascal/arrays.exp                | 104 +++++
- gdb/testsuite/gdb.pascal/arrays.pas                |  82 ++++
- gdb/testsuite/lib/gdb.exp                          |   5 +
- gdb/testsuite/lib/pascal.exp                       |  17 +
- 46 files changed, 3471 insertions(+), 1 deletion(-)
- create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S
- create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-pointer.c
- create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp
- create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S
- create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-typedef.c
- create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp
- create mode 100644 gdb/testsuite/gdb.base/internal-var-field-address.c
- create mode 100644 gdb/testsuite/gdb.base/internal-var-field-address.exp
- create mode 100644 gdb/testsuite/gdb.base/vla-frame.c
- create mode 100644 gdb/testsuite/gdb.base/vla-frame.exp
- create mode 100644 gdb/testsuite/gdb.base/vla-overflow.c
- create mode 100644 gdb/testsuite/gdb.base/vla-overflow.exp
- create mode 100644 gdb/testsuite/gdb.base/vla.c
- create mode 100644 gdb/testsuite/gdb.base/vla.exp
- create mode 100644 gdb/testsuite/gdb.cp/gdb9593.cc
- create mode 100644 gdb/testsuite/gdb.cp/gdb9593.exp
- create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S
- create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp
- create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-stripped.c
- create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-stripped.exp
- create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S
- create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp
- create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S
- create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp
- create mode 100644 gdb/testsuite/gdb.fortran/dwarf-stride.exp
- create mode 100644 gdb/testsuite/gdb.fortran/dwarf-stride.f90
- create mode 100644 gdb/testsuite/gdb.fortran/dynamic.exp
- create mode 100644 gdb/testsuite/gdb.fortran/dynamic.f90
- create mode 100644 gdb/testsuite/gdb.fortran/string.exp
- create mode 100644 gdb/testsuite/gdb.fortran/string.f90
- create mode 100644 gdb/testsuite/gdb.fortran/subrange.exp
- create mode 100644 gdb/testsuite/gdb.fortran/subrange.f90
- create mode 100644 gdb/testsuite/gdb.mi/mi2-var-stale-type.c
- create mode 100644 gdb/testsuite/gdb.mi/mi2-var-stale-type.exp
- create mode 100644 gdb/testsuite/gdb.opt/array-from-register-func.c
- create mode 100644 gdb/testsuite/gdb.opt/array-from-register.c
- create mode 100644 gdb/testsuite/gdb.opt/array-from-register.exp
- create mode 100644 gdb/testsuite/gdb.opt/fortran-string.exp
- create mode 100644 gdb/testsuite/gdb.opt/fortran-string.f90
- create mode 100644 gdb/testsuite/gdb.pascal/arrays.exp
- create mode 100644 gdb/testsuite/gdb.pascal/arrays.pas
 
 diff --git a/gdb/testsuite/gdb.ada/packed_array.exp b/gdb/testsuite/gdb.ada/packed_array.exp
-index 3e614b788a..0ae87786db 100644
 --- a/gdb/testsuite/gdb.ada/packed_array.exp
 +++ b/gdb/testsuite/gdb.ada/packed_array.exp
 @@ -56,5 +56,11 @@ gdb_test_multiple "$test" "$test" {
@@ -114,7 +22,6 @@ index 3e614b788a..0ae87786db 100644
  
 diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S b/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S
 new file mode 100644
-index 0000000000..3a983e6b22
 --- /dev/null
 +++ b/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S
 @@ -0,0 +1,358 @@
@@ -478,7 +385,6 @@ index 0000000000..3a983e6b22
 +      .section        .note.GNU-stack,"",@progbits
 diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c b/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c
 new file mode 100644
-index 0000000000..98ee43bbf2
 --- /dev/null
 +++ b/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c
 @@ -0,0 +1,45 @@
@@ -529,7 +435,6 @@ index 0000000000..98ee43bbf2
 +#endif
 diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp b/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp
 new file mode 100644
-index 0000000000..3e2e64a6ab
 --- /dev/null
 +++ b/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp
 @@ -0,0 +1,65 @@
@@ -600,7 +505,6 @@ index 0000000000..3e2e64a6ab
 +gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array"
 diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S b/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S
 new file mode 100644
-index 0000000000..66f7a399bf
 --- /dev/null
 +++ b/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S
 @@ -0,0 +1,455 @@
@@ -1061,7 +965,6 @@ index 0000000000..66f7a399bf
 +      .section        .note.GNU-stack,"",@progbits
 diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c
 new file mode 100644
-index 0000000000..40099e9d39
 --- /dev/null
 +++ b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c
 @@ -0,0 +1,45 @@
@@ -1112,7 +1015,6 @@ index 0000000000..40099e9d39
 +#endif
 diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp
 new file mode 100644
-index 0000000000..4ef6214629
 --- /dev/null
 +++ b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp
 @@ -0,0 +1,64 @@
@@ -1181,7 +1083,6 @@ index 0000000000..4ef6214629
 +
 +gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array"
 diff --git a/gdb/testsuite/gdb.base/arrayidx.c b/gdb/testsuite/gdb.base/arrayidx.c
-index 5a0d01d04f..9e4b16e902 100644
 --- a/gdb/testsuite/gdb.base/arrayidx.c
 +++ b/gdb/testsuite/gdb.base/arrayidx.c
 @@ -17,6 +17,13 @@
@@ -1199,7 +1100,6 @@ index 5a0d01d04f..9e4b16e902 100644
  main (void)
  {
 diff --git a/gdb/testsuite/gdb.base/arrayidx.exp b/gdb/testsuite/gdb.base/arrayidx.exp
-index 91eb3c6056..af29a51f23 100644
 --- a/gdb/testsuite/gdb.base/arrayidx.exp
 +++ b/gdb/testsuite/gdb.base/arrayidx.exp
 @@ -49,4 +49,12 @@ gdb_test "print array" \
@@ -1218,7 +1118,6 @@ index 91eb3c6056..af29a51f23 100644
 +}
 diff --git a/gdb/testsuite/gdb.base/internal-var-field-address.c b/gdb/testsuite/gdb.base/internal-var-field-address.c
 new file mode 100644
-index 0000000000..eeb7b8501c
 --- /dev/null
 +++ b/gdb/testsuite/gdb.base/internal-var-field-address.c
 @@ -0,0 +1,20 @@
@@ -1244,7 +1143,6 @@ index 0000000000..eeb7b8501c
 +} staticstruct = { 1 };
 diff --git a/gdb/testsuite/gdb.base/internal-var-field-address.exp b/gdb/testsuite/gdb.base/internal-var-field-address.exp
 new file mode 100644
-index 0000000000..33c9e94eee
 --- /dev/null
 +++ b/gdb/testsuite/gdb.base/internal-var-field-address.exp
 @@ -0,0 +1,26 @@
@@ -1276,7 +1174,6 @@ index 0000000000..33c9e94eee
 +gdb_test {p $varstruct.field} " = 1"
 diff --git a/gdb/testsuite/gdb.base/vla-frame.c b/gdb/testsuite/gdb.base/vla-frame.c
 new file mode 100644
-index 0000000000..5750f68b3d
 --- /dev/null
 +++ b/gdb/testsuite/gdb.base/vla-frame.c
 @@ -0,0 +1,31 @@
@@ -1313,7 +1210,6 @@ index 0000000000..5750f68b3d
 +}
 diff --git a/gdb/testsuite/gdb.base/vla-frame.exp b/gdb/testsuite/gdb.base/vla-frame.exp
 new file mode 100644
-index 0000000000..47736c7625
 --- /dev/null
 +++ b/gdb/testsuite/gdb.base/vla-frame.exp
 @@ -0,0 +1,38 @@
@@ -1357,7 +1253,6 @@ index 0000000000..47736c7625
 +gdb_test "bt full" "\r\n +s = \"X\\\\000\"\r\n.*"
 diff --git a/gdb/testsuite/gdb.base/vla-overflow.c b/gdb/testsuite/gdb.base/vla-overflow.c
 new file mode 100644
-index 0000000000..c5d5ee0bb9
 --- /dev/null
 +++ b/gdb/testsuite/gdb.base/vla-overflow.c
 @@ -0,0 +1,30 @@
@@ -1393,7 +1288,6 @@ index 0000000000..c5d5ee0bb9
 +}
 diff --git a/gdb/testsuite/gdb.base/vla-overflow.exp b/gdb/testsuite/gdb.base/vla-overflow.exp
 new file mode 100644
-index 0000000000..43a5825979
 --- /dev/null
 +++ b/gdb/testsuite/gdb.base/vla-overflow.exp
 @@ -0,0 +1,109 @@
@@ -1508,7 +1402,6 @@ index 0000000000..43a5825979
 +verbose -log "kb_found in bt after abort() = [expr [memory_v_pages_get] * $pagesize / 1024]"
 diff --git a/gdb/testsuite/gdb.base/vla.c b/gdb/testsuite/gdb.base/vla.c
 new file mode 100644
-index 0000000000..e1f3ed1780
 --- /dev/null
 +++ b/gdb/testsuite/gdb.base/vla.c
 @@ -0,0 +1,55 @@
@@ -1569,7 +1462,6 @@ index 0000000000..e1f3ed1780
 +}
 diff --git a/gdb/testsuite/gdb.base/vla.exp b/gdb/testsuite/gdb.base/vla.exp
 new file mode 100644
-index 0000000000..71fe637272
 --- /dev/null
 +++ b/gdb/testsuite/gdb.base/vla.exp
 @@ -0,0 +1,62 @@
@@ -1637,7 +1529,6 @@ index 0000000000..71fe637272
 +gdb_test "p temp3" " = '3' <repeats 48 times>" "second: print temp3"
 diff --git a/gdb/testsuite/gdb.cp/gdb9593.cc b/gdb/testsuite/gdb.cp/gdb9593.cc
 new file mode 100644
-index 0000000000..783c9622a8
 --- /dev/null
 +++ b/gdb/testsuite/gdb.cp/gdb9593.cc
 @@ -0,0 +1,180 @@
@@ -1823,7 +1714,6 @@ index 0000000000..783c9622a8
 +
 diff --git a/gdb/testsuite/gdb.cp/gdb9593.exp b/gdb/testsuite/gdb.cp/gdb9593.exp
 new file mode 100644
-index 0000000000..ef40424402
 --- /dev/null
 +++ b/gdb/testsuite/gdb.cp/gdb9593.exp
 @@ -0,0 +1,182 @@
@@ -2011,7 +1901,6 @@ index 0000000000..ef40424402
 +  "advance-over-throw"
 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S
 new file mode 100644
-index 0000000000..aac3baad8a
 --- /dev/null
 +++ b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S
 @@ -0,0 +1,246 @@
@@ -2263,7 +2152,6 @@ index 0000000000..aac3baad8a
 +      .string         "unsigned int"
 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp
 new file mode 100644
-index 0000000000..39e69b470f
 --- /dev/null
 +++ b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp
 @@ -0,0 +1,66 @@
@@ -2335,7 +2223,6 @@ index 0000000000..39e69b470f
 +gdb_test "ptype reg_string" {type = char \[-?[0-9]+\]}
 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stripped.c b/gdb/testsuite/gdb.dwarf2/dw2-stripped.c
 new file mode 100644
-index 0000000000..1f02d90eeb
 --- /dev/null
 +++ b/gdb/testsuite/gdb.dwarf2/dw2-stripped.c
 @@ -0,0 +1,42 @@
@@ -2383,7 +2270,6 @@ index 0000000000..1f02d90eeb
 +}
 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp b/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp
 new file mode 100644
-index 0000000000..9336e03157
 --- /dev/null
 +++ b/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp
 @@ -0,0 +1,79 @@
@@ -2468,7 +2354,6 @@ index 0000000000..9336e03157
 +         "step"
 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S
 new file mode 100644
-index 0000000000..5fcdd84986
 --- /dev/null
 +++ b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S
 @@ -0,0 +1,83 @@
@@ -2557,7 +2442,6 @@ index 0000000000..5fcdd84986
 +      .byte           0x0                     /* Terminator */
 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp
 new file mode 100644
-index 0000000000..bc35209fe5
 --- /dev/null
 +++ b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp
 @@ -0,0 +1,37 @@
@@ -2600,7 +2484,6 @@ index 0000000000..bc35209fe5
 +gdb_test "ptype struct some_struct" "type = struct some_struct {\[\r\n \t\]*void field;\[\r\n \t\]*}"
 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S b/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S
 new file mode 100644
-index 0000000000..9dbbf3c3e1
 --- /dev/null
 +++ b/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S
 @@ -0,0 +1,121 @@
@@ -2727,7 +2610,6 @@ index 0000000000..9dbbf3c3e1
 +      .byte           0x0                     /* Terminator */
 diff --git a/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp
 new file mode 100644
-index 0000000000..cec673cd39
 --- /dev/null
 +++ b/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp
 @@ -0,0 +1,39 @@
@@ -2772,7 +2654,6 @@ index 0000000000..cec673cd39
 +gdb_test "p notype_string" " = 'x' <repeats 129 times>"
 diff --git a/gdb/testsuite/gdb.fortran/dwarf-stride.exp b/gdb/testsuite/gdb.fortran/dwarf-stride.exp
 new file mode 100644
-index 0000000000..d7b8bea8db
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/dwarf-stride.exp
 @@ -0,0 +1,42 @@
@@ -2820,7 +2701,6 @@ index 0000000000..d7b8bea8db
 +gdb_test "p c40pt(2)" " = '1-hello.*"
 diff --git a/gdb/testsuite/gdb.fortran/dwarf-stride.f90 b/gdb/testsuite/gdb.fortran/dwarf-stride.f90
 new file mode 100644
-index 0000000000..e492b3af42
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/dwarf-stride.f90
 @@ -0,0 +1,40 @@
@@ -2866,7 +2746,6 @@ index 0000000000..e492b3af42
 +end program repro
 diff --git a/gdb/testsuite/gdb.fortran/dynamic.exp b/gdb/testsuite/gdb.fortran/dynamic.exp
 new file mode 100644
-index 0000000000..37d435f799
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/dynamic.exp
 @@ -0,0 +1,154 @@
@@ -3026,7 +2905,6 @@ index 0000000000..37d435f799
 +gdb_test "p vart(2,9)" "\\$\[0-9\]* = 10"
 diff --git a/gdb/testsuite/gdb.fortran/dynamic.f90 b/gdb/testsuite/gdb.fortran/dynamic.f90
 new file mode 100644
-index 0000000000..0f43564378
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/dynamic.f90
 @@ -0,0 +1,98 @@
@@ -3130,7 +3008,6 @@ index 0000000000..0f43564378
 +end
 diff --git a/gdb/testsuite/gdb.fortran/string.exp b/gdb/testsuite/gdb.fortran/string.exp
 new file mode 100644
-index 0000000000..1b7c0dbf73
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/string.exp
 @@ -0,0 +1,59 @@
@@ -3195,7 +3072,6 @@ index 0000000000..1b7c0dbf73
 +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"
 diff --git a/gdb/testsuite/gdb.fortran/string.f90 b/gdb/testsuite/gdb.fortran/string.f90
 new file mode 100644
-index 0000000000..226dc5d0ff
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/string.f90
 @@ -0,0 +1,37 @@
@@ -3238,7 +3114,6 @@ index 0000000000..226dc5d0ff
 +end
 diff --git a/gdb/testsuite/gdb.fortran/subrange.exp b/gdb/testsuite/gdb.fortran/subrange.exp
 new file mode 100644
-index 0000000000..c121ab9751
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/subrange.exp
 @@ -0,0 +1,72 @@
@@ -3316,7 +3191,6 @@ index 0000000000..c121ab9751
 +gdb_test {p $a (3, 2:2)} { = \(23\)}
 diff --git a/gdb/testsuite/gdb.fortran/subrange.f90 b/gdb/testsuite/gdb.fortran/subrange.f90
 new file mode 100644
-index 0000000000..4747ea9746
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/subrange.f90
 @@ -0,0 +1,28 @@
@@ -3350,7 +3224,6 @@ index 0000000000..4747ea9746
 +end
 diff --git a/gdb/testsuite/gdb.mi/mi2-var-stale-type.c b/gdb/testsuite/gdb.mi/mi2-var-stale-type.c
 new file mode 100644
-index 0000000000..ebced3c042
 --- /dev/null
 +++ b/gdb/testsuite/gdb.mi/mi2-var-stale-type.c
 @@ -0,0 +1,26 @@
@@ -3382,7 +3255,6 @@ index 0000000000..ebced3c042
 +}
 diff --git a/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp b/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp
 new file mode 100644
-index 0000000000..88326c0390
 --- /dev/null
 +++ b/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp
 @@ -0,0 +1,57 @@
@@ -3445,7 +3317,6 @@ index 0000000000..88326c0390
 +mi_gdb_test "-var-update *" "\\^done,changelist=.*" "-var-update *"
 diff --git a/gdb/testsuite/gdb.opt/array-from-register-func.c b/gdb/testsuite/gdb.opt/array-from-register-func.c
 new file mode 100644
-index 0000000000..729f457c82
 --- /dev/null
 +++ b/gdb/testsuite/gdb.opt/array-from-register-func.c
 @@ -0,0 +1,22 @@
@@ -3473,7 +3344,6 @@ index 0000000000..729f457c82
 +}
 diff --git a/gdb/testsuite/gdb.opt/array-from-register.c b/gdb/testsuite/gdb.opt/array-from-register.c
 new file mode 100644
-index 0000000000..3090e7e631
 --- /dev/null
 +++ b/gdb/testsuite/gdb.opt/array-from-register.c
 @@ -0,0 +1,28 @@
@@ -3507,7 +3377,6 @@ index 0000000000..3090e7e631
 +}
 diff --git a/gdb/testsuite/gdb.opt/array-from-register.exp b/gdb/testsuite/gdb.opt/array-from-register.exp
 new file mode 100644
-index 0000000000..f2de718bc3
 --- /dev/null
 +++ b/gdb/testsuite/gdb.opt/array-from-register.exp
 @@ -0,0 +1,33 @@
@@ -3546,7 +3415,6 @@ index 0000000000..f2de718bc3
 +gdb_test "p arr\[0\]" "\\$\[0-9\]+ = 42"
 diff --git a/gdb/testsuite/gdb.opt/fortran-string.exp b/gdb/testsuite/gdb.opt/fortran-string.exp
 new file mode 100644
-index 0000000000..90a2bdf212
 --- /dev/null
 +++ b/gdb/testsuite/gdb.opt/fortran-string.exp
 @@ -0,0 +1,39 @@
@@ -3591,7 +3459,6 @@ index 0000000000..90a2bdf212
 +gdb_test "p s" "\\$\[0-9\]* = 'foo'"
 diff --git a/gdb/testsuite/gdb.opt/fortran-string.f90 b/gdb/testsuite/gdb.opt/fortran-string.f90
 new file mode 100644
-index 0000000000..e48d520085
 --- /dev/null
 +++ b/gdb/testsuite/gdb.opt/fortran-string.f90
 @@ -0,0 +1,28 @@
@@ -3625,7 +3492,6 @@ index 0000000000..e48d520085
 +  end
 diff --git a/gdb/testsuite/gdb.pascal/arrays.exp b/gdb/testsuite/gdb.pascal/arrays.exp
 new file mode 100644
-index 0000000000..22acdb86d8
 --- /dev/null
 +++ b/gdb/testsuite/gdb.pascal/arrays.exp
 @@ -0,0 +1,104 @@
@@ -3735,7 +3601,6 @@ index 0000000000..22acdb86d8
 +
 diff --git a/gdb/testsuite/gdb.pascal/arrays.pas b/gdb/testsuite/gdb.pascal/arrays.pas
 new file mode 100644
-index 0000000000..295602d68c
 --- /dev/null
 +++ b/gdb/testsuite/gdb.pascal/arrays.pas
 @@ -0,0 +1,82 @@
@@ -3822,10 +3687,9 @@ index 0000000000..295602d68c
 +  writeln(s); { set breakpoint 2 here }
 +end.
 diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
-index a165bf0938..a13aaf7869 100644
 --- a/gdb/testsuite/lib/gdb.exp
 +++ b/gdb/testsuite/lib/gdb.exp
-@@ -169,6 +169,11 @@ proc gdb_unload {} {
+@@ -170,6 +170,11 @@ proc gdb_unload {} {
            send_gdb "y\n"
            exp_continue
        }
@@ -3838,7 +3702,6 @@ index a165bf0938..a13aaf7869 100644
            send_gdb "y\n"
            exp_continue
 diff --git a/gdb/testsuite/lib/pascal.exp b/gdb/testsuite/lib/pascal.exp
-index 03d1b1bc06..9f9e143dff 100644
 --- a/gdb/testsuite/lib/pascal.exp
 +++ b/gdb/testsuite/lib/pascal.exp
 @@ -37,6 +37,9 @@ proc pascal_init {} {
@@ -3872,6 +3735,3 @@ index 03d1b1bc06..9f9e143dff 100644
      }
      set pascal_init_done 1
  }   
--- 
-2.14.3
-
diff --git a/gdb-gdb-add-index-script.patch b/gdb-gdb-add-index-script.patch
deleted file mode 100644 (file)
index a4a2620..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
-From: Fedora GDB patches <invalid@email.com>
-Date: Fri, 27 Oct 2017 21:07:50 +0200
-Subject: RFC: add DWARF index support
-
-FileName: gdb-gdb-add-index-script.patch
-
-;; Provide /usr/bin/gdb-add-index for rpm-build (Tom Tromey).
-;;=push: Re-check against the upstream version.
-
-http://sourceware.org/ml/gdb-patches/2010-07/msg00184.html
-
-Jan Kratochvil: Fixed $d -> $dir.
-Jan Kratochvil: Remove /dev/null redirection.
-
->>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
-
-Tom> This patch series adds support for a DWARF index to gdb.
-
-Roland suggested we wrap up the index-creation code into a helper
-script.
-
-I'm not sure if this is something people would want in gdb proper, but I
-figured I would send it here just in case.
-
-Tom
-
-2010-07-09  Tom Tromey  <tromey@redhat.com>
-
-       * Makefile.in (install-only): Install gdb-add-index.
-       * gdb-add-index: New file.
-
-2010-07-09  Tom Tromey  <tromey@redhat.com>
-
-       * gdb.texinfo (Index Files): Mention gdb-add-index.
-
->From 30714fe719e61baea03d0dc5793eb0d564faebb7 Mon Sep 17 00:00:00 2001
-From: Tom Tromey <tromey@redhat.com>
-Date: Fri, 9 Jul 2010 11:17:54 -0600
-Subject: [PATCH 4/4] add gdb-add-index
-Subject: [PATCH 4/4] add gdb-add-index
----
- gdb/Makefile.in     |  9 +++++++++
- gdb/doc/Makefile.in |  9 ++++++++-
- gdb/doc/gdb.texinfo | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 74 insertions(+), 1 deletion(-)
-
-diff --git a/gdb/Makefile.in b/gdb/Makefile.in
-index e77d6a5c03..3142ad6af1 100644
---- a/gdb/Makefile.in
-+++ b/gdb/Makefile.in
-@@ -1770,6 +1770,15 @@ install-only: install-gstack $(CONFIG_INSTALL)
-                 $(INSTALL_SCRIPT) gcore \
-                         $(DESTDIR)$(bindir)/$$transformed_name; \
-       fi
-+      transformed_name=`t='$(program_transform_name)'; \
-+                        echo gdb-add-index | sed -e "$$t"` ; \
-+              if test "x$$transformed_name" = x; then \
-+                transformed_name=gdb-add-index ; \
-+              else \
-+                true ; \
-+              fi ; \
-+              $(INSTALL_PROGRAM) $(srcdir)/contrib/gdb-add-index.sh \
-+                      $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT)
-       @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
- install-strip:
-diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
-index eafadee899..0323bc4ecb 100644
---- a/gdb/doc/Makefile.in
-+++ b/gdb/doc/Makefile.in
-@@ -174,7 +174,7 @@ POD2MAN5 = pod2man --center="GNU Development Tools" \
-                  --release="gdb-`sed q version.subst`" --section=5
- # List of man pages generated from gdb.texi
--MAN1S = gdb.1 gdbserver.1 gcore.1
-+MAN1S = gdb.1 gdbserver.1 gcore.1 gdb-add-index.1
- MAN5S = gdbinit.5
- MANS = $(MAN1S) $(MAN5S)
-@@ -633,6 +633,13 @@ gcore.1: $(GDB_DOC_FILES)
-               mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
-       rm -f gcore.pod
-+gdb-add-index.1: $(GDB_DOC_FILES)
-+      touch $@
-+      -$(TEXI2POD) $(MANCONF) -Dgdb-add-index < $(srcdir)/gdb.texinfo > gdb-add-index.pod
-+      -($(POD2MAN1) gdb-add-index.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
-+              mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
-+      rm -f gdb-add-index.pod
-+
- gdbinit.5: $(GDB_DOC_FILES)
-       touch $@
-       -$(TEXI2POD) $(MANCONF) -Dgdbinit < $(srcdir)/gdb.texinfo > gdbinit.pod
-diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
-index 2f2cbd3dea..7b99ae1551 100644
---- a/gdb/doc/gdb.texinfo
-+++ b/gdb/doc/gdb.texinfo
-@@ -19796,6 +19796,14 @@ There are currently some limitation on indices.  They only work when
- for DWARF debugging information, not stabs.  And, they do not
- currently work for programs using Ada.
-+@value{GDBN} comes with a program, @command{gdb-add-index}, which can
-+be used to add the index to a symbol file.  It takes the symbol file
-+as its only argument:
-+
-+@smallexample
-+$ gdb-add-index symfile
-+@end smallexample
-+
- @node Symbol Errors
- @section Errors Reading Symbol Files
-@@ -42759,6 +42767,7 @@ switch (die->tag)
- * gdbserver man::               Remote Server for the GNU Debugger man page
- * gcore man::                   Generate a core file of a running program
- * gdbinit man::                 gdbinit scripts
-+* gdb-add-index man::           Add index files to speed up GDB
- @end menu
- @node gdb man
-@@ -43435,6 +43444,54 @@ Richard M. Stallman and Roland H. Pesch, July 1991.
- @end ifset
- @c man end
-+@node gdb-add-index man
-+@heading gdb-add-index
-+
-+@c man title gdb-add-index Add index files to speed up GDB
-+
-+@c man begin SYNOPSIS gdb-add-index
-+gdb-add-index @var{filename}
-+@c man end
-+
-+@c man begin DESCRIPTION gdb-add-index
-+When GDB finds a symbol file, it scans the symbols in the file in order
-+to construct an internal symbol table.  This lets most GDB operations
-+work quickly--at the cost of a delay early on.  For large programs,
-+this delay can be quite lengthy, so GDB provides a way to build an
-+index, which speeds up startup.
-+
-+To determine whether a file contains such an index, use the command
-+@command{readelf -S filename}: the index is stored in a section named
-+@code{.gdb_index}.  Note that the index is never generated for files that do
-+not contain DWARF debug information (sections named @code{.debug_*}).
-+
-+See more in
-+@ifset man
-+the @value{GDBN} manual in node @code{Index Files}
-+-- shell command @code{info -f gdb -n 'Index Files'}.
-+@end ifset
-+@ifclear man
-+@ref{Index Files}.
-+@end ifclear
-+@c man end
-+
-+@c man begin SEEALSO gdb-add-index
-+@ifset man
-+The full documentation for @value{GDBN} is maintained as a Texinfo manual.
-+If the @code{info} and @code{gdb} programs and @value{GDBN}'s Texinfo
-+documentation are properly installed at your site, the command
-+
-+@smallexample
-+info gdb
-+@end smallexample
-+
-+should give you access to the complete manual.
-+
-+@cite{Using GDB: A Guide to the GNU Source-Level Debugger},
-+Richard M. Stallman and Roland H. Pesch, July 1991.
-+@end ifset
-+@c man end
-+
- @include gpl.texi
- @node GNU Free Documentation License
--- 
-2.14.3
-
index 7d0082715eed4aa917cfc7bfbcd99cb41942f209..171d68f28e9a9a9c99ce6728d657ad861286b5f8 100644 (file)
      maybe-install-strip-sid \
      maybe-install-strip-sim \
      maybe-install-strip-texinfo \
-@@ -42608,7 +42589,6 @@
- all-gdb: maybe-all-libiberty
- all-gdb: maybe-all-libiconv
- all-gdb: maybe-all-opcodes
+@@ -49604,7 +49604,6 @@ all-stage4-intl: maybe-all-stage4-libico
+ all-stageprofile-intl: maybe-all-stageprofile-libiconv
+ all-stagefeedback-intl: maybe-all-stagefeedback-libiconv
+ configure-gdb: maybe-configure-sim
 -all-gdb: maybe-all-readline
  all-gdb: maybe-all-build-bison
  all-gdb: maybe-all-sim
- all-gdb: maybe-all-libdecnumber
-@@ -42946,7 +42926,6 @@
- all-sim: maybe-all-libiberty
- all-sim: maybe-all-bfd
- all-sim: maybe-all-opcodes
+ all-gdb: maybe-all-libtermcap
+@@ -49927,7 +49926,6 @@ install-sid: maybe-install-tcl
+ install-strip-sid: maybe-install-strip-tcl
+ install-sid: maybe-install-tk
+ install-strip-sid: maybe-install-strip-tk
 -all-sim: maybe-all-readline
  all-sim: maybe-configure-gdb
- all-fastjar: maybe-all-zlib
  all-fastjar: maybe-all-build-texinfo
+ all-bison: maybe-all-build-texinfo
index 76f8f81b9d44652b9f737b171b354bb307fb2724..7868efe758192fca651c6e87f93c6a3a8e1c5929 100644 (file)
@@ -3,8 +3,6 @@ From: Fedora GDB patches <invalid@email.com>
 Date: Fri, 27 Oct 2017 21:07:50 +0200
 Subject: gdb-vla-intel-fortran-strides.patch
 
-FileName: gdb-vla-intel-fortran-strides.patch
-
 ;; VLA (Fortran dynamic arrays) from Intel + archer-jankratochvil-vla tests.
 ;;=push
 
@@ -35,41 +33,11 @@ dbfd7140bf4c0500d1f5d192be781f83f78f7922
  gdb/valops.c                                | 197 +++++++++++--
  gdb/value.h                                 |   2 +
  23 files changed, 1242 insertions(+), 183 deletions(-)
----
- 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                                | 199 +++++++++++--
- gdb/value.h                                 |   2 +
- 23 files changed, 1245 insertions(+), 182 deletions(-)
- create mode 100644 gdb/testsuite/gdb.fortran/static-arrays.exp
- create mode 100644 gdb/testsuite/gdb.fortran/static-arrays.f90
- create mode 100644 gdb/testsuite/gdb.fortran/vla-stride.exp
- create mode 100644 gdb/testsuite/gdb.fortran/vla-stride.f90
 
 diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
-index 51f133f1b5..5105c8d23a 100644
 --- a/gdb/dwarf2loc.c
 +++ b/gdb/dwarf2loc.c
-@@ -2601,11 +2601,14 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
+@@ -2600,11 +2600,14 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
  /* See dwarf2loc.h.  */
  
  int
@@ -86,7 +54,7 @@ index 51f133f1b5..5105c8d23a 100644
    if (prop == NULL)
      return 0;
  
-@@ -2629,7 +2632,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
+@@ -2628,7 +2631,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
  
                *value = value_as_address (val);
              }
@@ -95,7 +63,7 @@ index 51f133f1b5..5105c8d23a 100644
          }
        }
        break;
-@@ -2651,7 +2654,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
+@@ -2650,7 +2653,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
            if (!value_optimized_out (val))
              {
                *value = value_as_address (val);
@@ -104,7 +72,7 @@ index 51f133f1b5..5105c8d23a 100644
              }
          }
        }
-@@ -2659,8 +2662,8 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
+@@ -2658,8 +2661,8 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
  
      case PROP_CONST:
        *value = prop->data.const_val;
@@ -115,7 +83,7 @@ index 51f133f1b5..5105c8d23a 100644
      case PROP_ADDR_OFFSET:
        {
        struct dwarf2_property_baton *baton
-@@ -2681,11 +2684,38 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
+@@ -2680,11 +2683,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);
@@ -157,7 +125,6 @@ index 51f133f1b5..5105c8d23a 100644
  
  /* See dwarf2loc.h.  */
 diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h
-index f82e7b2d11..74f0597359 100644
 --- a/gdb/dwarf2loc.h
 +++ b/gdb/dwarf2loc.h
 @@ -143,6 +143,12 @@ int dwarf2_evaluate_property (const struct dynamic_prop *prop,
@@ -174,10 +141,9 @@ index f82e7b2d11..74f0597359 100644
     property to C code.
  
 diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
-index 58da0fc1f9..8fc1f7ec45 100644
 --- a/gdb/dwarf2read.c
 +++ b/gdb/dwarf2read.c
-@@ -17551,7 +17551,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -17566,7 +17566,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;
@@ -186,7 +152,7 @@ index 58da0fc1f9..8fc1f7ec45 100644
    int low_default_is_valid;
    int high_bound_is_count = 0;
    const char *name;
-@@ -17571,7 +17571,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -17586,7 +17586,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
  
    low.kind = PROP_CONST;
    high.kind = PROP_CONST;
@@ -196,21 +162,22 @@ index 58da0fc1f9..8fc1f7ec45 100644
  
    /* Set LOW_DEFAULT_IS_VALID if current language and DWARF version allow
       omitting DW_AT_lower_bound.  */
-@@ -17604,6 +17606,13 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -17619,6 +17621,14 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
        break;
      }
  
 +  attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
 +  if (attr)
 +    if (!attr_to_dynamic_prop (attr, die, cu, &stride))
-+        complaint (&symfile_complaints, _("Missing DW_AT_byte_stride "
-+                  "- DIE at 0x%x [in module %s]"),
-+             to_underlying (die->sect_off), objfile_name (cu->objfile));
++        complaint (_("Missing DW_AT_byte_stride "
++                   "- DIE at 0x%s [in module %s]"),
++                 sect_offset_str (die->sect_off),
++                 objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
 +
    attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
    if (attr)
      attr_to_dynamic_prop (attr, die, cu, &low);
-@@ -17680,7 +17689,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -17696,7 +17706,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;
  
@@ -220,10 +187,9 @@ index 58da0fc1f9..8fc1f7ec45 100644
    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 6f74c41b9f..d9bca2791d 100644
 --- a/gdb/eval.c
 +++ b/gdb/eval.c
-@@ -384,29 +384,325 @@ init_array_element (struct value *array, struct value *element,
+@@ -377,29 +377,325 @@ init_array_element (struct value *array, struct value *element,
    return index;
  }
  
@@ -567,7 +533,7 @@ index 6f74c41b9f..d9bca2791d 100644
  }
  
  
-@@ -1928,19 +2224,8 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -1926,19 +2222,8 @@ evaluate_subexp_standard (struct type *expect_type,
        switch (code)
        {
        case TYPE_CODE_ARRAY:
@@ -588,7 +554,7 @@ index 6f74c41b9f..d9bca2791d 100644
  
        case TYPE_CODE_PTR:
        case TYPE_CODE_FUNC:
-@@ -2336,49 +2621,6 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -2334,49 +2619,6 @@ evaluate_subexp_standard (struct type *expect_type,
        }
        return (arg1);
  
@@ -638,7 +604,7 @@ index 6f74c41b9f..d9bca2791d 100644
      case BINOP_LOGICAL_AND:
        arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
        if (noside == EVAL_SKIP)
-@@ -3282,6 +3524,9 @@ calc_f77_array_dims (struct type *array_type)
+@@ -3293,6 +3535,9 @@ calc_f77_array_dims (struct type *array_type)
    int ndimen = 1;
    struct type *tmp_type;
  
@@ -649,15 +615,21 @@ index 6f74c41b9f..d9bca2791d 100644
      error (_("Can't get dimensions for a non-array type"));
  
 diff --git a/gdb/expprint.c b/gdb/expprint.c
-index ac5ae0fea1..41bb357a27 100644
 --- a/gdb/expprint.c
 +++ b/gdb/expprint.c
-@@ -581,12 +581,10 @@ print_subexp_standard (struct expression *exp, int *pos,
+@@ -578,17 +578,14 @@ print_subexp_standard (struct expression *exp, int *pos,
+         longest_to_int (exp->elts[pc + 1].longconst);
        *pos += 2;
  
+-      if (range_type == NONE_BOUND_DEFAULT_EXCLUSIVE
+-          || range_type == LOW_BOUND_DEFAULT_EXCLUSIVE)
++      if ((range_type & SUBARRAY_HIGH_BOUND_EXCLUSIVE)
++          == SUBARRAY_HIGH_BOUND_EXCLUSIVE)
+         fputs_filtered ("EXCLUSIVE_", stream);
        fputs_filtered ("RANGE(", stream);
 -      if (range_type == HIGH_BOUND_DEFAULT
--          || range_type == NONE_BOUND_DEFAULT)
+-          || range_type == NONE_BOUND_DEFAULT
+-          || range_type == NONE_BOUND_DEFAULT_EXCLUSIVE)
 +      if ((range_type & SUBARRAY_LOW_BOUND) == SUBARRAY_LOW_BOUND)
          print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
        fputs_filtered ("..", stream);
@@ -667,7 +639,7 @@ index ac5ae0fea1..41bb357a27 100644
          print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
        fputs_filtered (")", stream);
        return;
-@@ -1094,16 +1092,16 @@ dump_subexp_body_standard (struct expression *exp,
+@@ -1098,22 +1095,24 @@ dump_subexp_body_standard (struct expression *exp,
  
        switch (range_type)
          {
@@ -679,16 +651,28 @@ index ac5ae0fea1..41bb357a27 100644
 +        case SUBARRAY_HIGH_BOUND:
            fputs_filtered ("Range '..EXP'", stream);
            break;
+-        case LOW_BOUND_DEFAULT_EXCLUSIVE:
+-          fputs_filtered ("ExclusiveRange '..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
++              | SUBARRAY_HIGH_BOUND_EXCLUSIVE):
++          fputs_filtered ("ExclusiveRange '..EXP'", stream);
++          break;
 +        case (SUBARRAY_LOW_BOUND | SUBARRAY_HIGH_BOUND):
            fputs_filtered ("Range 'EXP..EXP'", stream);
            break;
+-        case NONE_BOUND_DEFAULT_EXCLUSIVE:
++        case (SUBARRAY_HIGH_BOUND | SUBARRAY_HIGH_BOUND_EXCLUSIVE):
+           fputs_filtered ("ExclusiveRange 'EXP..EXP'", stream);
+           break;
          default:
-@@ -1111,11 +1109,9 @@ dump_subexp_body_standard (struct expression *exp,
+@@ -1121,11 +1120,9 @@ dump_subexp_body_standard (struct expression *exp,
            break;
          }
  
@@ -703,38 +687,58 @@ index ac5ae0fea1..41bb357a27 100644
        }
        break;
 diff --git a/gdb/expression.h b/gdb/expression.h
-index a783ea5fef..be24792eb6 100644
 --- a/gdb/expression.h
 +++ b/gdb/expression.h
-@@ -153,17 +153,17 @@ extern void dump_raw_expression (struct expression *,
+@@ -148,28 +148,27 @@ extern void dump_raw_expression (struct expression *,
                                 struct ui_file *, const 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.  */
-+
+-   array or string.  Also, the upper end of the range can be exclusive
+-   or inclusive.  So we have six 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.
++   Also, the upper end of the range can be exclusive or inclusive.
++   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)"  */
+-{
+-  /* Neither the low nor the high bound was given -- so this refers to
+-     the entire available range.  */
+-  BOTH_BOUND_DEFAULT,
+-  /* The low bound was not given and the high bound is inclusive.  */
+-  LOW_BOUND_DEFAULT,
+-  /* The high bound was not given and the low bound in inclusive.  */
+-  HIGH_BOUND_DEFAULT,
+-  /* Both bounds were given and both are inclusive.  */
+-  NONE_BOUND_DEFAULT,
+-  /* The low bound was not given and the high bound is exclusive.  */
+-  NONE_BOUND_DEFAULT_EXCLUSIVE,
+-  /* Both bounds were given.  The low bound is inclusive and the high
+-     bound is exclusive.  */
+-  LOW_BOUND_DEFAULT_EXCLUSIVE,
+-};
++  {
 +    SUBARRAY_NONE_BOUND = 0x0,                /* "( : )"  */
 +    SUBARRAY_LOW_BOUND = 0x1,         /* "(low:)"  */
 +    SUBARRAY_HIGH_BOUND = 0x2,                /* "(:high)"  */
-+    SUBARRAY_STRIDE = 0x4             /* "(::stride)"  */
-   };
++    SUBARRAY_STRIDE = 0x4,            /* "(::stride)"  */
++    /* The low bound was not given and the high bound is exclusive.
++       In this case we always use (SUBARRAY_HIGH_BOUND |
++       SUBARRAY_HIGH_BOUND_EXCLUSIVE).  */
++    SUBARRAY_HIGH_BOUND_EXCLUSIVE = 0x8,
++    /* Both bounds were given.  The low bound is inclusive and the high
++       bound is exclusive.  In this case, we use (SUBARRAY_LOW_BOUND |
++       SUBARRAY_HIGH_BOUND | SUBARRAY_HIGH_BOUND_EXCLUSIVE).  */
++    // SUBARRAY_LOW_BOUND_EXCLUSIVE = (SUBARRAY_LOW_BOUND
++    //                                    | SUBARRAY_HIGH_BOUND_EXCLUSIVE),
++  };
  
  #endif /* !defined (EXPRESSION_H) */
 diff --git a/gdb/f-exp.y b/gdb/f-exp.y
-index 6495e03cc5..cd89bb7ca2 100644
 --- a/gdb/f-exp.y
 +++ b/gdb/f-exp.y
 @@ -257,31 +257,63 @@ arglist :        subrange
@@ -807,7 +811,6 @@ index 6495e03cc5..cd89bb7ca2 100644
        ;
  
 diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
-index 903f2af638..b4067a8460 100644
 --- a/gdb/f-valprint.c
 +++ b/gdb/f-valprint.c
 @@ -119,8 +119,14 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type,
@@ -827,7 +830,6 @@ index 903f2af638..b4067a8460 100644
        for (i = lowerbound;
           (i < upperbound + 1 && (*elts) < options->print_max);
 diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
-index 43fe56e487..a72e2b3e0a 100644
 --- a/gdb/gdbtypes.c
 +++ b/gdb/gdbtypes.c
 @@ -902,7 +902,8 @@ operator== (const range_bounds &l, const range_bounds &r)
@@ -892,7 +894,7 @@ index 43fe56e487..a72e2b3e0a 100644
        else if (bit_stride > 0)
        TYPE_LENGTH (result_type) =
          (bit_stride * (high_bound - low_bound + 1) + 7) / 8;
-@@ -1992,12 +2002,12 @@ resolve_dynamic_range (struct type *dyn_range_type,
+@@ -1981,12 +1991,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;
@@ -907,7 +909,7 @@ index 43fe56e487..a72e2b3e0a 100644
      {
        low_bound.kind = PROP_CONST;
        low_bound.data.const_val = value;
-@@ -2009,7 +2019,7 @@ resolve_dynamic_range (struct type *dyn_range_type,
+@@ -1998,7 +2008,7 @@ resolve_dynamic_range (struct type *dyn_range_type,
      }
  
    prop = &TYPE_RANGE_DATA (dyn_range_type)->high;
@@ -916,7 +918,7 @@ index 43fe56e487..a72e2b3e0a 100644
      {
        high_bound.kind = PROP_CONST;
        high_bound.data.const_val = value;
-@@ -2024,12 +2034,20 @@ resolve_dynamic_range (struct type *dyn_range_type,
+@@ -2013,12 +2023,20 @@ resolve_dynamic_range (struct type *dyn_range_type,
        high_bound.data.const_val = 0;
      }
  
@@ -939,10 +941,9 @@ index 43fe56e487..a72e2b3e0a 100644
    return static_range_type;
  }
 diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
-index 92ca85c295..179238ce82 100644
 --- a/gdb/gdbtypes.h
 +++ b/gdb/gdbtypes.h
-@@ -560,6 +560,10 @@ struct range_bounds
+@@ -612,6 +612,10 @@ struct range_bounds
  
    struct dynamic_prop high;
  
@@ -953,7 +954,7 @@ index 92ca85c295..179238ce82 100644
    /* True if HIGH range bound contains the number of elements in the
       subrange. This affects how the final hight bound is computed.  */
  
-@@ -731,7 +735,6 @@ struct main_type
+@@ -776,7 +780,6 @@ struct main_type
      /* * Union member used for range types.  */
  
      struct range_bounds *bounds;
@@ -961,7 +962,7 @@ index 92ca85c295..179238ce82 100644
    } flds_bnds;
  
    /* * Slot to point to additional language-specific fields of this
-@@ -1253,6 +1256,15 @@ extern void allocate_gnat_aux_type (struct type *);
+@@ -1329,6 +1332,15 @@ extern bool set_type_align (struct type *, ULONGEST);
    TYPE_RANGE_DATA(range_type)->high.kind
  #define TYPE_LOW_BOUND_KIND(range_type) \
    TYPE_RANGE_DATA(range_type)->low.kind
@@ -977,7 +978,7 @@ index 92ca85c295..179238ce82 100644
  
  /* Property accessors for the type data location.  */
  #define TYPE_DATA_LOCATION(thistype) \
-@@ -1287,6 +1299,9 @@ extern void allocate_gnat_aux_type (struct type *);
+@@ -1363,6 +1375,9 @@ extern bool set_type_align (struct type *, ULONGEST);
     TYPE_HIGH_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
  #define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \
     TYPE_LOW_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
@@ -987,7 +988,7 @@ index 92ca85c295..179238ce82 100644
  
  #define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \
     (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype))))
-@@ -1818,6 +1833,7 @@ extern struct type *create_array_type_with_stride
+@@ -1892,6 +1907,7 @@ extern struct type *create_array_type_with_stride
     struct dynamic_prop *, unsigned int);
  
  extern struct type *create_range_type (struct type *, struct type *,
@@ -996,10 +997,9 @@ index 92ca85c295..179238ce82 100644
                                       const struct dynamic_prop *);
  
 diff --git a/gdb/parse.c b/gdb/parse.c
-index 8b2bb22c76..e1bf3edbe2 100644
 --- a/gdb/parse.c
 +++ b/gdb/parse.c
-@@ -984,22 +984,20 @@ operator_length_standard (const struct expression *expr, int endpos,
+@@ -989,24 +989,20 @@ operator_length_standard (const struct expression *expr, int endpos,
  
      case OP_RANGE:
        oplen = 3;
@@ -1010,6 +1010,7 @@ index 8b2bb22c76..e1bf3edbe2 100644
 -      switch (range_type)
 -      {
 -      case LOW_BOUND_DEFAULT:
+-      case LOW_BOUND_DEFAULT_EXCLUSIVE:
 -      case HIGH_BOUND_DEFAULT:
 -        args = 1;
 -        break;
@@ -1017,6 +1018,7 @@ index 8b2bb22c76..e1bf3edbe2 100644
 -        args = 0;
 -        break;
 -      case NONE_BOUND_DEFAULT:
+-      case NONE_BOUND_DEFAULT_EXCLUSIVE:
 -        args = 2;
 -        break;
 -      }
@@ -1034,10 +1036,9 @@ index 8b2bb22c76..e1bf3edbe2 100644
        break;
  
 diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y
-index 199e87671e..397a92dfdb 100644
 --- a/gdb/rust-exp.y
 +++ b/gdb/rust-exp.y
-@@ -2448,23 +2448,17 @@ convert_ast_to_expression (struct parser_state *state,
+@@ -2478,24 +2478,28 @@ convert_ast_to_expression (struct parser_state *state,
  
      case OP_RANGE:
        {
@@ -1054,33 +1055,47 @@ index 199e87671e..397a92dfdb 100644
          {
            convert_ast_to_expression (state, operation->right.op, top);
 -          if (kind == BOTH_BOUND_DEFAULT)
--            kind = LOW_BOUND_DEFAULT;
--          else
--            {
+-            kind = (operation->inclusive
+-                    ? LOW_BOUND_DEFAULT : LOW_BOUND_DEFAULT_EXCLUSIVE);
++          if (kind == SUBARRAY_NONE_BOUND)
++            {
++              kind = (range_type) SUBARRAY_HIGH_BOUND;
++              if (!operation->inclusive)
++                kind = (range_type) (kind | SUBARRAY_HIGH_BOUND_EXCLUSIVE);
++            }
+           else
+             {
 -              gdb_assert (kind == HIGH_BOUND_DEFAULT);
--              kind = NONE_BOUND_DEFAULT;
--            }
-+          kind = (range_type) (kind | SUBARRAY_HIGH_BOUND);
+-              kind = (operation->inclusive
+-                      ? NONE_BOUND_DEFAULT : NONE_BOUND_DEFAULT_EXCLUSIVE);
++              gdb_assert (kind == SUBARRAY_LOW_BOUND);
++              kind = (range_type) (kind | SUBARRAY_HIGH_BOUND);
++              if (!operation->inclusive)
++                kind = (range_type) (kind | SUBARRAY_HIGH_BOUND_EXCLUSIVE);
+             }
          }
-       write_exp_elt_opcode (state, OP_RANGE);
-       write_exp_elt_longcst (state, kind);
+       else
 diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
-index f7bec33a42..cb924e084d 100644
 --- a/gdb/rust-lang.c
 +++ b/gdb/rust-lang.c
-@@ -1366,9 +1366,9 @@ rust_range (struct expression *exp, int *pos, enum noside noside)
+@@ -1149,13 +1149,11 @@ rust_range (struct expression *exp, int *pos, enum noside noside)
    kind = (enum range_type) longest_to_int (exp->elts[*pos + 1].longconst);
    *pos += 3;
  
--  if (kind == HIGH_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT)
+-  if (kind == HIGH_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT
+-      || kind == NONE_BOUND_DEFAULT_EXCLUSIVE)
 +  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 == LOW_BOUND_DEFAULT || kind == LOW_BOUND_DEFAULT_EXCLUSIVE
+-      || kind == NONE_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT_EXCLUSIVE)
 +  if ((kind & SUBARRAY_HIGH_BOUND) == SUBARRAY_HIGH_BOUND)
      high = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+-  bool inclusive = (kind == NONE_BOUND_DEFAULT || kind == LOW_BOUND_DEFAULT);
++  bool inclusive = (!((kind & SUBARRAY_HIGH_BOUND_EXCLUSIVE) == SUBARRAY_HIGH_BOUND_EXCLUSIVE));
  
    if (noside == EVAL_SKIP)
-@@ -1457,7 +1457,7 @@ rust_compute_range (struct type *type, struct value *range,
+     return value_from_longest (builtin_type (exp->gdbarch)->builtin_int, 1);
+@@ -1244,7 +1242,7 @@ rust_compute_range (struct type *type, struct value *range,
  
    *low = 0;
    *high = 0;
@@ -1089,7 +1104,7 @@ index f7bec33a42..cb924e084d 100644
  
    if (TYPE_NFIELDS (type) == 0)
      return;
-@@ -1465,15 +1465,14 @@ rust_compute_range (struct type *type, struct value *range,
+@@ -1252,15 +1250,14 @@ rust_compute_range (struct type *type, struct value *range,
    i = 0;
    if (strcmp (TYPE_FIELD_NAME (type, 0), "start") == 0)
      {
@@ -1105,9 +1120,9 @@ index f7bec33a42..cb924e084d 100644
 -             ? LOW_BOUND_DEFAULT : NONE_BOUND_DEFAULT);
 +      *kind = (range_type) (*kind | SUBARRAY_HIGH_BOUND);
        *high = value_as_long (value_field (range, i));
-     }
- }
-@@ -1488,7 +1487,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
+       if (rust_inclusive_range_type_p (type))
+@@ -1278,7 +1275,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
    struct type *rhstype;
    LONGEST low, high_bound;
    /* Initialized to appease the compiler.  */
@@ -1116,7 +1131,7 @@ index f7bec33a42..cb924e084d 100644
    LONGEST high = 0;
    int want_slice = 0;
  
-@@ -1586,7 +1585,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
+@@ -1376,7 +1373,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
        error (_("Cannot subscript non-array type"));
  
        if (want_slice
@@ -1125,7 +1140,7 @@ index f7bec33a42..cb924e084d 100644
        low = low_bound;
        if (low < 0)
        error (_("Index less than zero"));
-@@ -1604,7 +1603,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
+@@ -1394,7 +1391,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
          CORE_ADDR addr;
          struct value *addrval, *tem;
  
@@ -1136,7 +1151,6 @@ index f7bec33a42..cb924e084d 100644
            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 0000000000..cc9ecc04ab
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/static-arrays.exp
 @@ -0,0 +1,421 @@
@@ -1563,7 +1577,6 @@ index 0000000000..cc9ecc04ab
 +              "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 0000000000..f22fcbe124
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/static-arrays.f90
 @@ -0,0 +1,55 @@
@@ -1623,7 +1636,6 @@ index 0000000000..f22fcbe124
 +  call sub
 +end
 diff --git a/gdb/testsuite/gdb.fortran/vla-ptype.exp b/gdb/testsuite/gdb.fortran/vla-ptype.exp
-index 5f367348b0..5351a0aa2e 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 = <not allocated>" "ptype vla2 not allocated"
@@ -1635,7 +1647,6 @@ index 5f367348b0..5351a0aa2e 100644
 +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 3113983ba4..83bc849619 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"
@@ -1648,7 +1659,6 @@ index 3113983ba4..83bc849619 100644
 +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 0000000000..dcf15e5daf
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/vla-stride.exp
 @@ -0,0 +1,44 @@
@@ -1698,7 +1708,6 @@ index 0000000000..dcf15e5daf
 +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 0000000000..8d2425222e
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/vla-stride.f90
 @@ -0,0 +1,29 @@
@@ -1732,7 +1741,6 @@ index 0000000000..8d2425222e
 +  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 508290a36e..d87f59b92b 100644
 --- a/gdb/testsuite/gdb.fortran/vla.f90
 +++ b/gdb/testsuite/gdb.fortran/vla.f90
 @@ -54,4 +54,14 @@ program vla
@@ -1751,10 +1759,9 @@ index 508290a36e..d87f59b92b 100644
 +
  end program vla
 diff --git a/gdb/valarith.c b/gdb/valarith.c
-index 58e3a09c37..035def5466 100644
 --- a/gdb/valarith.c
 +++ b/gdb/valarith.c
-@@ -189,10 +189,16 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound)
+@@ -187,10 +187,16 @@ 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);
@@ -1774,10 +1781,9 @@ index 58e3a09c37..035def5466 100644
        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 9525dc8499..4cd4fd96ae 100644
 --- a/gdb/valops.c
 +++ b/gdb/valops.c
-@@ -3776,56 +3776,195 @@ value_of_this_silent (const struct language_defn *lang)
+@@ -3808,56 +3808,195 @@ value_of_this_silent (const struct language_defn *lang)
  
  struct value *
  value_slice (struct value *array, int lowbound, int length)
@@ -2004,10 +2010,9 @@ index 9525dc8499..4cd4fd96ae 100644
  
  /* Create a value for a FORTRAN complex number.  Currently most of the
 diff --git a/gdb/value.h b/gdb/value.h
-index 7dc67dc721..03ca06448f 100644
 --- a/gdb/value.h
 +++ b/gdb/value.h
-@@ -1128,6 +1128,8 @@ extern struct value *varying_to_slice (struct value *);
+@@ -1139,6 +1139,8 @@ extern struct value *varying_to_slice (struct value *);
  
  extern struct value *value_slice (struct value *, int, int);
  
@@ -2016,6 +2021,3 @@ index 7dc67dc721..03ca06448f 100644
  extern struct value *value_literal_complex (struct value *, struct value *,
                                            struct type *);
  
--- 
-2.14.3
-
index 27afcb9d95ffa6382a6d3541a2e74cc1cd9968df..49ab71c94f55fb367611a41e9c22bb838daaf8e3 100644 (file)
@@ -3,8 +3,6 @@ From: Fedora GDB patches <invalid@email.com>
 Date: Fri, 27 Oct 2017 21:07:50 +0200
 Subject: gdb-vla-intel-fortran-vla-strings.patch
 
-FileName: gdb-vla-intel-fortran-vla-strings.patch
-
 ;;=push
 
 git diff --stat -p gdb/master...gdb/users/bheckel/fortran-vla-strings
@@ -31,38 +29,11 @@ git diff --stat -p gdb/master...gdb/users/bheckel/fortran-vla-strings
  gdb/valops.c                              |  16 ++-
  gdb/valprint.c                            |   6 --
  20 files changed, 827 insertions(+), 110 deletions(-)
----
- gdb/NEWS                                  |   2 +
- gdb/c-valprint.c                          |  22 ++++
- gdb/dwarf2read.c                          | 163 +++++++++++++++++++++++++-----
- gdb/f-typeprint.c                         |  93 +++++++++--------
- gdb/gdbtypes.c                            |  40 +++++++-
- 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   |   4 +-
- gdb/testsuite/gdb.mi/mi-vla-fortran.exp   |   8 +-
- gdb/typeprint.c                           |  19 ++++
- gdb/valops.c                              |  16 ++-
- gdb/valprint.c                            |   6 --
- 19 files changed, 807 insertions(+), 97 deletions(-)
- create mode 100644 gdb/testsuite/gdb.fortran/pointers.exp
- create mode 100644 gdb/testsuite/gdb.fortran/pointers.f90
- create mode 100644 gdb/testsuite/gdb.fortran/print_type.exp
- create mode 100644 gdb/testsuite/gdb.fortran/vla-strings.exp
- create mode 100644 gdb/testsuite/gdb.fortran/vla-strings.f90
 
 diff --git a/gdb/NEWS b/gdb/NEWS
-index 6c9a2ecefd..f40eb6c390 100644
 --- a/gdb/NEWS
 +++ b/gdb/NEWS
-@@ -3,6 +3,8 @@
+@@ -109,6 +109,8 @@ SH-5/SH64 running OpenBSD  SH-5/SH64 support in sh*-*-openbsd*
  
  *** Changes in GDB 8.1
  
@@ -72,7 +43,6 @@ index 6c9a2ecefd..f40eb6c390 100644
    in XML target descriptions.  This allows for finer grain grouping of
    registers on systems with a large amount of registers.
 diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
-index c4c0918e26..3904fab260 100644
 --- a/gdb/c-valprint.c
 +++ b/gdb/c-valprint.c
 @@ -653,6 +653,28 @@ c_value_print (struct value *val, struct ui_file *stream,
@@ -105,10 +75,9 @@ index c4c0918e26..3904fab260 100644
          type_print (value_type (val), "", stream, -1);
          fprintf_filtered (stream, ") ");
 diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
-index 8fc1f7ec45..98e7d842f0 100644
 --- a/gdb/dwarf2read.c
 +++ b/gdb/dwarf2read.c
-@@ -2077,7 +2077,8 @@ static void read_signatured_type (struct signatured_type *);
+@@ -1789,7 +1789,8 @@ static void read_signatured_type (struct signatured_type *);
  
  static int attr_to_dynamic_prop (const struct attribute *attr,
                                 struct die_info *die, struct dwarf2_cu *cu,
@@ -118,7 +87,7 @@ index 8fc1f7ec45..98e7d842f0 100644
  
  /* memory allocation interface */
  
-@@ -13745,7 +13746,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
+@@ -13648,7 +13649,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
      {
        newobj->static_link
        = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop);
@@ -127,7 +96,7 @@ index 8fc1f7ec45..98e7d842f0 100644
      }
  
    cu->list_in_scope = &local_symbols;
-@@ -16327,7 +16328,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -16329,7 +16330,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
  
        byte_stride_prop
        = (struct dynamic_prop *) alloca (sizeof (struct dynamic_prop));
@@ -136,8 +105,8 @@ index 8fc1f7ec45..98e7d842f0 100644
 +                                      NULL, 0);
        if (!stride_ok)
        {
-         complaint (&symfile_complaints,
-@@ -17075,29 +17077,94 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
+         complaint (_("unable to read array DW_AT_byte_stride "
+@@ -17090,29 +17092,90 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
    struct gdbarch *gdbarch = get_objfile_arch (objfile);
    struct type *type, *range_type, *index_type, *char_type;
    struct attribute *attr;
@@ -163,8 +132,7 @@ index 8fc1f7ec45..98e7d842f0 100644
 +        /* 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 "
++          complaint (_("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,
@@ -186,12 +154,10 @@ index 8fc1f7ec45..98e7d842f0 100644
 +
 +            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"));
++              complaint (_("Could not parse DW_AT_byte_size"));
 +          }
 +        else if (bit_size != NULL)
-+          complaint (&symfile_complaints,
-+                     _("DW_AT_string_length AND "
++          complaint (_("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.  */
@@ -202,8 +168,7 @@ index 8fc1f7ec45..98e7d842f0 100644
 +
 +            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"));
++              complaint (_("Could not parse DW_AT_string_length"));
 +          }
 +
 +        TYPE_RANGE_DATA (range_type)->high = high;
@@ -243,7 +208,7 @@ index 8fc1f7ec45..98e7d842f0 100644
    char_type = language_string_char_type (cu->language_defn, gdbarch);
    type = create_string_type (NULL, char_type, range_type);
  
-@@ -17446,7 +17513,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -17460,7 +17523,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
  
  static int
  attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
@@ -252,8 +217,8 @@ index 8fc1f7ec45..98e7d842f0 100644
 +                    const gdb_byte *additional_data, int additional_data_size)
  {
    struct dwarf2_property_baton *baton;
-   struct obstack *obstack = &cu->objfile->objfile_obstack;
-@@ -17456,14 +17524,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
+   struct obstack *obstack
+@@ -17471,14 +17535,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
  
    if (attr_form_is_block (attr))
      {
@@ -269,7 +234,7 @@ index 8fc1f7ec45..98e7d842f0 100644
 +        gdb_byte *data;
 +
 +        data = (gdb_byte *) obstack_alloc(
-+            &cu->objfile->objfile_obstack,
++            &cu->per_cu->dwarf2_per_objfile->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,
@@ -291,7 +256,7 @@ index 8fc1f7ec45..98e7d842f0 100644
      }
    else if (attr_form_is_ref (attr))
      {
-@@ -17496,8 +17583,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
+@@ -17511,8 +17594,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
                baton = XOBNEW (obstack, struct dwarf2_property_baton);
                baton->referenced_type = die_type (target_die, target_cu);
                baton->locexpr.per_cu = cu->per_cu;
@@ -302,7 +267,7 @@ index 8fc1f7ec45..98e7d842f0 100644
 +                {
 +                  gdb_byte *data;
 +
-+                  data = (gdb_byte *) obstack_alloc (&cu->objfile->objfile_obstack,
++                  data = (gdb_byte *) obstack_alloc (&cu->per_cu->dwarf2_per_objfile->objfile->objfile_obstack,
 +                          DW_BLOCK (target_attr)->size + additional_data_size);
 +                  memcpy (data, DW_BLOCK (target_attr)->data,
 +                          DW_BLOCK (target_attr)->size);
@@ -322,24 +287,26 @@ index 8fc1f7ec45..98e7d842f0 100644
                prop->data.baton = baton;
                prop->kind = PROP_LOCEXPR;
                gdb_assert (prop->data.baton != NULL);
-@@ -17608,24 +17715,24 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -17623,7 +17726,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
  
    attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
    if (attr)
 -    if (!attr_to_dynamic_prop (attr, die, cu, &stride))
 +    if (!attr_to_dynamic_prop (attr, die, cu, &stride, NULL, 0))
-         complaint (&symfile_complaints, _("Missing DW_AT_byte_stride "
-                   "- DIE at 0x%x [in module %s]"),
-              to_underlying (die->sect_off), objfile_name (cu->objfile));
+         complaint (_("Missing DW_AT_byte_stride "
+                    "- DIE at 0x%s [in module %s]"),
+                  sect_offset_str (die->sect_off),
+@@ -17631,7 +17734,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
  
    attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
    if (attr)
 -    attr_to_dynamic_prop (attr, die, cu, &low);
 +    attr_to_dynamic_prop (attr, die, cu, &low, NULL, 0);
    else if (!low_default_is_valid)
-     complaint (&symfile_complaints, _("Missing DW_AT_lower_bound "
-                                     "- DIE at 0x%x [in module %s]"),
-              to_underlying (die->sect_off), objfile_name (cu->objfile));
+     complaint (_("Missing DW_AT_lower_bound "
+                                     "- DIE at %s [in module %s]"),
+@@ -17639,10 +17742,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+              objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
  
    attr = dwarf2_attr (die, DW_AT_upper_bound, cu);
 -  if (!attr_to_dynamic_prop (attr, die, cu, &high))
@@ -351,35 +318,34 @@ index 8fc1f7ec45..98e7d842f0 100644
        {
          /* If bounds are constant do the final calculation here.  */
          if (low.kind == PROP_CONST && high.kind == PROP_CONST)
-@@ -25223,7 +25330,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
+@@ -25143,7 +25246,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
    attr = dwarf2_attr (die, DW_AT_allocated, cu);
    if (attr_form_is_block (attr))
      {
 -      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);
+         add_dyn_prop (DYN_PROP_ALLOCATED, prop, type);
      }
    else if (attr != NULL)
-@@ -25238,7 +25345,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
+@@ -25157,7 +25260,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
    attr = dwarf2_attr (die, DW_AT_associated, cu);
    if (attr_form_is_block (attr))
      {
 -      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);
+         add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type);
      }
    else if (attr != NULL)
-@@ -25251,7 +25358,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
+@@ -25169,7 +25272,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
  
    /* Read DW_AT_data_location and set in type.  */
    attr = dwarf2_attr (die, DW_AT_data_location, cu);
 -  if (attr_to_dynamic_prop (attr, die, cu, &prop))
 +  if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0))
-     add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type, objfile);
+     add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type);
  
    if (dwarf2_per_objfile->die_type_hash == NULL)
 diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
-index f14f1811f4..4f6a0ed09a 100644
 --- a/gdb/f-typeprint.c
 +++ b/gdb/f-typeprint.c
 @@ -37,7 +37,7 @@ static void f_type_print_args (struct type *, struct ui_file *);
@@ -522,7 +488,7 @@ index f14f1811f4..4f6a0ed09a 100644
        if (passed_a_ptr)
        fprintf_filtered (stream, ")");
  
-@@ -383,7 +388,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
+@@ -388,7 +393,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
              fputs_filtered (" :: ", stream);
              fputs_filtered (TYPE_FIELD_NAME (type, index), stream);
              f_type_print_varspec_suffix (TYPE_FIELD_TYPE (type, index),
@@ -532,10 +498,9 @@ index f14f1811f4..4f6a0ed09a 100644
            }
          fprintfi_filtered (level, stream, "End Type ");
 diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
-index a72e2b3e0a..cb5524023f 100644
 --- a/gdb/gdbtypes.c
 +++ b/gdb/gdbtypes.c
-@@ -1915,7 +1915,8 @@ is_dynamic_type_internal (struct type *type, int top_level)
+@@ -1904,7 +1904,8 @@ is_dynamic_type_internal (struct type *type, int top_level)
    type = check_typedef (type);
  
    /* We only want to recognize references at the outermost level.  */
@@ -545,7 +510,7 @@ index a72e2b3e0a..cb5524023f 100644
      type = check_typedef (TYPE_TARGET_TYPE (type));
  
    /* Types that have a dynamic TYPE_DATA_LOCATION are considered
-@@ -1949,6 +1950,7 @@ is_dynamic_type_internal (struct type *type, int top_level)
+@@ -1938,6 +1939,7 @@ is_dynamic_type_internal (struct type *type, int top_level)
        }
  
      case TYPE_CODE_ARRAY:
@@ -553,7 +518,7 @@ index a72e2b3e0a..cb5524023f 100644
        {
        gdb_assert (TYPE_NFIELDS (type) == 1);
  
-@@ -2067,7 +2069,8 @@ resolve_dynamic_array (struct type *type,
+@@ -2056,7 +2058,8 @@ resolve_dynamic_array (struct type *type,
    struct dynamic_prop *prop;
    unsigned int bit_stride = 0;
  
@@ -563,7 +528,7 @@ index a72e2b3e0a..cb5524023f 100644
  
    type = copy_type (type);
  
-@@ -2092,11 +2095,15 @@ resolve_dynamic_array (struct type *type,
+@@ -2081,11 +2084,15 @@ resolve_dynamic_array (struct type *type,
  
    ary_dim = check_typedef (TYPE_TARGET_TYPE (elt_type));
  
@@ -580,7 +545,7 @@ index a72e2b3e0a..cb5524023f 100644
    prop = get_dyn_prop (DYN_PROP_BYTE_STRIDE, type);
    if (prop != NULL)
      {
-@@ -2251,6 +2258,28 @@ resolve_dynamic_struct (struct type *type,
+@@ -2240,6 +2247,28 @@ resolve_dynamic_struct (struct type *type,
    return resolved_type;
  }
  
@@ -609,7 +574,7 @@ index a72e2b3e0a..cb5524023f 100644
  /* Worker for resolved_dynamic_type.  */
  
  static struct type *
-@@ -2299,7 +2328,12 @@ resolve_dynamic_type_internal (struct type *type,
+@@ -2288,7 +2317,12 @@ resolve_dynamic_type_internal (struct type *type,
            break;
          }
  
@@ -623,7 +588,6 @@ index a72e2b3e0a..cb5524023f 100644
          break;
  
 diff --git a/gdb/testsuite/gdb.cp/vla-cxx.cc b/gdb/testsuite/gdb.cp/vla-cxx.cc
-index 1b5b27bf3d..06198b41e0 100644
 --- a/gdb/testsuite/gdb.cp/vla-cxx.cc
 +++ b/gdb/testsuite/gdb.cp/vla-cxx.cc
 @@ -15,6 +15,10 @@
@@ -655,7 +619,6 @@ index 1b5b27bf3d..06198b41e0 100644
    return vla[2];
  }
 diff --git a/gdb/testsuite/gdb.cp/vla-cxx.exp b/gdb/testsuite/gdb.cp/vla-cxx.exp
-index ac87499d49..dacbfb6ca0 100644
 --- a/gdb/testsuite/gdb.cp/vla-cxx.exp
 +++ b/gdb/testsuite/gdb.cp/vla-cxx.exp
 @@ -23,6 +23,12 @@ if ![runto_main] {
@@ -680,7 +643,6 @@ index ac87499d49..dacbfb6ca0 100644
 +gdb_test "print *ptr" " = \\{5, 7, 9\\}"
 diff --git a/gdb/testsuite/gdb.fortran/pointers.exp b/gdb/testsuite/gdb.fortran/pointers.exp
 new file mode 100644
-index 0000000000..67cf99989d
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/pointers.exp
 @@ -0,0 +1,143 @@
@@ -829,7 +791,6 @@ index 0000000000..67cf99989d
 +gdb_test "print \$pc" "= \\(PTR TO -> \\( void \\(\\)\\(\\)\\)\\) $hex <pointers\\+\\d+>" "Print program counter"
 diff --git a/gdb/testsuite/gdb.fortran/pointers.f90 b/gdb/testsuite/gdb.fortran/pointers.f90
 new file mode 100644
-index 0000000000..6240c87988
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/pointers.f90
 @@ -0,0 +1,109 @@
@@ -944,7 +905,6 @@ index 0000000000..6240c87988
 +end program pointers
 diff --git a/gdb/testsuite/gdb.fortran/print_type.exp b/gdb/testsuite/gdb.fortran/print_type.exp
 new file mode 100644
-index 0000000000..45b4968f6c
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/print_type.exp
 @@ -0,0 +1,100 @@
@@ -1049,7 +1009,6 @@ index 0000000000..45b4968f6c
 +}
 +gdb_test "ptype realp" "type = PTR TO -> \\( $real \\)"
 diff --git a/gdb/testsuite/gdb.fortran/vla-ptype.exp b/gdb/testsuite/gdb.fortran/vla-ptype.exp
-index 5351a0aa2e..fa248c5a0c 100644
 --- a/gdb/testsuite/gdb.fortran/vla-ptype.exp
 +++ b/gdb/testsuite/gdb.fortran/vla-ptype.exp
 @@ -32,9 +32,9 @@ set real [fortran_real4]
@@ -1091,7 +1050,6 @@ index 5351a0aa2e..fa248c5a0c 100644
    "ptype vla2(5, 45, 20) not allocated"
 diff --git a/gdb/testsuite/gdb.fortran/vla-strings.exp b/gdb/testsuite/gdb.fortran/vla-strings.exp
 new file mode 100644
-index 0000000000..484fdcb652
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/vla-strings.exp
 @@ -0,0 +1,103 @@
@@ -1200,7 +1158,6 @@ index 0000000000..484fdcb652
 +}
 diff --git a/gdb/testsuite/gdb.fortran/vla-strings.f90 b/gdb/testsuite/gdb.fortran/vla-strings.f90
 new file mode 100644
-index 0000000000..3c22735fdb
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/vla-strings.f90
 @@ -0,0 +1,39 @@
@@ -1244,7 +1201,6 @@ index 0000000000..3c22735fdb
 +  l = associated(var_char_p)              ! var_char_p-not-associated
 +end program vla_strings
 diff --git a/gdb/testsuite/gdb.fortran/vla-type.exp b/gdb/testsuite/gdb.fortran/vla-type.exp
-index aff0d5a258..6f2d6a4009 100755
 --- a/gdb/testsuite/gdb.fortran/vla-type.exp
 +++ b/gdb/testsuite/gdb.fortran/vla-type.exp
 @@ -132,7 +132,10 @@ gdb_test "ptype fivearr(2)%tone" \
@@ -1269,7 +1225,6 @@ index aff0d5a258..6f2d6a4009 100755
           "ptype fivedynarr(2)%tone, not allocated"
  
 diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran/vla-value.exp
-index 4b1842e38c..5a831a3964 100644
 --- a/gdb/testsuite/gdb.fortran/vla-value.exp
 +++ b/gdb/testsuite/gdb.fortran/vla-value.exp
 @@ -35,7 +35,7 @@ gdb_breakpoint [gdb_get_line_number "vla1-init"]
@@ -1291,7 +1246,6 @@ index 4b1842e38c..5a831a3964 100644
  gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated\\\)" \
    "print undefined pvla(1,3,8)"
 diff --git a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
-index b6e777235c..14b611f7b5 100644
 --- a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
 +++ b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
 @@ -51,10 +51,10 @@ mi_expect_stop "breakpoint-hit" "vla" "" ".*vla.f90" "$bp_lineno" \
@@ -1321,10 +1275,9 @@ index b6e777235c..14b611f7b5 100644
        mi_gdb_test "582-var-show-format pvla2_not_associated" \
            "582\\^done,format=\"natural\"" \
 diff --git a/gdb/typeprint.c b/gdb/typeprint.c
-index c098a3f426..319fbaf94e 100644
 --- a/gdb/typeprint.c
 +++ b/gdb/typeprint.c
-@@ -538,6 +538,25 @@ whatis_exp (const char *exp, int show)
+@@ -589,6 +589,25 @@ whatis_exp (const char *exp, int show)
        printf_filtered (" */\n");    
      }
  
@@ -1349,12 +1302,11 @@ index c098a3f426..319fbaf94e 100644
 +
    LA_PRINT_TYPE (type, "", gdb_stdout, show, 0, &flags);
    printf_filtered ("\n");
+ }
 diff --git a/gdb/valops.c b/gdb/valops.c
-index 4cd4fd96ae..9b25980090 100644
 --- a/gdb/valops.c
 +++ b/gdb/valops.c
-@@ -1564,6 +1564,19 @@ value_ind (struct value *arg1)
+@@ -1565,6 +1565,19 @@ value_ind (struct value *arg1)
    if (TYPE_CODE (base_type) == TYPE_CODE_PTR)
      {
        struct type *enc_type;
@@ -1374,7 +1326,7 @@ index 4cd4fd96ae..9b25980090 100644
  
        /* We may be pointing to something embedded in a larger object.
           Get the real type of the enclosing object.  */
-@@ -1579,8 +1592,7 @@ value_ind (struct value *arg1)
+@@ -1580,8 +1593,7 @@ value_ind (struct value *arg1)
        else
        /* Retrieve the enclosing object pointed to.  */
        arg2 = value_at_lazy (enc_type, 
@@ -1385,10 +1337,9 @@ index 4cd4fd96ae..9b25980090 100644
        enc_type = value_type (arg2);
        return readjust_indirect_value_type (arg2, enc_type, base_type, arg1);
 diff --git a/gdb/valprint.c b/gdb/valprint.c
-index b19123f23e..d01d02fc09 100644
 --- a/gdb/valprint.c
 +++ b/gdb/valprint.c
-@@ -1111,12 +1111,6 @@ value_check_printable (struct value *val, struct ui_file *stream,
+@@ -1108,12 +1108,6 @@ value_check_printable (struct value *val, struct ui_file *stream,
        return 0;
      }
  
@@ -1401,6 +1352,3 @@ index b19123f23e..d01d02fc09 100644
    if (type_not_allocated (value_type (val)))
      {
        val_print_not_allocated (stream);
--- 
-2.14.3
-
index 6f4c625d23291b187ff14bcac4cd4d89e9407242..b2170f4c5493048a5342018b32e975663c0ddf04 100644 (file)
@@ -1,10 +1,7 @@
 From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
 From: Jan Kratochvil <jan.kratochvil@redhat.com>
 Date: Fri, 1 Aug 2014 23:02:17 +0200
-Subject: Crash regression(?) printing Fortran strings in bt [Re: [V2 00/23]
- Fortran dynamic array support]
-
-FileName: gdb-vla-intel-stringbt-fix.patch
+Subject: gdb-vla-intel-stringbt-fix.patch
 
 ;;=push+jan
 
@@ -29,18 +26,8 @@ cannot reproduce it.
 
 Thanks,
 Jan
----
- gdb/dwarf2loc.c                                    | 15 +++++++++
- .../gdb.fortran/dynamic-other-frame-stub.f90       | 24 +++++++++++++
- gdb/testsuite/gdb.fortran/dynamic-other-frame.exp  | 39 ++++++++++++++++++++++
- gdb/testsuite/gdb.fortran/dynamic-other-frame.f90  | 36 ++++++++++++++++++++
- 4 files changed, 114 insertions(+)
- create mode 100644 gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
- create mode 100644 gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
- create mode 100644 gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
 
 diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
-index 5105c8d23a..5486e4dc12 100644
 --- a/gdb/dwarf2loc.c
 +++ b/gdb/dwarf2loc.c
 @@ -42,6 +42,7 @@
@@ -74,7 +61,6 @@ index 5105c8d23a..5486e4dc12 100644
    ctx.gdbarch = get_objfile_arch (objfile);
 diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
 new file mode 100644
-index 0000000000..261ce17ae5
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
 @@ -0,0 +1,24 @@
@@ -104,7 +90,6 @@ index 0000000000..261ce17ae5
 +end subroutine bar
 diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
 new file mode 100644
-index 0000000000..570a28ca65
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
 @@ -0,0 +1,39 @@
@@ -149,7 +134,6 @@ index 0000000000..570a28ca65
 +gdb_test "bt" {foo \(string='hello'.*}
 diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
 new file mode 100644
-index 0000000000..2bc637db49
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
 @@ -0,0 +1,36 @@
@@ -189,6 +173,3 @@ index 0000000000..2bc637db49
 +  end interface
 +  call foo ('hello')
 +end
--- 
-2.14.3
-
index 68c288470ce67137485deb7c22c303426275c2ee..36c97abc7cf5e1bb0a9a31c32da490b84544f89c 100644 (file)
@@ -3,23 +3,10 @@ From: Fedora GDB patches <invalid@email.com>
 Date: Fri, 27 Oct 2017 21:07:50 +0200
 Subject: gdb-vla-intel-tests.patch
 
-FileName: gdb-vla-intel-tests.patch
-
 ;;=fedoratest
----
- gdb/testsuite/gdb.fortran/vla-func.exp       |  61 ++++++++++++++++
- gdb/testsuite/gdb.fortran/vla-func.f90       |  71 +++++++++++++++++++
- gdb/testsuite/gdb.fortran/vla-stringsold.exp | 101 +++++++++++++++++++++++++++
- gdb/testsuite/gdb.fortran/vla-stringsold.f90 |  40 +++++++++++
- 4 files changed, 273 insertions(+)
- create mode 100644 gdb/testsuite/gdb.fortran/vla-func.exp
- create mode 100644 gdb/testsuite/gdb.fortran/vla-func.f90
- create mode 100644 gdb/testsuite/gdb.fortran/vla-stringsold.exp
- create mode 100644 gdb/testsuite/gdb.fortran/vla-stringsold.f90
 
 diff --git a/gdb/testsuite/gdb.fortran/vla-func.exp b/gdb/testsuite/gdb.fortran/vla-func.exp
 new file mode 100644
-index 0000000000..f0f236bef0
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/vla-func.exp
 @@ -0,0 +1,61 @@
@@ -86,7 +73,6 @@ index 0000000000..f0f236bef0
 +  "ptype vla3 (after func2)"
 diff --git a/gdb/testsuite/gdb.fortran/vla-func.f90 b/gdb/testsuite/gdb.fortran/vla-func.f90
 new file mode 100644
-index 0000000000..7540f54dbb
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/vla-func.f90
 @@ -0,0 +1,71 @@
@@ -163,7 +149,6 @@ index 0000000000..7540f54dbb
 +end program vla_func
 diff --git a/gdb/testsuite/gdb.fortran/vla-stringsold.exp b/gdb/testsuite/gdb.fortran/vla-stringsold.exp
 new file mode 100644
-index 0000000000..c1bf7ef763
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/vla-stringsold.exp
 @@ -0,0 +1,101 @@
@@ -270,7 +255,6 @@ index 0000000000..c1bf7ef763
 +  "ptype var_char_p after associated"
 diff --git a/gdb/testsuite/gdb.fortran/vla-stringsold.f90 b/gdb/testsuite/gdb.fortran/vla-stringsold.f90
 new file mode 100644
-index 0000000000..0a1d5221d0
 --- /dev/null
 +++ b/gdb/testsuite/gdb.fortran/vla-stringsold.f90
 @@ -0,0 +1,40 @@
@@ -314,6 +298,3 @@ index 0000000000..0a1d5221d0
 +  var_char_p => null()
 +  l = associated(var_char_p)              ! var_char_p-not-associated
 +end program vla_strings
--- 
-2.14.3
-
index 1205c56121bf4c04157e710f20de66e31a3446f0..92da00693088470933d6ccdecd4709518362a541 100644 (file)
--- a/gdb.spec
+++ b/gdb.spec
@@ -20,12 +20,12 @@ Summary(uk.UTF-8):  Символьний відладчик для С та інш
 Summary(zh_CN.UTF-8):  [开发]C和其他语言的调试器
 Summary(zh_TW.UTF-8):  [.-A開發]C和.$)B其.-A他語.$)B言的調試器
 Name:          gdb
-Version:       8.1.1
+Version:       8.2
 Release:       1
 License:       GPL v3+
 Group:         Development/Debuggers
 Source0:       http://ftp.gnu.org/gnu/gdb/%{name}-%{version}.tar.xz
-# Source0-md5: 372fa63a53adeee1bfbfd581d8da9e34
+# Source0-md5: b5a49dbff00d9a87fbe114d14b3101c0
 Source1:       http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
 # Source1-md5: 2e8a48939ae282c12bbacdd54e398247
 Source3:       %{name}-gstack.man
@@ -37,7 +37,7 @@ Patch104:     gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
 Patch105:      gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
 Patch106:      gdb-6.6-buildid-locate-rpm-scl.patch
 Patch110:      gdb-6.3-gstack-20050411.patch
-Patch111:      gdb-gdb-add-index-script.patch
+
 Patch112:      gdb-archer-vla-tests.patch
 Patch113:      gdb-vla-intel-fortran-strides.patch
 Patch114:      gdb-vla-intel-stringbt-fix.patch
@@ -191,7 +191,7 @@ GDB w postaci biblioteki statycznej.
 %patch105 -p1
 %patch106 -p1
 %patch110 -p1
-%patch111 -p1
+
 %patch112 -p1
 %patch113 -p1
 %patch114 -p1
This page took 0.33096 seconds and 4 git commands to generate.