[packages/gdb] - up to 9.1
arekm
arekm at pld-linux.org
Mon Feb 10 12:28:00 CET 2020
commit e28f2cc17e3e83521eb28a43ff691caa45d7de2c
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Mon Feb 10 12:27:52 2020 +0100
- up to 9.1
gdb-6.3-gstack-20050411.patch | 6 +-
gdb-6.6-buildid-locate-core-as-arg.patch | 64 +-
gdb-6.6-buildid-locate-rpm-librpm-workaround.patch | 2 +-
gdb-6.6-buildid-locate-rpm-scl.patch | 21 +-
gdb-6.6-buildid-locate-rpm.patch | 95 +--
gdb-6.6-buildid-locate-solib-missing-ids.patch | 4 +-
gdb-6.6-buildid-locate.patch | 325 ++++----
gdb-archer-vla-tests.patch | 12 +-
gdb-readline.patch | 68 +-
gdb-vla-intel-fortran-strides.patch | 449 +++--------
gdb-vla-intel-fortran-vla-strings.patch | 863 ++++++++-------------
gdb-vla-intel-stringbt-fix.patch | 10 +-
gdb-vla-intel-tests.patch | 87 ++-
gdb.spec | 32 +-
14 files changed, 797 insertions(+), 1241 deletions(-)
---
diff --git a/gdb.spec b/gdb.spec
index 6da2d1b..5f7aea4 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -21,12 +21,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.3.1
-Release: 2
+Version: 9.1
+Release: 1
License: GPL v3+
Group: Development/Debuggers
Source0: http://ftp.gnu.org/gnu/gdb/%{name}-%{version}.tar.xz
-# Source0-md5: 73b6a5d8141672c62bf851cd34c4aa83
+# Source0-md5: f7e9f6236c425097d9e5f18a6ac40655
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
@@ -213,7 +213,20 @@ cat > gdb/version.in << EOF
%{version}-%{release} (PLD Linux)
EOF
-sed -i -e 's#_GCC_AUTOCONF_VERSION\], \[2\.64\]#_GCC_AUTOCONF_VERSION], [2.69]#g' config/override.m4
+sed -E -i -e '1s,#!\s*/usr/bin/env\s+python2(\s|$),#!%{__python}\1,' -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python}\1,' -e '1s,#!\s*/usr/bin/python(\s|$),#!%{__python}\1,' \
+ contrib/dg-extract-results.py \
+ gdb/contrib/test_pubnames_and_indexes.py \
+ gdb/testsuite/analyze-racy-logs.py \
+ gdb/testsuite/print-ts.py
+
+sed -E -i -e '1s,#!\s*/usr/bin/env\s+python3(\s|$),#!%{__python3}\1,' \
+ gdb/copyright.py
+
+sed -E -i -e '1s,#!\s*/usr/bin/env\s+(.*),#!%{__bindir}\1,' \
+ gdb/contrib/cc-with-tweaks.sh \
+ gdb/gcore \
+ gdb/gcore.in \
+ src-release.sh
%build
# omit hand-written gdb/testsuite aclocal.m4
@@ -233,8 +246,9 @@ for dir in $(find gdb -name 'configure.in' -o -name 'configure.ac'); do
cd $olddir
done
cp -f /usr/share/automake/config.* .
+install -d build && cd build
# don't --enable-shared here, there would be libs version mismatch with binutils
-%configure \
+../%configure \
--disable-gdbtk \
--disable-shared \
--disable-silent-rules \
@@ -276,10 +290,10 @@ cp -f /usr/share/automake/config.* .
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_infodir}
-%{__make} -j1 install install-info \
+%{__make} -C build -j1 install install-info \
DESTDIR=$RPM_BUILD_ROOT
-cp -a gdb/libgdb.a $RPM_BUILD_ROOT%{_libdir}
+cp -a build/gdb/libgdb.a $RPM_BUILD_ROOT%{_libdir}
# gdbtui seems all identical to gdb except when invoked as gdbtui, ncurses
# window is created too.
@@ -305,13 +319,13 @@ done
cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_mandir}/man1/gstack.1
-cp -p libdecnumber/libdecnumber.a $RPM_BUILD_ROOT%{_libdir}
+cp -p build/libdecnumber/libdecnumber.a $RPM_BUILD_ROOT%{_libdir}
# Remove the files that are part of a gdb build but that are owned and provided by other packages.
# These are part of binutils:
%{__rm} $RPM_BUILD_ROOT%{_localedir}/*/LC_MESSAGES/{bfd,opcodes}.mo
%{__rm} $RPM_BUILD_ROOT%{_infodir}/bfd.info*
-%{__rm} $RPM_BUILD_ROOT%{_includedir}/{ansidecl,bfd,bfdlink,diagnostics,dis-asm,symcat,plugin-api}.h
+%{__rm} $RPM_BUILD_ROOT%{_includedir}/{ansidecl,bfd,bfd_stdint,bfdlink,diagnostics,dis-asm,symcat,plugin-api}.h
%{__rm} $RPM_BUILD_ROOT%{_libdir}/lib{bfd,opcodes}.la
%{__rm} $RPM_BUILD_ROOT%{_libdir}/lib{bfd,opcodes}.a
diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch
index 6690e15..982863a 100644
--- a/gdb-6.3-gstack-20050411.patch
+++ b/gdb-6.3-gstack-20050411.patch
@@ -16,7 +16,7 @@ Subject: gdb-6.3-gstack-20050411.patch
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
-@@ -1749,7 +1749,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
+@@ -1768,7 +1768,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
install: all
@$(MAKE) $(FLAGS_TO_PASS) install-only
@@ -25,7 +25,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e "$$t"` ; \
if test "x$$transformed_name" = x; then \
-@@ -1798,7 +1798,25 @@ install-guile:
+@@ -1817,7 +1817,25 @@ install-guile:
install-python:
$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb
@@ -52,7 +52,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e $$t` ; \
if test "x$$transformed_name" = x; then \
-@@ -1821,6 +1839,18 @@ uninstall: force $(CONFIG_UNINSTALL)
+@@ -1840,6 +1858,18 @@ uninstall: force $(CONFIG_UNINSTALL)
fi
@$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
diff --git a/gdb-6.6-buildid-locate-core-as-arg.patch b/gdb-6.6-buildid-locate-core-as-arg.patch
index a59c2b7..d182ae1 100644
--- a/gdb-6.6-buildid-locate-core-as-arg.patch
+++ b/gdb-6.6-buildid-locate-core-as-arg.patch
@@ -61,31 +61,19 @@ Http://sourceware.org/ml/gdb-patches/2010-01/msg00517.html
* exec.c (exec_file_attach): Print a more useful error message if the
user did "gdb core".
-diff --git a/gdb/common/common-exceptions.h b/gdb/common/common-exceptions.h
---- a/gdb/common/common-exceptions.h
-+++ b/gdb/common/common-exceptions.h
-@@ -104,6 +104,9 @@ enum errors {
- "_ERROR" is appended to the name. */
- MAX_COMPLETIONS_REACHED_ERROR,
-
-+ /* Attempt to load a core file as executable. */
-+ IS_CORE_ERROR,
-+
- /* Add more errors here. */
- NR_ERRORS
- };
diff --git a/gdb/exec.c b/gdb/exec.c
--- a/gdb/exec.c
+++ b/gdb/exec.c
-@@ -36,6 +36,7 @@
- #include "gdb_bfd.h"
- #include "gcore.h"
- #include "source.h"
-+#include "exceptions.h"
+@@ -18,6 +18,8 @@
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
- #include <fcntl.h>
- #include "readline/readline.h"
-@@ -355,12 +356,27 @@ exec_file_attach (const char *filename, int from_tty)
+ #include "defs.h"
++#include "arch-utils.h"
++#include "exceptions.h"
+ #include "frame.h"
+ #include "inferior.h"
+ #include "target.h"
+@@ -345,12 +347,27 @@ exec_file_attach (const char *filename, int from_tty)
if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
{
@@ -106,20 +94,33 @@ diff --git a/gdb/exec.c b/gdb/exec.c
+
+ if (is_core != 0)
+ throw_error (IS_CORE_ERROR,
-+ _("\"%s\" is a core file.\n"
-+ "Please specify an executable to debug."),
-+ scratch_pathname);
++ _("\"%s\" is a core file.\n"
++ "Please specify an executable to debug."),
++ scratch_pathname);
+ else
-+ error (_("\"%s\": not in executable format: %s"),
++ error (_("\"%ss\": not in executable format: %s"),
+ scratch_pathname,
+ gdb_bfd_errmsg (bfd_get_error (), matching).c_str ());
}
if (build_section_table (exec_bfd, §ions, §ions_end))
+diff --git a/gdb/gdbsupport/common-exceptions.h b/gdb/gdbsupport/common-exceptions.h
+--- a/gdb/gdbsupport/common-exceptions.h
++++ b/gdb/gdbsupport/common-exceptions.h
+@@ -106,6 +106,9 @@ enum errors {
+ "_ERROR" is appended to the name. */
+ MAX_COMPLETIONS_REACHED_ERROR,
+
++ /* Attempt to load a core file as executable. */
++ IS_CORE_ERROR,
++
+ /* Add more errors here. */
+ NR_ERRORS
+ };
diff --git a/gdb/main.c b/gdb/main.c
--- a/gdb/main.c
+++ b/gdb/main.c
-@@ -448,6 +448,35 @@ struct cmdarg
+@@ -467,6 +467,34 @@ struct cmdarg
char *string;
};
@@ -132,11 +133,11 @@ diff --git a/gdb/main.c b/gdb/main.c
+{
+ gdb_assert (exec_bfd == NULL);
+
-+ TRY
++ try
+ {
+ exec_file_attach (filename, from_tty);
+ }
-+ CATCH (e, RETURN_MASK_ALL)
++ catch (gdb_exception_error &e)
+ {
+ if (e.error == IS_CORE_ERROR)
+ {
@@ -147,15 +148,14 @@ diff --git a/gdb/main.c b/gdb/main.c
+ if (exec_bfd != NULL)
+ return;
+ }
-+ throw_exception (e);
++ throw_exception (std::move (e));
+ }
-+ END_CATCH
+}
+
static void
captured_main_1 (struct captured_main_args *context)
{
-@@ -893,6 +922,8 @@ captured_main_1 (struct captured_main_args *context)
+@@ -907,6 +935,8 @@ captured_main_1 (struct captured_main_args *context)
{
symarg = argv[optind];
execarg = argv[optind];
@@ -164,7 +164,7 @@ diff --git a/gdb/main.c b/gdb/main.c
optind++;
}
-@@ -1043,12 +1074,25 @@ captured_main_1 (struct captured_main_args *context)
+@@ -1063,12 +1093,25 @@ captured_main_1 (struct captured_main_args *context)
&& symarg != NULL
&& strcmp (execarg, symarg) == 0)
{
diff --git a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
index f8dcbeb..abea6e6 100644
--- a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
+++ b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
@@ -9,7 +9,7 @@ Subject: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
diff --git a/gdb/build-id.c b/gdb/build-id.c
--- a/gdb/build-id.c
+++ b/gdb/build-id.c
-@@ -712,6 +712,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
+@@ -709,6 +709,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
#include <dlfcn.h>
#endif
diff --git a/gdb-6.6-buildid-locate-rpm-scl.patch b/gdb-6.6-buildid-locate-rpm-scl.patch
index 5b3d4ad..ca683ed 100644
--- a/gdb-6.6-buildid-locate-rpm-scl.patch
+++ b/gdb-6.6-buildid-locate-rpm-scl.patch
@@ -12,7 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=953585
diff --git a/gdb/build-id.c b/gdb/build-id.c
--- a/gdb/build-id.c
+++ b/gdb/build-id.c
-@@ -746,7 +746,11 @@ static int missing_rpm_list_entries;
+@@ -743,7 +743,11 @@ static int missing_rpm_list_entries;
/* Returns the count of newly added rpms. */
static int
@@ -24,7 +24,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
{
static int rpm_init_done = 0;
rpmts ts;
-@@ -853,7 +857,11 @@ missing_rpm_enlist (const char *filename)
+@@ -850,7 +854,11 @@ missing_rpm_enlist (const char *filename)
mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
if (mi != NULL)
{
@@ -36,7 +36,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
{
Header h;
char *debuginfo, **slot, *s, *s2;
-@@ -971,6 +979,37 @@ missing_rpm_enlist (const char *filename)
+@@ -968,6 +976,37 @@ missing_rpm_enlist (const char *filename)
xfree (debuginfo);
count++;
}
@@ -74,10 +74,10 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
rpmdbFreeIterator_p (mi);
}
-@@ -981,6 +1020,21 @@ missing_rpm_enlist (const char *filename)
+@@ -977,6 +1016,20 @@ missing_rpm_enlist (const char *filename)
+ return count;
}
- static int
+#ifdef GDB_INDEX_VERIFY_VENDOR
+missing_rpm_enlist (const char *filename)
+{
@@ -90,16 +90,15 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+{
+ return missing_rpm_enlist_1 (filename, 1);
+}
-+
-+static int
+#endif
- missing_rpm_list_compar (const char *const *ap, const char *const *bp)
++
+ static bool
+ missing_rpm_list_compar (const char *ap, const char *bp)
{
- return strcoll (*ap, *bp);
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
-@@ -3501,6 +3501,16 @@ read_gdb_index_from_buffer (struct objfile *objfile,
+@@ -3497,6 +3497,16 @@ read_gdb_index_from_buffer (struct objfile *objfile,
"set use-deprecated-index-sections on". */
if (version < 6 && !deprecated_ok)
{
@@ -116,7 +115,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
static int warning_printed = 0;
if (!warning_printed)
{
-@@ -3512,6 +3522,10 @@ to use the section anyway."),
+@@ -3508,6 +3518,10 @@ to use the section anyway."),
warning_printed = 1;
}
return 0;
diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch
index 3f7c651..fa1c629 100644
--- a/gdb-6.6-buildid-locate-rpm.patch
+++ b/gdb-6.6-buildid-locate-rpm.patch
@@ -235,16 +235,15 @@ diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4
diff --git a/gdb/build-id.c b/gdb/build-id.c
--- a/gdb/build-id.c
+++ b/gdb/build-id.c
-@@ -35,6 +35,8 @@
- #include "elf/common.h"
- #include "elf-bfd.h"
- #include <sys/stat.h>
-+#include "elf/external.h"
+@@ -33,6 +33,7 @@
+ #include "gdb_bfd.h"
+ #include "gdbcmd.h"
+ #include "gdbcore.h"
+#include "inferior.h"
-
- #define BUILD_ID_VERBOSE_NONE 0
- #define BUILD_ID_VERBOSE_FILENAMES 1
-@@ -700,8 +702,366 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
+ #include "libbfd.h"
+ #include "objfiles.h"
+ #include "observable.h"
+@@ -698,8 +699,359 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
return result;
}
@@ -513,10 +512,10 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ return count;
+}
+
-+static int
-+missing_rpm_list_compar (const char *const *ap, const char *const *bp)
++static bool
++missing_rpm_list_compar (const char *ap, const char *bp)
+{
-+ return strcoll (*ap, *bp);
++ return strcoll (ap, bp) < 0;
+}
+
+/* It returns a NULL-terminated array of strings needing to be FREEd. It may
@@ -525,37 +524,32 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+static void
+missing_rpm_list_print (void)
+{
-+ char **array, **array_iter;
+ struct missing_rpm *list_iter;
-+ struct cleanup *cleanups;
+
+ if (missing_rpm_list_entries == 0)
+ return;
+
-+ array = (char **) xmalloc (sizeof (*array) * missing_rpm_list_entries);
-+ cleanups = make_cleanup (xfree, array);
++ std::vector<const char *> array (missing_rpm_list_entries);
++ size_t idx = 0;
+
-+ array_iter = array;
+ for (list_iter = missing_rpm_list; list_iter != NULL;
+ list_iter = list_iter->next)
+ {
-+ *array_iter++ = list_iter->rpm;
++ array[idx++] = list_iter->rpm;
+ }
-+ gdb_assert (array_iter == array + missing_rpm_list_entries);
++ gdb_assert (idx == missing_rpm_list_entries);
+
-+ qsort (array, missing_rpm_list_entries, sizeof (*array),
-+ (int (*) (const void *, const void *)) missing_rpm_list_compar);
++ std::sort (array.begin (), array.end (), missing_rpm_list_compar);
+
+ printf_unfiltered (_("Missing separate debuginfos, use: %s"),
+#ifdef DNF_DEBUGINFO_INSTALL
+ "dnf "
+#endif
+ "debuginfo-install");
-+ for (array_iter = array; array_iter < array + missing_rpm_list_entries;
-+ array_iter++)
++ for (const char *el : array)
+ {
+ putchar_unfiltered (' ');
-+ puts_unfiltered (*array_iter);
++ puts_unfiltered (el);
+ }
+ putchar_unfiltered ('\n');
+
@@ -566,8 +560,6 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ xfree (list_iter);
+ }
+ missing_rpm_list_entries = 0;
-+
-+ do_cleanups (cleanups);
+}
+
+static void
@@ -612,7 +604,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
avoidance. */
struct missing_filepair
-@@ -755,11 +1115,17 @@ missing_filepair_change (void)
+@@ -753,11 +1105,17 @@ missing_filepair_change (void)
/* All their memory came just from missing_filepair_OBSTACK. */
missing_filepair_hash = NULL;
}
@@ -630,7 +622,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
missing_filepair_change ();
}
-@@ -826,14 +1192,39 @@ debug_print_missing (const char *binary, const char *debug)
+@@ -824,14 +1182,38 @@ debug_print_missing (const char *binary, const char *debug)
*slot = missing_filepair;
@@ -639,14 +631,13 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+#ifdef HAVE_LIBRPM
+ if (missing_exec == MISSING_EXEC_NOT_TRIED)
+ {
-+ char *execfilename;
++ const char *execfilename = get_exec_file (0);
- fprintf_unfiltered (gdb_stdlog,
- _("Missing separate debuginfo for %s\n"), binary);
- if (debug != NULL)
- fprintf_unfiltered (gdb_stdlog, _("Try to install the hash file %s\n"),
- debug);
-+ execfilename = get_exec_file (0);
+ if (execfilename != NULL)
+ {
+ if (missing_rpm_enlist (execfilename) == 0)
@@ -680,7 +671,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
diff --git a/gdb/config.in b/gdb/config.in
--- a/gdb/config.in
+++ b/gdb/config.in
-@@ -33,6 +33,9 @@
+@@ -36,6 +36,9 @@
/* Define to BFD's default target vector. */
#undef DEFAULT_BFD_VEC
@@ -690,9 +681,9 @@ diff --git a/gdb/config.in b/gdb/config.in
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#undef ENABLE_NLS
-@@ -255,6 +258,9 @@
- /* Define if Python 2.7 is being used. */
- #undef HAVE_LIBPYTHON2_7
+@@ -245,6 +248,9 @@
+ /* Define if you have the mpfr library. */
+ #undef HAVE_LIBMPFR
+/* Define if librpm library is being used. */
+#undef HAVE_LIBRPM
@@ -703,7 +694,7 @@ diff --git a/gdb/config.in b/gdb/config.in
diff --git a/gdb/configure b/gdb/configure
--- a/gdb/configure
+++ b/gdb/configure
-@@ -751,6 +751,11 @@ CODESIGN_CERT
+@@ -761,6 +761,11 @@ CODESIGN_CERT
HAVE_NATIVE_GCORE_TARGET
TARGET_OBS
subdirs
@@ -715,7 +706,7 @@ diff --git a/gdb/configure b/gdb/configure
GDB_DATADIR
DEBUGDIR
MAKEINFO_EXTRA_FLAGS
-@@ -855,6 +860,7 @@ with_gdb_datadir
+@@ -864,6 +869,7 @@ with_gdb_datadir
with_relocated_sources
with_auto_load_dir
with_auto_load_safe_path
@@ -723,7 +714,7 @@ diff --git a/gdb/configure b/gdb/configure
enable_targets
enable_64_bit_bfd
enable_gdbmi
-@@ -914,6 +920,11 @@ CCC
+@@ -926,6 +932,11 @@ CCC
CPP
MAKEINFO
MAKEINFOFLAGS
@@ -735,7 +726,7 @@ diff --git a/gdb/configure b/gdb/configure
YACC
YFLAGS
XMKMF'
-@@ -1585,6 +1596,8 @@ Optional Packages:
+@@ -1598,6 +1609,8 @@ Optional Packages:
[--with-auto-load-dir]
--without-auto-load-safe-path
do not restrict auto-loaded files locations
@@ -744,7 +735,7 @@ diff --git a/gdb/configure b/gdb/configure
--with-libunwind-ia64 use libunwind frame unwinding for ia64 targets
--with-curses use the curses library instead of the termcap
library
-@@ -1642,6 +1655,13 @@ Some influential environment variables:
+@@ -1661,6 +1674,13 @@ Some influential environment variables:
MAKEINFO Parent configure detects if it is of sufficient version.
MAKEINFOFLAGS
Parameters for MAKEINFO.
@@ -758,7 +749,7 @@ diff --git a/gdb/configure b/gdb/configure
YACC The `Yet Another Compiler Compiler' implementation to use.
Defaults to the first program found out of: `bison -y', `byacc',
`yacc'.
-@@ -6623,6 +6643,494 @@ _ACEOF
+@@ -6587,6 +6607,494 @@ _ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
$as_echo "$with_auto_load_safe_path" >&6; }
@@ -1256,7 +1247,7 @@ diff --git a/gdb/configure b/gdb/configure
diff --git a/gdb/configure.ac b/gdb/configure.ac
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
-@@ -166,6 +166,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir,
+@@ -144,6 +144,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir,
[Directories safe to hold auto-loaded files.])
AC_MSG_RESULT([$with_auto_load_safe_path])
@@ -1456,30 +1447,18 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac
AC_CONFIG_SUBDIRS(testsuite)
# Check whether to support alternative target configurations
-diff --git a/gdb/corelow.c b/gdb/corelow.c
---- a/gdb/corelow.c
-+++ b/gdb/corelow.c
-@@ -365,7 +365,7 @@ build_id_locate_exec (int from_tty)
- symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED;
- }
- else
-- debug_print_missing (_("the main executable file"), build_id_filename);
-+ debug_print_missing (BUILD_ID_MAIN_EXECUTABLE_FILENAME, build_id_filename);
-
- do_cleanups (back_to);
-
diff --git a/gdb/event-top.c b/gdb/event-top.c
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
-@@ -40,6 +40,7 @@
- #include "common/buffer.h"
+@@ -41,6 +41,7 @@
#include "ser-event.h"
#include "gdb_select.h"
+ #include "gdbsupport/gdb-sigmask.h"
+#include "symfile.h"
/* readline include files. */
#include "readline/readline.h"
-@@ -359,6 +360,8 @@ display_gdb_prompt (const char *new_prompt)
+@@ -363,6 +364,8 @@ display_gdb_prompt (const char *new_prompt)
/* Reset the nesting depth used when trace-commands is set. */
reset_command_nest_depth ();
@@ -1488,7 +1467,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c
/* Do not call the python hook on an explicit prompt change as
passed to this function, as this forms a secondary/local prompt,
IE, displayed but not set. */
-@@ -770,7 +773,10 @@ command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl)
+@@ -772,7 +775,10 @@ command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl)
command_handler (cmd);
if (ui->prompt_state != PROMPTED)
@@ -1503,7 +1482,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c
diff --git a/gdb/symfile.h b/gdb/symfile.h
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
-@@ -534,6 +534,8 @@ void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
+@@ -542,6 +542,8 @@ extern void generic_load (const char *args, int from_tty);
/* build-id support. */
extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr);
extern void debug_print_missing (const char *binary, const char *debug);
diff --git a/gdb-6.6-buildid-locate-solib-missing-ids.patch b/gdb-6.6-buildid-locate-solib-missing-ids.patch
index e86920b..73b763a 100644
--- a/gdb-6.6-buildid-locate-solib-missing-ids.patch
+++ b/gdb-6.6-buildid-locate-solib-missing-ids.patch
@@ -14,7 +14,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1339862
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
-@@ -1347,14 +1347,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
+@@ -1346,14 +1346,27 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
}
{
@@ -44,7 +44,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
if (build_id != NULL)
{
char *name, *build_id_filename;
-@@ -1369,23 +1382,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
+@@ -1368,23 +1381,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
xfree (name);
}
else
diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch
index c588eb1..504c6a9 100644
--- a/gdb-6.6-buildid-locate.patch
+++ b/gdb-6.6-buildid-locate.patch
@@ -6,22 +6,50 @@ Subject: gdb-6.6-buildid-locate.patch
;; New locating of the matching binaries from the pure core file (build-id).
;;=push+jan
+diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
+--- a/bfd/libbfd-in.h
++++ b/bfd/libbfd-in.h
+@@ -127,7 +127,7 @@ static inline char *
+ bfd_strdup (const char *str)
+ {
+ size_t len = strlen (str) + 1;
+- char *buf = bfd_malloc (len);
++ char *buf = (char *) bfd_malloc (len);
+ if (buf != NULL)
+ memcpy (buf, str, len);
+ return buf;
+diff --git a/bfd/libbfd.h b/bfd/libbfd.h
+--- a/bfd/libbfd.h
++++ b/bfd/libbfd.h
+@@ -132,7 +132,7 @@ static inline char *
+ bfd_strdup (const char *str)
+ {
+ size_t len = strlen (str) + 1;
+- char *buf = bfd_malloc (len);
++ char *buf = (char *) bfd_malloc (len);
+ if (buf != NULL)
+ memcpy (buf, str, len);
+ return buf;
diff --git a/gdb/build-id.c b/gdb/build-id.c
--- a/gdb/build-id.c
+++ b/gdb/build-id.c
-@@ -26,11 +26,67 @@
+@@ -24,13 +24,71 @@
+ #include "gdbsupport/gdb_vecs.h"
+ #include "symfile.h"
#include "objfiles.h"
++#include <sys/stat.h>
++#include "elf-bfd.h"
++#include "elf/common.h"
++#include "elf/external.h"
++#include "elf/internal.h"
#include "filenames.h"
++#include "gdb_bfd.h"
++#include "gdbcmd.h"
#include "gdbcore.h"
+#include "libbfd.h"
-+#include "gdbcore.h"
-+#include "gdbcmd.h"
++#include "objfiles.h"
+#include "observable.h"
-+#include "elf/external.h"
-+#include "elf/internal.h"
-+#include "elf/common.h"
-+#include "elf-bfd.h"
-+#include <sys/stat.h>
++#include "symfile.h"
+
+#define BUILD_ID_VERBOSE_NONE 0
+#define BUILD_ID_VERBOSE_FILENAMES 1
@@ -76,9 +104,9 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
-build_id_bfd_get (bfd *abfd)
+build_id_bfd_shdr_get (bfd *abfd)
{
- if (!bfd_check_format (abfd, bfd_object))
- return NULL;
-@@ -42,6 +98,348 @@ build_id_bfd_get (bfd *abfd)
+ if (!bfd_check_format (abfd, bfd_object)
+ && !bfd_check_format (abfd, bfd_core))
+@@ -43,6 +101,348 @@ build_id_bfd_get (bfd *abfd)
return NULL;
}
@@ -367,7 +395,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+
+static void build_id_addr_candidate (bfd *abfd, asection *sect, void *obj)
+{
-+ if (build_id_addr >= bfd_section_vma (abfd, sect))
++ if (build_id_addr >= bfd_section_vma (sect))
+ {
+ struct build_id_addr_sect *candidate;
+
@@ -402,7 +430,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ candidate = candidate->next)
+ {
+ i_phdr = elf_get_phdr (core_bfd,
-+ bfd_section_vma (core_bfd, candidate->sect),
++ bfd_section_vma (candidate->sect),
+ &e_phnum, &loadbase);
+ if (i_phdr != NULL)
+ break;
@@ -427,7 +455,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
/* See build-id.h. */
int
-@@ -50,7 +448,7 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
+@@ -51,7 +451,7 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
const struct bfd_build_id *found;
int retval = 0;
@@ -436,7 +464,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
if (found == NULL)
warning (_("File \"%s\" has no build-id, file skipped"),
-@@ -65,62 +463,173 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
+@@ -66,56 +466,159 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
return retval;
}
@@ -482,8 +510,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
-build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len,
- const bfd_byte *build_id)
+build_id_to_debug_bfd_1 (const std::string &orig_link, size_t build_id_len,
-+ const bfd_byte *build_id, char **link_return,
-+ int add_debug_suffix)
++ const bfd_byte *build_id, char **link_return)
{
+ gdb_bfd_ref_ptr ret_bfd = {};
+ std::string ret_link;
@@ -524,9 +551,6 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
- {
- if (separate_debug_file_debug)
- printf_unfiltered (_(" no, unable to open.\n"));
-+ if (add_debug_suffix)
-+ link += ".debug";
-+
+ ret_link = link;
+
+ struct stat statbuf_trash;
@@ -551,7 +575,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+
+ continue;
+ }
-+
+
+- return {};
+ /* We expect to be silent on the non-existing files. */
+ gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename.get (), gnutarget, -1);
+
@@ -570,8 +595,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+
+ continue;
+ }
-
-- return {};
++
+ ret_bfd = debug_bfd;
+ break;
}
@@ -583,6 +607,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
{
if (separate_debug_file_debug)
- printf_unfiltered (_(" no, build-id does not match.\n"));
+-
+- return {};
+ printf_unfiltered (_(" yes!\n"));
+ }
+ else
@@ -591,15 +617,11 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ always the non-.%u-suffixed file. */
+ std::string link0 = orig_link;
+
-+ if (add_debug_suffix)
-+ link0 += ".debug";
-+
+ /* If the symlink has target request to install the target.
+ BASE-debuginfo.rpm contains the symlink but BASE.rpm may be missing.
+ https://bugzilla.redhat.com/show_bug.cgi?id=981154 */
+ std::string link0_resolved (link_resolve (link0.c_str (), 0));
-
-- return {};
++
+ if (link_all.empty ())
+ link_all = link0_resolved;
+ else
@@ -628,16 +650,17 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ return ret_bfd;
}
- /* See build-id.h. */
+ /* Common code for finding BFDs of a given build-id. This function
+@@ -124,7 +627,7 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len,
- gdb_bfd_ref_ptr
--build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
-+build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id,
-+ char **link_return, int add_debug_suffix)
+ static gdb_bfd_ref_ptr
+ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
+- const char *suffix)
++ const char *suffix, char **link_return)
{
/* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
cause "/.build-id/..." lookups. */
-@@ -143,16 +652,16 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
+@@ -147,16 +650,17 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
if (size > 0)
{
size--;
@@ -650,26 +673,25 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
while (size-- > 0)
string_appendf (link, "%02x", (unsigned) *data++);
-- link += ".debug";
--
+ link += suffix;
+
gdb_bfd_ref_ptr debug_bfd
- = build_id_to_debug_bfd_1 (link, build_id_len, build_id);
-+ = build_id_to_debug_bfd_1 (link, build_id_len, build_id,
-+ link_return, add_debug_suffix);
++ = build_id_to_debug_bfd_1 (link, build_id_len, build_id, link_return);
if (debug_bfd != NULL)
return debug_bfd;
-@@ -166,7 +675,8 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
+@@ -170,7 +674,8 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
if (strcmp (gdb_sysroot, TARGET_SYSROOT_PREFIX) != 0)
{
link = gdb_sysroot + link;
- debug_bfd = build_id_to_debug_bfd_1 (link, build_id_len, build_id);
+ debug_bfd = build_id_to_debug_bfd_1 (link, build_id_len, build_id,
-+ link_return, add_debug_suffix);
++ link_return);
if (debug_bfd != NULL)
return debug_bfd;
}
-@@ -175,22 +685,190 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
+@@ -179,38 +684,208 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
return {};
}
@@ -679,12 +701,11 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ gdb_bfd_ref_ptr abfd;
+ char *result;
+
-+ abfd = build_id_to_debug_bfd (build_id->size, build_id->data, link_return, 0);
++ abfd = build_id_to_exec_bfd (build_id->size, build_id->data, link_return);
+ if (abfd == NULL)
+ return NULL;
+
-+ result = xstrdup (bfd_get_filename (abfd));
-+ abfd.release ();
++ result = xstrdup (bfd_get_filename (abfd.get ()));
+ return result;
+}
+
@@ -826,6 +847,29 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+
/* See build-id.h. */
+ gdb_bfd_ref_ptr
+-build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
++build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id,
++ char **link_return)
+ {
+- return build_id_to_bfd_suffix (build_id_len, build_id, ".debug");
++ return build_id_to_bfd_suffix (build_id_len, build_id, ".debug",
++ link_return);
+ }
+
+ /* See build-id.h. */
+
+ gdb_bfd_ref_ptr
+-build_id_to_exec_bfd (size_t build_id_len, const bfd_byte *build_id)
++build_id_to_exec_bfd (size_t build_id_len, const bfd_byte *build_id,
++ char **link_return)
+ {
+- return build_id_to_bfd_suffix (build_id_len, build_id, "");
++ return build_id_to_bfd_suffix (build_id_len, build_id, "", link_return);
+ }
+
+ /* See build-id.h. */
+
std::string
-find_separate_debug_file_by_buildid (struct objfile *objfile)
+find_separate_debug_file_by_buildid (struct objfile *objfile,
@@ -848,7 +892,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
gdb_bfd_ref_ptr abfd (build_id_to_debug_bfd (build_id->size,
- build_id->data));
+ build_id->data,
-+ (!build_id_filename_return ? NULL : &build_id_filename_cstr), 1));
++ (!build_id_filename_return ? NULL : &build_id_filename_cstr)));
+ if (build_id_filename_return)
+ {
+ if (!build_id_filename_cstr)
@@ -863,7 +907,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
/* Prevent looping on a stripped .debug file. */
if (abfd != NULL
&& filename_cmp (bfd_get_filename (abfd.get ()),
-@@ -203,3 +881,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
+@@ -223,3 +898,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
return std::string ();
}
@@ -890,7 +934,7 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h
+++ b/gdb/build-id.h
@@ -23,9 +23,10 @@
#include "gdb_bfd.h"
- #include "common/rsp-low.h"
+ #include "gdbsupport/rsp-low.h"
-/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */
+/* Separate debuginfo files have corrupted PHDR but SHDR is correct there.
@@ -901,18 +945,26 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h
/* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value.
Otherwise, issue a warning and return false. */
-@@ -39,14 +40,19 @@ extern int build_id_verify (bfd *abfd,
- the caller. */
+@@ -38,21 +39,26 @@ extern int build_id_verify (bfd *abfd,
+ can be found, return NULL. */
extern gdb_bfd_ref_ptr build_id_to_debug_bfd (size_t build_id_len,
- const bfd_byte *build_id);
+ const bfd_byte *build_id,
-+ char **link_return,
-+ int add_debug_suffix);
++ char **link_return);
+
+extern char *build_id_to_filename (const struct bfd_build_id *build_id,
+ char **link_return);
+ /* Find and open a BFD for an executable file given a build-id. If no BFD
+ can be found, return NULL. The returned reference to the BFD must be
+ released by the caller. */
+
+ extern gdb_bfd_ref_ptr build_id_to_exec_bfd (size_t build_id_len,
+- const bfd_byte *build_id);
++ const bfd_byte *build_id,
++ char **link_return);
+
/* Find the separate debug file for OBJFILE, by using the build-id
associated with OBJFILE's BFD. If successful, returns the file name for the
separate debug file, otherwise, return an empty string. */
@@ -927,7 +979,7 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h
diff --git a/gdb/coffread.c b/gdb/coffread.c
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
-@@ -729,7 +729,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
+@@ -709,7 +709,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
/* Try to add separate debug file if no symbols table found. */
if (!objfile_has_partial_symbols (objfile))
{
@@ -940,88 +992,55 @@ diff --git a/gdb/coffread.c b/gdb/coffread.c
diff --git a/gdb/corelow.c b/gdb/corelow.c
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
-@@ -43,6 +43,10 @@
- #include "gdb_bfd.h"
- #include "completer.h"
- #include "common/filestuff.h"
+@@ -22,6 +22,10 @@
+ #include <signal.h>
+ #include <fcntl.h>
+ #include "frame.h" /* required by inferior.h */
+#include "auxv.h"
++#include "build-id.h"
+#include "elf/common.h"
+#include "gdbcmd.h"
-+#include "build-id.h"
-
- #ifndef O_LARGEFILE
- #define O_LARGEFILE 0
-@@ -320,6 +324,54 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
+ #include "inferior.h"
+ #include "infrun.h"
+ #include "symtab.h"
+@@ -322,6 +326,8 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
inferior_ptid = ptid; /* Yes, make it current. */
}
-+static int build_id_core_loads = 1;
-+
-+static void
-+build_id_locate_exec (int from_tty)
-+{
-+ CORE_ADDR at_entry;
-+ struct bfd_build_id *build_id;
-+ char *execfilename;
-+ char *build_id_filename;
-+ struct cleanup *back_to;
-+
-+ if (exec_bfd != NULL || symfile_objfile != NULL)
-+ return;
-+
-+ if (target_auxv_search (current_top_target (), AT_ENTRY, &at_entry) <= 0)
-+ return;
-+
-+ build_id = build_id_addr_get (at_entry);
-+ if (build_id == NULL)
-+ return;
-+ back_to = make_cleanup (xfree, build_id);
-+
-+ /* SYMFILE_OBJFILE should refer to the main executable (not only to its
-+ separate debug info file). gcc44+ keeps .eh_frame only in the main
-+ executable without its duplicate .debug_frame in the separate debug info
-+ file - such .eh_frame would not be found if SYMFILE_OBJFILE would refer
-+ directly to the separate debug info file. */
-+
-+ execfilename = build_id_to_filename (build_id, &build_id_filename);
-+ make_cleanup (xfree, build_id_filename);
-+
-+ if (execfilename != NULL)
-+ {
-+ make_cleanup (xfree, execfilename);
-+ exec_file_attach (execfilename, from_tty);
-+ symbol_file_add_main (execfilename,
-+ symfile_add_flag (!from_tty ? 0 : SYMFILE_VERBOSE));
-+ if (symfile_objfile != NULL)
-+ symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED;
-+ }
-+ else
-+ debug_print_missing (_("the main executable file"), build_id_filename);
-+
-+ do_cleanups (back_to);
-+
-+ /* No automatic SOLIB_ADD as the libraries would get read twice. */
-+}
++static bool build_id_core_loads = true;
+
/* Issue a message saying we have no core to debug, if FROM_TTY. */
static void
-@@ -455,6 +507,14 @@ core_target_open (const char *arg, int from_tty)
- switch_to_thread (thread);
- }
+@@ -358,19 +364,25 @@ core_file_command (const char *filename, int from_tty)
+ static void
+ locate_exec_from_corefile_build_id (bfd *abfd, int from_tty)
+ {
+- const bfd_build_id *build_id = build_id_bfd_get (abfd);
++ const bfd_build_id *build_id = build_id_bfd_shdr_get (abfd);
+ if (build_id == nullptr)
+ return;
-+ /* Find the build_id identifiers. If it gets executed after
-+ POST_CREATE_INFERIOR we would clash with asking to discard the already
-+ loaded VDSO symbols. If it gets executed before bfd_map_over_sections
-+ INFERIOR_PTID is still not set and libthread_db initialization crashes on
-+ PID == 0 in ps_pglobal_lookup. */
-+ if (build_id_core_loads != 0)
-+ build_id_locate_exec (from_tty);
-+
- post_create_inferior (target, from_tty);
++ char *build_id_filename;
+ gdb_bfd_ref_ptr execbfd
+- = build_id_to_exec_bfd (build_id->size, build_id->data);
++ = build_id_to_exec_bfd (build_id->size, build_id->data,
++ &build_id_filename);
- /* Now go through the target stack looking for threads since there
-@@ -1063,4 +1123,11 @@ void
+ if (execbfd != nullptr)
+ {
+ exec_file_attach (bfd_get_filename (execbfd.get ()), from_tty);
+ symbol_file_add_main (bfd_get_filename (execbfd.get ()),
+ symfile_add_flag (from_tty ? SYMFILE_VERBOSE : 0));
++ if (symfile_objfile != NULL)
++ symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED;
+ }
++ else
++ debug_print_missing (BUILD_ID_MAIN_EXECUTABLE_FILENAME, build_id_filename);
+ }
+
+ /* See gdbcore.h. */
+@@ -998,4 +1010,11 @@ void
_initialize_corelow (void)
{
add_target (core_target_info, core_target_open, filename_completer);
@@ -1036,7 +1055,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
-@@ -19945,6 +19945,27 @@ information files.
+@@ -20862,6 +20862,27 @@ information files.
@end table
@@ -1067,28 +1086,38 @@ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
diff --git a/gdb/dwarf-index-cache.c b/gdb/dwarf-index-cache.c
--- a/gdb/dwarf-index-cache.c
+++ b/gdb/dwarf-index-cache.c
-@@ -93,7 +93,7 @@ index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile)
- if (!enabled ())
+@@ -94,7 +94,7 @@ index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile)
return;
+ /* Get build id of objfile. */
- const bfd_build_id *build_id = build_id_bfd_get (obj->obfd);
+ const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd);
if (build_id == nullptr)
{
if (debug_index_cache)
+@@ -112,7 +112,8 @@ index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile)
+
+ if (dwz != nullptr)
+ {
+- const bfd_build_id *dwz_build_id = build_id_bfd_get (dwz->dwz_bfd.get ());
++ const bfd_build_id *dwz_build_id
++ = build_id_bfd_shdr_get (dwz->dwz_bfd.get ());
+
+ if (dwz_build_id == nullptr)
+ {
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
-@@ -2727,7 +2727,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile)
+@@ -2718,7 +2718,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile)
}
if (dwz_bfd == NULL)
- dwz_bfd = build_id_to_debug_bfd (buildid_len, buildid);
-+ dwz_bfd = build_id_to_debug_bfd (buildid_len, buildid, NULL, 1);
++ dwz_bfd = build_id_to_debug_bfd (buildid_len, buildid, NULL);
if (dwz_bfd == NULL)
error (_("could not find '.gnu_debugaltlink' file for %s"),
-@@ -6237,7 +6237,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner)
+@@ -6276,7 +6276,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner)
static gdb::array_view<const gdb_byte>
get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj)
{
@@ -1097,7 +1126,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
if (build_id == nullptr)
return {};
-@@ -6250,7 +6250,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj)
+@@ -6289,7 +6289,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj)
static gdb::array_view<const gdb_byte>
get_gdb_index_contents_from_cache_dwz (objfile *obj, dwz_file *dwz)
{
@@ -1109,7 +1138,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
diff --git a/gdb/elfread.c b/gdb/elfread.c
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
-@@ -1287,7 +1287,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
+@@ -1299,7 +1299,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
&& objfile->separate_debug_objfile == NULL
&& objfile->separate_debug_objfile_backlink == NULL)
{
@@ -1120,22 +1149,26 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c
if (debugfile.empty ())
debugfile = find_separate_debug_file_by_debuglink (objfile);
-@@ -1299,6 +1301,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
+@@ -1311,8 +1313,12 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
symbol_file_add_separate (debug_bfd.get (), debugfile.c_str (),
symfile_flags, objfile);
}
+- else
+- has_dwarf2 = false;
+ /* Check if any separate debug info has been extracted out. */
+ else if (bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink")
+ != NULL)
+ debug_print_missing (objfile_name (objfile), build_id_filename.get ());
++ else
++ has_dwarf2 = false;
}
- }
+ /* Read the CTF section only if there is no DWARF info. */
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
-@@ -554,6 +554,10 @@ struct objfile
- htab_t static_links {};
+@@ -627,6 +627,10 @@ struct objfile
+ htab_up static_links;
};
+/* This file was loaded according to the BUILD_ID_CORE_LOADS rules. */
@@ -1150,14 +1183,14 @@ diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c
+++ b/gdb/python/py-objfile.c
@@ -132,7 +132,7 @@ objfpy_get_build_id (PyObject *self, void *closure)
- TRY
+ try
{
- build_id = build_id_bfd_get (objfile->obfd);
+ build_id = build_id_bfd_shdr_get (objfile->obfd);
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception &except)
{
-@@ -535,7 +535,7 @@ objfpy_lookup_objfile_by_build_id (const char *build_id)
+@@ -600,7 +600,7 @@ objfpy_lookup_objfile_by_build_id (const char *build_id)
/* Don't return separate debug files. */
if (objfile->separate_debug_objfile_backlink != NULL)
continue;
@@ -1177,7 +1210,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
static int svr4_have_link_map_offsets (void);
-@@ -1345,9 +1346,51 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
+@@ -1344,9 +1345,51 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm,
continue;
}
@@ -1235,10 +1268,17 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
diff --git a/gdb/symfile.h b/gdb/symfile.h
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
-@@ -531,6 +531,10 @@ void expand_symtabs_matching
+@@ -532,12 +532,17 @@ void expand_symtabs_matching
void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
int need_fullname);
++
+ /* Target-agnostic function to load the sections of an executable into memory.
+
+ ARGS should be in the form "EXECUTABLE [OFFSET]", where OFFSET is an
+ optional offset to apply to each section. */
+ extern void generic_load (const char *args, int from_tty);
+
+/* build-id support. */
+extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr);
+extern void debug_print_missing (const char *binary, const char *debug);
@@ -1297,10 +1337,10 @@ diff --git a/gdb/testsuite/gdb.base/new-ui-pending-input.exp b/gdb/testsuite/gdb
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
-@@ -1697,6 +1697,16 @@ proc default_gdb_start { } {
- warning "Couldn't set the width to 0."
+@@ -1891,6 +1891,17 @@ proc default_gdb_start { } {
}
}
+
+ # Turn off the missing warnings as the testsuite does not expect it.
+ send_gdb "set build-id-verbose 0\n"
+ gdb_expect 10 {
@@ -1311,9 +1351,10 @@ diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
+ warning "Could not disable the missing debug infos warnings.."
+ }
+ }
++
+ gdb_debug_init
return 0
}
-
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
diff --git a/gdb-archer-vla-tests.patch b/gdb-archer-vla-tests.patch
index fa4fa0d..9921940 100644
--- a/gdb-archer-vla-tests.patch
+++ b/gdb-archer-vla-tests.patch
@@ -8,7 +8,7 @@ Subject: gdb-archer-vla-tests.patch
diff --git a/gdb/testsuite/gdb.ada/packed_array.exp b/gdb/testsuite/gdb.ada/packed_array.exp
--- a/gdb/testsuite/gdb.ada/packed_array.exp
+++ b/gdb/testsuite/gdb.ada/packed_array.exp
-@@ -56,5 +56,11 @@ gdb_test_multiple "$test" "$test" {
+@@ -53,5 +53,11 @@ gdb_test_multiple "$test" "$test" {
# are. Observed with (FSF GNU Ada 4.5.3 20110124).
xfail $test
}
@@ -2804,7 +2804,7 @@ new file mode 100644
+gdb_breakpoint [gdb_get_line_number "varx-allocated"]
+gdb_continue_to_breakpoint "varx-allocated"
+# $1 = (( ( 0, 0, 0, 0, 0, 0) ( 0, 0, 0, 0, 0, 0) --- , 0) ) ( ( 0, 0, ...) ...) ...)
-+gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" "ptype varx allocated"
++gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4), allocatable \\(6,5:15,17:28\\)" "ptype varx allocated"
+# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1.
+gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" "p l if varx allocated"
+
@@ -2831,7 +2831,7 @@ new file mode 100644
+gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 6" "p varv(3, 7, 19) associated"
+# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1.
+gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" "p l if varv associated"
-+gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" "ptype varx with varv associated"
++gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4), allocatable \\(6,5:15,17:28\\)" "ptype varx with varv associated"
+# Intel Fortran Compiler 10.1.008 uses the pointer type.
+gdb_test "ptype varv" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)\\)?" "ptype varv associated"
+
@@ -2852,7 +2852,7 @@ new file mode 100644
+gdb_breakpoint [gdb_get_line_number "varx-deallocated"]
+gdb_continue_to_breakpoint "varx-deallocated"
+gdb_test "p varx" "\\$\[0-9\]* = <not allocated>" "p varx deallocated"
-+gdb_test "ptype varx" {type = real\(kind=4\) \(:,:,:\)} "ptype varx deallocated"
++gdb_test "ptype varx" {type = real\(kind=4\), allocatable \(:,:,:\)} "ptype varx deallocated"
+gdb_test "p l" "\\$\[0-9\]* = \\.FALSE\\." "p l if varx deallocated"
+gdb_test "p varx(1,5,17)" {no such vector element \(vector not allocated\)} "p varx(1,5,17) deallocated"
+gdb_test "ptype varx(1,5,17)" {no such vector element \(vector not allocated\)} "ptype varx(1,5,17) deallocated"
@@ -3690,7 +3690,7 @@ diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -170,6 +170,11 @@ proc gdb_unload {} {
- send_gdb "y\n"
+ send_gdb "y\n" answer
exp_continue
}
+ -re "A program is being debugged already..*Are you sure you want to change the file.*y or n. $"\
@@ -3699,7 +3699,7 @@ diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
+ exp_continue
+ }
-re "Discard symbol table from .*y or n.*$" {
- send_gdb "y\n"
+ send_gdb "y\n" answer
exp_continue
diff --git a/gdb/testsuite/lib/pascal.exp b/gdb/testsuite/lib/pascal.exp
--- a/gdb/testsuite/lib/pascal.exp
diff --git a/gdb-readline.patch b/gdb-readline.patch
index d0e7a21..fa3e011 100644
--- a/gdb-readline.patch
+++ b/gdb-readline.patch
@@ -1,10 +1,10 @@
--- gdb-6.7.org/gdb/Makefile.in 2007-09-05 02:14:02.000000000 +0200
+++ gdb-6.7/gdb/Makefile.in 2007-10-10 21:11:18.119976680 +0200
-@@ -126,11 +126,11 @@
- BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC)
+@@ -175,11 +175,11 @@ LIBDECNUMBER_SRC = $(srcdir)/$(LIBDECNUM
+ LIBDECNUMBER_CFLAGS = -I$(LIBDECNUMBER_DIR) -I$(LIBDECNUMBER_SRC)
- # Where is the READLINE library? Typically in ../readline.
--READLINE_DIR = ../readline
+ # Where is the READLINE library? Typically in ../readline/readline.
+-READLINE_DIR = ../readline/readline
-READLINE_SRC = $(srcdir)/$(READLINE_DIR)
-READLINE = @READLINE@
-READLINE_DEPS = @READLINE_DEPS@
@@ -17,12 +17,12 @@
# Where is expat? This will be empty if expat was not available.
LIBEXPAT = @LIBEXPAT@
-@@ -597,7 +597,7 @@ CLIBS = $(SIM) $(READLINE) $(OPCODES) $(
+@@ -613,7 +613,7 @@ CLIBS = $(SIM) $(READLINE) $(OPCODES) $(
$(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \
$(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) $(LIBMPFR) \
- $(SRCHIGH_LIBS)
--CDEPS = $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \
-+CDEPS = $(NAT_CDEPS) $(SIM) $(BFD) \
+ $(SRCHIGH_LIBS) $(LIBXXHASH) $(PTHREAD_LIBS)
+-CDEPS = $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) $(LIBCTF) \
++CDEPS = $(NAT_CDEPS) $(SIM) $(BFD) $(LIBCTF) \
$(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU)
DIST = gdb
@@ -36,15 +36,7 @@
maybe-configure-sid \
maybe-configure-sim \
maybe-configure-texinfo \
-@@ -1057,7 +1056,6 @@
- @endif libiberty-no-bootstrap
- all-host: maybe-all-libiconv
- all-host: maybe-all-m4
--all-host: maybe-all-readline
- all-host: maybe-all-sid
- all-host: maybe-all-sim
- all-host: maybe-all-texinfo
-@@ -1149,7 +1147,6 @@
+@@ -1149,7 +1148,6 @@
info-host: maybe-info-libiberty
info-host: maybe-info-libiconv
info-host: maybe-info-m4
@@ -52,7 +44,7 @@
info-host: maybe-info-sid
info-host: maybe-info-sim
info-host: maybe-info-texinfo
-@@ -1226,7 +1223,6 @@
+@@ -1226,7 +1224,6 @@
dvi-host: maybe-dvi-libiberty
dvi-host: maybe-dvi-libiconv
dvi-host: maybe-dvi-m4
@@ -60,7 +52,7 @@
dvi-host: maybe-dvi-sid
dvi-host: maybe-dvi-sim
dvi-host: maybe-dvi-texinfo
-@@ -1303,7 +1299,6 @@
+@@ -1303,7 +1300,6 @@
pdf-host: maybe-pdf-libiberty
pdf-host: maybe-pdf-libiconv
pdf-host: maybe-pdf-m4
@@ -68,7 +60,7 @@
pdf-host: maybe-pdf-sid
pdf-host: maybe-pdf-sim
pdf-host: maybe-pdf-texinfo
-@@ -1380,7 +1375,6 @@
+@@ -1380,7 +1376,6 @@
html-host: maybe-html-libiberty
html-host: maybe-html-libiconv
html-host: maybe-html-m4
@@ -76,7 +68,7 @@
html-host: maybe-html-sid
html-host: maybe-html-sim
html-host: maybe-html-texinfo
-@@ -1457,7 +1451,6 @@
+@@ -1457,7 +1452,6 @@
TAGS-host: maybe-TAGS-libiberty
TAGS-host: maybe-TAGS-libiconv
TAGS-host: maybe-TAGS-m4
@@ -84,7 +76,7 @@
TAGS-host: maybe-TAGS-sid
TAGS-host: maybe-TAGS-sim
TAGS-host: maybe-TAGS-texinfo
-@@ -1534,7 +1527,6 @@
+@@ -1534,7 +1528,6 @@
install-info-host: maybe-install-info-libiberty
install-info-host: maybe-install-info-libiconv
install-info-host: maybe-install-info-m4
@@ -92,7 +84,7 @@
install-info-host: maybe-install-info-sid
install-info-host: maybe-install-info-sim
install-info-host: maybe-install-info-texinfo
-@@ -1611,7 +1603,6 @@
+@@ -1611,7 +1604,6 @@
install-pdf-host: maybe-install-pdf-libiberty
install-pdf-host: maybe-install-pdf-libiconv
install-pdf-host: maybe-install-pdf-m4
@@ -100,7 +92,7 @@
install-pdf-host: maybe-install-pdf-sid
install-pdf-host: maybe-install-pdf-sim
install-pdf-host: maybe-install-pdf-texinfo
-@@ -1688,7 +1679,6 @@
+@@ -1688,7 +1680,6 @@
install-html-host: maybe-install-html-libiberty
install-html-host: maybe-install-html-libiconv
install-html-host: maybe-install-html-m4
@@ -108,7 +100,7 @@
install-html-host: maybe-install-html-sid
install-html-host: maybe-install-html-sim
install-html-host: maybe-install-html-texinfo
-@@ -1765,7 +1755,6 @@
+@@ -1765,7 +1756,6 @@
installcheck-host: maybe-installcheck-libiberty
installcheck-host: maybe-installcheck-libiconv
installcheck-host: maybe-installcheck-m4
@@ -116,7 +108,7 @@
installcheck-host: maybe-installcheck-sid
installcheck-host: maybe-installcheck-sim
installcheck-host: maybe-installcheck-texinfo
-@@ -1842,7 +1831,6 @@
+@@ -1842,7 +1832,6 @@
mostlyclean-host: maybe-mostlyclean-libiberty
mostlyclean-host: maybe-mostlyclean-libiconv
mostlyclean-host: maybe-mostlyclean-m4
@@ -124,7 +116,7 @@
mostlyclean-host: maybe-mostlyclean-sid
mostlyclean-host: maybe-mostlyclean-sim
mostlyclean-host: maybe-mostlyclean-texinfo
-@@ -1919,7 +1907,6 @@
+@@ -1919,7 +1908,6 @@
clean-host: maybe-clean-libiberty
clean-host: maybe-clean-libiconv
clean-host: maybe-clean-m4
@@ -132,7 +124,7 @@
clean-host: maybe-clean-sid
clean-host: maybe-clean-sim
clean-host: maybe-clean-texinfo
-@@ -1996,7 +1983,6 @@
+@@ -1996,7 +1984,6 @@
distclean-host: maybe-distclean-libiberty
distclean-host: maybe-distclean-libiconv
distclean-host: maybe-distclean-m4
@@ -140,7 +132,7 @@
distclean-host: maybe-distclean-sid
distclean-host: maybe-distclean-sim
distclean-host: maybe-distclean-texinfo
-@@ -2073,7 +2059,6 @@
+@@ -2073,7 +2060,6 @@
maintainer-clean-host: maybe-maintainer-clean-libiberty
maintainer-clean-host: maybe-maintainer-clean-libiconv
maintainer-clean-host: maybe-maintainer-clean-m4
@@ -148,7 +140,7 @@
maintainer-clean-host: maybe-maintainer-clean-sid
maintainer-clean-host: maybe-maintainer-clean-sim
maintainer-clean-host: maybe-maintainer-clean-texinfo
-@@ -2205,7 +2190,6 @@
+@@ -2205,7 +2191,6 @@
maybe-check-libiberty \
maybe-check-libiconv \
maybe-check-m4 \
@@ -156,7 +148,7 @@
maybe-check-sid \
maybe-check-sim \
maybe-check-texinfo \
-@@ -2308,7 +2292,6 @@
+@@ -2308,7 +2293,6 @@
maybe-install-libiberty \
maybe-install-libiconv \
maybe-install-m4 \
@@ -164,7 +156,7 @@
maybe-install-sid \
maybe-install-sim \
maybe-install-texinfo \
-@@ -2354,7 +2337,6 @@
+@@ -2354,7 +2338,6 @@
maybe-install-libiberty \
maybe-install-libiconv \
maybe-install-m4 \
@@ -172,7 +164,7 @@
maybe-install-sid \
maybe-install-sim \
maybe-install-texinfo \
-@@ -2450,7 +2432,6 @@
+@@ -2450,7 +2433,6 @@
maybe-install-strip-libiberty \
maybe-install-strip-libiconv \
maybe-install-strip-m4 \
@@ -180,19 +172,19 @@
maybe-install-strip-sid \
maybe-install-strip-sim \
maybe-install-strip-texinfo \
-@@ -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
+@@ -51050,7 +51032,6 @@ all-stagefeedback-intl: maybe-all-stagef
configure-gdb: maybe-configure-sim
+ configure-gdb: maybe-all-gnulib
+ all-gdb: maybe-all-gnulib
-all-gdb: maybe-all-readline
all-gdb: maybe-all-build-bison
all-gdb: maybe-all-sim
all-gdb: maybe-all-libtermcap
-@@ -49927,7 +49926,6 @@ install-sid: maybe-install-tcl
+@@ -51387,7 +51368,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-build-texinfo
- all-bison: maybe-all-build-texinfo
+ all-libctf: all-libiberty
diff --git a/gdb-vla-intel-fortran-strides.patch b/gdb-vla-intel-fortran-strides.patch
index eb6e58a..4f468eb 100644
--- a/gdb-vla-intel-fortran-strides.patch
+++ b/gdb-vla-intel-fortran-strides.patch
@@ -34,162 +34,10 @@ dbfd7140bf4c0500d1f5d192be781f83f78f7922
gdb/value.h | 2 +
23 files changed, 1242 insertions(+), 183 deletions(-)
-diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
---- a/gdb/dwarf2loc.c
-+++ b/gdb/dwarf2loc.c
-@@ -2429,11 +2429,14 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
- /* See dwarf2loc.h. */
-
- int
--dwarf2_evaluate_property (const struct dynamic_prop *prop,
-+dwarf2_evaluate_property_signed (const struct dynamic_prop *prop,
- struct frame_info *frame,
- struct property_addr_info *addr_stack,
-- CORE_ADDR *value)
-+ CORE_ADDR *value,
-+ int is_signed)
- {
-+ int rc = 0;
-+
- if (prop == NULL)
- return 0;
-
-@@ -2457,7 +2460,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
-
- *value = value_as_address (val);
- }
-- return 1;
-+ rc = 1;
- }
- }
- break;
-@@ -2479,7 +2482,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
- if (!value_optimized_out (val))
- {
- *value = value_as_address (val);
-- return 1;
-+ rc = 1;
- }
- }
- }
-@@ -2487,8 +2490,8 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
-
- case PROP_CONST:
- *value = prop->data.const_val;
-- return 1;
--
-+ rc = 1;
-+ break;
- case PROP_ADDR_OFFSET:
- {
- struct dwarf2_property_baton *baton
-@@ -2509,11 +2512,38 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
- val = value_at (baton->offset_info.type,
- pinfo->addr + baton->offset_info.offset);
- *value = value_as_address (val);
-- return 1;
-+ rc = 1;
- }
-+ break;
- }
-
-- return 0;
-+ if (rc == 1 && is_signed == 1)
-+ {
-+ /* If we have a valid return candidate and it's value is signed,
-+ we have to sign-extend the value because CORE_ADDR on 64bit machine has
-+ 8 bytes but address size of an 32bit application is 4 bytes. */
-+ struct gdbarch * gdbarch = target_gdbarch ();
-+ const int addr_bit = gdbarch_addr_bit (gdbarch);
-+ const CORE_ADDR neg_mask = ((~0) << (addr_bit - 1));
-+
-+ /* Check if signed bit is set and sign-extend values. */
-+ if (*value & (neg_mask))
-+ *value |= (neg_mask );
-+ }
-+ return rc;
-+}
-+
-+int
-+dwarf2_evaluate_property (const struct dynamic_prop *prop,
-+ struct frame_info *frame,
-+ struct property_addr_info *addr_stack,
-+ CORE_ADDR *value)
-+{
-+ return dwarf2_evaluate_property_signed (prop,
-+ frame,
-+ addr_stack,
-+ value,
-+ 0);
- }
-
- /* See dwarf2loc.h. */
-diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h
---- a/gdb/dwarf2loc.h
-+++ b/gdb/dwarf2loc.h
-@@ -143,6 +143,12 @@ int dwarf2_evaluate_property (const struct dynamic_prop *prop,
- struct property_addr_info *addr_stack,
- CORE_ADDR *value);
-
-+int dwarf2_evaluate_property_signed (const struct dynamic_prop *prop,
-+ struct frame_info *frame,
-+ struct property_addr_info *addr_stack,
-+ CORE_ADDR *value,
-+ int is_signed);
-+
- /* A helper for the compiler interface that compiles a single dynamic
- property to C code.
-
-diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
---- a/gdb/dwarf2read.c
-+++ b/gdb/dwarf2read.c
-@@ -17752,7 +17752,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
- struct type *base_type, *orig_base_type;
- struct type *range_type;
- struct attribute *attr;
-- struct dynamic_prop low, high;
-+ struct dynamic_prop low, high, stride;
- int low_default_is_valid;
- int high_bound_is_count = 0;
- const char *name;
-@@ -17772,7 +17772,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
-
- low.kind = PROP_CONST;
- high.kind = PROP_CONST;
-+ stride.kind = PROP_CONST;
- high.data.const_val = 0;
-+ stride.data.const_val = 0;
-
- /* Set LOW_DEFAULT_IS_VALID if current language and DWARF version allow
- omitting DW_AT_lower_bound. */
-@@ -17805,6 +17807,14 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
- break;
- }
-
-+ attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
-+ if (attr)
-+ if (!attr_to_dynamic_prop (attr, die, cu, &stride))
-+ complaint (_("Missing DW_AT_byte_stride "
-+ "- DIE at 0x%s [in module %s]"),
-+ sect_offset_str (die->sect_off),
-+ objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
-+
- attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
- if (attr)
- attr_to_dynamic_prop (attr, die, cu, &low);
-@@ -17897,7 +17907,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
- && !TYPE_UNSIGNED (base_type) && (high.data.const_val & negative_mask))
- high.data.const_val |= negative_mask;
-
-- range_type = create_range_type (NULL, orig_base_type, &low, &high);
-+ range_type = create_range_type (NULL, orig_base_type, &low, &high, &stride);
-
- if (high_bound_is_count)
- TYPE_RANGE_DATA (range_type)->flag_upper_bound_is_count = 1;
diff --git a/gdb/eval.c b/gdb/eval.c
--- a/gdb/eval.c
+++ b/gdb/eval.c
-@@ -377,29 +377,324 @@ init_array_element (struct value *array, struct value *element,
+@@ -372,29 +372,324 @@ init_array_element (struct value *array, struct value *element,
return index;
}
@@ -533,7 +381,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c
}
-@@ -1242,19 +1537,6 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos,
+@@ -1235,19 +1530,6 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos,
return eval_call (exp, noside, nargs, argvec, var_func_name, expect_type);
}
@@ -553,7 +401,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c
struct value *
evaluate_subexp_standard (struct type *expect_type,
struct expression *exp, int *pos,
-@@ -1949,33 +2231,8 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -1942,33 +2224,8 @@ evaluate_subexp_standard (struct type *expect_type,
switch (code)
{
case TYPE_CODE_ARRAY:
@@ -588,7 +436,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c
case TYPE_CODE_PTR:
case TYPE_CODE_FUNC:
-@@ -2372,49 +2629,6 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -2388,49 +2645,6 @@ evaluate_subexp_standard (struct type *expect_type,
}
return (arg1);
@@ -638,7 +486,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c
case BINOP_LOGICAL_AND:
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (noside == EVAL_SKIP)
-@@ -3334,6 +3548,9 @@ calc_f77_array_dims (struct type *array_type)
+@@ -3350,6 +3564,9 @@ calc_f77_array_dims (struct type *array_type)
int ndimen = 1;
struct type *tmp_type;
@@ -651,7 +499,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c
diff --git a/gdb/expprint.c b/gdb/expprint.c
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
-@@ -578,17 +578,14 @@ print_subexp_standard (struct expression *exp, int *pos,
+@@ -580,17 +580,14 @@ print_subexp_standard (struct expression *exp, int *pos,
longest_to_int (exp->elts[pc + 1].longconst);
*pos += 2;
@@ -673,7 +521,7 @@ diff --git a/gdb/expprint.c b/gdb/expprint.c
print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
fputs_filtered (")", stream);
return;
-@@ -1105,22 +1102,24 @@ dump_subexp_body_standard (struct expression *exp,
+@@ -1107,22 +1104,24 @@ dump_subexp_body_standard (struct expression *exp,
switch (range_type)
{
@@ -706,7 +554,7 @@ diff --git a/gdb/expprint.c b/gdb/expprint.c
fputs_filtered ("ExclusiveRange 'EXP..EXP'", stream);
break;
default:
-@@ -1128,11 +1127,9 @@ dump_subexp_body_standard (struct expression *exp,
+@@ -1130,11 +1129,9 @@ dump_subexp_body_standard (struct expression *exp,
break;
}
@@ -723,7 +571,7 @@ diff --git a/gdb/expprint.c b/gdb/expprint.c
diff --git a/gdb/expression.h b/gdb/expression.h
--- a/gdb/expression.h
+++ b/gdb/expression.h
-@@ -150,28 +150,27 @@ extern void dump_raw_expression (struct expression *,
+@@ -167,28 +167,27 @@ extern void dump_raw_expression (struct expression *,
struct ui_file *, const char *);
extern void dump_prefix_expression (struct expression *, struct ui_file *);
@@ -775,12 +623,12 @@ diff --git a/gdb/expression.h b/gdb/expression.h
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
-@@ -257,31 +257,63 @@ arglist : subrange
+@@ -282,31 +282,63 @@ arglist : subrange
arglist : arglist ',' exp %prec ABOVE_COMMA
- { arglist_len++; }
+ { pstate->arglist_len++; }
+ | arglist ',' subrange %prec ABOVE_COMMA
-+ { arglist_len++; }
++ { pstate->arglist_len++; }
;
/* There are four sorts of subrange types in F90. */
@@ -847,148 +695,52 @@ diff --git a/gdb/f-exp.y b/gdb/f-exp.y
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
-@@ -119,8 +119,14 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type,
-
- if (nss != ndimensions)
- {
-- size_t dim_size = TYPE_LENGTH (TYPE_TARGET_TYPE (type));
-+ size_t dim_size;
+@@ -129,6 +129,11 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type,
+ byte_stride = dim_size;
size_t offs = 0;
-+ LONGEST byte_stride = abs (TYPE_BYTE_STRIDE (range_type));
-+
+
+ if (byte_stride)
+ dim_size = byte_stride;
+ else
+ dim_size = TYPE_LENGTH (TYPE_TARGET_TYPE (type));
-
++
for (i = lowerbound;
(i < upperbound + 1 && (*elts) < options->print_max);
+ i++)
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
-@@ -911,7 +911,8 @@ operator== (const range_bounds &l, const range_bounds &r)
- struct type *
- create_range_type (struct type *result_type, struct type *index_type,
- const struct dynamic_prop *low_bound,
-- const struct dynamic_prop *high_bound)
-+ const struct dynamic_prop *high_bound,
-+ const struct dynamic_prop *stride)
- {
- if (result_type == NULL)
- result_type = alloc_type_copy (index_type);
-@@ -926,6 +927,7 @@ create_range_type (struct type *result_type, struct type *index_type,
- TYPE_ZALLOC (result_type, sizeof (struct range_bounds));
- TYPE_RANGE_DATA (result_type)->low = *low_bound;
+@@ -936,7 +936,7 @@ create_range_type (struct type *result_type, struct type *index_type,
TYPE_RANGE_DATA (result_type)->high = *high_bound;
-+ TYPE_RANGE_DATA (result_type)->stride = *stride;
+ TYPE_RANGE_DATA (result_type)->bias = bias;
- if (low_bound->kind == PROP_CONST && low_bound->data.const_val >= 0)
- TYPE_UNSIGNED (result_type) = 1;
-@@ -954,7 +956,7 @@ struct type *
- create_static_range_type (struct type *result_type, struct type *index_type,
- LONGEST low_bound, LONGEST high_bound)
- {
-- struct dynamic_prop low, high;
-+ struct dynamic_prop low, high, stride;
+- /* Initialize the stride to be a constant, the value will already be zero
++ /* bias the stride to be a constant, the value will already be zero
+ thanks to the use of TYPE_ZALLOC above. */
+ TYPE_RANGE_DATA (result_type)->stride.kind = PROP_CONST;
- low.kind = PROP_CONST;
- low.data.const_val = low_bound;
-@@ -962,7 +964,11 @@ create_static_range_type (struct type *result_type, struct type *index_type,
+@@ -1001,7 +1001,8 @@ create_static_range_type (struct type *result_type, struct type *index_type,
high.kind = PROP_CONST;
high.data.const_val = high_bound;
-- result_type = create_range_type (result_type, index_type, &low, &high);
-+ stride.kind = PROP_CONST;
-+ stride.data.const_val = 0;
-+
+- result_type = create_range_type (result_type, index_type, &low, &high, 0);
+ result_type = create_range_type (result_type, index_type,
-+ &low, &high, &stride);
++ &low, &high, 0);
return result_type;
}
-@@ -1180,16 +1186,20 @@ create_array_type_with_stride (struct type *result_type,
- && (!type_not_associated (result_type)
- && !type_not_allocated (result_type)))
- {
-- LONGEST low_bound, high_bound;
-+ LONGEST low_bound, high_bound, byte_stride;
-
+@@ -1236,6 +1237,7 @@ create_array_type_with_stride (struct type *result_type,
if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
low_bound = high_bound = 0;
element_type = check_typedef (element_type);
-+ byte_stride = abs (TYPE_BYTE_STRIDE (range_type));
+
/* Be careful when setting the array length. Ada arrays can be
empty arrays with the high_bound being smaller than the low_bound.
In such cases, the array length should be zero. */
- if (high_bound < low_bound)
- TYPE_LENGTH (result_type) = 0;
-+ else if (byte_stride > 0)
-+ TYPE_LENGTH (result_type) = byte_stride * (high_bound - low_bound + 1);
- else if (bit_stride > 0)
- TYPE_LENGTH (result_type) =
- (bit_stride * (high_bound - low_bound + 1) + 7) / 8;
-@@ -1990,12 +2000,12 @@ resolve_dynamic_range (struct type *dyn_range_type,
- CORE_ADDR value;
- struct type *static_range_type, *static_target_type;
- const struct dynamic_prop *prop;
-- struct dynamic_prop low_bound, high_bound;
-+ struct dynamic_prop low_bound, high_bound, stride;
-
- gdb_assert (TYPE_CODE (dyn_range_type) == TYPE_CODE_RANGE);
-
- prop = &TYPE_RANGE_DATA (dyn_range_type)->low;
-- if (dwarf2_evaluate_property (prop, NULL, addr_stack, &value))
-+ if (dwarf2_evaluate_property_signed (prop, NULL, addr_stack, &value, 1))
- {
- low_bound.kind = PROP_CONST;
- low_bound.data.const_val = value;
-@@ -2007,7 +2017,7 @@ resolve_dynamic_range (struct type *dyn_range_type,
- }
-
- prop = &TYPE_RANGE_DATA (dyn_range_type)->high;
-- if (dwarf2_evaluate_property (prop, NULL, addr_stack, &value))
-+ if (dwarf2_evaluate_property_signed (prop, NULL, addr_stack, &value, 1))
- {
- high_bound.kind = PROP_CONST;
- high_bound.data.const_val = value;
-@@ -2022,12 +2032,20 @@ resolve_dynamic_range (struct type *dyn_range_type,
- high_bound.data.const_val = 0;
- }
-
-+ prop = &TYPE_RANGE_DATA (dyn_range_type)->stride;
-+ if (dwarf2_evaluate_property_signed (prop, NULL, addr_stack, &value, 1))
-+ {
-+ stride.kind = PROP_CONST;
-+ stride.data.const_val = value;
-+ }
-+
- static_target_type
- = resolve_dynamic_type_internal (TYPE_TARGET_TYPE (dyn_range_type),
- addr_stack, 0);
- static_range_type = create_range_type (copy_type (dyn_range_type),
- static_target_type,
-- &low_bound, &high_bound);
-+ &low_bound, &high_bound, &stride);
-+
- TYPE_RANGE_DATA (static_range_type)->flag_bound_evaluated = 1;
- return static_range_type;
- }
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
-@@ -614,6 +614,10 @@ struct range_bounds
-
- struct dynamic_prop high;
-
-+ /* * Stride of range. */
-+
-+ struct dynamic_prop stride;
-+
- /* True if HIGH range bound contains the number of elements in the
- subrange. This affects how the final hight bound is computed. */
-
-@@ -778,7 +782,6 @@ struct main_type
+@@ -803,7 +803,6 @@ struct main_type
/* * Union member used for range types. */
struct range_bounds *bounds;
@@ -996,10 +748,10 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
} flds_bnds;
/* * Slot to point to additional language-specific fields of this
-@@ -1327,6 +1330,15 @@ extern bool set_type_align (struct type *, ULONGEST);
- TYPE_RANGE_DATA(range_type)->high.kind
- #define TYPE_LOW_BOUND_KIND(range_type) \
- TYPE_RANGE_DATA(range_type)->low.kind
+@@ -1365,6 +1364,15 @@ extern bool set_type_align (struct type *, ULONGEST);
+ #define TYPE_BIT_STRIDE(range_type) \
+ (TYPE_RANGE_DATA(range_type)->stride.data.const_val \
+ * (TYPE_RANGE_DATA(range_type)->flag_is_byte_stride ? 8 : 1))
+#define TYPE_BYTE_STRIDE(range_type) \
+ TYPE_RANGE_DATA(range_type)->stride.data.const_val
+#define TYPE_BYTE_STRIDE_BLOCK(range_type) \
@@ -1012,7 +764,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
/* Property accessors for the type data location. */
#define TYPE_DATA_LOCATION(thistype) \
-@@ -1361,6 +1373,9 @@ extern bool set_type_align (struct type *, ULONGEST);
+@@ -1400,6 +1408,9 @@ extern bool set_type_align (struct type *, ULONGEST);
TYPE_HIGH_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
#define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \
TYPE_LOW_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
@@ -1022,18 +774,10 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
#define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \
(TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype))))
-@@ -1896,6 +1911,7 @@ extern struct type *create_array_type_with_stride
- struct dynamic_prop *, unsigned int);
-
- extern struct type *create_range_type (struct type *, struct type *,
-+ const struct dynamic_prop *,
- const struct dynamic_prop *,
- const struct dynamic_prop *);
-
diff --git a/gdb/parse.c b/gdb/parse.c
--- a/gdb/parse.c
+++ b/gdb/parse.c
-@@ -989,24 +989,20 @@ operator_length_standard (const struct expression *expr, int endpos,
+@@ -919,24 +919,20 @@ operator_length_standard (const struct expression *expr, int endpos,
case OP_RANGE:
oplen = 3;
@@ -1072,7 +816,7 @@ diff --git a/gdb/parse.c b/gdb/parse.c
diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y
--- a/gdb/rust-exp.y
+++ b/gdb/rust-exp.y
-@@ -2475,24 +2475,28 @@ rust_parser::convert_ast_to_expression (const struct rust_op *operation,
+@@ -2492,24 +2492,28 @@ rust_parser::convert_ast_to_expression (const struct rust_op *operation,
case OP_RANGE:
{
@@ -1112,7 +856,7 @@ diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y
diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
--- a/gdb/rust-lang.c
+++ b/gdb/rust-lang.c
-@@ -1193,13 +1193,11 @@ rust_range (struct expression *exp, int *pos, enum noside noside)
+@@ -1224,13 +1224,11 @@ rust_range (struct expression *exp, int *pos, enum noside noside)
kind = (enum range_type) longest_to_int (exp->elts[*pos + 1].longconst);
*pos += 3;
@@ -1129,7 +873,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
if (noside == EVAL_SKIP)
return value_from_longest (builtin_type (exp->gdbarch)->builtin_int, 1);
-@@ -1288,7 +1286,7 @@ rust_compute_range (struct type *type, struct value *range,
+@@ -1319,7 +1317,7 @@ rust_compute_range (struct type *type, struct value *range,
*low = 0;
*high = 0;
@@ -1138,7 +882,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
if (TYPE_NFIELDS (type) == 0)
return;
-@@ -1296,15 +1294,14 @@ rust_compute_range (struct type *type, struct value *range,
+@@ -1327,15 +1325,14 @@ rust_compute_range (struct type *type, struct value *range,
i = 0;
if (strcmp (TYPE_FIELD_NAME (type, 0), "start") == 0)
{
@@ -1156,7 +900,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
*high = value_as_long (value_field (range, i));
if (rust_inclusive_range_type_p (type))
-@@ -1322,7 +1319,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
+@@ -1353,7 +1350,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
struct type *rhstype;
LONGEST low, high_bound;
/* Initialized to appease the compiler. */
@@ -1165,7 +909,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
LONGEST high = 0;
int want_slice = 0;
-@@ -1420,7 +1417,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
+@@ -1451,7 +1448,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
error (_("Cannot subscript non-array type"));
if (want_slice
@@ -1174,7 +918,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
low = low_bound;
if (low < 0)
error (_("Index less than zero"));
-@@ -1438,7 +1435,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
+@@ -1469,7 +1466,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
CORE_ADDR addr;
struct value *addrval, *tem;
@@ -1669,33 +1413,53 @@ new file mode 100644
+program testprog
+ call sub
+end
-diff --git a/gdb/testsuite/gdb.fortran/vla-ptype.exp b/gdb/testsuite/gdb.fortran/vla-ptype.exp
---- a/gdb/testsuite/gdb.fortran/vla-ptype.exp
-+++ b/gdb/testsuite/gdb.fortran/vla-ptype.exp
-@@ -98,3 +98,7 @@ gdb_test "ptype vla2" "type = <not allocated>" "ptype vla2 not allocated"
- gdb_test "ptype vla2(5, 45, 20)" \
- "no such vector element \\\(vector not allocated\\\)" \
- "ptype vla2(5, 45, 20) not allocated"
-+
-+gdb_breakpoint [gdb_get_line_number "vla1-neg-bounds"]
-+gdb_continue_to_breakpoint "vla1-neg-bounds"
-+gdb_test "ptype vla1" "type = $real \\(-2:1,-5:4,-3:-1\\)" "ptype vla1 negative bounds"
diff --git a/gdb/testsuite/gdb.fortran/vla-sizeof.exp b/gdb/testsuite/gdb.fortran/vla-sizeof.exp
--- a/gdb/testsuite/gdb.fortran/vla-sizeof.exp
+++ b/gdb/testsuite/gdb.fortran/vla-sizeof.exp
-@@ -44,3 +44,7 @@ gdb_test "print sizeof(pvla)" " = 0" "print sizeof non-associated pvla"
- gdb_breakpoint [gdb_get_line_number "pvla-associated"]
- gdb_continue_to_breakpoint "pvla-associated"
+@@ -32,7 +32,8 @@ gdb_test "print sizeof(vla1)" " = 0" "print sizeof non-allocated vla1"
+ gdb_test "print sizeof(vla1(3,2,1))" \
+ "no such vector element \\(vector not allocated\\)" \
+ "print sizeof non-allocated indexed vla1"
+-gdb_test "print sizeof(vla1(3:4,2,1))" "array not allocated" \
++gdb_test "print sizeof(vla1(3:4,2,1))" \
++ "provided bound\\(s\\) outside array bound\\(s\\)" \
+ "print sizeof non-allocated sliced vla1"
+
+ # Try to access value in allocated VLA
+@@ -41,7 +42,7 @@ gdb_continue_to_breakpoint "vla1-allocated"
+ gdb_test "print sizeof(vla1)" " = 4000" "print sizeof allocated vla1"
+ gdb_test "print sizeof(vla1(3,2,1))" "4" \
+ "print sizeof element from allocated vla1"
+-gdb_test "print sizeof(vla1(3:4,2,1))" "800" \
++gdb_test "print sizeof(vla1(3:4,2,1))" "8" \
+ "print sizeof sliced vla1"
+
+ # Try to access values in undefined pointer to VLA (dangling)
+@@ -49,7 +50,8 @@ gdb_test "print sizeof(pvla)" " = 0" "print sizeof non-associated pvla"
+ gdb_test "print sizeof(pvla(3,2,1))" \
+ "no such vector element \\(vector not associated\\)" \
+ "print sizeof non-associated indexed pvla"
+-gdb_test "print sizeof(pvla(3:4,2,1))" "array not associated" \
++gdb_test "print sizeof(pvla(3:4,2,1))" \
++ "provided bound\\(s\\) outside array bound\\(s\\)" \
+ "print sizeof non-associated sliced pvla"
+
+ # Try to access values in pointer to VLA and compare them
+@@ -58,7 +60,8 @@ gdb_continue_to_breakpoint "pvla-associated"
gdb_test "print sizeof(pvla)" " = 4000" "print sizeof associated pvla"
+ gdb_test "print sizeof(pvla(3,2,1))" "4" \
+ "print sizeof element from associated pvla"
+-gdb_test "print sizeof(pvla(3:4,2,1))" "800" "print sizeof sliced pvla"
+
-+gdb_breakpoint [gdb_get_line_number "vla1-neg-bounds"]
-+gdb_continue_to_breakpoint "vla1-neg-bounds"
-+gdb_test "print sizeof(vla1)" " = 480" "print sizeof vla1 negative bounds"
++gdb_test "print sizeof(pvla(3:4,2,1))" "8" "print sizeof sliced pvla"
+
+ gdb_breakpoint [gdb_get_line_number "vla1-neg-bounds-v1"]
+ gdb_continue_to_breakpoint "vla1-neg-bounds-v1"
diff --git a/gdb/testsuite/gdb.fortran/vla-stride.exp b/gdb/testsuite/gdb.fortran/vla-stride.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/vla-stride.exp
-@@ -0,0 +1,44 @@
+@@ -0,0 +1,47 @@
+# Copyright 2016 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
@@ -1723,6 +1487,9 @@ new file mode 100644
+ continue
+}
+
++gdb_test_no_output "set max-value-size unlimited" \
++ "set max-value-size to unlimited"
++
+gdb_breakpoint [gdb_get_line_number "re-reverse-elements"]
+gdb_continue_to_breakpoint "re-reverse-elements"
+gdb_test "print pvla" " = \\\(1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\\)" \
@@ -1774,51 +1541,10 @@ new file mode 100644
+
+ pvla => null() ! single-element
+end program vla_stride
-diff --git a/gdb/testsuite/gdb.fortran/vla.f90 b/gdb/testsuite/gdb.fortran/vla.f90
---- a/gdb/testsuite/gdb.fortran/vla.f90
-+++ b/gdb/testsuite/gdb.fortran/vla.f90
-@@ -54,4 +54,14 @@ program vla
-
- allocate (vla3 (2,2)) ! vla2-deallocated
- vla3(:,:) = 13
-+
-+ allocate (vla1 (-2:1, -5:4, -3:-1))
-+ l = allocated(vla1)
-+
-+ vla1(:, :, :) = 1
-+ vla1(-2, -3, -1) = -231
-+
-+ deallocate (vla1) ! vla1-neg-bounds
-+ l = allocated(vla1)
-+
- end program vla
-diff --git a/gdb/valarith.c b/gdb/valarith.c
---- a/gdb/valarith.c
-+++ b/gdb/valarith.c
-@@ -187,11 +187,17 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound)
- struct type *array_type = check_typedef (value_type (array));
- struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
- ULONGEST elt_size = type_length_units (elt_type);
-- ULONGEST elt_offs = elt_size * (index - lowerbound);
-+ LONGEST elt_offs = index - lowerbound;
-+ LONGEST elt_stride = TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (array_type));
-+
-+ if (elt_stride != 0)
-+ elt_offs *= elt_stride;
-+ else
-+ elt_offs *= elt_size;
-
- if (index < lowerbound
- || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type)
-- && elt_offs >= type_length_units (array_type))
-+ && abs (elt_offs) >= type_length_units (array_type))
- || (VALUE_LVAL (array) != lval_memory
- && TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type)))
- {
diff --git a/gdb/valops.c b/gdb/valops.c
--- a/gdb/valops.c
+++ b/gdb/valops.c
-@@ -3792,56 +3792,195 @@ value_of_this_silent (const struct language_defn *lang)
+@@ -3797,13 +3797,42 @@ value_of_this_silent (const struct language_defn *lang)
struct value *
value_slice (struct value *array, int lowbound, int length)
@@ -1865,6 +1591,9 @@ diff --git a/gdb/valops.c b/gdb/valops.c
if (TYPE_CODE (array_type) != TYPE_CODE_ARRAY
&& TYPE_CODE (array_type) != TYPE_CODE_STRING)
error (_("cannot take slice of non-array"));
+@@ -3813,45 +3842,155 @@ value_slice (struct value *array, int lowbound, int length)
+ if (type_not_associated (array_type))
+ error (_("array not associated"));
- range_type = TYPE_INDEX_TYPE (array_type);
- if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0)
@@ -1932,7 +1661,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c
/* FIXME-type-allocation: need a way to free this type when we are
- done with it. */
-- slice_range_type = create_static_range_type ((struct type *) NULL,
+- slice_range_type = create_static_range_type (NULL,
- TYPE_TARGET_TYPE (range_type),
- lowbound,
- lowbound + length - 1);
@@ -1954,7 +1683,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c
+
+ slice_type = create_array_type (NULL, element_type, slice_range_type);
-- slice_type = create_array_type ((struct type *) NULL,
+- slice_type = create_array_type (NULL,
- element_type,
- slice_range_type);
- TYPE_CODE (slice_type) = TYPE_CODE (array_type);
@@ -2047,7 +1776,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c
diff --git a/gdb/value.h b/gdb/value.h
--- a/gdb/value.h
+++ b/gdb/value.h
-@@ -1139,6 +1139,8 @@ extern struct value *varying_to_slice (struct value *);
+@@ -1145,6 +1145,8 @@ extern struct value *varying_to_slice (struct value *);
extern struct value *value_slice (struct value *, int, int);
diff --git a/gdb-vla-intel-fortran-vla-strings.patch b/gdb-vla-intel-fortran-vla-strings.patch
index 16c24d1..deea4b5 100644
--- a/gdb-vla-intel-fortran-vla-strings.patch
+++ b/gdb-vla-intel-fortran-vla-strings.patch
@@ -33,7 +33,7 @@ git diff --stat -p gdb/master...gdb/users/bheckel/fortran-vla-strings
diff --git a/gdb/NEWS b/gdb/NEWS
--- a/gdb/NEWS
+++ b/gdb/NEWS
-@@ -335,6 +335,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd*
+@@ -805,6 +805,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd*
*** Changes in GDB 8.1
@@ -45,7 +45,7 @@ diff --git a/gdb/NEWS b/gdb/NEWS
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
-@@ -653,6 +653,28 @@ c_value_print (struct value *val, struct ui_file *stream,
+@@ -649,6 +649,28 @@ c_value_print (struct value *val, struct ui_file *stream,
else
{
/* normal case */
@@ -77,50 +77,68 @@ diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
-@@ -1833,7 +1833,8 @@ static void read_signatured_type (struct signatured_type *);
+@@ -1827,7 +1827,10 @@ static void read_signatured_type (struct signatured_type *);
static int attr_to_dynamic_prop (const struct attribute *attr,
struct die_info *die, struct dwarf2_cu *cu,
-- struct dynamic_prop *prop);
-+ struct dynamic_prop *prop, const gdb_byte *additional_data,
+- struct dynamic_prop *prop, struct type *type);
++ struct dynamic_prop *prop,
++ struct type *default_type,
++ const gdb_byte *additional_data,
+ int additional_data_size);
/* memory allocation interface */
-@@ -13757,7 +13758,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
- {
+@@ -13799,7 +13802,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
newobj->static_link
= XOBNEW (&objfile->objfile_obstack, struct dynamic_prop);
-- attr_to_dynamic_prop (attr, die, cu, newobj->static_link);
-+ attr_to_dynamic_prop (attr, die, cu, newobj->static_link, NULL, 0);
+ attr_to_dynamic_prop (attr, die, cu, newobj->static_link,
+- dwarf2_per_cu_addr_type (cu->per_cu));
++ dwarf2_per_cu_addr_type (cu->per_cu), NULL, 0);
}
cu->list_in_scope = cu->get_builder ()->get_local_symbols ();
-@@ -16495,7 +16496,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
-
+@@ -16565,7 +16568,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
byte_stride_prop
= (struct dynamic_prop *) alloca (sizeof (struct dynamic_prop));
-- stride_ok = attr_to_dynamic_prop (attr, die, cu, byte_stride_prop);
-+ stride_ok = attr_to_dynamic_prop (attr, die, cu, byte_stride_prop,
-+ NULL, 0);
+ stride_ok = attr_to_dynamic_prop (attr, die, cu, byte_stride_prop,
+- prop_type);
++ prop_type, NULL, 0);
if (!stride_ok)
{
complaint (_("unable to read array DW_AT_byte_stride "
-@@ -17256,29 +17258,90 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
- struct gdbarch *gdbarch = get_objfile_arch (objfile);
- struct type *type, *range_type, *index_type, *char_type;
+@@ -17325,7 +17328,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
struct attribute *attr;
-- unsigned int length;
-+ unsigned int length = UINT_MAX;
-+
+ struct dynamic_prop prop;
+ bool length_is_constant = true;
+- LONGEST length;
++ ULONGEST length = UINT_MAX;
+
+ /* There are a couple of places where bit sizes might be made use of
+ when parsing a DW_TAG_string_type, however, no producer that we know
+@@ -17346,6 +17349,10 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
+ }
+ }
+
+ index_type = objfile_type (objfile)->builtin_int;
+ range_type = create_static_range_type (NULL, index_type, 1, length);
-
++
+ /* If DW_AT_string_length is defined, the length is stored in memory. */
attr = dwarf2_attr (die, DW_AT_string_length, cu);
- if (attr)
+ if (attr != nullptr && !attr_form_is_constant (attr))
+ {
+@@ -17372,13 +17379,71 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
+ }
+
+ /* Convert the attribute into a dynamic property. */
+- if (!attr_to_dynamic_prop (attr, die, cu, &prop, prop_type))
++ if (!attr_to_dynamic_prop (attr, die, cu, &prop, prop_type, NULL, 0))
+ length = 1;
+ else
+ length_is_constant = false;
+ }
+ else if (attr != nullptr)
{
-- length = DW_UNSND (attr);
+ if (attr_form_is_block (attr))
+ {
+ struct attribute *byte_size, *bit_size;
@@ -152,8 +170,8 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
+ /* Operand for DW_OP_deref_size. */
+ (gdb_byte) DW_UNSND(byte_size) };
+
-+ if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops,
-+ ARRAY_SIZE(append_ops)))
++ if (!attr_to_dynamic_prop (attr, die, cu, &high, index_type,
++ append_ops, ARRAY_SIZE(append_ops)))
+ complaint (_("Could not parse DW_AT_byte_size"));
+ }
+ else if (bit_size != NULL)
@@ -166,8 +184,8 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
+ const gdb_byte append_ops[] =
+ { DW_OP_deref };
+
-+ if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops,
-+ ARRAY_SIZE(append_ops)))
++ if (!attr_to_dynamic_prop (attr, die, cu, &high, index_type,
++ append_ops, ARRAY_SIZE(append_ops)))
+ complaint (_("Could not parse DW_AT_string_length"));
+ }
+
@@ -178,56 +196,53 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
+ TYPE_HIGH_BOUND (range_type) = DW_UNSND(attr);
+ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST;
+ }
++
+ /* This DW_AT_string_length just contains the length with no
+ indirection. There's no need to create a dynamic property in this
+ case. Pass 0 for the default value as we know it will not be
+@@ -17392,6 +17457,20 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
}
else
{
-- /* Check for the DW_AT_byte_size attribute. */
+ /* Check for the DW_AT_byte_size attribute, which represents the length
+ in this case. */
- attr = dwarf2_attr (die, DW_AT_byte_size, cu);
- if (attr)
-- {
-- length = DW_UNSND (attr);
-- }
++ attr = dwarf2_attr (die, DW_AT_byte_size, cu);
++ if (attr)
+ {
+ TYPE_HIGH_BOUND (range_type) = DW_UNSND(attr);
+ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST;
+ }
- else
-- {
-- length = 1;
-- }
++ else
+ {
+ TYPE_HIGH_BOUND (range_type) = 1;
+ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST;
+ }
++
+ /* Use 1 as a fallback length if we have nothing else. */
+ length = 1;
}
-
-- index_type = objfile_type (objfile)->builtin_int;
-- range_type = create_static_range_type (NULL, index_type, 1, length);
+@@ -17407,6 +17486,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
+ low_bound.data.const_val = 1;
+ range_type = create_range_type (NULL, index_type, &low_bound, &prop, 0);
+ }
++
char_type = language_string_char_type (cu->language_defn, gdbarch);
type = create_string_type (NULL, char_type, range_type);
-@@ -17646,7 +17709,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
-
+@@ -17858,7 +17938,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
static int
attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
-- struct dwarf2_cu *cu, struct dynamic_prop *prop)
-+ struct dwarf2_cu *cu, struct dynamic_prop *prop,
+ struct dwarf2_cu *cu, struct dynamic_prop *prop,
+- struct type *default_type)
++ struct type *default_type,
+ const gdb_byte *additional_data, int additional_data_size)
{
struct dwarf2_property_baton *baton;
struct obstack *obstack
-@@ -17657,14 +17721,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
-
- if (attr_form_is_block (attr))
- {
-- baton = XOBNEW (obstack, struct dwarf2_property_baton);
-+ baton = XOBNEW(obstack, struct dwarf2_property_baton);
- baton->referenced_type = NULL;
- baton->locexpr.per_cu = cu->per_cu;
-- baton->locexpr.size = DW_BLOCK (attr)->size;
-- baton->locexpr.data = DW_BLOCK (attr)->data;
+@@ -17885,9 +17966,30 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
+ baton->locexpr.is_reference = false;
+ break;
+ }
+
+ if (additional_data != NULL && additional_data_size > 0)
+ {
@@ -256,12 +271,13 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
}
else if (attr_form_is_ref (attr))
{
-@@ -17697,8 +17780,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
+@@ -17920,9 +18022,29 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
baton = XOBNEW (obstack, struct dwarf2_property_baton);
- baton->referenced_type = die_type (target_die, target_cu);
+ baton->property_type = die_type (target_die, target_cu);
baton->locexpr.per_cu = cu->per_cu;
- baton->locexpr.size = DW_BLOCK (target_attr)->size;
- baton->locexpr.data = DW_BLOCK (target_attr)->data;
+ baton->locexpr.is_reference = true;
+
+ if (additional_data != NULL && additional_data_size > 0)
+ {
@@ -287,124 +303,91 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
prop->data.baton = baton;
prop->kind = PROP_LOCEXPR;
gdb_assert (prop->data.baton != NULL);
-@@ -17809,7 +17912,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
-
- attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
- if (attr)
-- if (!attr_to_dynamic_prop (attr, die, cu, &stride))
-+ if (!attr_to_dynamic_prop (attr, die, cu, &stride, NULL, 0))
- complaint (_("Missing DW_AT_byte_stride "
- "- DIE at 0x%s [in module %s]"),
- sect_offset_str (die->sect_off),
-@@ -17817,7 +17920,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -18099,8 +18221,8 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+ }
attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
- if (attr)
-- attr_to_dynamic_prop (attr, die, cu, &low);
-+ attr_to_dynamic_prop (attr, die, cu, &low, NULL, 0);
+- if (attr != nullptr)
+- attr_to_dynamic_prop (attr, die, cu, &low, base_type);
++ if (attr)
++ attr_to_dynamic_prop (attr, die, cu, &low, base_type, NULL, 0);
else if (!low_default_is_valid)
complaint (_("Missing DW_AT_lower_bound "
"- DIE at %s [in module %s]"),
-@@ -17826,10 +17929,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -18109,10 +18231,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
struct attribute *attr_ub, *attr_count;
attr = attr_ub = dwarf2_attr (die, DW_AT_upper_bound, cu);
-- if (!attr_to_dynamic_prop (attr, die, cu, &high))
-+ if (!attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0))
+- if (!attr_to_dynamic_prop (attr, die, cu, &high, base_type))
++ if (!attr_to_dynamic_prop (attr, die, cu, &high, base_type, NULL, 0))
{
attr = attr_count = dwarf2_attr (die, DW_AT_count, cu);
-- if (attr_to_dynamic_prop (attr, die, cu, &high))
-+ if (attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0))
+- if (attr_to_dynamic_prop (attr, die, cu, &high, base_type))
++ if (attr_to_dynamic_prop (attr, die, cu, &high, base_type, NULL, 0))
{
/* If bounds are constant do the final calculation here. */
if (low.kind == PROP_CONST && high.kind == PROP_CONST)
-@@ -25396,7 +25499,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
- attr = dwarf2_attr (die, DW_AT_allocated, cu);
- if (attr_form_is_block (attr))
+@@ -18164,7 +18286,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+ struct type *prop_type
+ = dwarf2_per_cu_addr_sized_int_type (cu->per_cu, false);
+ attr_to_dynamic_prop (attr_byte_stride, die, cu, &byte_stride_prop,
+- prop_type);
++ prop_type, NULL, 0);
+ }
+
+ struct dynamic_prop bit_stride_prop;
+@@ -18185,7 +18307,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+ struct type *prop_type
+ = dwarf2_per_cu_addr_sized_int_type (cu->per_cu, false);
+ attr_to_dynamic_prop (attr_bit_stride, die, cu, &bit_stride_prop,
+- prop_type);
++ prop_type, NULL, 0);
+ }
+ }
+
+@@ -25879,7 +26001,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
{
-- if (attr_to_dynamic_prop (attr, die, cu, &prop))
-+ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0))
+ struct type *prop_type
+ = dwarf2_per_cu_addr_sized_int_type (cu->per_cu, false);
+- if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type))
++ if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type, NULL, 0))
add_dyn_prop (DYN_PROP_ALLOCATED, prop, type);
}
else if (attr != NULL)
-@@ -25410,7 +25513,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
- attr = dwarf2_attr (die, DW_AT_associated, cu);
- if (attr_form_is_block (attr))
+@@ -25895,7 +26017,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
{
-- if (attr_to_dynamic_prop (attr, die, cu, &prop))
-+ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0))
+ struct type *prop_type
+ = dwarf2_per_cu_addr_sized_int_type (cu->per_cu, false);
+- if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type))
++ if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type, NULL, 0))
add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type);
}
else if (attr != NULL)
-@@ -25422,7 +25525,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
-
+@@ -25908,7 +26030,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
/* Read DW_AT_data_location and set in type. */
attr = dwarf2_attr (die, DW_AT_data_location, cu);
-- if (attr_to_dynamic_prop (attr, die, cu, &prop))
-+ if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0))
+ if (attr_to_dynamic_prop (attr, die, cu, &prop,
+- dwarf2_per_cu_addr_type (cu->per_cu)))
++ dwarf2_per_cu_addr_type (cu->per_cu), NULL, 0))
add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type);
if (dwarf2_per_objfile->die_type_hash == NULL)
diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
--- a/gdb/f-typeprint.c
+++ b/gdb/f-typeprint.c
-@@ -37,7 +37,7 @@ static void f_type_print_args (struct type *, struct ui_file *);
- #endif
-
- static void f_type_print_varspec_suffix (struct type *, struct ui_file *, int,
-- int, int, int);
-+ int, int, int, int);
-
- void f_type_print_varspec_prefix (struct type *, struct ui_file *,
- int, int);
-@@ -53,18 +53,6 @@ f_print_type (struct type *type, const char *varstring, struct ui_file *stream,
- {
- enum type_code code;
-
-- if (type_not_associated (type))
-- {
-- val_print_not_associated (stream);
-- return;
-- }
--
-- if (type_not_allocated (type))
-- {
-- val_print_not_allocated (stream);
-- return;
-- }
--
- f_type_print_base (type, stream, show, level);
- code = TYPE_CODE (type);
- if ((varstring != NULL && *varstring != '\0')
-@@ -89,7 +77,7 @@ f_print_type (struct type *type, const char *varstring, struct ui_file *stream,
-
- demangled_args = (*varstring != '\0'
- && varstring[strlen (varstring) - 1] == ')');
-- f_type_print_varspec_suffix (type, stream, show, 0, demangled_args, 0);
-+ f_type_print_varspec_suffix (type, stream, show, 0, demangled_args, 0, 0);
- }
- }
-
-@@ -159,7 +147,7 @@ f_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
- static void
- f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
- int show, int passed_a_ptr, int demangled_args,
-- int arrayprint_recurse_level)
-+ int arrayprint_recurse_level, int print_rank_only)
- {
- int upper_bound, lower_bound;
-
-@@ -183,34 +171,50 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
- fprintf_filtered (stream, "(");
-
- if (type_not_associated (type))
-- val_print_not_associated (stream);
-+ print_rank_only = 1;
- else if (type_not_allocated (type))
-- val_print_not_allocated (stream);
-+ print_rank_only = 1;
-+ else if ((TYPE_ASSOCIATED_PROP (type)
-+ && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ASSOCIATED_PROP (type)))
+@@ -197,15 +197,14 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
+ print_rank_only = true;
+ else if ((TYPE_ASSOCIATED_PROP (type)
+ && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ASSOCIATED_PROP (type)))
+- || (TYPE_ALLOCATED_PROP (type)
+- && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ALLOCATED_PROP (type)))
+- || (TYPE_DATA_LOCATION (type)
+- && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_DATA_LOCATION (type))))
+- {
+- /* This case exist when we ptype a typename which has the dynamic
+- properties but cannot be resolved as there is no object. */
+- print_rank_only = true;
+- }
+ || (TYPE_ALLOCATED_PROP (type)
+ && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ALLOCATED_PROP (type)))
+ || (TYPE_DATA_LOCATION (type)
@@ -412,95 +395,43 @@ diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
+ /* This case exist when we ptype a typename which has the
+ dynamic properties but cannot be resolved as there is
+ no object. */
-+ print_rank_only = 1;
-+
-+ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)
-+ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
-+ 0, 0, arrayprint_recurse_level,
-+ print_rank_only);
-+
-+ if (print_rank_only == 1)
-+ fprintf_filtered (stream, ":");
++ print_rank_only = true;
+
+ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)
+ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
+@@ -217,8 +216,9 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
else
-- {
-- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)
-- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
-- 0, 0, arrayprint_recurse_level);
--
-- lower_bound = f77_get_lowerbound (type);
-- if (lower_bound != 1) /* Not the default. */
-- fprintf_filtered (stream, "%d:", lower_bound);
--
-- /* Make sure that, if we have an assumed size array, we
-- print out a warning and print the upperbound as '*'. */
--
-- if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
-- fprintf_filtered (stream, "*");
-- else
-- {
-- upper_bound = f77_get_upperbound (type);
-- fprintf_filtered (stream, "%d", upper_bound);
-- }
--
-- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY)
-- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
-- 0, 0, arrayprint_recurse_level);
-- }
-+ {
-+ lower_bound = f77_get_lowerbound (type);
-+ if (lower_bound != 1) /* Not the default. */
-+ fprintf_filtered (stream, "%d:", lower_bound);
-+
-+ /* Make sure that, if we have an assumed size array, we
-+ print out a warning and print the upperbound as '*'. */
-+
-+ if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
-+ fprintf_filtered (stream, "*");
-+ else
-+ {
-+ upper_bound = f77_get_upperbound (type);
-+ fprintf_filtered (stream, "%d", upper_bound);
-+ }
-+ }
-+
-+ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY)
-+ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
-+ 0, 0, arrayprint_recurse_level,
-+ print_rank_only);
+ {
+ LONGEST lower_bound = f77_get_lowerbound (type);
+
- if (arrayprint_recurse_level == 1)
- fprintf_filtered (stream, ")");
- else
-@@ -221,13 +225,14 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
- case TYPE_CODE_PTR:
+ if (lower_bound != 1) /* Not the default. */
+- fprintf_filtered (stream, "%s:", plongest (lower_bound));
++ fprintf_filtered (stream, "%s:", plongest (lower_bound));
+
+ /* Make sure that, if we have an assumed size array, we
+ print out a warning and print the upperbound as '*'. */
+@@ -229,7 +229,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
+ {
+ LONGEST upper_bound = f77_get_upperbound (type);
+
+- fputs_filtered (plongest (upper_bound), stream);
++ fprintf_filtered (stream, "%s", plongest (upper_bound));
+ }
+ }
+
+@@ -249,7 +249,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
case TYPE_CODE_REF:
f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 1, 0,
-- arrayprint_recurse_level);
-+ arrayprint_recurse_level, 0);
- fprintf_filtered (stream, ")");
+ arrayprint_recurse_level, false);
+- fprintf_filtered (stream, " )");
++ fprintf_filtered (stream, ")");
break;
case TYPE_CODE_FUNC:
- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
-- passed_a_ptr, 0, arrayprint_recurse_level);
-+ passed_a_ptr, 0, arrayprint_recurse_level,
-+ 0);
- if (passed_a_ptr)
- fprintf_filtered (stream, ")");
-
-@@ -388,7 +393,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
- fputs_filtered (" :: ", stream);
- fputs_filtered (TYPE_FIELD_NAME (type, index), stream);
- f_type_print_varspec_suffix (TYPE_FIELD_TYPE (type, index),
-- stream, show - 1, 0, 0, 0);
-+ stream, show - 1, 0, 0, 0, 0);
- fputs_filtered ("\n", stream);
- }
- fprintfi_filtered (level, stream, "End Type ");
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
-@@ -1913,7 +1913,8 @@ is_dynamic_type_internal (struct type *type, int top_level)
+@@ -1939,7 +1939,8 @@ is_dynamic_type_internal (struct type *type, int top_level)
type = check_typedef (type);
/* We only want to recognize references at the outermost level. */
@@ -510,32 +441,26 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
type = check_typedef (TYPE_TARGET_TYPE (type));
/* Types that have a dynamic TYPE_DATA_LOCATION are considered
-@@ -1947,6 +1948,7 @@ is_dynamic_type_internal (struct type *type, int top_level)
+@@ -1972,10 +1973,10 @@ is_dynamic_type_internal (struct type *type, int top_level)
+ || is_dynamic_type_internal (TYPE_TARGET_TYPE (type), 0));
}
+- case TYPE_CODE_STRING:
+ /* Strings are very much like an array of characters, and can be
+ treated as one here. */
case TYPE_CODE_ARRAY:
+ case TYPE_CODE_STRING:
{
gdb_assert (TYPE_NFIELDS (type) == 1);
-@@ -2065,7 +2067,8 @@ resolve_dynamic_array (struct type *type,
- struct dynamic_prop *prop;
- unsigned int bit_stride = 0;
-
-- gdb_assert (TYPE_CODE (type) == TYPE_CODE_ARRAY);
-+ gdb_assert (TYPE_CODE (type) == TYPE_CODE_ARRAY
-+ || TYPE_CODE (type) == TYPE_CODE_STRING);
-
- type = copy_type (type);
-
-@@ -2090,11 +2093,15 @@ resolve_dynamic_array (struct type *type,
+@@ -2139,11 +2140,15 @@ resolve_dynamic_array_or_string (struct type *type,
ary_dim = check_typedef (TYPE_TARGET_TYPE (elt_type));
- if (ary_dim != NULL && TYPE_CODE (ary_dim) == TYPE_CODE_ARRAY)
+ if (ary_dim != NULL && (TYPE_CODE (ary_dim) == TYPE_CODE_ARRAY
+ || TYPE_CODE (ary_dim) == TYPE_CODE_STRING))
- elt_type = resolve_dynamic_array (ary_dim, addr_stack);
+ elt_type = resolve_dynamic_array_or_string (ary_dim, addr_stack);
else
elt_type = TYPE_TARGET_TYPE (type);
@@ -545,7 +470,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
prop = get_dyn_prop (DYN_PROP_BYTE_STRIDE, type);
if (prop != NULL)
{
-@@ -2249,6 +2256,28 @@ resolve_dynamic_struct (struct type *type,
+@@ -2295,6 +2300,28 @@ resolve_dynamic_struct (struct type *type,
return resolved_type;
}
@@ -574,19 +499,16 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
/* Worker for resolved_dynamic_type. */
static struct type *
-@@ -2297,7 +2326,12 @@ resolve_dynamic_type_internal (struct type *type,
- break;
- }
-
+@@ -2349,6 +2376,9 @@ resolve_dynamic_type_internal (struct type *type,
+ case TYPE_CODE_ARRAY:
+ resolved_type = resolve_dynamic_array_or_string (type, addr_stack);
+ break;
+ case TYPE_CODE_PTR:
+ resolved_type = resolve_dynamic_pointer (type, addr_stack);
+ break;
-+
- case TYPE_CODE_ARRAY:
-+ case TYPE_CODE_STRING:
- resolved_type = resolve_dynamic_array (type, addr_stack);
- break;
+ case TYPE_CODE_RANGE:
+ resolved_type = resolve_dynamic_range (type, addr_stack);
diff --git a/gdb/testsuite/gdb.cp/vla-cxx.cc b/gdb/testsuite/gdb.cp/vla-cxx.cc
--- a/gdb/testsuite/gdb.cp/vla-cxx.cc
+++ b/gdb/testsuite/gdb.cp/vla-cxx.cc
@@ -683,15 +605,15 @@ new file mode 100644
+
+gdb_breakpoint [gdb_get_line_number "Before pointer assignment"]
+gdb_continue_to_breakpoint "Before pointer assignment"
-+gdb_test "print logp" "= \\(PTR TO -> \\( $logical \\)\\) 0x0" "print logp, not associated"
++gdb_test "print logp" "= \\(PTR TO -> \\( $logical\\)\\) 0x0" "print logp, not associated"
+gdb_test "print *logp" "Cannot access memory at address 0x0" "print *logp, not associated"
-+gdb_test "print comp" "= \\(PTR TO -> \\( $complex \\)\\) 0x0" "print comp, not associated"
++gdb_test "print comp" "= \\(PTR TO -> \\( $complex\\)\\) 0x0" "print comp, not associated"
+gdb_test "print *comp" "Cannot access memory at address 0x0" "print *comp, not associated"
-+gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1 \\)\\) 0x0" "print charp, not associated"
++gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1\\)\\) 0x0" "print charp, not associated"
+gdb_test "print *charp" "Cannot access memory at address 0x0" "print *charp, not associated"
-+gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3 \\)\\) 0x0" "print charap, not associated"
++gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3\\)\\) 0x0" "print charap, not associated"
+gdb_test "print *charap" "Cannot access memory at address 0x0" "print *charap, not associated"
-+gdb_test "print intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0" "print intp, not associated"
++gdb_test "print intp" "= \\(PTR TO -> \\( $int\\)\\) 0x0" "print intp, not associated"
+gdb_test "print *intp" "Cannot access memory at address 0x0" "print *intp, not associated"
+set test "print intap, not associated"
+gdb_test_multiple "print intap" $test {
@@ -702,9 +624,9 @@ new file mode 100644
+ pass $test
+ }
+}
-+gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) 0x0" "print realp, not associated"
++gdb_test "print realp" "= \\(PTR TO -> \\( $real\\)\\) 0x0" "print realp, not associated"
+gdb_test "print *realp" "Cannot access memory at address 0x0" "print *realp, not associated"
-+gdb_test "print \$my_var = intp" "= \\(PTR TO -> \\( $int \\)\\) 0x0"
++gdb_test "print \$my_var = intp" "= \\(PTR TO -> \\( $int\\)\\) 0x0"
+set test "print cyclicp1, not associated"
+gdb_test_multiple "print cyclicp1" $test {
+ -re "= \\( i = -?\\d+, p = 0x0 \\)\r\n$gdb_prompt $" {
@@ -716,10 +638,10 @@ new file mode 100644
+}
+set test "print cyclicp1%p, not associated"
+gdb_test_multiple "print cyclicp1%p" $test {
-+ -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) 0x0\r\n$gdb_prompt $" {
++ -re "= \\(PTR TO -> \\( Type typewithpointer\\)\\) 0x0\r\n$gdb_prompt $" {
+ pass $test
+ }
-+ -re "= \\(PTR TO -> \\( Type typewithpointer \\)\\) <not associated>\r\n$gdb_prompt $" {
++ -re "= \\(PTR TO -> \\( Type typewithpointer\\)\\) <not associated>\r\n$gdb_prompt $" {
+ pass $test
+ }
+}
@@ -732,15 +654,15 @@ new file mode 100644
+
+gdb_breakpoint [gdb_get_line_number "After value assignment"]
+gdb_continue_to_breakpoint "After value assignment"
-+gdb_test "print logp" "= \\(PTR TO -> \\( $logical \\)\\) $hex\( <.*>\)?"
++gdb_test "print logp" "= \\(PTR TO -> \\( $logical\\)\\) $hex\( <.*>\)?"
+gdb_test "print *logp" "= \\.TRUE\\."
-+gdb_test "print comp" "= \\(PTR TO -> \\( $complex \\)\\) $hex\( <.*>\)?"
++gdb_test "print comp" "= \\(PTR TO -> \\( $complex\\)\\) $hex\( <.*>\)?"
+gdb_test "print *comp" "= \\(1,2\\)"
-+gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1 \\)\\) $hex\( <.*>\)?"
++gdb_test "print charp" "= \\(PTR TO -> \\( character\\*1\\)\\) $hex\( <.*>\)?"
+gdb_test "print *charp" "= 'a'"
-+gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3 \\)\\) $hex\( <.*>\)?"
++gdb_test "print charap" "= \\(PTR TO -> \\( character\\*3\\)\\) $hex\( <.*>\)?"
+gdb_test "print *charap" "= 'abc'"
-+gdb_test "print intp" "= \\(PTR TO -> \\( $int \\)\\) $hex\( <.*>\)?"
++gdb_test "print intp" "= \\(PTR TO -> \\( $int\\)\\) $hex\( <.*>\)?"
+gdb_test "print *intp" "= 10"
+set test_name "print intap, associated"
+gdb_test_multiple "print intap" $test_name {
@@ -762,16 +684,16 @@ new file mode 100644
+ pass $test_name
+ }
+}
-+gdb_test "print realp" "= \\(PTR TO -> \\( $real \\)\\) $hex\( <.*>\)?"
++gdb_test "print realp" "= \\(PTR TO -> \\( $real\\)\\) $hex\( <.*>\)?"
+gdb_test "print *realp" "= 3\\.14000\\d+"
-+gdb_test "print arrayOfPtr(2)%p" "= \\(PTR TO -> \\( Type two \\)\\) $hex\( <.*>\)?"
++gdb_test "print arrayOfPtr(2)%p" "= \\(PTR TO -> \\( Type two\\)\\) $hex\( <.*>\)?"
+gdb_test "print *(arrayOfPtr(2)%p)" "= \\( ivla1 = \\(11, 12, 13\\), ivla2 = \\(\\( 211, 221\\) \\( 212, 222\\) \\) \\)"
+set test_name "print arrayOfPtr(3)%p"
+gdb_test_multiple $test_name $test_name {
-+ -re "= \\(PTR TO -> \\( Type two \\)\\) <not associated>\r\n$gdb_prompt $" {
++ -re "= \\(PTR TO -> \\( Type two\\)\\) <not associated>\r\n$gdb_prompt $" {
+ pass $test_name
+ }
-+ -re "= \\(PTR TO -> \\( Type two \\)\\) 0x0\r\n$gdb_prompt $" {
++ -re "= \\(PTR TO -> \\( Type two\\)\\) 0x0\r\n$gdb_prompt $" {
+ pass $test_name
+ }
+}
@@ -785,37 +707,17 @@ new file mode 100644
+ }
+}
+gdb_test "print cyclicp1" "= \\( i = 1, p = $hex\( <.*>\)? \\)"
-+gdb_test "print cyclicp1%p" "= \\(PTR TO -> \\( Type typewithpointer \\)\\) $hex\( <.*>\)?"
++gdb_test "print cyclicp1%p" "= \\(PTR TO -> \\( Type typewithpointer\\)\\) $hex\( <.*>\)?"
+gdb_test "print *((integer*) &inta + 2)" "= 3" "print temporary pointer, array"
+gdb_test "print *((integer*) &intvla + 3)" "= 4" "print temporary pointer, allocated vla"
-+gdb_test "print \$pc" "= \\(PTR TO -> \\( void \\(\\)\\(\\)\\)\\) $hex <pointers\\+\\d+>" "Print program counter"
++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
---- /dev/null
+--- a/gdb/testsuite/gdb.fortran/pointers.f90
+++ b/gdb/testsuite/gdb.fortran/pointers.f90
-@@ -0,0 +1,109 @@
-+! Copyright 2016 Free Software Foundation, Inc.
-+!
-+! This program is free software; you can redistribute it and/or modify
-+! it under the terms of the GNU General Public License as published by
-+! the Free Software Foundation; either version 3 of the License, or
-+! (at your option) any later version.
-+!
-+! This program is distributed in the hope that it will be useful,
-+! but WITHOUT ANY WARRANTY; without even the implied warranty of
-+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+! GNU General Public License for more details.
-+!
-+! You should have received a copy of the GNU General Public License
-+! along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+program pointers
-+
-+ type :: two
-+ integer, allocatable :: ivla1 (:)
-+ integer, allocatable :: ivla2 (:, :)
-+ end type two
-+
+@@ -20,21 +20,34 @@ program pointers
+ integer, allocatable :: ivla2 (:, :)
+ end type two
+
+ type :: typeWithPointer
+ integer i
+ type(typeWithPointer), pointer:: p
@@ -825,229 +727,125 @@ new file mode 100644
+ type (two), pointer :: p
+ end type twoPtr
+
-+ logical, target :: logv
-+ complex, target :: comv
-+ character, target :: charv
-+ character (len=3), target :: chara
-+ integer, target :: intv
-+ integer, target, dimension (10,2) :: inta
+ logical, target :: logv
+ complex, target :: comv
+ character, target :: charv
+ character (len=3), target :: chara
+ integer, target :: intv
+ integer, target, dimension (10,2) :: inta
+- real, target :: realv
+- type(two), target :: twov
+ integer, target, allocatable, dimension (:) :: intvla
+ real, target :: realv
+ type(two), target :: twov
+ type(twoPtr) :: arrayOfPtr (3)
+ type(typeWithPointer), target:: cyclicp1,cyclicp2
-+
-+ logical, pointer :: logp
-+ complex, pointer :: comp
+
+ logical, pointer :: logp
+ complex, pointer :: comp
+- character, pointer :: charp
+- character (len=3), pointer :: charap
+ character, pointer:: charp
+ character (len=3), pointer:: charap
-+ integer, pointer :: intp
-+ integer, pointer, dimension (:,:) :: intap
+ integer, pointer :: intp
+ integer, pointer, dimension (:,:) :: intap
+ integer, pointer, dimension (:) :: intvlap
-+ real, pointer :: realp
-+ type(two), pointer :: twop
-+
-+ nullify (logp)
-+ nullify (comp)
-+ nullify (charp)
-+ nullify (charap)
-+ nullify (intp)
-+ nullify (intap)
+ real, pointer :: realp
+ type(two), pointer :: twop
+
+@@ -44,8 +57,14 @@ program pointers
+ nullify (charap)
+ nullify (intp)
+ nullify (intap)
+ nullify (intvlap)
-+ nullify (realp)
-+ nullify (twop)
+ nullify (realp)
+ nullify (twop)
+ nullify (arrayOfPtr(1)%p)
+ nullify (arrayOfPtr(2)%p)
+ nullify (arrayOfPtr(3)%p)
+ nullify (cyclicp1%p)
+ nullify (cyclicp2%p)
-+
-+ logp => logv ! Before pointer assignment
-+ comp => comv
-+ charp => charv
-+ charap => chara
-+ intp => intv
-+ intap => inta
+
+ logp => logv ! Before pointer assignment
+ comp => comv
+@@ -53,8 +72,14 @@ program pointers
+ charap => chara
+ intp => intv
+ intap => inta
+ intvlap => intvla
-+ realp => realv
-+ twop => twov
+ realp => realv
+ twop => twov
+ arrayOfPtr(2)%p => twov
+ cyclicp1%i = 1
+ cyclicp1%p => cyclicp2
+ cyclicp2%i = 2
+ cyclicp2%p => cyclicp1
-+
-+ logv = associated(logp) ! Before value assignment
-+ comv = cmplx(1,2)
-+ charv = "a"
-+ chara = "abc"
-+ intv = 10
-+ inta(:,:) = 1
-+ inta(3,1) = 3
+
+ logv = associated(logp) ! Before value assignment
+ comv = cmplx(1,2)
+@@ -63,6 +88,10 @@ program pointers
+ intv = 10
+ inta(:,:) = 1
+ inta(3,1) = 3
+ allocate (intvla(10))
+ intvla(:) = 2
+ intvla(4) = 4
+ intvlap => intvla
-+ realv = 3.14
-+
-+ allocate (twov%ivla1(3))
-+ allocate (twov%ivla2(2,2))
-+ twov%ivla1(1) = 11
-+ twov%ivla1(2) = 12
-+ twov%ivla1(3) = 13
-+ twov%ivla2(1,1) = 211
-+ twov%ivla2(2,1) = 221
-+ twov%ivla2(1,2) = 212
-+ twov%ivla2(2,2) = 222
-+
-+ intv = intv + 1 ! After value assignment
-+
-+end program pointers
+ realv = 3.14
+
+ allocate (twov%ivla1(3))
diff --git a/gdb/testsuite/gdb.fortran/print_type.exp b/gdb/testsuite/gdb.fortran/print_type.exp
-new file mode 100644
---- /dev/null
+--- a/gdb/testsuite/gdb.fortran/print_type.exp
+++ b/gdb/testsuite/gdb.fortran/print_type.exp
-@@ -0,0 +1,100 @@
-+# Copyright 2016 Free Software Foundation, Inc.
-+
-+# This program is free software; you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation; either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-+
-+standard_testfile "pointers.f90"
-+load_lib fortran.exp
-+
-+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
-+ {debug f90 quiet}] } {
-+ return -1
-+}
-+
-+
-+if ![runto_main] {
-+ untested "could not run to main"
-+ return -1
-+}
-+
-+# Depending on the compiler being used, the type names can be printed differently.
-+set logical [fortran_logical4]
-+set real [fortran_real4]
-+set int [fortran_int4]
-+set complex [fortran_complex4]
-+
-+gdb_breakpoint [gdb_get_line_number "Before pointer assignment"]
-+gdb_continue_to_breakpoint "Before pointer assignment"
-+gdb_test "ptype logp" "type = PTR TO -> \\( $logical \\)" "ptype logp, not associated"
-+gdb_test "ptype comp" "type = PTR TO -> \\( $complex \\)" "ptype comp, not associated"
-+gdb_test "ptype charp" "type = PTR TO -> \\( character\\*1 \\)" "ptype charp, not associated"
-+gdb_test "ptype charap" "type = PTR TO -> \\( character\\*3 \\)" "ptype charap, not associated"
-+gdb_test "ptype intp" "type = PTR TO -> \\( $int \\)" "ptype intp, not associated"
-+set test "ptype intap, not associated"
-+gdb_test_multiple "ptype intap" $test {
-+ -re "type = PTR TO -> \\( $int \\(:,:\\)\\)\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "type = $int \\(:,:\\)\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+gdb_test "ptype realp" "type = PTR TO -> \\( $real \\)" "ptype realp, not associated"
-+gdb_test "ptype twop" \
-+ [multi_line "type = PTR TO -> \\( Type two" \
-+ " $int :: ivla1\\(:\\)" \
-+ " $int :: ivla2\\(:,:\\)" \
-+ "End Type two \\)"] \
-+ "ptype twop, not associated"
-+gdb_test "ptype two" \
-+ [multi_line "type = Type two" \
-+ " $int :: ivla1\\(:\\)" \
-+ " $int :: ivla2\\(:,:\\)" \
-+ "End Type two"]
-+
-+
-+gdb_breakpoint [gdb_get_line_number "Before value assignment"]
-+gdb_continue_to_breakpoint "Before value assignment"
-+gdb_test "ptype twop" \
-+ [multi_line "type = PTR TO -> \\( Type two" \
-+ " $int :: ivla1\\(:\\)" \
-+ " $int :: ivla2\\(:,:\\)" \
-+ "End Type two \\)"]
-+
-+
-+gdb_breakpoint [gdb_get_line_number "After value assignment"]
-+gdb_continue_to_breakpoint "After value assignment"
-+gdb_test "ptype logv" "type = $logical"
-+gdb_test "ptype comv" "type = $complex"
-+gdb_test "ptype charv" "type = character\\*1"
-+gdb_test "ptype chara" "type = character\\*3"
-+gdb_test "ptype intv" "type = $int"
-+gdb_test "ptype inta" "type = $int \\(10,2\\)"
-+gdb_test "ptype realv" "type = $real"
-+
-+
-+gdb_test "ptype logp" "type = PTR TO -> \\( $logical \\)"
-+gdb_test "ptype comp" "type = PTR TO -> \\( $complex \\)"
-+gdb_test "ptype charp" "type = PTR TO -> \\( character\\*1 \\)"
-+gdb_test "ptype charap" "type = PTR TO -> \\( character\\*3 \\)"
-+gdb_test "ptype intp" "type = PTR TO -> \\( $int \\)"
-+set test "ptype intap"
-+gdb_test_multiple $test $test {
-+ -re "type = $int \\(10,2\\)\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+ -re "type = PTR TO -> \\( $int \\(10,2\\)\\)\r\n$gdb_prompt $" {
-+ pass $test
-+ }
-+}
-+gdb_test "ptype realp" "type = PTR TO -> \\( $real \\)"
-diff --git a/gdb/testsuite/gdb.fortran/vla-ptype.exp b/gdb/testsuite/gdb.fortran/vla-ptype.exp
---- a/gdb/testsuite/gdb.fortran/vla-ptype.exp
-+++ b/gdb/testsuite/gdb.fortran/vla-ptype.exp
-@@ -32,9 +32,9 @@ set real [fortran_real4]
- # Check the ptype of various VLA states and pointer to VLA's.
- gdb_breakpoint [gdb_get_line_number "vla1-init"]
- gdb_continue_to_breakpoint "vla1-init"
--gdb_test "ptype vla1" "type = <not allocated>" "ptype vla1 not initialized"
--gdb_test "ptype vla2" "type = <not allocated>" "ptype vla2 not initialized"
--gdb_test "ptype pvla" "type = <not associated>" "ptype pvla not initialized"
-+gdb_test "ptype vla1" "type = $real \\(:,:,:\\)" "ptype vla1 not initialized"
-+gdb_test "ptype vla2" "type = $real \\(:,:,:\\)" "ptype vla2 not initialized"
-+gdb_test "ptype pvla" "type = $real \\(:,:,:\\)" "ptype pvla not initialized"
- gdb_test "ptype vla1(3, 6, 9)" "no such vector element \\\(vector not allocated\\\)" \
- "ptype vla1(3, 6, 9) not initialized"
- gdb_test "ptype vla2(5, 45, 20)" \
-@@ -81,20 +81,20 @@ gdb_test "ptype vla2(5, 45, 20)" "type = $real" \
+@@ -1,5 +1,6 @@
+ # Copyright 2019-2020 Free Software Foundation, Inc.
+ #
++
+ # This program is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+ # the Free Software Foundation; either version 3 of the License, or
+@@ -40,7 +41,7 @@ set complex [fortran_complex4]
+ # matches the string TYPE.
+ proc check_pointer_type { var_name type } {
+ gdb_test "ptype ${var_name}" \
+- "type = PTR TO -> \\( ${type} \\)"
++ "type = PTR TO -> \\( ${type}\\)"
+ }
- gdb_breakpoint [gdb_get_line_number "pvla-deassociated"]
- gdb_continue_to_breakpoint "pvla-deassociated"
--gdb_test "ptype pvla" "type = <not associated>" "ptype pvla deassociated"
-+gdb_test "ptype pvla" "type = $real \\(:,:,:\\)" "ptype pvla deassociated"
- gdb_test "ptype pvla(5, 45, 20)" \
- "no such vector element \\\(vector not associated\\\)" \
- "ptype pvla(5, 45, 20) not associated"
+ gdb_breakpoint [gdb_get_line_number "Before pointer assignment"]
+@@ -85,7 +86,8 @@ gdb_test "ptype twop" \
+ [multi_line "type = PTR TO -> \\( Type two" \
+ " $int, allocatable :: ivla1\\(:\\)" \
+ " $int, allocatable :: ivla2\\(:,:\\)" \
+- "End Type two \\)"]
++ "End Type two\\)"]
++
- gdb_breakpoint [gdb_get_line_number "vla1-deallocated"]
- gdb_continue_to_breakpoint "vla1-deallocated"
--gdb_test "ptype vla1" "type = <not allocated>" "ptype vla1 not allocated"
-+gdb_test "ptype vla1" "type = $real \\(:,:,:\\)" "ptype vla1 not allocated"
- gdb_test "ptype vla1(3, 6, 9)" "no such vector element \\\(vector not allocated\\\)" \
- "ptype vla1(3, 6, 9) not allocated"
+ gdb_breakpoint [gdb_get_line_number "After value assignment"]
+ gdb_continue_to_breakpoint "After value assignment"
+@@ -97,11 +99,11 @@ gdb_test "ptype intv" "type = $int"
+ gdb_test "ptype inta" "type = $int \\(10,2\\)"
+ gdb_test "ptype realv" "type = $real"
- gdb_breakpoint [gdb_get_line_number "vla2-deallocated"]
- gdb_continue_to_breakpoint "vla2-deallocated"
--gdb_test "ptype vla2" "type = <not allocated>" "ptype vla2 not allocated"
-+gdb_test "ptype vla2" "type = $real \\(:,:,:\\)" "ptype vla2 not allocated"
- gdb_test "ptype vla2(5, 45, 20)" \
- "no such vector element \\\(vector not allocated\\\)" \
- "ptype vla2(5, 45, 20) not allocated"
+-gdb_test "ptype logp" "type = PTR TO -> \\( $logical \\)"
+-gdb_test "ptype comp" "type = PTR TO -> \\( $complex \\)"
+-gdb_test "ptype charp" "type = PTR TO -> \\( character\\*1 \\)"
+-gdb_test "ptype charap" "type = PTR TO -> \\( character\\*3 \\)"
+-gdb_test "ptype intp" "type = PTR TO -> \\( $int \\)"
++gdb_test "ptype logp" "type = PTR TO -> \\( $logical\\)"
++gdb_test "ptype comp" "type = PTR TO -> \\( $complex\\)"
++gdb_test "ptype charp" "type = PTR TO -> \\( character\\*1\\)"
++gdb_test "ptype charap" "type = PTR TO -> \\( character\\*3\\)"
++gdb_test "ptype intp" "type = PTR TO -> \\( $int\\)"
+ set test "ptype intap"
+ gdb_test_multiple $test $test {
+ -re "type = $int \\(10,2\\)\r\n$gdb_prompt $" {
+@@ -111,4 +113,4 @@ gdb_test_multiple $test $test {
+ pass $test
+ }
+ }
+-gdb_test "ptype realp" "type = PTR TO -> \\( $real \\)"
++gdb_test "ptype realp" "type = PTR TO -> \\( $real\\)"
diff --git a/gdb/testsuite/gdb.fortran/vla-strings.exp b/gdb/testsuite/gdb.fortran/vla-strings.exp
new file mode 100644
--- /dev/null
@@ -1087,7 +885,7 @@ new file mode 100644
+gdb_continue_to_breakpoint "var_char-allocated-1"
+set test "whatis var_char first time"
+gdb_test_multiple "whatis var_char" $test {
-+ -re "type = PTR TO -> \\( character\\*10 \\)\r\n$gdb_prompt $" {
++ -re "type = PTR TO -> \\( character\\*10\\)\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "type = character\\*10\r\n$gdb_prompt $" {
@@ -1096,7 +894,7 @@ new file mode 100644
+}
+set test "ptype var_char first time"
+gdb_test_multiple "ptype var_char" $test {
-+ -re "type = PTR TO -> \\( character\\*10 \\)\r\n$gdb_prompt $" {
++ -re "type = PTR TO -> \\( character\\*10\\)\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "type = character\\*10\r\n$gdb_prompt $" {
@@ -1114,7 +912,7 @@ new file mode 100644
+gdb_continue_to_breakpoint "var_char-filled-1"
+set test "print var_char, var_char-filled-1"
+gdb_test_multiple "print var_char" $test {
-+ -re "= \\(PTR TO -> \\( character\\*3 \\)\\) $hex\r\n$gdb_prompt $" {
++ -re "= \\(PTR TO -> \\( character\\*3\\)\\) $hex\r\n$gdb_prompt $" {
+ gdb_test "print *var_char" "= 'foo'" "print *var_char, var_char-filled-1"
+ pass $test
+ }
@@ -1124,7 +922,7 @@ new file mode 100644
+}
+set test "ptype var_char, var_char-filled-1"
+gdb_test_multiple "ptype var_char" $test {
-+ -re "type = PTR TO -> \\( character\\*3 \\)\r\n$gdb_prompt $" {
++ -re "type = PTR TO -> \\( character\\*3\\)\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "type = character\\*3\r\n$gdb_prompt $" {
@@ -1139,7 +937,7 @@ new file mode 100644
+gdb_continue_to_breakpoint "var_char-filled-2"
+set test "print var_char, var_char-filled-2"
+gdb_test_multiple "print var_char" $test {
-+ -re "= \\(PTR TO -> \\( character\\*6 \\)\\) $hex\r\n$gdb_prompt $" {
++ -re "= \\(PTR TO -> \\( character\\*6\\)\\) $hex\r\n$gdb_prompt $" {
+ gdb_test "print *var_char" "= 'foobar'" "print *var_char, var_char-filled-2"
+ pass $test
+ }
@@ -1149,7 +947,7 @@ new file mode 100644
+}
+set test "ptype var_char, var_char-filled-2"
+gdb_test_multiple "ptype var_char" $test {
-+ -re "type = PTR TO -> \\( character\\*6 \\)\r\n$gdb_prompt $" {
++ -re "type = PTR TO -> \\( character\\*6\\)\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "type = character\\*6\r\n$gdb_prompt $" {
@@ -1200,30 +998,6 @@ new file mode 100644
+ var_char_p => null()
+ l = associated(var_char_p) ! var_char_p-not-associated
+end program vla_strings
-diff --git a/gdb/testsuite/gdb.fortran/vla-type.exp b/gdb/testsuite/gdb.fortran/vla-type.exp
---- a/gdb/testsuite/gdb.fortran/vla-type.exp
-+++ b/gdb/testsuite/gdb.fortran/vla-type.exp
-@@ -132,7 +132,10 @@ gdb_test "ptype fivearr(2)%tone" \
- "End Type one" ]
-
- # Check allocation status of dynamic array and it's dynamic members
--gdb_test "ptype fivedynarr" "type = <not allocated>"
-+gdb_test "ptype fivedynarr" \
-+ [multi_line "type = Type five" \
-+ " Type one :: tone" \
-+ "End Type five \\(:\\)" ]
- gdb_test "next" ""
- gdb_test "ptype fivedynarr(2)" \
- [multi_line "type = Type five" \
-@@ -141,7 +144,7 @@ gdb_test "ptype fivedynarr(2)" \
- "ptype fivedynarr(2), tone is not allocated"
- gdb_test "ptype fivedynarr(2)%tone" \
- [multi_line "type = Type one" \
-- " $int :: ivla\\(<not allocated>\\)" \
-+ " $int :: ivla\\(:,:,:\\)" \
- "End Type one" ] \
- "ptype fivedynarr(2)%tone, not allocated"
-
diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran/vla-value.exp
--- a/gdb/testsuite/gdb.fortran/vla-value.exp
+++ b/gdb/testsuite/gdb.fortran/vla-value.exp
@@ -1231,53 +1005,42 @@ diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran
gdb_continue_to_breakpoint "vla1-init"
gdb_test "print vla1" " = <not allocated>" "print non-allocated vla1"
gdb_test "print &vla1" \
-- " = \\\(PTR TO -> \\\( $real \\\(<not allocated>\\\)\\\)\\\) $hex" \
-+ " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\)\\\)\\\) $hex" \
+- " = \\\(PTR TO -> \\\( $real, allocatable \\\(:,:,:\\\) \\\)\\\) $hex" \
++ " = \\\(PTR TO -> \\\( $real, allocatable \\\(:,:,:\\\)\\\)\\\) $hex" \
"print non-allocated &vla1"
gdb_test "print vla1(1,1,1)" "no such vector element \\\(vector not allocated\\\)" \
"print member in non-allocated vla1 (1)"
+@@ -56,7 +56,7 @@ with_timeout_factor 15 {
+ "step over value assignment of vla1"
+ }
+ gdb_test "print &vla1" \
+- " = \\\(PTR TO -> \\\( $real, allocatable \\\(10,10,10\\\) \\\)\\\) $hex" \
++ " = \\\(PTR TO -> \\\( $real, allocatable \\\(10,10,10\\\)\\\)\\\) $hex" \
+ "print allocated &vla1"
+ gdb_test "print vla1(3, 6, 9)" " = 1311" "print allocated vla1(3,6,9)"
+ gdb_test "print vla1(1, 3, 8)" " = 1311" "print allocated vla1(1,3,8)"
@@ -76,7 +76,7 @@ gdb_test "print vla1(9, 9, 9)" " = 999" \
# Try to access values in undefined pointer to VLA (dangling)
gdb_test "print pvla" " = <not associated>" "print undefined pvla"
gdb_test "print &pvla" \
-- " = \\\(PTR TO -> \\\( $real \\\(<not associated>\\\)\\\)\\\) $hex" \
+- " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\) \\\)\\\) $hex" \
+ " = \\\(PTR TO -> \\\( $real \\\(:,:,:\\\)\\\)\\\) $hex" \
"print non-associated &pvla"
gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated\\\)" \
"print undefined pvla(1,3,8)"
-diff --git a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
---- a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
-+++ b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
-@@ -51,10 +51,10 @@ mi_expect_stop "breakpoint-hit" "vla" "" ".*vla.f90" "$bp_lineno" \
- mi_gdb_test "500-data-evaluate-expression vla1" \
- "500\\^done,value=\"<not allocated>\"" "evaluate not allocated vla, before allocation"
-
--mi_create_varobj_checked vla1_not_allocated vla1 "<not allocated>" \
-+mi_create_varobj_checked vla1_not_allocated vla1 "$real \\(:\\)" \
- "create local variable vla1_not_allocated"
- mi_gdb_test "501-var-info-type vla1_not_allocated" \
-- "501\\^done,type=\"<not allocated>\"" \
-+ "501\\^done,type=\"$real \\(:\\)\"" \
- "info type variable vla1_not_allocated"
- mi_gdb_test "502-var-show-format vla1_not_allocated" \
- "502\\^done,format=\"natural\"" \
-@@ -146,10 +146,10 @@ gdb_expect {
- -re "580\\^done,value=\"<not associated>\".*${mi_gdb_prompt}$" {
- pass $test
-
-- mi_create_varobj_checked pvla2_not_associated pvla2 "<not associated>" \
-+ mi_create_varobj_checked pvla2_not_associated pvla2 "$real \\(:,:\\)" \
- "create local variable pvla2_not_associated"
- mi_gdb_test "581-var-info-type pvla2_not_associated" \
-- "581\\^done,type=\"<not associated>\"" \
-+ "581\\^done,type=\"$real \\(:,:\\)\"" \
- "info type variable pvla2_not_associated"
- mi_gdb_test "582-var-show-format pvla2_not_associated" \
- "582\\^done,format=\"natural\"" \
+@@ -85,7 +85,7 @@ gdb_test "print pvla(1, 3, 8)" "no such vector element \\\(vector not associated
+ gdb_breakpoint [gdb_get_line_number "pvla-associated"]
+ gdb_continue_to_breakpoint "pvla-associated"
+ gdb_test "print &pvla" \
+- " = \\\(PTR TO -> \\\( $real \\\(10,10,10\\\) \\\)\\\) $hex" \
++ " = \\\(PTR TO -> \\\( $real \\\(10,10,10\\\)\\\)\\\) $hex" \
+ "print associated &pvla"
+ gdb_test "print pvla(3, 6, 9)" " = 42" "print associated pvla(3,6,9)"
+ gdb_test "print pvla(1, 3, 8)" " = 1001" "print associated pvla(1,3,8)"
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
-@@ -589,6 +589,25 @@ whatis_exp (const char *exp, int show)
+@@ -574,6 +574,25 @@ whatis_exp (const char *exp, int show)
printf_filtered (" */\n");
}
@@ -1339,7 +1102,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c
diff --git a/gdb/valprint.c b/gdb/valprint.c
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
-@@ -1108,12 +1108,6 @@ value_check_printable (struct value *val, struct ui_file *stream,
+@@ -1149,12 +1149,6 @@ value_check_printable (struct value *val, struct ui_file *stream,
return 0;
}
diff --git a/gdb-vla-intel-stringbt-fix.patch b/gdb-vla-intel-stringbt-fix.patch
index 7ef64a5..aedc7b1 100644
--- a/gdb-vla-intel-stringbt-fix.patch
+++ b/gdb-vla-intel-stringbt-fix.patch
@@ -30,15 +30,7 @@ Jan
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
-@@ -42,6 +42,7 @@
- #include <algorithm>
- #include <vector>
- #include <unordered_set>
-+#include <functional>
- #include "common/underlying.h"
- #include "common/byte-vector.h"
-
-@@ -2158,6 +2159,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
+@@ -2154,6 +2154,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
ctx.per_cu = per_cu;
ctx.obj_address = 0;
diff --git a/gdb-vla-intel-tests.patch b/gdb-vla-intel-tests.patch
index 36c97ab..4814b71 100644
--- a/gdb-vla-intel-tests.patch
+++ b/gdb-vla-intel-tests.patch
@@ -5,6 +5,25 @@ Subject: gdb-vla-intel-tests.patch
;;=fedoratest
+diff --git a/gdb/testsuite/gdb.fortran/ptr-indentation.exp b/gdb/testsuite/gdb.fortran/ptr-indentation.exp
+--- a/gdb/testsuite/gdb.fortran/ptr-indentation.exp
++++ b/gdb/testsuite/gdb.fortran/ptr-indentation.exp
+@@ -37,5 +37,5 @@ gdb_continue_to_breakpoint "BP1"
+ gdb_test "ptype tinsta" \
+ [multi_line "type = Type tuserdef" \
+ " $int :: i" \
+- " PTR TO -> \\( $real :: ptr \\)" \
++ " PTR TO -> \\( $real :: ptr\\)" \
+ "End Type tuserdef"]
+diff --git a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp
+--- a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp
++++ b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp
+@@ -42,4 +42,4 @@ gdb_test "ptype say_numbers" \
+ "type = void \\(integer\\(kind=4\\), integer\\(kind=4\\), integer\\(kind=4\\)\\)"
+
+ gdb_test "ptype fun_ptr" \
+- "type = PTR TO -> \\( integer\\(kind=4\\) \\(\\) \\(REF TO -> \\( integer\\(kind=4\\) \\)\\) \\)"
++ "type = PTR TO -> \\( integer\\(kind=4\\) \\(\\) \\(REF TO -> \\( integer\\(kind=4\\)\\)\\)\\)"
diff --git a/gdb/testsuite/gdb.fortran/vla-func.exp b/gdb/testsuite/gdb.fortran/vla-func.exp
new file mode 100644
--- /dev/null
@@ -42,7 +61,7 @@ new file mode 100644
+gdb_continue_to_breakpoint "func1-vla-passed"
+gdb_test "print vla" " = \\( *\\( *22, *22, *22,\[()22, .\]*\\)" \
+ "print vla (func1)"
-+gdb_test "ptype vla" "type = integer\\\(kind=4\\\) \\\(10,10\\\)" \
++gdb_test "ptype vla" "type = integer\\\(kind=4\\\), allocatable \\\(10,10\\\)" \
+ "ptype vla (func1)"
+
+gdb_breakpoint [gdb_get_line_number "func1-vla-modified"]
@@ -69,7 +88,7 @@ new file mode 100644
+gdb_continue_to_breakpoint "func2-returned"
+gdb_test "print vla3" " = \\\(1, 2, 44, 4, 44, 44, 44, 8, 44, 44\\\)" \
+ "print vla3 (after func2)"
-+gdb_test "ptype vla3" "type = integer\\\(kind=4\\\) \\\(10\\\)" \
++gdb_test "ptype vla3" "type = integer\\\(kind=4\\\), allocatable \\\(10\\\)" \
+ "ptype vla3 (after func2)"
diff --git a/gdb/testsuite/gdb.fortran/vla-func.f90 b/gdb/testsuite/gdb.fortran/vla-func.f90
new file mode 100644
@@ -147,6 +166,16 @@ new file mode 100644
+
+ ret = .TRUE. ! func2-returned
+end program vla_func
+diff --git a/gdb/testsuite/gdb.fortran/vla-ptr-info.exp b/gdb/testsuite/gdb.fortran/vla-ptr-info.exp
+--- a/gdb/testsuite/gdb.fortran/vla-ptr-info.exp
++++ b/gdb/testsuite/gdb.fortran/vla-ptr-info.exp
+@@ -28,5 +28,5 @@ if ![runto_main] {
+ # Check the status of a pointer to a dynamic array.
+ gdb_breakpoint [gdb_get_line_number "pvla-associated"]
+ gdb_continue_to_breakpoint "pvla-associated"
+-gdb_test "print &pvla" " = \\(PTR TO -> \\( real\\(kind=4\\) \\(10,10,10\\) \\)\\) ${hex}" \
++gdb_test "print &pvla" " = \\(PTR TO -> \\( real\\(kind=4\\) \\(10,10,10\\)\\)\\) ${hex}" \
+ "print pvla pointer information"
diff --git a/gdb/testsuite/gdb.fortran/vla-stringsold.exp b/gdb/testsuite/gdb.fortran/vla-stringsold.exp
new file mode 100644
--- /dev/null
@@ -185,11 +214,11 @@ new file mode 100644
+gdb_breakpoint [gdb_get_line_number "var_char-allocated-1"]
+gdb_continue_to_breakpoint "var_char-allocated-1"
+gdb_test "print var_char" \
-+ " = \\(PTR TO -> \\( character\\*10 \\)\\) ${hex}" \
++ " = \\(PTR TO -> \\( character\\*10\\)\\) ${hex}" \
+ "print var_char after allocated first time"
-+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*10 \\)" \
++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*10\\)" \
+ "whatis var_char first time"
-+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*10 \\)" \
++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*10\\)" \
+ "ptype var_char first time"
+gdb_test "next" "\\d+.*var_char = 'foo'.*" \
+ "next to allocation status of var_char"
@@ -198,13 +227,13 @@ new file mode 100644
+gdb_breakpoint [gdb_get_line_number "var_char-filled-1"]
+gdb_continue_to_breakpoint "var_char-filled-1"
+gdb_test "print var_char" \
-+ " = \\(PTR TO -> \\( character\\*3 \\)\\) ${hex}" \
++ " = \\(PTR TO -> \\( character\\*3\\)\\) ${hex}" \
+ "print var_char after filled first time"
+gdb_test "print *var_char" " = 'foo'" \
+ "print *var_char after filled first time"
-+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*3 \\)" \
++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*3\\)" \
+ "whatis var_char after filled first time"
-+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*3 \\)" \
++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*3\\)" \
+ "ptype var_char after filled first time"
+gdb_test "print var_char(1)" " = 102 'f'" "print var_char(1)"
+gdb_test "print var_char(3)" " = 111 'o'" "print var_char(3)"
@@ -212,46 +241,46 @@ new file mode 100644
+gdb_breakpoint [gdb_get_line_number "var_char-filled-2"]
+gdb_continue_to_breakpoint "var_char-filled-2"
+gdb_test "print var_char" \
-+ " = \\(PTR TO -> \\( character\\*6 \\)\\) ${hex}" \
++ " = \\(PTR TO -> \\( character\\*6\\)\\) ${hex}" \
+ "print var_char after allocated second time"
+gdb_test "print *var_char" " = 'foobar'" \
+ "print *var_char after allocated second time"
-+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*6 \\)" \
++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*6\\)" \
+ "whatis var_char second time"
-+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*6 \\)" \
++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*6\\)" \
+ "ptype var_char second time"
+
+gdb_breakpoint [gdb_get_line_number "var_char-empty"]
+gdb_continue_to_breakpoint "var_char-empty"
+gdb_test "print var_char" \
-+ " = \\(PTR TO -> \\( character\\*0 \\)\\) ${hex}" \
++ " = \\(PTR TO -> \\( character\\*0\\)\\) ${hex}" \
+ "print var_char after set empty"
+gdb_test "print *var_char" " = \"\"" "print *var_char after set empty"
-+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*0 \\)" \
++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*0\\)" \
+ "whatis var_char after set empty"
-+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*0 \\)" \
++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*0\\)" \
+ "ptype var_char after set empty"
+
+gdb_breakpoint [gdb_get_line_number "var_char-allocated-3"]
+gdb_continue_to_breakpoint "var_char-allocated-3"
+gdb_test "print var_char" \
-+ " = \\(PTR TO -> \\( character\\*21 \\)\\) ${hex}" \
++ " = \\(PTR TO -> \\( character\\*21\\)\\) ${hex}" \
+ "print var_char after allocated third time"
-+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*21 \\)" \
++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*21\\)" \
+ "whatis var_char after allocated third time"
-+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*21 \\)" \
++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*21\\)" \
+ "ptype var_char after allocated third time"
+
+gdb_breakpoint [gdb_get_line_number "var_char_p-associated"]
+gdb_continue_to_breakpoint "var_char_p-associated"
+gdb_test "print var_char_p" \
-+ " = \\(PTR TO -> \\( character\\*7 \\)\\) ${hex}" \
++ " = \\(PTR TO -> \\( character\\*7\\)\\) ${hex}" \
+ "print var_char_p after associated"
+gdb_test "print *var_char_p" " = 'johndoe'" \
+ "print *var_char_ after associated"
-+gdb_test "whatis var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \
++gdb_test "whatis var_char_p" "type = PTR TO -> \\( character\\*7\\)" \
+ "whatis var_char_p after associated"
-+gdb_test "ptype var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \
++gdb_test "ptype var_char_p" "type = PTR TO -> \\( character\\*7\\)" \
+ "ptype var_char_p after associated"
diff --git a/gdb/testsuite/gdb.fortran/vla-stringsold.f90 b/gdb/testsuite/gdb.fortran/vla-stringsold.f90
new file mode 100644
@@ -298,3 +327,21 @@ new file mode 100644
+ var_char_p => null()
+ l = associated(var_char_p) ! var_char_p-not-associated
+end program vla_strings
+diff --git a/gdb/testsuite/gdb.fortran/whatis_type.exp b/gdb/testsuite/gdb.fortran/whatis_type.exp
+--- a/gdb/testsuite/gdb.fortran/whatis_type.exp
++++ b/gdb/testsuite/gdb.fortran/whatis_type.exp
+@@ -44,7 +44,7 @@ gdb_test "whatis t2" "type = Type t2"
+ gdb_test "whatis t2v" "type = Type t2"
+ gdb_test "whatis t3" "type = Type t3"
+ gdb_test "whatis t3v" "type = Type t3"
+-gdb_test "whatis t3p" "type = PTR TO -> \\( Type t3 \\)"
++gdb_test "whatis t3p" "type = PTR TO -> \\( Type t3\\)"
+
+ gdb_test "ptype t1" \
+ [multi_line "type = Type t1" \
+@@ -73,4 +73,4 @@ gdb_test "ptype t3p" \
+ [multi_line "type = PTR TO -> \\( Type t3" \
+ " $int :: t3_i" \
+ " Type t2 :: t2_n" \
+- "End Type t3 \\)"]
++ "End Type t3\\)"]
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/gdb.git/commitdiff/e28f2cc17e3e83521eb28a43ff691caa45d7de2c
More information about the pld-cvs-commit
mailing list